fix(tui): render success-emitted batch-update warnings in the update-results overlay (#259) - #265
Merged
Merged
Conversation
… overlay (#259) Warnings emitted by successful updates in an apply-updates batch were folded into the aggregate Warnings slice, which the "update results" overlay never showed - and that overlay keeps priority over #253's warnings overlay, so the text was unreachable: the status line read "Applied 1 update(s) (2 warnings)" with no way to see them. On Icarus, an update that triggers a recompile emits merge-time asset-conflict warnings this way. applyUpdatesSequentially now appends success-emitted warnings to ResultLines as one trailing section (blank separator, then one line per distinct warning), deduped on exact text - they are profile-level merge diagnostics re-emitted verbatim by every update that re-runs the merge, so a batch would otherwise repeat the same text once per update. The aggregate Warnings slice is deduped identically so the one-row "(N warnings)" status count matches the section. Failure warnings are untouched: they already have their own ✗ lines in the same overlay, and including them in the section would render them twice. The overlay priority pinned by TestActionDoneResultLinesKeepPriorityOverWarningsOverlay is unchanged - the deferral is simply lossless now, because the winning overlay carries the warnings itself. prototypeProvider.ApplyUpdate now returns the same canned merge warnings prototype deploys already used (#253's demo-mode parity precedent, extracted into prototypeMergeWarnings), so --prototype exercises the new section and its dedupe. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes a TUI rendering gap where warnings produced by successful updates in an apply-updates batch were previously only reflected in the (N warnings) status suffix and could be unreadable when the “update results” overlay had priority. The fix makes those warnings visible by appending a deduped trailing warnings section to the batch’s ResultLines, so the existing “update results” overlay fully captures both per-update results and success-emitted warnings.
Changes:
- Append distinct success-emitted warnings to
applyUpdatesSequentially’sResultLinesas a trailing section, while deduping those warnings by exact text. - Add targeted tests covering the regression, failure+warning coexistence, and exact-text dedupe behavior.
- Update
prototypeProvider.ApplyUpdateto emit the same canned multi-warning diagnostics as deploy, ensuring--prototypeexercises the updated UI paths; update CHANGELOG.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| internal/tui/mutations.go | Appends deduped success-emitted warnings into the update-results overlay via trailing ResultLines section. |
| internal/tui/mutations_test.go | Adds regression and behavior tests for readable success warnings, coexistence with failures, and exact-text dedupe; updates end-to-end prototype flow assertions. |
| internal/tui/app.go | Updates comments to reflect that overlay priority deferral is now lossless for update batches. |
| internal/tui/actions_test.go | Updates comments clarifying the unchanged overlay-priority behavior post-fix. |
| internal/tui/actions_provider.go | Adds prototypeMergeWarnings helper and makes prototype updates emit multi-warning outcomes for demo parity. |
| internal/tui/actions_provider_test.go | Adds a test ensuring prototype update actions produce consistent multi-warning demo output; extends test recording provider behavior. |
| CHANGELOG.md | Documents the fix under [Unreleased]. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…update-batch-warnings # Conflicts: # CHANGELOG.md
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #259.
The bug
#253 auto-opens a warnings overlay when an outcome carries 2+ warnings — but when an outcome carries both
ResultLinesand 2+Warnings(only the apply-updates batch,applyUpdatesSequentially), the pre-existing "update results" overlay keeps priority and the warnings overlay defers. Failures were readable (they get ✗ lines), but warnings emitted by successful updates were folded into the aggregateWarningsslice with nowhere to render: the status line readApplied 1 update(s) (2 warnings)and the text was unreachable. On Icarus, an update that triggers a recompile emits merge-time asset-conflict warnings exactly this way.The fix (issue's direction A, plus dedupe)
applyUpdatesSequentiallyappends success-emitted warnings toResultLinesas one trailing section — blank separator, then one line per distinct warning — so the single overlay theactionDoneMsghandler opens carries them.<name>: <err>warnings it synthesizes for failures — appending the flat aggregate inapp.gowould duplicate every ✗ failure line.Warningsslice is deduped identically, keeping the one-row(N warnings)status count in step with the section. Failure warnings are never deduped (and stay out of the section — they already have ✗ lines).Overlay priority unchanged
TestActionDoneResultLinesKeepPriorityOverWarningsOverlaystill passes unmodified (comment extended): the "update results" overlay still wins,app.go's handler logic is untouched — the deferral is simply lossless now.Prototype parity
prototypeProvider.ApplyUpdatenow returns the same canned merge warnings prototype deploys already used (#253's demo-mode precedent, extracted intoprototypeMergeWarnings), identical per update so--prototypedemos both the section and its dedupe.TestPrototypeUpdatesEndToEndKeyFlowupdated accordingly (status gains(2 warnings), and now asserts the overlay's exact lines).TDD
Four new tests written and shown failing before the implementation:
TestApplyUpdatesSequentially_SuccessWarningsAppendedAsSection— the bug itselfTestApplyUpdatesSequentially_FailuresAndSuccessWarningsBothReadable— ✗ lines and the section coexist, no duplicated failure textTestApplyUpdatesSequentially_SuccessWarningsDedupedOnExactText— repeated text collapses, near-identical text does notTestPrototypeProviderActions_ApplyUpdate_CannedMultiWarningDemo— demo-mode parityGate:
go build ./... && go vet ./... && gofmt -l .clean,go test ./...exit 0, 18/18 packages ok.No version bump (story PR); CHANGELOG entry added under
[Unreleased].TUI change — needs the manual smoke pass before merge.
🤖 Generated with Claude Code