Skip to content

Right-click a page to rename or delete it, and an agent to delete it - #417

Merged
SunkenInTime merged 3 commits into
mainfrom
t3/right-click-menus
Nov 1, 2026
Merged

SunkenInTime merged 3 commits into
mainfrom
t3/right-click-menus

Conversation

@SunkenInTime

@SunkenInTime SunkenInTime commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Agent menu before and after

Page menu before and after, on the last page, and for a viewer

Real frames from the driver runs, stepped at 1.5 s each (local agent delete, local rename, cloud delete and Undo):

Right-click flow

ci: test

People right-click things and expect to act on them. THINKII asked for this on pages in April and Dara said "on it", and placed agents had a right-click menu with no Delete in it. Before this PR, deleting either one meant hovering first: the row's trash button, or E on a hovered agent.

Pages. Right-clicking a page row offers Rename and Delete. Both call the same functions as the row's buttons, so rename keeps its dialog and delete keeps its confirmation, its teammate warning and the cloud Undo toast. The last page shows a greyed Delete, matching its greyed trash button. A viewer gets no menu.

Agents. The menu on a placed agent gets a Delete at the bottom, styled like the other canvas menus. It uses the same undoable delete as pressing E on a hovered agent. Viewers already had no agent menu and still don't.

Two cases needed a decision:

  • Agent in a selection. Delete removes the whole selection, as the Delete key and E do. If the agent you right-clicked isn't in the selection, only that agent goes and the selection stays. The Delete key and E would remove the selection instead, even with the cursor on another agent, but a menu opened on one agent should act on that agent.
  • Lineup drafts. "Create Lineup" makes a draft with the same id as the placed agent. Without a guard, Delete on the draft would remove the real agent, so drafts don't get the item. A test pins this.

What I saw in a running build

Windows release driver builds against the dev deployment, before and after, from the same commit apart from the change.

  • Local strategy, right-click-local.json, 101 steps clean: agent delete and Ctrl+Z, selection delete and undo, unselected agent with a selection kept, rename, delete with confirm, delete with cancel, last page refuses.
  • Cloud strategy as owner, right-click-cloud.json, 63 steps clean: agent delete and undo reach synced, rename, delete, Undo toast brings the page back.
  • Cloud strategy as a second account on a view link, right-click-viewer.json, 24 steps clean: right-clicking an agent and a page shows no menu, and the script fails if Rename or Delete appears.
  • Scratch checks: left-click still opens a page, drag still reorders, a menu near the window's bottom edge moves up and stays on screen.
  • Key steps: a driver key does nothing when the window lacks keyboard focus, and the step still logs ok. Every undo and delete in these scripts now has an expectAgents count after it that fails the run. Those runs used a build whose driver also took focus back before each key; that guard is not in this PR. Twenty rounds of delete selection, Ctrl+Z, each agent back on its spot, all landed.
  • Keyboard comparison, scratch: with one agent selected and the cursor on another, the Delete key and E both removed the selected agent; with nothing selected, E removed the hovered one. Ctrl+Z restored each.

The driver gained shareLink, openShareLink and typeText so scripts can open a strategy as a viewer and rename a page, plus expectAgents and keyE, the same lines as #425. Those are in lib/dev/drive, which only compiles into driver builds.

Not covered

  • Web. The menu widget turns off the browser's own menu and the canvas menus already rely on that, but I didn't run this in a browser.
  • The collapsed pages pill has no menu. It shows only the active page and has no buttons today, so I left it.
  • Right-clicking exactly on the pencil or trash icon opens nothing, because the button takes the click.
  • A second right-click on another row leaves the first menu open. Two agent menus do the same on the unchanged build. The cause is in shadcn_ui: all its menus share one click-outside group.
  • View cone and circle agents weren't driven. They go through the same delete call as plain agents.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no blocking issues were found.

Summary

Adds Rename and Delete to page menus, and undoable Delete to placed-agent menus.

  • Right-clicking a page row opens its Rename and Delete menu.
  • Right-clicking a placed agent offers Delete in its canvas menu.
  • Driver scripts can exercise page and agent menus as editors and viewers.

No new actionable issues were found in the changes since the previous review. The full-PR rule check found no violations. Checks here were source-only; the app and driver scripts were not run.

Reviews (3) · Last reviewed commit: "Fail the right-click scripts when an und..." · Reviewed by Greptile

Both do what the hover controls already do: the page row's pencil and trash,
and the delete key on a placed agent, with the same confirmation, undo,
last-page protection and view-only rules.

The driver learns shareLink, openShareLink and typeText, so a script can open
a strategy as a viewer and rename a page.
@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 48 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 627072e9-d665-497f-aaa9-86aa37142c9c
Commits

Reviewing files that changed from the base of the PR and between 9e799b1 and 862c5e2.

Files selected for processing: 9
  • lib/dev/drive/drive.dart
  • lib/widgets/delete_helpers.dart
  • lib/widgets/draggable_widgets/agents/agent_widget.dart
  • lib/widgets/pages_bar.dart
  • test/lineup_viewer_access_test.dart
  • test/widgets/pages_bar_undo_delete_test.dart
  • tool/drive/scripts/right-click-cloud.json
  • tool/drive/scripts/right-click-local.json
  • tool/drive/scripts/right-click-viewer.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A driver key is dropped when the window has no keyboard focus, and the
step still logs ok. Each key step in these scripts now has an agent count
after it that fails the run, including the third undo, which had no check.
@SunkenInTime
SunkenInTime merged commit 0fbf9f2 into main Nov 1, 2026
15 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.

1 participant