feat: make modified files in sidebar clickable to open with OS default app#25905
Open
JosephITA wants to merge 1 commit intoanomalyco:devfrom
Open
feat: make modified files in sidebar clickable to open with OS default app#25905JosephITA wants to merge 1 commit intoanomalyco:devfrom
JosephITA wants to merge 1 commit intoanomalyco:devfrom
Conversation
…t app Files listed under "Modified Files" in the session sidebar are now clickable. Clicking a file opens it with the OS default application for that file type (e.g., VS Code for .ts, browser for .html). Motivation: I often review changed files in opencode without having my editor open. Manually navigating to each file is slow -- clicking the file directly in the sidebar is much faster. Implementation: resolves the project-relative diff path to absolute using the project directory, then opens it via the `open` package (same pattern used by Link for URLs). File names are styled in the primary accent color to indicate clickability, consistent with how links appear elsewhere.
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate Found:
This PR appears to be directly related to PR #25905. Both involve making file references clickable in the UI to open them. PR #19153 may be addressing a similar feature for edited file references. You should verify whether this is a duplicate or if they cover different aspects (e.g., edited files vs. modified files, or different UI components). |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
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.
Issue for this PR
N/A
Type of change
What does this PR do?
Files listed under "Modified Files" in the session sidebar are now clickable. Clicking a file opens it with the OS default application for that file type (e.g., VS Code for .ts, browser for .html).
I often review changed files in opencode without having my editor open. Manually navigating to each file is slow -- clicking the file directly in the sidebar is much faster.
Implementation: resolves the project-relative diff path to absolute using the project directory, then opens it via the
openpackage (same pattern used by Link for URLs). File names are styled in the primary accent color to indicate clickability, consistent with how links appear elsewhere.How did you verify your code works?
Ran
bun typecheckinpackages/opencode-- passes cleanly. The pre-pushturbo typecheckacross all packages also passed. Reviewed the data flow: diff file paths are relative to the project directory,state.path.directoryprovides the absolute project root, and the<Show when={list().length > 0}>guard ensures the directory is populated before files are rendered.Screenshots / recordings
N/A (terminal UI change, visual difference is the file name color changing from muted to primary accent)
Checklist