feat(desktop): add 'Open in TUI' context menu for sessions#20426
Open
yhl10000 wants to merge 1 commit intoanomalyco:devfrom
Open
feat(desktop): add 'Open in TUI' context menu for sessions#20426yhl10000 wants to merge 1 commit intoanomalyco:devfrom
yhl10000 wants to merge 1 commit intoanomalyco:devfrom
Conversation
Add right-click context menu on session items in the sidebar with an 'Open in TUI' option that spawns a system terminal running \opencode attach\ connected to the same backend server and session. Implementation spans the full IPC chain: - ElectronAPI type + preload bridge for \openInTui\ - IPC handler with cross-platform terminal spawning (Windows/macOS/Linux) - Platform abstraction so the app package stays platform-agnostic - ContextMenu UI on SessionItem with 'Open in TUI' and 'Archive' actions
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 — new feature request. No existing issue.
Type of change
What does this PR do?
Adds a right-click context menu on session items in the desktop sidebar. The menu has two actions:
opencode attach <url> --session <id> --password <pwd>, connecting to the same running sidecar and session so users can continue working in TUI mode.The terminal spawning is cross-platform:
cmd /c start cmd /k ...opens a new cmd windowosascripttells Terminal.app to run the commandx-terminal-emulator,gnome-terminal,konsole,xtermin orderThe implementation follows the existing IPC chain pattern: ElectronAPI type → preload bridge → IPC handler → Platform abstraction → UI. The
packages/applayer stays platform-agnostic by using an optionalopenInTuimethod on thePlatforminterface.How did you verify your code works?
npx electron-vite devdonestatepackages/opencode/src/provider/sdk/copilot/)Screenshots / recordings
Checklist