Skip to content

feat(desktop): add native editing context menu for editable text - #2503

Merged
vastsa merged 2 commits into
vastsa:mainfrom
chengzhi-c:feat/editable-context-menu
Nov 21, 2026
Merged

vastsa merged 2 commits into
vastsa:mainfrom
chengzhi-c:feat/editable-context-menu

Conversation

@chengzhi-c

@chengzhi-c chengzhi-c commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Right-clicking an editable text control in the main window opens Undo, Redo, Cut, Copy, Paste, and Select All. Actions reflect the editor state and preserve its selection and undo history. Native labels follow Electron/OS localization.

Refs #567 (editable text controls).

Windows composer control (isolated fixture):

Before After
Before After

Right-clicking an editable control in the main window presented no menu, so
Undo, Redo, Cut, Copy, Paste, and Select All were reachable only through
keyboard shortcuts.

Register one context-menu listener per window's webContents, gate it on
params.isEditable, and pop a native menu built from the six editing roles with
their enabled state taken from params.editFlags. The menu targets the
originating window, frame, and pointer position, and uses native roles so the
editor keeps its own selection, undo stack, and paste path.

Read-only controls return before any menu is built, and renderer-owned context
menus keep priority because preventDefault suppresses the native event.

Refs vastsa#567
Wait for window focus and native edit results before asserting editor state. Run the interaction test under Xvfb in CI so it executes on Linux.

Refs vastsa#567
@chengzhi-c
chengzhi-c marked this pull request as ready for review November 21, 2026 11:29
@vastsa
vastsa merged commit 023ed86 into vastsa:main Nov 21, 2026
6 checks passed
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.

2 participants