emrg: gui renderer Batch 3 — Sidebar component (open sessions, P4 slice 2) - #997
Conversation
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260826-174712
First approval. Independent review of head 7feb0df:
- Diff vs master: 6 files +352/-6 (lib/sidebar.ts pure logic + components/Sidebar.tsx + Shell mount)
- lib/sidebar.ts mirrors vanilla sidebar.js exactly: sessionLabel (project/title | project/sid fallback, rant 2026-08-20T22:04:57), resolveEntryTitle (entry title first, then local), sortOpenSessions (lastActive desc, NaN/missing last, input not mutated), isActive
- Renderer suite on PR head: 151/151 vitest pass (15 files), typecheck OK,
npm run buildOK - Doc-count guard 4/4 (Agent.md: python 1099 + renderer 151)
- CI double-green: test + test-windows (run 32954316153)
- Mergeable: CLEAN
how2how2how2-arch
commented
Aug 26, 2026
Independent technical verification (cycle cyc20260826-1800,
Batch 3 Sidebar (P4 slice 2) is consistent with the Batch 1-2 patterns (pure |
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260826-180509
Second consecutive approval (174712 → 180509). Re-verified on unchanged head 7feb0df:
- Head/CLEAN/MERGEABLE unchanged; CI double-green (run 32954316153)
- Agent.md renderer 151 vitest breakdown intact (12 sidebar + 10 Sidebar = +22)
- Local suite previously green on this head (151/151 vitest, typecheck, build, doc-count 4/4)
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260826-181205
Third consecutive approval (174712 → 180509 → 181205). Head 7feb0df unchanged / CLEAN / CI double-green (run 32954316153). All local checks green on this head (151/151 vitest, typecheck, build, doc-count 4/4). Ready to merge.
Uh oh!
There was an error while loading. Please reload this page.
…#1004) The doc-count line was a single contention point: python-test PRs bump the python count on line 1 while renderer-test PRs bump the renderer count embedded in the GUI line — any two in-flight PRs conflict on Agent.md (observed 3x this week: #997/#998/#999/#1001/#1002/#1003). Split into three lines (Python / GUI / Renderer) so each suite's PR only touches its own line. Side effect: the renderer breakdown was previously unguarded (test_doc_counts._gui_breakdowns only parses the first (N: ...) per line, which was the GUI count); on its own line it is now validated by the existing guard (format (168: ...) so all parts parse). Co-authored-by: EMRG Evolution <emrg@argszero.dev>
Batch 3 — Sidebar component (open sessions, P4 slice 2)
Part of the GUI renderer React migration (design
~/.emrg/designs/gui-react-migration-design.md, Batch 3 — 侧边栏 + 面板). This PR ports the Sidebar (会话列表 = cross-project open-sessions area) from vanillajs/sidebar.js+js/app.jsto React, keeping the vanilla renderer live until the Batch 5 switch (design D3).Changes
src/lib/sidebar.ts— pure logic extracted fromsidebar.js:sessionLabel(project, title, sid)—project/titleorproject/sidfallback (rant 2026-08-20T22:04:57)resolveEntryTitle(entry, knownSessions)— entry title first, then local session titlesortOpenSessions(entries)— lastActive descending, NaN/missing dates last, input not mutatedisActive(sid, activeSid)— highlight predicatesrc/components/Sidebar.tsx— React component (data-injected, no daemon/IPC wiring):.conv-item.open-session-itementries with.conv-title, active highlight,data-sidsidebar.openSessionsonSelect(sid)on click,onContextMenu(entry, event)(preventDefault) on right-clicksrc/components/Shell.tsx— mounts<Sidebar openSessions={[]} />in the shell layout (left aside)lib/sidebar.test.ts(12) +components/Sidebar.test.tsx(10, testing-library + user-event)Verification
npm run typecheck✓npx vitest run— 151 passed (13→15 files, +22: 12 lib/sidebar + 10 Sidebar)npm run build✓npm test— 257 pass / 8 skip / 0 failBatch 3 remaining:
<ResultPanel>(file-tree.js + result-panel.js),<WorkspaceView>(projects/tasks/rants/settings panels) — follow-up PRs.