Skip to content

fix(ui): make Memory Dashboard and Settings mutually exclusive in chatStore - #1368

Merged
kovtcharov-amd merged 1 commit into
amd:mainfrom
blackdeathdrow:fix/memory-dashboard-vs-settings-flags
Jun 2, 2026
Merged

kovtcharov-amd merged 1 commit into
amd:mainfrom
blackdeathdrow:fix/memory-dashboard-vs-settings-flags

Conversation

@blackdeathdrow

Copy link
Copy Markdown
Contributor

Why this matters

Clicking the Memory Dashboard button in the sidebar (or the Memory icon in the chat-toolbar) had no effect when the Settings page was currently open. The user had to close Settings first before Memory Dashboard would respond. The reverse direction "worked" but left a stale showMemoryDashboard=true in the store, so closing Settings via the back arrow could re-surface the Memory Dashboard from a previous session.

The Agent UI is not router-based. "Routing" between top-level views is a stateful ternary in App.tsx:531-535 that gives showSettings unconditional priority over showMemoryDashboard, and the two store setters never cleared each other's flag.

What changed

Single-source-of-truth fix in src/gaia/apps/webui/src/stores/chatStore.ts:262-265: the two setters are now mutually exclusive — opening one view always closes the other. This is better than patching all three call sites (sidebar × 2, chat-toolbar × 1) because future call sites cannot reintroduce the bug.

-    setShowSettings: (show) => set({ showSettings: show }),
-    setShowMemoryDashboard: (show) => set({ showMemoryDashboard: show }),
+    setShowSettings: (show) =>
+        set(show ? { showSettings: true, showMemoryDashboard: false } : { showSettings: false }),
+    setShowMemoryDashboard: (show) =>
+        set(show ? { showMemoryDashboard: true, showSettings: false } : { showMemoryDashboard: false }),

onHome in App.tsx:524 still works correctly — it sets both flags to false explicitly, and the false path of each setter does not touch the other flag.

Test plan

  • Manual: open Settings from the sidebar, then click the Memory Dashboard button — Memory Dashboard renders (not Settings).
  • Manual: open Memory Dashboard, then click Settings — Settings renders (no change there, but verify flag state is clean).
  • Manual: from each view, hit the back arrow — return to the chat / welcome view, not to whatever was opened "behind" it.
  • Add Playwright regression covering the "open Settings, click Memory Dashboard, verify Memory Dashboard is the rendered view" scenario and its symmetric counterpart.

Notes

Fixes #1367

…tStore

Clicking the Memory Dashboard button (sidebar or chat-toolbar) while the
Settings page was open did nothing: `setShowMemoryDashboard(true)` ran,
but the render ternary in `App.tsx:531-535` gives `showSettings`
unconditional priority, so SettingsPage stayed on screen. The reverse
direction "worked" but left a stale `showMemoryDashboard=true` in the
store, so closing Settings via the back arrow could re-surface the
Memory Dashboard from a previous session.

The two store setters are now mutually exclusive — opening one view
always closes the other, and a single-source-of-truth fix means future
call sites cannot reintroduce the bug. `onHome` in `App.tsx:524` still
works since it sets both flags to `false` explicitly (the `false` path
of each setter does not touch the other flag).

Fixes #1367

## Test plan

- [ ] Manual: open Settings from the sidebar, then click the Memory
  Dashboard button — Memory Dashboard renders (not Settings).
- [ ] Manual: open Memory Dashboard, then click Settings — Settings
  renders (no change there, but verify the flag state is clean).
- [ ] Manual: from each view, hit the back arrow — return to the chat
  / welcome view, not to whatever was opened "behind" it.
- [ ] Add Playwright regression covering the "open Settings, click
  Memory Dashboard, verify Memory Dashboard is the rendered view"
  scenario and its symmetric counterpart.
@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Clean, well-reasoned fix that correctly addresses the root cause at the store level rather than patching individual call sites.


Summary

The two Zustand setters were independent — opening one view never cleared the other flag, leaving the showSettings ? ... : showMemoryDashboard ? ... ternary in App.tsx:531–534 to silently suppress Memory Dashboard whenever Settings had been previously opened. The fix makes the setters mutually exclusive on the true path only, leaving the false path intentionally narrow so that closing one view doesn't disturb a view that was never open. All three call sites (Sidebar.tsx:453/456, ChatView.tsx:1362) and the onHome double-clear in App.tsx:524 behave correctly with the new semantics.


Issues Found

🟢 Minor — Playwright regression test not included (chatStore.ts — test plan item)

The PR test plan lists "Add Playwright regression covering the open-Settings → click-Memory-Dashboard flow" as an unchecked item. The fix itself is tiny and low-risk, but this exact scenario (stale showMemoryDashboard flag surviving across views) is the kind of thing that silently regresses without a rendered test. Adding a Playwright assertion before or shortly after merge would prevent a repeat of the original bug and cover the symmetric direction.

No code change needed here — just tracking this as a follow-up before the next feature that touches these flags lands.


Strengths

  • Right abstraction level. Enforcing mutual exclusivity in the store rather than all three call sites is the correct call — future callers get the correct behavior for free.
  • false path is intentionally narrow. Closing a view only clears its own flag, which correctly preserves the other view's state and keeps onHome's explicit double-clear working without side effects.
  • PR description is exemplary. Root cause, affected commit (74f637a4), why the store-level fix beats the call-site approach, and the onHome edge case are all covered concisely.

Verdict

Approve. The fix is correct and minimal. The only follow-up is the Playwright regression called out in the test plan — worth landing soon so this class of state-priority bug stays caught.

@amd amd deleted a comment from codecov-commenter Jun 2, 2026
@kovtcharov-amd
kovtcharov-amd enabled auto-merge June 2, 2026 21:21
@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Jun 2, 2026
Merged via the queue into amd:main with commit f91c8cc Jun 2, 2026
24 checks passed
@blackdeathdrow
blackdeathdrow deleted the fix/memory-dashboard-vs-settings-flags branch June 2, 2026 21:49
kovtcharov-amd pushed a commit that referenced this pull request Jun 3, 2026
19 PRs merged to main after the v0.20.0 notes were drafted; merge main into
the release branch and update the notes to match.

- Multi-Device: note #1338 wired the selector end-to-end (it was a no-op
  after #1252 alone) and added loud runtime validation for unavailable devices.
- PowerPoint RAG: note #1366 unblocked .pptx in the Agent UI file picker
  (backend already accepted it; the frontend rejected it pre-upload).
- Activations: note #1310 widened the "Active for" panel to MCP-consuming
  agents (e.g. the chat agent), not just static REQUIRED_CONNECTORS.
- New bug fixes: RAG embedding reuse (#1306), overlapping-chat-turn 409
  (#1304), Memory/Settings mutual exclusivity (#1368).
- Tooling/CI: doc-vs-code realignment (#1298/#1337/#1340), gaia-testing
  skill (#1372), Claude CI + Codecov hardening.
- Full Changelog regenerated: 44 -> 63 commits.
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.

[Bug]: Memory Dashboard button has no effect when Settings is open (mutually-exclusive view flags not enforced)

2 participants