Skip to content

emrg: GUI open-sessions sidebar + gui_state restore — P4 slice 2 (GUI multi-session rant P4) - #639

Merged
argszero merged 1 commit into
masterfrom
feature/gui-p4-s2-sidebar
Aug 10, 2026
Merged

emrg: GUI open-sessions sidebar + gui_state restore — P4 slice 2 (GUI multi-session rant P4)#639
argszero merged 1 commit into
masterfrom
feature/gui-p4-s2-sidebar

Conversation

@argszero

Copy link
Copy Markdown
Owner

Summary

P4 slice 2 of the GUI multi-session rant (2026-08-10T15:07:19): the open-sessions sidebar + boot restore — the other half of P4 after slice 1 (#637, open-sessions state + gui_state.json persistence).

Changes

emrg/gui/main.js

  • restoreOpenSessions(sessions) — on init: read gui_state.json, re-open valid entries (cap 20, resume + re-subscribe), skip stale entries (removed + re-persisted), restore activeSid (fallback: most recent), window-title sync
  • broadcastOpenSessions() — pushes open_sessions events to the renderer on every mutation (open/touch/activate/close/delete/new) — the sidebar's live data source
  • init response now includes open_sessions + active_sid so the renderer adopts the restored active session without an extra switchSession IPC round-trip

emrg/gui/renderer

  • sidebar.jsrenderOpenSessions(list): cross-project open-session section at the top of the sidebar (项目名 / 会话标题, lastActive desc from main, active highlight, click → switch, right-click → close/rename/delete); highlight now also covers open-session items
  • app.jsstate.openSessions; handles open_sessions events; closeOpenSession(sid) (disconnect + remove container + keep disk data; closing the active session switches to the most recent remaining open session, else new); showOpenSessionsMenu (关闭保留数据 / rename / delete with confirm)
  • index.html#open-sessions nav + label above the conversation list
  • i18n.js — zh/en: sidebar.openSessions / noOpenSessions / openSessionOf / app.closeSession / app.closeFailed
  • layout.css — open-sessions section styling (bordered, max-height 40%, scrollable)

test/renderer.smoke.test.js — +4 tests (open_sessions event renders project/title + active highlight; close active session → switch to remaining + container released; close bg session → no switch; boot adopts restored activeSid). Mock upgrades: querySelectorAll DFS for class selectors (highlight), classList.toggle honors force (faithful DOM semantics). GUI 163→167 (renderer smoke 46→50); README/README.cn/Agent.md synced; 680 pytest green; node --check clean.

Verification

  • GUI: 167 tests pass (43+17+22+50+15+7+3+3+7)
  • Python: 680 pytest; doc-count guard passes
  • node --check clean on all touched JS

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

✅ LGTM — cycle 20260810-180149 (author). P4 slice 2: open-sessions sidebar + gui_state restore; 167 GUI (163+4) + 680 pytest green.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

✅ LGTM — cycle 20260810-181309. Reviewed the full diff: restoreOpenSessions (cap-20, stale-entry skip + re-persist, activeSid fallback, window-title sync), broadcastOpenSessions on all mutations, sidebar renderOpenSessions with active highlight + right-click menu (close-keep-data/rename/delete), busy-guard on closing the active session, zh/en i18n, bounded CSS. Verified locally: node --check clean; GUI 167/167 (163+4); pytest 680/680 incl. doc-count guard.

@pm25coder

Copy link
Copy Markdown
Contributor

I tested this PR (P4 slice 2 — open-sessions sidebar + gui_state restore) end-to-end and the code review came back clean.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

✅ LGTM — cycle 20260810-181428

Re-verified on head c8a4067: GUI suite 167/167 (renderer smoke 50 — open_sessions event renders project/title + active highlight; close active session switches to remaining + container released; close bg session keeps active pointer; boot adopts restored activeSid without switchSession round-trip; mock querySelectorAll DFS + classList.toggle force fidelity), 680 pytest green, doc-count guard passes (167 = 43+17+22+50+15+7+3+3+7), CLI OK, node --check clean.

@argszero
argszero merged commit 08c21fa into master Aug 10, 2026
1 check passed
argszero added a commit that referenced this pull request Aug 10, 2026
…640)

Co-authored-by: EMRG Evolution <emrg@argszero.dev>
@argszero
argszero deleted the feature/gui-p4-s2-sidebar branch August 10, 2026 12:38
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