Skip to content

Draw the file list as folders rather than a column of paths - #187

Merged
adityak74 merged 1 commit into
mainfrom
feat/web-file-tree
Sep 6, 2026
Merged

Draw the file list as folders rather than a column of paths#187
adityak74 merged 1 commit into
mainfrom
feat/web-file-tree

Conversation

@adityak74

Copy link
Copy Markdown
Contributor

The problem

A run wrote 351 files and put 349 of them in one directory. The Files
pane drew all 351 as full paths, one per line:

doclang-test/assets/image_000000_aba61…   779 B
doclang-test/assets/image_000001_b053…   205 KB
doclang-test/assets/image_000002_ff69…   196 KB

Every row starts with the same prefix, the part that tells them apart is
the part the pane elides, and the folder they share is never said out
loud. The prefix belongs on one line above the rows, not repeated down
the whole column.

The fix

web/src/artifact-tree.ts groups the listing by directory and builds a
native details per folder, the same choice activity-group.ts made:
it collapses with no state of ours, the keyboard already reaches it, and
the browser knows what to do with it.

main.ts still builds the file row, so the click, the open mark and the
"new" badge did not move. A row shows the leaf name and keeps the whole
path in its title and its data-path, so nothing downstream had to
change.

Which folders start open

The top level is open and everything under it is shut. Those are two
different problems. A workspace with a single directory in it would
otherwise open to one row naming that directory, and a pane that shows
nothing until you click is not an improvement on one that shows too
much. The hundreds of files are one step down, and that is the step
worth folding.

A folder holding the file the pane is showing, or a file the turn just
wrote, opens regardless, so a fresh file is never hidden behind a fold.

Nothing here is tuned to a count. A rule that opens a folder when it is
small enough turns a listing into an argument about what small is.

On the listing in this screenshot

The 351 files become one open doclang-test row, holding
FINDINGS.md and a shut assets · 349 files.

Checks

  • npm run check clean
  • npm test: 435 pass, 0 fail, up from 419
  • npm run build produces the bundle, and the running server serves it

A folder name is part of a path the agent chose, so it reaches the page
through textContent like everything else in web/. The first test in
artifact-tree.test.ts is the injection case, and nothing in that
module assembles markup.

I could not drive the running server from the browser in this session,
the extension lands on a Chrome error page for loopback, so the folder
rendering is covered by the tests and by confirming the server serves
the new bundle and stylesheet rather than by a screenshot.

https://claude.ai/code/session_01PG2vuux5tMsjnZBLWJzMyp

A run that wrote 351 files put 349 of them in one directory, and the
Files pane drew all 351 as full paths, one per line. Every row began
with the same prefix, the part that told them apart was the part the
pane elided, and the folder they shared was never said out loud.

The prefix belongs on one line above the rows. artifact-tree.ts groups
the listing by directory and builds a native details per folder, the
same choice activity-group.ts made: it collapses with no state of ours
and the keyboard already reaches it. main.ts still builds the file row,
so the click, the open mark and the new badge did not move. A row shows
the leaf name and keeps the whole path in its title and its data-path.

The top level is open and everything under it is shut. Those are two
different problems: a workspace with one directory would otherwise open
to a single row naming that directory, and a pane that shows nothing
until you click is not an improvement on one that shows too much. The
hundreds of files are one step down, which is the step worth folding. A
folder holding the open file, or one this turn wrote, opens regardless,
so a fresh file is never hidden behind a fold.

Nothing here is tuned to a count. A rule that opens a folder when it is
small enough turns a listing into an argument about what small is.

A folder name is part of a path the agent chose, so it reaches the page
through textContent like everything else in web/, and the first test is
the injection case.

Claude-Session: https://claude.ai/code/session_01PG2vuux5tMsjnZBLWJzMyp
@adityak74
adityak74 merged commit ece7a62 into main Sep 6, 2026
8 checks passed
@adityak74
adityak74 deleted the feat/web-file-tree branch September 6, 2026 02:24
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.

1 participant