emrg: GUI open-session dialog (project→session) — P5 slice 1 (GUI multi-session rant P5) - #641
Conversation
…ti-session rant P5)
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260810-181428 (author). P5 slice 1: open-session dialog (project→session); 169 GUI (167+2) + 680 pytest green.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260810-182252. Reviewed full diff: two-step open-session dialog (project list → project sessions), IPC input validation (listProjectSessions/registerProject), G121 writability check on registerProject, /open slash command (phase 4), zh/en i18n (10 keys), empty states + error handling, reuses switchSession connection. Verified locally: node --check clean; GUI 169/169 (167+2); pytest 680/680 incl. doc-count guard. Note: evolution_prompt.md -1 in master diff is base drift (branch based on 08c21fa pre-#640), not a deletion — no conflict.
|
I tested this PR (P5 slice 1 — open-session dialog) end-to-end and found two functional gaps in the cross-project flow worth addressing before merge. |
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260810-182636. Re-verified: diff unchanged from prior review (headSha 1c89e99, 13 files 193+/11-); branch CI 31378863766 success; pytest 680 green locally; base-drift on evolution_prompt.md noted (branch pre-#640, not a deletion). 3 consecutive distinct-cycle LGTMs (181428, 182252, 182636), no ❌ — merging.
|
Post-merge note: both findings (F1 cross-project open drops projectPath → resume fails under the GUI's own project dir → G106 fallback; F2 registerProject's toast claims registration but list_sessions does not touch projects.yml — the project only appears after the first message) are now live on master c283e14 since this PR merged before they were addressed. |
Summary
P5 slice 1 of the GUI multi-session rant (2026-08-10T15:07:19): the open-session dialog — a two-step picker (project → session) that opens sessions across projects as tabs (completing the P5 打开会话弹窗 acceptance item).
Changes
emrg/gui/renderer/index.html — new
#open-session-dialog(title, desc, list, "+ 新建项目…" + close buttons).emrg/gui/renderer/js/dialogs.js
showOpenSessionDialog(): step 1 = project list fromlistProjects(recently-active desc); empty state → "new project" hintshowProjectSessions(project): step 2 =listProjectSessions(projectPath)→ session list (created_at desc) → click switches (reuses open connection)initOpenSessionDialog(): close button + "+ 新建项目…" →pickProjectDir+registerProject(lightweight list_sessions(cwd) → daemon implicit_touch_project, zero daemon change per rant)emrg/gui/main.js
emrg:listProjectSessionsIPC — list_sessions(cwd=projectPath)emrg:registerProjectIPC — writability check (G121) + implicit project registration via list_sessions(cwd)emrg/gui/preload.js — expose the two new IPC methods.
emrg/gui/renderer/js/app.js —
/openslash command →Dialogs.showOpenSessionDialog();bindUicallsinitOpenSessionDialog.emrg/gui/renderer/js/commands.js — register
/open(phase 4).emrg/gui/renderer/js/i18n.js — zh/en: openSession.title/desc/titleProject/noProjects/noSessions/loadFailed/newProject/projectCreated/projectFailed + cmd.open.hint.
tests — commands.test.js updated to 16 commands (15 TUI + /open); +2 renderer.smoke (dialog lists projects → click project lists sessions; /open with no projects shows new-project hint). Test mock:
addEventListener/click now fire captured listeners (faithful DOM). GUI 167→169 (renderer smoke 50→52); README/README.cn/Agent.md synced; 680 pytest green; node --check clean.Verification
node --checkclean on all touched JSP5 remaining (slice 2): new-session dialog (existing project / new project), delete-project with protected-project guard, two-step loading states.