Skip to content

fix(gui-app): stop restore toast replay across task tabs - #865

Merged
hdkshingala merged 2 commits into
mainfrom
traycer/brave-salmon
Jul 31, 2026
Merged

hdkshingala merged 2 commits into
mainfrom
traycer/brave-salmon

Conversation

@hdkshingala

Copy link
Copy Markdown
Member

Summary

  • stop completed restore/revert result toasts from replaying whenever a task tab regains focus
  • retain completed restore state for the restore dialog while tracking toast delivery on the chat session handle
  • show a completion when its tab first becomes active, dedupe focus changes, remounts, and duplicate completion frames, and still show genuinely new restores

Root cause

Completed restore state intentionally persists after the operation finishes. The toast was emitted from an active-pane effect that re-runs whenever the pane regains focus, so every task-tab shuffle replayed the same completed result.

The new focused-pane toast bridge keys each completion by checkpoint and finish time and records delivery in a bounded per-session set outside React component state. That keeps the one-shot marker alive across tab changes and remounts without consuming the restore state the dialog still needs.

Related issue

None.

Verification

  • focused chat-tile setup suite: 14/14 tests passed
  • regression covers inactive completion, first focus, repeated task-tab shuffles, remount, duplicate frame, and a subsequent restore
  • affected GUI lint and formatting passed in pre-commit
  • affected shared/protocol/GUI compile and build passed in pre-commit
  • React Doctor reported no issues for changed files
  • pre-commit hooks passed
  • commits are signed off per DCO

Checklist

  • full-repository bun run build, bun run lint, and bun run test pass (CI owns the broad suites)
  • code is formatted
  • pre-commit hooks pass
  • tests added/updated where it makes sense
  • commits are signed off

@coderabbitai

coderabbitai Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 82af4176-169c-4f7d-ac91-56cb95034c7d

📥 Commits

Reviewing files that changed from the base of the PR and between b12fe08 and df6e1c0.

📒 Files selected for processing (4)
  • clients/gui-app/src/components/epic-canvas/renderers/__tests__/chat-tile-setup.test.tsx
  • clients/gui-app/src/components/epic-canvas/renderers/chat-tile-restore-result-toasts.tsx
  • clients/gui-app/src/components/epic-canvas/renderers/chat-tile.tsx
  • clients/gui-app/src/stores/chats/chat-session-store.ts

Summary by CodeRabbit

  • New Features

    • Added restore-result notifications to chat tiles.
    • Notifications appear when the pane becomes active after a restore completes.
    • Each completed restore generates only one notification, including across focus changes and remounts.
    • Notifications distinguish separate restore completions and avoid repeated messages for the same result.
  • Tests

    • Added coverage for notification timing, deduplication, remount behavior, and multiple restore completions.

Walkthrough

The change moves restore-result toast delivery into a dedicated pane-aware component. It tracks delivered completions per chat session, limits retained keys, removes the previous chat-tile focus effect, and adds coverage for deferred, deduplicated, and distinct restore completions.

Changes

Restore toast delivery

Layer / File(s) Summary
Session completion tracking
clients/gui-app/src/stores/chats/chat-session-store.ts
The chat session handle now stores delivered restore-completion keys. The store initializes the set and limits retention to 32 entries.
Pane-aware toast integration
clients/gui-app/src/components/epic-canvas/renderers/chat-tile-restore-result-toasts.tsx, clients/gui-app/src/components/epic-canvas/renderers/chat-tile.tsx, clients/gui-app/src/components/epic-canvas/renderers/__tests__/chat-tile-setup.test.tsx
The new component observes completed restores, deduplicates notifications, and displays toasts when the pane is active. ChatTile renders the component and removes the previous focus effect. Tests cover inactive panes, remounts, duplicate timestamps, and distinct completions.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: tanveergill

Poem

A rabbit watched the restore run,
Then saved each toast from being spun.
When panes wake, one message glows,
While bounded keys keep replay close.
“Hop!” says Bun. “The flow is done.”

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the fix for restore toast replay across task tabs.
Description check ✅ Passed The description accurately explains the restore toast replay fix, delivery tracking, deduplication behavior, and verification.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch traycer/brave-salmon

Comment @coderabbitai help to get the list of available commands.

@hdkshingala
hdkshingala enabled auto-merge (squash) July 31, 2026 20:08
@hdkshingala
hdkshingala merged commit b795e7c into main Jul 31, 2026
18 checks passed
@hdkshingala
hdkshingala deleted the traycer/brave-salmon branch July 31, 2026 20:11
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.

1 participant