From 020b29f9b73bf644df281495cae7593cf66acfb6 Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Mon, 8 Jun 2026 22:16:35 +0200 Subject: [PATCH] file T-289 (right-click context menus with context-aware actions) Rolling UI epic T-276 child. Secondary-tap context menu built on the ClideAnchoredOverlay + ClideMenu primitives (D-88): a baseline of copy/cut/paste/select-all driven by surface focus/selection, plus context-aware items injected per surface (file-navigator duplicate/rename, git-pane stage/unstage/revert). Injected actions map to clide verbs for user/Claude parity (D-6). Co-Authored-By: Claude Opus 4.8 (1M context) --- .pql/changelog/tickets/2026-06.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.pql/changelog/tickets/2026-06.sql b/.pql/changelog/tickets/2026-06.sql index e1e9a554..b3664ee2 100644 --- a/.pql/changelog/tickets/2026-06.sql +++ b/.pql/changelog/tickets/2026-06.sql @@ -2337,3 +2337,17 @@ RE-SCOPE (2026-06-08, per D-88 amendment): the goal is NOT ''migrate everything - Quick-open keeps bespoke content (centred filter + fuzzy + two-column rows); uses ClideAnchoredOverlay base only. Weakest fit; last or skip. - Theme picker: its own small toggle+list content on the base (or ClideMenu if it cleanly fits). Order: (1) fix the base blockers — focus capture racing content autofocus, and follower content untappable in the canSizeOverlay/zero-MediaQuery test harness (use View size for autoFlip; add a test path for anchored content) — with tests; THEN (2) ClideTypeahead + migrate slash + @; (3) theme picker; (4) quick-open last.', 'backlog', 'medium', NULL, NULL, NULL, '2026-06-08 17:52:51', '2026-06-08 20:12:31', NULL, '254250a0c8666da7273e17f4a9c0d8fb', 1) ON CONFLICT(id) DO UPDATE SET type=excluded.type, parent_id=excluded.parent_id, title=excluded.title, description=excluded.description, status=excluded.status, priority=excluded.priority, assigned_to=excluded.assigned_to, team=excluded.team, decision_ref=excluded.decision_ref, updated_at=excluded.updated_at, deleted_at=excluded.deleted_at, hash=excluded.hash, canonical_version=excluded.canonical_version WHERE excluded.updated_at > tickets.updated_at OR (excluded.updated_at = tickets.updated_at AND excluded.hash > tickets.hash); +INSERT INTO tickets (id, type, parent_id, title, description, status, priority, assigned_to, team, decision_ref, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('T-289', 'story', 'T-276', 'Right-click context menus with context-aware actions', 'Add right-click (secondary-tap / context-menu key) handling across clide surfaces, opening a context menu anchored at the pointer. + +**Build on existing primitives.** Reuse `ClideAnchoredOverlay` + `ClideMenu` (D-88, landed via T-286/T-288) for the popup — do not introduce a new menu widget. The context menu is just another content component over the shared anchored-overlay base, opened on secondary tap instead of a click target. + +**Common actions (the usual suspects).** A baseline set available wherever they apply: Copy, Cut, Paste, Select All. These are driven by focus/selection state of the surface under the pointer (editor, text field, terminal selection, list item label). + +**Context-aware injected actions.** On top of the baseline, each surface contributes extra menu items relevant to *what* was clicked: +- **File navigator** — clicking a file: Duplicate, Rename, Delete, Reveal, Copy path; clicking a folder: New file/folder, etc. +- **Git pane** — clicking a staged file: Unstage, Revert/Discard; clicking an unstaged file: Stage, Discard changes; clicking a hunk where applicable. +- Other panes contribute their own as the pattern proves out. + +**Architecture.** Define a small contract so a surface can declare its context-menu items for a given target (the right-clicked element + its state), which get merged with the baseline edit actions. Honour user/Claude parity (D-6): each injected action should map to an existing `clide` verb / command where one exists, so the menu is a discoverable front-end to commands Claude can also invoke. + +**Scope notes.** Start with file navigator + git pane as the two concrete consumers (they motivate the feature). Keyboard parity: context-menu key + Shift+F10 should open the same menu for the focused element. Accessibility: menu items reachable and labelled per the a11y contract.', 'backlog', 'medium', NULL, NULL, NULL, '2026-06-08 20:16:22', '2026-06-08 20:16:22', NULL, 'd09051ca5ca83fbc3a4e0fd63c5a56e8', 1) ON CONFLICT(id) DO UPDATE SET type=excluded.type, parent_id=excluded.parent_id, title=excluded.title, description=excluded.description, status=excluded.status, priority=excluded.priority, assigned_to=excluded.assigned_to, team=excluded.team, decision_ref=excluded.decision_ref, updated_at=excluded.updated_at, deleted_at=excluded.deleted_at, hash=excluded.hash, canonical_version=excluded.canonical_version WHERE excluded.updated_at > tickets.updated_at OR (excluded.updated_at = tickets.updated_at AND excluded.hash > tickets.hash);