Skip to content

fix(app): open selected file from file tree#29337

Closed
YOMXXX wants to merge 1 commit into
anomalyco:devfrom
YOMXXX:fix/file-tree-open-selected-file
Closed

fix(app): open selected file from file tree#29337
YOMXXX wants to merge 1 commit into
anomalyco:devfrom
YOMXXX:fix/file-tree-open-selected-file

Conversation

@YOMXXX
Copy link
Copy Markdown

@YOMXXX YOMXXX commented May 26, 2026

Issue for this PR

Closes #29299

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The desktop header open button always used the project directory as its target. After selecting a file in the right file tree, clicking the open button still opened the project root instead of the selected file.

This PR tracks the most recently selected file from the side-panel file tree, keeps that selection in sync when an active file tab changes, and resolves the header open/copy target to that file path. Without a selected file, the button still falls back to the project directory.

How did you verify your code works?

  • cd packages/app && PATH="$HOME/.bun/bin:$PATH" bun test src/components/session/session-header-path.test.ts src/pages/session/helpers.test.ts src/components/file-tree.test.ts
  • cd packages/app && PATH="$HOME/.bun/bin:$PATH" bun typecheck
  • git diff --check
  • cd packages/app && PATH="$HOME/.bun/bin:$PATH" bun test --preload ./happydom.ts ./src
  • PATH="$HOME/.bun/bin:$PATH" .husky/pre-push

Screenshots / recordings

Not included; this changes the open target behavior without changing visible layout.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@thdxr thdxr closed this May 27, 2026
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.

TUI file tree: clicking a file opens project root instead of the file

2 participants