emrg: GUI workspace panel P3 — file browser tree + basic viewer (rant 2026-08-11T12:20:35) - #665
Conversation
… 2026-08-11T12:20:35)
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle
P3 slice 1: file browser tree (lazy listFiles fetch + cache, root follows session projectPath) + basic viewer (readFile text, binary/error hints, system-open button). Verified: GUI 198/198 ✓ (5 new smoke tests incl. cache no-refetch + per-session root), pytest 694 ✓, doc guard 3/3 ✓, import + --help ✓. CI test run green.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle
Reviewed P3 slice 1 (file browser tree + basic viewer) in a local worktree at branch head ed99815:
- file-tree.js: lazy directory tree — root = active session projectPath (app.js wires
FileTree.setSessionin switchSession/newSession/init via projectPathFor with openSessions→projectDir fallback); per-path cache (loaded/loading/error/entries) so collapse/re-expand never refetches; dirs-first sorting / 5000-cap / symlink-safety delegated to the P1 daemon list_files; file row click → ResultPanel.openFileTab(sid, path). - Viewer (P3.3 basic):
#result-viewerpane activates on file tabs;emrg.readFilecontent rendered as escaped text in<pre><code>(el() text nodes — no XSS); content cached per tab (no refetch on re-activation/session switch); binary → localized hint, read error → localized error, header has path + system-open button (emrg.openFile→ shell.openPath).openFileTab/closeFileTabnull-sid = current-session bucket (matches app.js pairing). - IPC: preload exposes listFiles/readFile/openFile; main.js passthrough to daemon list_files/read_file (startLine/lineLimit included) + openFile existsSync guard — all from P1 (#661), consumed correctly here.
- i18n: 6 new zh/en keys (treeLoading/treeLoadFailed/viewerLoading/viewerBinary/viewerError/viewerOpen).
- Verification: renderer smoke + full GUI suite 198/198 (the 1 daemon_client 'python=python3' failure was purely environmental — fresh worktree lacked
.venv; passes 43/43 with it, same as master), pytest 694/694, doc guard 3/3, import + --help OK. CI test run green (31461585861).
Note (non-blocking, already tracked): the P2.2 cross-session artifact-card DOM note stays open until P3.2 re-scopes the artifact list — consistent with the PR's stated next slices. No issues found.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle (3rd)
Re-verified against branch head ed99815: file browser tree (lazy listFiles + cache, root = session projectPath), basic viewer (readFile text/binary/error + system-open). Local GUI 198/198 ✓ pytest 694 ✓. CI test run green (31461585861). Merge conditions met (3 consecutive ✅ from different cycles).
Uh oh!
There was an error while loading. Please reload this page.
…zero#665) + keep both P3/artifact-isolation tests
P3 slice 1 of the workspace-panel rant (P1 data layer #661, P2 framework #664 merged). Fills the 文件 Tab with real content.
P3.1 File browser (new module
renderer/js/file-tree.js)FileTree.setSession(sid, path)); dir click →emrg.listFiles(P1 daemon) fetch-once + cache (collapse/re-expand does not refetch)ResultPanel.openFileTab(sid, path)(P2.2 tab framework)P3.3 Viewer (basic tier)
#result-viewerpane shown when a file tab is active;emrg.readFilecontent rendered as escaped text in<pre><code>(cached per tab — no refetch on tab re-activation / session switch)openFileTab/closeFileTabnow treat null sid as the current session bucket (matches app.js switchSession+setSession pairing)i18n:
result.treeLoading/treeLoadFailed/viewerLoading/viewerBinary/viewerError/viewerOpenzh/en.Tests: +5 renderer smoke (root auto-expand lazy load, dir lazy-load + cache no-refetch, file click → tab + viewer text, binary hint, per-session root switch); harness adds
result-viewerid, file-tree module, listFiles/readFile mocks. GUI 193 → 198; pytest 694 ✓; doc guard 3/3 ✓; import + --help ✓.Next slices: highlight.js code colors + md rendering + image display (P3.3 full), WebContentsView HTML preview (P2.3/P3.4), artifact list re-scope to write/edit files (P3.2).