* fix(web): expand folder optimistically on first click in Files panel
The first click on a folder in the Files panel previously deferred the
expanded-state update until after loadNodeChildren resolved, so the
chevron and children only appeared once the WebSocket round-trip
finished. Users perceived the click as a no-op and had to click again.
Flip the expanded set synchronously, then load children in the
background. Extracts the toggle logic into a testable helper and locks
in the regression with unit tests.
Closes#983
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* docs(web): collapse toggleFolderExpand docstring to a single line
Per the CLAUDE.md "no multi-line comment blocks" rule flagged by review.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix(web): dedupe in-flight loadNodeChildren and collapse comment to one line
- Add `activeLoadsRef` + `isLoading(path)` to `useLoadingTimers`, and guard
`loadNodeChildren` against duplicate fetches for the same path. Rapid
double-clicks on a freshly collapsed folder no longer issue two
identical WebSocket round-trips (Greptile P2).
- Collapse the `toggleFolderExpand` comment to a single line per
CLAUDE.md (Claude review).
- Add `file-browser-load-children.test.ts` covering the dedupe contract,
the post-finish re-fetch path, and the children-already-loaded
short-circuit.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Kandev Agent <agent@kandev.dev>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>