Skip to content

feat(web): terminal link context menu actions - #7280

Open
flamboh wants to merge 5 commits into
pingdotgg:mainfrom
flamboh:t3code/fix-terminal-directory-hover
Open

feat(web): terminal link context menu actions#7280
flamboh wants to merge 5 commits into
pingdotgg:mainfrom
flamboh:t3code/fix-terminal-directory-hover

Conversation

@flamboh

@flamboh flamboh commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Note

🤖 GPT-6 on behalf of Oliver

What Changed

Right-clicking a terminal path or URL now offers Open, Add to chat, and Copy for the target under the pointer. The highlight stays for as long as the menu is open. Local filesystem paths also offer the environment's file-manager reveal action when supported; URLs and remote environments do not.

Add to chat inserts paths with the file chip appearance and URLs as plain text.

Why

Right-clicking threw away the detected target and offered only the selection actions and Paste, so you couldn't open or copy the path or link you were pointing at. Putting this in the context menu is a natural addition.

Behavior precedent

Ghostty-based terminals do the same thing: right-click offers actions for the target under the pointer and pins the highlight while the menu is open.

UI Changes

Before

image

After

image
Cap.2026-08-19.at.00.22.13.mp4

Verification

  • 95 tests passed across terminal paths, URL opening, platform labels, editor selection, local storage, and Ghostty context-menu lifecycle.
  • Web typecheck passed.
  • Targeted lint and git diff --check passed.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes

Implemented by GPT-5.6 Sol and Fable 5 via Codex and T3 Code. Rebase and file-manager reveal by GPT-5.6 Sol; review, test trimming, and this description by GPT-6 through Codex.

Note

Add terminal link context menu actions for open, preview, reveal, copy, and chat

  • Right-clicking a terminal link now shows a context menu with actions tailored to the link type: URLs get integrated-browser, system-browser, chat, and copy; filesystem paths get editor-open, optional file-manager reveal, chat, and copy
  • A link-to-chat callback is wired from GhosttyTerminalSurface through ThreadTerminalDrawer and PersistentThreadTerminalPanel up to ChatView, which inserts the serialized link into the composer draft or shows an error toast
  • The right-clicked link stays highlighted with a pointer cursor while the menu is open; a request-id guard prevents a stale menu from clearing a newer link's highlight
  • resolveAndPersistPreferredEditor accepts an optional editor override used by the path-open action; an unavailable override yields no editor instead of silently falling back
  • A new openTerminalLinkInIntegratedBrowser workflow lets the explicit menu action open the integrated preview regardless of the configured default browser target, falling back to the system browser when unsupported
  • Risk: GhosttyTerminalSurfaceOptions.onContextMenu callback signature changed to receive link text instead of just the mouse event — any out-of-tree host implementing this interface needs updating
📊 Macroscope summarized a01dc85. 6 files reviewed, 1 issue evaluated, 1 issue filtered, 0 comments posted

🗂️ Filtered Issues

apps/web/src/components/ThreadTerminalDrawer.tsx — 0 comments posted, 1 evaluated, 1 filtered
  • line 265: terminalLinkChatText strips the only separator from a Windows drive root. For a terminal link such as C:\, the suffix pattern matches the backslash (it is not at index 0), producing C: and serializing [C:](C:); adding that path to chat therefore no longer refers to the drive root. [ Already posted ]

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d01b6203-2825-4cfb-baa1-307b36f90ed6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 17, 2026
Comment thread apps/web/src/terminal/ghostty/surface.ts Outdated
@flamboh
flamboh force-pushed the t3code/fix-terminal-directory-hover branch from e3f1bc3 to ba7c971 Compare August 17, 2026 01:23
Comment thread apps/web/src/components/ChatView.tsx Outdated
Comment thread apps/web/src/components/ThreadTerminalDrawer.tsx Outdated
Comment thread apps/web/src/terminal/ghostty/surface.ts Outdated

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One finding: the newly pinned right-click link highlight can be unpinned by a superseded menu flow (browser fallback menu), leaving the open menu with no highlighted target. Details inline.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/terminal/ghostty/surface.ts Outdated

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the terminal link changes for UI/interaction consistency. One finding: the new "Add path/link to chat" action silently drops the target when the composer refuses input, unlike the other add-to-chat surface and unlike every other failure path in the terminal context menu. Everything else (menu item shape/labels/icon: "copy", pinned-highlight lifetime, modifier-gated hover matching activation, focused tests) matches existing repo contracts.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/ChatView.tsx Outdated
@flamboh
flamboh force-pushed the t3code/fix-terminal-directory-hover branch 2 times, most recently from cb9f05f to c54a206 Compare August 17, 2026 01:40

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UI consistency review: one finding on how terminal paths are inserted into the composer.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/ThreadTerminalDrawer.tsx Outdated

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One finding: terminalLinkChatText can emit a composer file link with an empty label for directory-style terminal links, which renders as a label-less chip in the composer. Details inline.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/ThreadTerminalDrawer.tsx
@flamboh
flamboh force-pushed the t3code/fix-terminal-directory-hover branch from c54a206 to cf2bb08 Compare August 17, 2026 01:50
@flamboh
flamboh marked this pull request as ready for review August 17, 2026 02:01
@macroscopeapp

macroscopeapp Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR adds a substantial user-facing terminal-link feature spanning context menus, chat composition, editor and file-manager actions, external browsing, and integrated preview behavior. The cross-component runtime impact and multiple new workflows warrant human review.

You can add or adjust custom eligibility rules. Learn more.

@flamboh
flamboh force-pushed the t3code/fix-terminal-directory-hover branch from cf2bb08 to 278b617 Compare August 19, 2026 06:59
@flamboh flamboh changed the title fix(web): make terminal links actionable feat(web): terminal link context menu actions Aug 19, 2026
@flamboh
flamboh force-pushed the t3code/fix-terminal-directory-hover branch 2 times, most recently from 6864071 to 27c4e07 Compare August 23, 2026 10:04

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One finding: a comment documenting a browser/Electron constraint was dropped from terminalContextMenuItems while the behavior it explains is unchanged. Everything else in the diff looks consistent — the new menu entries reuse the shared ContextMenuItem contract (labels and the copy icon match pullRequestLinkContextMenu / ChatMarkdown's file-link menu), the new "Unable to add to chat" toast matches the sibling flow in FileBrowserPanel, and the pinned link highlight is re-projected through screen coordinates so scrolling and superseded menus don't strand it.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/ThreadTerminalDrawer.tsx Outdated
@flamboh

flamboh commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

last failed macroscope check is over a suggested comment, not actually any functionality issues

@flamboh
flamboh force-pushed the t3code/fix-terminal-directory-hover branch from be165ee to a4a9704 Compare August 24, 2026 21:43

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One finding on the new terminal link context menu: the open-link entry chains into a second context menu for previewable URLs instead of offering the destinations in the menu the user already opened.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/ThreadTerminalDrawer.tsx Outdated

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One consistency finding: the terminal link's two open destinations are now labelled two different ways depending on the gesture (right-click vs modifier-click). Details inline.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/preview/openTerminalLinkInPreview.ts Outdated
@flamboh
flamboh force-pushed the t3code/fix-terminal-directory-hover branch from c15945b to 386ce1c Compare August 24, 2026 21:57

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the changed TypeScript against the Effect service conventions. No Effect service definitions, layers, error classes, or runtime boundaries are introduced or modified here: openTerminalLinkInPreview.ts keeps its existing Schema.TaggedErrorClass errors with structural attributes plus a preserved cause, no ManagedRuntime.make, Layer.succeed, or runPromise* usage is added, and no service instances are passed as constructor parameters. One change-discipline nit below.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/web/src/components/ThreadTerminalDrawer.tsx

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One finding on the new terminal link menu: Copy path copies the raw matched token, so it can include a :line:col position that no other path-copy action in the app includes.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/ThreadTerminalDrawer.tsx Outdated
@flamboh
flamboh force-pushed the t3code/fix-terminal-directory-hover branch 2 times, most recently from bf2bf77 to f4fd4ba Compare August 24, 2026 23:12
Comment thread apps/web/src/components/ThreadTerminalDrawer.tsx Outdated
@flamboh
flamboh force-pushed the t3code/fix-terminal-directory-hover branch from 3fb5219 to 9b5df63 Compare September 2, 2026 07:49
@flamboh
flamboh force-pushed the t3code/fix-terminal-directory-hover branch from 9b5df63 to a01dc85 Compare September 4, 2026 22:58
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. and removed vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant