emrg: GUI multi-session deviations fix — new-chat/open-session entries + per-session drafts (rant 2026-08-10T21:59:11) - #656
Conversation
…s + per-session drafts (rant 2026-08-10T21:59:11)
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260810-221539
Verified locally before push: pytest 687/687 green (incl. evolution_prompt placeholder guard), GUI 183/183 (4 new renderer.smoke tests: B1 dialog-not-direct-new / B2 open-session entry / B3 draft save-restore + send-clear/new-empty), import check + emrg --help OK. Diff 9 files +126/−7 covers all three deviations (B1/B2/B3) with regression safety; doc counts synced (179→183).
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle
Reviewed the full diff (126+/7-, 9 files) after CI SUCCESS (run 31397853180, 1m25s). All three host-verified deviations addressed cleanly:
- B1: new-chat-btn + ⌘N both route through
Dialogs.showNewSessionDialog()(project picker) instead of callingnewSession()directly — matches the host's expected new-chat flow. - B2: dedicated
#open-chat-btnghost button wired to the two-step open-session dialog, with zh/en i18n keys + CSS. Test asserts dialog opens. - B3: per-session drafts via
state.drafts: Map<sid, string>— saveDraft before switch/new, restoreDraft after, cleared on sendMessage; new sessions start empty. Auto-resize height restored like the normal input handler. Tests cover switch-away/switch-back restore and send-clears-draft in both directions.
Regression safety noted: open-session dialog's internal '+ 新对话' entry and no-projectPath fallbacks keep working (unchanged paths). Tests: 4 new renderer smoke (59→63, GUI 179→183) with positive+negative assertions; pytest 687 unchanged; doc counts synced across README.md/README.cn.md/Agent.md. Also includes the evolution_prompt quick-ref entry for merged #655 — good pattern. No issues found.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260810-222517 (3rd consecutive ✅, no ❌ interleaved)
Re-verified: head 3849d3a unchanged; diff 9 files +126/−7 (B1 new-chat-btn+⌘N→showNewSessionDialog / B2 #open-chat-btn entry / B3 per-session drafts Map + save/restore + send-clear + new-empty; i18n zh/en; CSS; 4 renderer.smoke tests; doc counts 179→183); quick-ref #655 entry included; CI test SUCCESS (run 31397853180). Merge condition satisfied.
|
I tested PR #656 end-to-end on Windows (fresh checkout of
Code review notes (all non-blocking):
Thanks — the host-verified deviations are all addressed with good test discrimination. |
…ns B1-B3) (#657) Co-authored-by: EMRG Evolution <emrg@argszero.dev>
Summary
Fixes 3 implementation deviations found by the host in v0.2.22 (rant 2026-08-10T21:59:11, design doc f4e5d6c7). Core P1-P6 of the GUI multi-session feature were already merged; these are the leftover acceptance gaps.
Changes (emrg/gui/)
B1 — 新建会话入口 (host-verified): sidebar
new-chat-btn+ ⌘N were callingnewSession()directly (creating a session with no project selection). Now both callDialogs.showNewSessionDialog()— the existing project-picker dialog (active-sorted projects → click to create in that project, or create-new-project button).B2 — 打开会话入口: the two-step open-session dialog (project → session) was only reachable via the
/opencommand. Added a dedicated#open-chat-btnghost button under the new-chat button in the sidebar →Dialogs.showOpenSessionDialog(), with zh/en i18n keys + CSS.B3 — per-session drafts: the chat container was per-session but the composer input was a global singleton — switching sessions lost the draft. Added
state.drafts: Map<sid, string>:switchSession: saves current input to the old sid before switching, restores the target sid's draft afternewSession: saves old sid draft; new session starts with an empty draftsendMessage: clears the draft for the session once the message is sentRegression safety: the open-session dialog's internal
+ 新建会话…entry and the no-projectPath fallback paths (delete/close-session →newSession()) keep working unchanged.Tests (renderer.smoke.test.js)
new-chat-btnclick opens the new-session dialog and does NOT callnewSession()directlyopen-chat-btnclick opens the open-session dialogGUI tests: 179 → 183 (renderer smoke 59 → 63; README.md / README.cn.md / Agent.md synced). pytest unchanged: 687. Also adds the evolution_prompt quick-ref entry for merged #655 (mid-turn queue injection P1, user-facing daemon feature).