Skip to content

feat: session menu adds Open PR, Open in editor, and numbered group shortcuts - #104154

Merged
steipete merged 2 commits into
mainfrom
claude/missing-implementation-pr-be1c76
Jul 11, 2026
Merged

steipete merged 2 commits into
mainfrom
claude/missing-implementation-pr-be1c76

Conversation

@steipete

@steipete steipete commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Closes #104153

What Problem This Solves

Work sessions (sessions bound to a managed worktree) already detect their pull request (chat PR chips) and have a local checkout, but the session context menu offers no way to reach either: jumping to a session's PR or opening its worktree in an editor means opening the chat first or digging through the Worktrees page. The Move to group submenu is also mouse-only, while every other menu item has a single-letter shortcut.

Why This Change Was Made

The session list (app sidebar and Sessions page) is where session triage happens, so the per-session context menu is the natural home for these jump actions. All the data already exists behind gateway methods (controlUi.sessionPullRequests, worktrees.list) and the editor URL schemes already power the chat file sidebar's "Open in editor" button, so the menu only needed the surface, not new backend capability.

User Impact

For sessions bound to a worktree, the session context menu now shows:

  • Open PR (shortcut G) — opens the pull request detected on the session's branch (active PRs preferred over merged/closed). Rendered disabled until the lazy lookup resolves so the menu never shifts under the pointer; stays disabled when no PR exists.
  • Open in submenu — opens the worktree checkout in Cursor, VS Code, Windsurf, or Zed via their URL schemes (same mechanism as the chat file sidebar).

For every session, the Move to group submenu entries are now numbered (1-9): existing groups first, then Remove from group, then New group…, matching the order users scan. Pressing a digit files the session immediately. Plain chat sessions see no new items.

Menu (light) Move to group Open in
Session menu with Open PR and Open in Numbered group submenu Editor submenu

Dark mode: menu · groups · editors

Evidence

  • Menu surface polish (follow-up commit f7ae085b389): the menu now promotes itself to the browser popover top layer — sidebar-hosted menus render inside the nav stacking context (z-index 10) which paints below the sidebar resizer divider (z-index 20), so the divider line used to bleed through the menu. Same pattern as openclaw-native-link-menu. The four menu surfaces sharing the hardcoded 0 18px 40px drop shadow now use the theme token var(--shadow-lg) (much softer in light mode). Screenshots above are regenerated with these fixes.
  • Screenshots above were captured against the deterministic mock-gateway harness (ui/src/test-helpers/control-ui-e2e.ts) with a worktree session, a detected open PR, and four groups.
  • node scripts/run-vitest.mjs ui/src/components/session-menu.test.ts ui/src/components/session-menu-work.test.ts ui/src/pages/chat/components/chat-sidebar.test.ts — 32 tests passed (new coverage: numbered digit shortcuts and ordering, Open PR loading/enabled dispatch, editor submenu dispatch, PR-pick preference, worktree path resolution incl. removed worktrees).
  • node scripts/run-vitest.mjs ui/src/pages/sessions/sessions-page.test.ts ui/src/pages/sessions/view.test.ts ui/src/components/app-sidebar.test.ts — 54 tests passed.
  • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.ui.json clean; oxlint/oxfmt clean on touched files.
  • i18n: control-ui-i18n.ts sync --write translated the two new strings across all 20 locales with fallbacks=0.

Implementation notes for reviewers:

  • editorOpenUrl moved from ui/src/pages/chat/components/chat-sidebar.ts to ui/src/lib/editor-links.ts (shared by the chat file sidebar and both menu hosts); the old export is deleted.
  • The PR/worktree lookup is lazy and versioned: hosts fetch on menu open via ui/src/components/session-menu-work.ts and drop stale responses when the menu closes or switches sessions. The menu items carry their payload in the action, so no host state is read after close.
  • activateMenuShortcut now accepts digits; digit targets only exist in the DOM while a submenu is open, so closed menus ignore them.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: L maintainer Maintainer-authored PR labels Jul 11, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 11, 2026
@clawsweeper

clawsweeper Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 11, 2026, 1:01 AM ET / 05:01 UTC.

Summary
Adds session-menu actions for opening associated pull requests and managed worktrees in desktop editors, plus numbered keyboard shortcuts for moving sessions between groups.

PR surface: Source +395, Tests +197. Total +592 across 73 files.

Reproducibility: yes. from source: sessions without managed worktrees return before PR lookup, and remote gateway paths are passed to browser-local editor schemes. The contributor has not demonstrated either path in a real setup.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: persistent cache schema: ui/src/i18n/.i18n/ar.tm.jsonl, persistent cache schema: ui/src/i18n/.i18n/de.tm.jsonl, persistent cache schema: ui/src/i18n/.i18n/es.tm.jsonl, persistent cache schema: ui/src/i18n/.i18n/fa.tm.jsonl, persistent cache schema: ui/src/i18n/.i18n/fr.tm.jsonl, persistent cache schema: ui/src/i18n/.i18n/hi.tm.jsonl, and 24 more. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #104153
Summary: This PR is the direct implementation candidate for the linked open feature issue.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🦐 gold shrimp
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Separate broad PR lookup from worktree-only editor eligibility and resolve the editor-host contract.
  • [P1] Refresh the implementation against current main and add redacted real behavior proof for the retained external actions.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The screenshots and listed tests use a deterministic mock gateway; add redacted live evidence showing the intended PR opens and the supported editor receives the correct checkout, then update the PR body to trigger a fresh review or ask a maintainer for @clawsweeper re-review.

Risk before merge

  • [P1] Remote Control UI users could receive an editor URL containing a filesystem path that exists only on the gateway host.
  • [P1] Valid sessions whose PR is resolvable from non-worktree workspace metadata would not receive the new Open PR action.
  • [P1] The branch is behind current main across its central UI files and needs a refreshed current-base review before landing.
  • [P1] The supplied screenshots and tests do not demonstrate either external action in a real setup.

Maintainer options:

  1. Split topology-safe actions (recommended)
    Keep Open PR and numeric shortcuts, remove editor handoff from this PR, and revisit it with an explicit host-ownership contract.
  2. Implement host-aware editor opening
    Add an explicit same-host capability or owning-host dispatch with focused local and remote coverage before retaining the editor submenu.
  3. Pause for product direction
    Hold the branch until maintainers choose the permanent editor-host contract and the implementation is refreshed onto current main.

Next step before merge

  • [P1] A maintainer must choose the editor-host contract, the protected label requires explicit handling, and contributor real-behavior proof remains a merge gate.

Maintainer decision needed

  • Question: Should session-menu editor opening be deferred, restricted by an explicit same-host capability, or routed to the host that owns the managed worktree?
  • Rationale: Custom editor URL schemes execute on the browser machine while the path comes from the gateway, and current code exposes no reliable contract proving those machines share a filesystem.
  • Likely owner: steipete — The relevant session-menu, PR-detection, and editor-opening surfaces trace most strongly to his recent merged Control UI work.
  • Options:
    • Split out editor opening (recommended): Land Open PR and numeric shortcuts while deferring editor handoff until host ownership is represented explicitly.
    • Add same-host capability: Retain editor opening only when a trusted capability proves the browser machine owns the gateway checkout path.
    • Route to owning host: Introduce a host-aware editor command that executes where the managed worktree resides.

Security
Cleared: The diff introduces no dependency, workflow-permission, secret-handling, package-resolution, downloaded-code, or other concrete supply-chain concern.

Review findings

  • [P2] Gate editor handoff to the worktree-owning host — ui/src/pages/sessions/sessions-page.ts:1008
  • [P2] Resolve PRs independently of managed worktrees — ui/src/pages/sessions/sessions-page.ts:921-924
Review details

Best possible solution:

Land Open PR and numeric group shortcuts against current main with PR lookup independent of worktree presence; defer editor opening unless an explicit same-host capability or owning-host dispatch makes the path valid, then prove the retained actions in a real setup.

Do we have a high-confidence way to reproduce the issue?

Yes from source: sessions without managed worktrees return before PR lookup, and remote gateway paths are passed to browser-local editor schemes. The contributor has not demonstrated either path in a real setup.

Is this the best way to solve the issue?

No. The session menu is an appropriate surface, but PR eligibility and editor host ownership need separate contracts; splitting editor opening is the narrowest safe current solution.

Full review comments:

  • [P2] Gate editor handoff to the worktree-owning host — ui/src/pages/sessions/sessions-page.ts:1008
    This still passes the gateway's absolute worktree path to a custom URL scheme executed by the browser machine. With a remote gateway, Cursor, VS Code, Windsurf, or Zed receives a path that exists on another host; gate this on explicit same-host ownership, route it to the owning host, or split the editor action out.
    Confidence: 0.96
  • [P2] Resolve PRs independently of managed worktrees — ui/src/pages/sessions/sessions-page.ts:921-924
    This return hides Open PR whenever row.worktree is absent, although the existing gateway resolves PRs from spawnedCwd, spawnedWorkspaceDir, and agent workspace sources. Fetch PR data for every supported session and only leave the editor path unavailable without a managed worktree. This was equally visible on the earlier reviewed head and is being raised late.
    Confidence: 0.98
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against c47ceb0f3dcc.

Label changes

Label justifications:

  • P3: This is bounded Control UI workflow ergonomics rather than an urgent regression or blocked core workflow.
  • merge-risk: 🚨 compatibility: Merging as written would narrow the existing session PR eligibility contract and assume browser and gateway filesystem paths belong to the same host.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The screenshots and listed tests use a deterministic mock gateway; add redacted live evidence showing the intended PR opens and the supported editor receives the correct checkout, then update the PR body to trigger a fresh review or ask a maintainer for @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +395, Tests +197. Total +592 across 73 files.

View PR surface stats
Area Files Added Removed Net
Source 70 579 184 +395
Tests 3 199 2 +197
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 73 778 186 +592

What I checked:

  • Still necessary on current main: Current main has no Open PR or editor action in the shared session menu, and its shortcut handler still accepts letters only. (ui/src/components/session-menu.ts:17, c47ceb0f3dcc)
  • Remote editor-host mismatch: The Sessions page passes an absolute path returned by the gateway to a custom editor URL scheme executed by the browser machine, which is invalid when the gateway and browser run on different hosts. (ui/src/pages/sessions/sessions-page.ts:1008, f7ae085b3898)
  • PR lookup is incorrectly worktree-gated: Both menu hosts return before invoking the shared lookup when no managed worktree exists, although the helper can load PRs independently and the existing chat surface requests PRs for any non-empty session key. (ui/src/pages/sessions/sessions-page.ts:921, f7ae085b3898)
  • Late-finding continuity verified: The follow-up commit changed only popover layering and shared shadows, so the newly reported PR eligibility defect was equally visible on the earlier reviewed head. (ui/src/pages/sessions/sessions-page.ts:921, f7ae085b3898)
  • Proof is mock-only: The six linked images show polished light and dark menu states, but the PR states they were captured with the deterministic mock-gateway harness and they do not show an actual PR or editor handoff. (ui/src/test-helpers/control-ui-e2e.ts:1, f7ae085b3898)
  • Feature ownership history: Live GitHub path history ties the shared session-menu extraction, keyboard shortcuts, editor-link surface, and session PR resolver primarily to recent Peter Steinberger changes, with Shakker's Control UI architecture refactor as adjacent ownership context. (ui/src/components/session-menu.ts:1, 127a2c550d67)

Likely related people:

  • steipete: Live path history shows the shared session menu, menu shortcuts, editor-opening surface, and session PR detection were introduced or substantially maintained through his recent merged changes. (role: introduced and recently maintained behavior; confidence: high; commits: e500a4f017bf, 127a2c550d67, 84f21bd9fcb1; files: ui/src/components/session-menu.ts, ui/src/components/menu-shortcuts.ts, ui/src/components/app-sidebar.ts)
  • shakkernerd: The recent Control UI architecture refactor touched the route-owned page and state structure surrounding the affected session and chat components. (role: adjacent architecture contributor; confidence: medium; commits: 65e12328aa20; files: ui/src/pages/sessions/sessions-page.ts, ui/src/pages/chat/components/chat-sidebar.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (1 earlier review cycle)
  • reviewed 2026-07-11T04:24:22.962Z sha 92a8e96 :: needs real behavior proof before merge. :: [P2] Gate editor handoff to the worktree-owning host

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f7ae085b38

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +921 to +924
if (!row.worktree) {
this.sessionMenuWork = null;
return;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Don’t gate Open PR on managed worktrees

For sessions that have a GitHub PR but are not backed by a managed worktree (for example a normal agent workspace or legacy spawnedCwd on a feature branch), this returns before calling fetchSessionMenuWork, so the Sessions page menu never renders the new Open PR action. The existing chat PR chips call controlUi.sessionPullRequests for any session (ui/src/pages/chat/chat-pane.ts:320), and the gateway resolves PRs from spawnedCwd, spawnedWorkspaceDir, or the default agent workspace rather than requiring row.worktree (src/gateway/control-ui-session-prs.ts:146); the app sidebar has the same early guard at ui/src/components/app-sidebar.ts:644. Fetch the PR URL independently of worktreeId and only leave the editor path null when there is no managed worktree.

Useful? React with 👍 / 👎.

@steipete
steipete force-pushed the claude/missing-implementation-pr-be1c76 branch from f7ae085 to b58930d Compare July 11, 2026 05:07
@steipete
steipete merged commit cb64117 into main Jul 11, 2026
72 checks passed
@steipete
steipete deleted the claude/missing-implementation-pr-be1c76 branch July 11, 2026 05:17
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 11, 2026
…hortcuts (openclaw#104154)

* feat(ui): add Open PR, Open in editor, and numbered group shortcuts to the session menu

* fix(ui): lift session menu to popover top layer and use shadow tokens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: L status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Session menu work actions - Open PR, Open in editor, numbered group shortcuts

1 participant