Skip to content

fix(app): expand Windows file tree folders - #39249

Merged
Hona merged 1 commit into
devfrom
windows-tree-dev
Jul 28, 2026
Merged

fix(app): expand Windows file tree folders#39249
Hona merged 1 commit into
devfrom
windows-tree-dev

Conversation

@opencode-agent

Copy link
Copy Markdown
Contributor

Summary

  • canonicalize Windows directory separators before keying file-tree expansion state
  • cover trailing and nested backslash paths in the path helper unit suite
  • add a headless Chromium regression that feeds the real V2 file tree Windows-shaped directory entries, expands a folder, and opens its nested file

Investigation

The server appends the platform separator to directory entries, so Windows returns paths such as frontend\\. The V2 row model canonicalizes this to frontend, while normalizeDir() previously preserved the backslash and stored expansion state under frontend\\. Rendering queried frontend, so the state never matched and aria-expanded remained false.

Confirmed reports:

Supersedes stale PR #36743 with a clean change based on current dev.

Checks

  • bun test --preload ./happydom.ts ./src/context/file/path.test.ts — 38 passed
  • bun typecheck — passed
  • bun run test:e2e -- e2e/regression/open-file-expand-folder.spec.ts --reporter=line — passed
  • bun run test:e2e -- e2e/regression/review-open-file.spec.ts e2e/regression/file-browser-sidebar-tab-switch.spec.ts --reporter=line — 2 passed

Requested by: @Hona (Hona via Slack)

@Hona
Hona enabled auto-merge (squash) July 28, 2026 03:44
@Hona
Hona merged commit 237e694 into dev Jul 28, 2026
8 checks passed
@Hona
Hona deleted the windows-tree-dev branch July 28, 2026 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The file resource panel in WebUI cannot expand folders. V2 desktop: file tree folders don't expand on Windows (trailing path.sep breaks normalizeDir)

1 participant