Repository navigation
fix(web): preserve inline selection and add desktop context menus - #570
Merged
Merged
Conversation
nixuuu
added a commit
that referenced
this pull request
Nov 26, 2026
Right-clicking a message field in Canopy Desktop opened an Electron menu styled with the system color scheme. The composer menu now uses the active Canopy palette in a separate Electron view owned by the desktop shell. Electron still determines which actions are available and runs its editing commands after the composer regains focus. The application page has no command interface to this view. Fixes: #570 Thanks to @janek-normalnie for reporting the mismatch. ### Verification - Local Linux, revision `eb7bf49d8`. Formatting and lint passed for all nine changed code files. The diff passed whitespace checks and contained only source and documentation. The existing context-menu template test passed all four cases and its inputs are unchanged. - Copy audit. Existing command labels carry over, and the accessible menu name is “Edit message.” Labels, keyboard hints and disabled controls are available as text or accessibility state. - CI covers typecheck, affected tests and builds. The workflows do not exercise the actual message menu in a graphical Electron session. Palette changes, focus restoration, clipboard operations and keyboard navigation in the new view remain unverified in the desktop runtime.
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.
Selecting a message across a file reference used to omit the path from both clipboard text and Cite. File references and attachment previews now use selectable inline links; mentions also allow selection. A drag or a click that leaves text selected does not activate a link, while a plain click or Enter still opens the file preview.
Desktop windows now provide a native context menu: Copy for selected text; native editing roles and spelling suggestions in editable fields; Copy link and Open link in browser for links. External opening validates HTTP(S) only. Existing sidebar/bot menus and sensitive values retain their local
contextmenu.preventDefault()behavior. There is no global context-menu cancellation in the web renderer, no new IPC, and no change to sandboxing or context isolation.Fixes: #514
The file-reference buttons were introduced by #514, whose merge is currently on
devand has not reachednextormain.Validation:
bun install --frozen-lockfile,bun run gen:check, full repositorybun run typecheck,bun run lint,bun run format:check, and the web build passed. Web and desktop typechecks and the web build also passed after the final inline-link adjustment.bun test apps/desktop/test/context-menu.test.ts: 3 tests, 27 assertions. Covers selection/composer menu roles, disabled editing actions, spelling opt-outs, and rejection of non-HTTP(S) external opening.check:tmpwas intentionally left to CI, as requested. No web UI test suite or diagnostic artifacts were added.Copy audit (docs/copy.md §8):
Copy link/Open link in browser: short imperative actions, sentence case, no trailing punctuation or new glossary terms. Native editing roles keep the operating system's conventional labels and shortcuts.Open <path>/Download <name>labels and all error/status text are unchanged. Short and long labels were checked at desktop and phone width; the file path has a visible text label and does not rely on colour or an icon.