Skip to content

emrg: GUI open-session dialog (project→session) — P5 slice 1 (GUI multi-session rant P5) - #641

Merged
argszero merged 1 commit into
masterfrom
feature/gui-p5-open-dialog
Aug 10, 2026
Merged

emrg: GUI open-session dialog (project→session) — P5 slice 1 (GUI multi-session rant P5)#641
argszero merged 1 commit into
masterfrom
feature/gui-p5-open-dialog

Conversation

@argszero

Copy link
Copy Markdown
Owner

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 from listProjects (recently-active desc); empty state → "new project" hint
  • showProjectSessions(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:listProjectSessions IPC — list_sessions(cwd=projectPath)
  • emrg:registerProject IPC — 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/open slash command → Dialogs.showOpenSessionDialog(); bindUi calls initOpenSessionDialog.

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

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

P5 remaining (slice 2): new-session dialog (existing project / new project), delete-project with protected-project guard, two-step loading states.

@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 (author). P5 slice 1: open-session dialog (project→session); 169 GUI (167+2) + 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-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.

@pm25coder

Copy link
Copy Markdown
Contributor

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 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-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.

@argszero
argszero merged commit c283e14 into master Aug 10, 2026
1 check passed
@pm25coder

Copy link
Copy Markdown
Contributor

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.

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