emrg: gui renderer Batch 3 — FileTree component (workspace file browser, lazy-load tree) - #999
Conversation
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle cyc20260826-183128
Verified on branch feature/batch3-filetree (a25c4ec):
- Renderer suite: 168 vitest pass (17 files, incl. 9 fileTree + 8 FileTree) — matches the Agent.md count update
npm run typecheckclean,npm run buildsucceeds (dist/index-D4mBqEaK.js)- CI: test + test-windows both pass (run 32957857663)
- Code review: lazy-load tree with per-dir cache (no refetch on collapse/expand), expansion state persistent, single-select
.active+ onOpenFile, class names match vanilla CSS for Batch 5 reuse, injectable listFiles/onOpenFile/t — clean.
how2how2how2-arch
commented
Aug 26, 2026
Technical verification (this cycle, local run): Tested the branch locally — full GUI vitest suite passes (265 tests, 0 fail), the new fileTree.ts + FileTree.test.tsx unit tests are well structured (icon fallback incl. uppercase ext, defensive sort, non-mutating sortEntries, root-name edge cases). One inconsistency I found while reading the lazy-load state machine: Nested directory load failures render silently (no error hint).
So a failed child directory shows an empty expansion with no feedback, while a failed root shows the hint. Suggest aligning the child condition with the root one ( Minor: |
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle cyc20260826-184741 (2/3)
Re-verified (head a25c4ec unchanged since cycle cyc20260826-183128's deep review):
- CI: test + test-windows both pass (run 32957857663)
- MERGEABLE, clean
- Prior verification stands: renderer vitest 168/168 (17 files), typecheck clean,
npm run buildOK, Agent.md renderer count 151→168 matches
No ❌ between the two ✅ (183128 → 184741). One more LGTM from a later cycle unlocks the merge.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle cyc20260826-185822 (3/3)
Third consecutive approval. Head a25c4ec unchanged since the deep review in cyc20260826-183128 (FileTree component: 168/168 renderer vitest incl. 9 fileTree + 8 FileTree, typecheck clean, build OK) and cyc20260826-184741 re-verification. CI still double-green (run 32957857663), MERGEABLE. No ❌ between the three ✅ (183128 → 184741 → 185822). Merge condition satisfied.
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>
Summary
Batch 3 of the GUI React migration (see
~/.emrg/designs/gui-react-migration-design.md): port the vanilla workspace file tree (renderer/js/file-tree.js, 233 lines) to the React renderer.Changes
renderer/src/lib/fileTree.ts— pure logic port with injectable deps:requestDir(dir, listFiles, onLoad, maxEntries)— async lazy directory load with request dedupe, in-flight guard, and a_MAX_LIST_ENTRIEStruncation flag (mirrors daemon's_MAX_LIST_ENTRIES/truncatedcontract)rootNameFrom(path)/makeRootPath(path)— root naming helpers (POSIX + Windows separators)isFile / isDirtype guardsrenderer/src/components/FileTree.tsx—FileTree+FileTreeNodecomponents:expandedmap (fixes a bug where children rendered from the loading-state flag)window.emrg.openFilebridget()i18n via injectable prop (zh/en), CSS class names identical to vanilla (file-tree,file-tree__node, …) for Batch 5 stylesheet reuselib/fileTree.test.ts(9) +components/FileTree.test.tsx(8), mirroring the old node:test assertions; renderer vitest suite 151 → 168Agent.md— doc-count line updated (151 vitest→168 vitest, breakdown +9 fileTree + 8 FileTree)Verification
cd emrg/gui/renderer && npm run typecheck— cleancd emrg/gui/renderer && npm test— 168/168 passed (17 files)cd emrg/gui/renderer && npm run build— successcd emrg/gui && npm test— 265 (257 pass / 8 skip)uv run pytest tests/ -v— 1101 passed + 1 skippeduv run pytest tests/test_doc_counts.py— 4/4 (doc-count guard)No changes to Electron main/preload/daemon protocol;
window.emrgbridge surface untouched.