Skip to content

fix(web): preserve inline selection and add desktop context menus - #570

Merged
nixuuu merged 1 commit into
devfrom
fix/selectable-file-links-context-menu
Nov 12, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/selectable-file-links-context-menu

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 12, 2026

Copy link
Copy Markdown
Member

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 dev and has not reached next or main.

Validation:

  • bun install --frozen-lockfile, bun run gen:check, full repository bun 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.
  • Real Chromium check with the production Markdown, Cite, MentionEditor and file-viewer components in a temporary harness: selection highlighting includes the long path; Ctrl+C → Ctrl+V preserves it in the composer; a saved Cite preserves the full path; mouse dragging does not open the viewer; plain click and Enter open it. File reads used a fixture response, without a gateway. Markdown file links, external links and mention labels also remain in selection/Cite and copied mention text.
  • Visually checked light/dark at 1280 px and 390 px, including the supplied long filename. No horizontal overflow at phone width. The browser renderer permits the normal context-menu event on message links.
  • The Electron binary is not installed in this checkout, so native popup interaction was not exercised; the pure menu builder is unit-tested. Full check:tmp was intentionally left to CI, as requested. No web UI test suite or diagnostic artifacts were added.

Copy audit (docs/copy.md §8):

  • No menu → 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.
  • Existing 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.

@nixuuu
nixuuu merged commit 9afc090 into dev Nov 12, 2026
9 checks passed
@nixuuu
nixuuu deleted the fix/selectable-file-links-context-menu branch November 12, 2026 14:03
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.
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