Skip to content

feat: make modified files in sidebar clickable to open with OS default app#25905

Open
JosephITA wants to merge 1 commit intoanomalyco:devfrom
JosephITA:dev
Open

feat: make modified files in sidebar clickable to open with OS default app#25905
JosephITA wants to merge 1 commit intoanomalyco:devfrom
JosephITA:dev

Conversation

@JosephITA
Copy link
Copy Markdown

@JosephITA JosephITA commented May 5, 2026

Issue for this PR

N/A

Type of change

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

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 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.

How did you verify your code works?

Ran bun typecheck in packages/opencode -- passes cleanly. The pre-push turbo typecheck across all packages also passed. Reviewed the data flow: diff file paths are relative to the project directory, state.path.directory provides 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

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

…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.
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label May 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

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).

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label May 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

1 participant