fix: reveal markdown directory links in the file tree, not Finder (#72)#87
Merged
Merged
Conversation
A markdown-preview link resolving to a directory used to reveal the folder in Finder, jumping the reader out of the app mid-README while sibling file links open in a tab right there. GitHub instead renders a folder listing for the same link. Redirect the is_dir branch to revealInTree(taskId, resolved, true), which un-hides the right panel, switches it to All files, and expands/scrolls/highlights the target directory in the sidebar tree. resolved is already task-root-relative and resolveTaskHref guarantees containment, so it's the exact path space the tree keys on (the same one the editor breadcrumb reveal uses). Binary files (images, archives), which the editor can't render, still reveal in the OS file manager. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019x3kbDKdUAfbCKeWhBnmJw
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #72.
Problem
A link in the markdown preview that resolves to a directory (e.g.
[some-project](some-project/)) revealed the folder in Finder, jumping the reader out of the app mid-README, while sibling links to actual files open in a tab right there. GitHub instead renders a folder-listing page for the same link.Fix
Redirect the
is_dirbranch inMarkdownPreview.onClicktorevealInTree(taskId, resolved, true)instead oftaskRevealPath. That store action already:isDiris supported),It's the same reveal the editor breadcrumb's folder segments use (
TaskView.tsx), so behavior is consistent app-wide.resolvedfromresolveTaskHrefis already task-root-relative and containment-checked (root-escaping paths returnnull), so it's exactly the path space the tree keys on. Member files resolve to<member_dir>/rest, which is just a subfolder in the wrapper tree, so multi-repo works with no special casing.Binary files (images, archives) that the editor can't render still reveal in the OS file manager, unchanged.
Test plan
tsc -bclean. No CHANGELOG entry (maintainer-authored at release time).🤖 Generated with Claude Code
https://claude.ai/code/session_019x3kbDKdUAfbCKeWhBnmJw