Skip to content

fix(tui): render success-emitted batch-update warnings in the update-results overlay (#259) - #265

Merged
dyoung522 merged 2 commits into
developfrom
dyoung522/fix-259-update-batch-warnings
Aug 8, 2026
Merged

fix(tui): render success-emitted batch-update warnings in the update-results overlay (#259)#265
dyoung522 merged 2 commits into
developfrom
dyoung522/fix-259-update-batch-warnings

Conversation

@dyoung522

Copy link
Copy Markdown
Collaborator

Fixes #259.

The bug

#253 auto-opens a warnings overlay when an outcome carries 2+ warnings — but when an outcome carries both ResultLines and 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 aggregate Warnings slice with nowhere to render: the status line read Applied 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)

applyUpdatesSequentially appends success-emitted warnings to ResultLines as one trailing section — blank separator, then one line per distinct warning — so the single overlay the actionDoneMsg handler opens carries them.

  • Batch-time, not render-time: only the batch loop can distinguish success-emitted warnings from the <name>: <err> warnings it synthesizes for failures — appending the flat aggregate in app.go would duplicate every ✗ failure line.
  • Dedupe on exact text (first occurrence wins, batch order): the motivating warnings are profile-level merge diagnostics ("asset X is bundled by both A and B"), re-emitted verbatim by every update that re-runs the merge — a 5-update batch would otherwise repeat the same lines 5×. Exact match only, so distinct warnings sharing a prefix never collapse. The aggregate Warnings slice 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).
  • Direction B (interleaving under each ✓ line) rejected: it would misattribute profile-level conflicts to whichever update happened to trigger the recompile.

Overlay priority unchanged

TestActionDoneResultLinesKeepPriorityOverWarningsOverlay still 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.ApplyUpdate now returns the same canned merge warnings prototype deploys already used (#253's demo-mode precedent, extracted into prototypeMergeWarnings), identical per update so --prototype demos both the section and its dedupe. TestPrototypeUpdatesEndToEndKeyFlow updated 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 itself
  • TestApplyUpdatesSequentially_FailuresAndSuccessWarningsBothReadable — ✗ lines and the section coexist, no duplicated failure text
  • TestApplyUpdatesSequentially_SuccessWarningsDedupedOnExactText — repeated text collapses, near-identical text does not
  • TestPrototypeProviderActions_ApplyUpdate_CannedMultiWarningDemo — demo-mode parity

Gate: 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

… 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>
Copilot AI lite review requested due to automatic review settings August 8, 2026 22:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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’s ResultLines as 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.ApplyUpdate to emit the same canned multi-warning diagnostics as deploy, ensuring --prototype exercises 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
Copilot AI review requested due to automatic review settings August 8, 2026 22:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

@dyoung522
dyoung522 merged commit 7b11636 into develop Aug 8, 2026
2 checks passed
@dyoung522
dyoung522 deleted the dyoung522/fix-259-update-batch-warnings branch August 8, 2026 23:01
@dyoung522 dyoung522 mentioned this pull request Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants