Skip to content

Close the Hubs menu on a press outside it; no worktree menu on the main checkout - #14

Merged
ZmeiGorynych merged 2 commits into
mainfrom
egor/hubs-menu-outside-click-main-worktree-menu
Oct 21, 2026
Merged

ZmeiGorynych merged 2 commits into
mainfrom
egor/hubs-menu-outside-click-main-worktree-menu

Conversation

@ZmeiGorynych

@ZmeiGorynych ZmeiGorynych commented Oct 21, 2026 •

Copy link
Copy Markdown
Member
  • The Hubs menu now closes on a pointer press anywhere outside it and the Hubs button, as the worktree menu and the preset picker already do. Escape and the button's toggle are unchanged.
  • Right-clicking the main worktree opened a menu whose only item, "Delete worktree", was always disabled there. It now opens no menu, and closes one that is open. Other blocked cases (locked, host not connected, gone) keep the disabled item with its reason.
  • Test-only: the fake SSH in src/hub/links/hub.test.ts wrote its argument file one printf at a time, so a loaded run could read a partial list (forwardToHub failed once locally). It now writes through a rename.

Tests

  • hubs.spec.ts: a press on a repo tab closes the open menu; the button opens and closes it.
  • sidebar.spec.ts: right-clicking the main worktree shows no menu and closes an open one; Escape still closes the worktree menu (split from the old main-worktree test).
  • The two new-behaviour tests fail on main. Full suite: vitest 2422/2422, Playwright 182/182.

Summary by CodeRabbit

  • Bug Fixes
    • Hubs menus now close when clicking or pressing outside them.
    • The main worktree no longer opens a context menu.
    • Escape and the Hubs button reliably close open menus.
  • Tests
    • Added end-to-end coverage for menu dismissal and main worktree behavior.

…in checkout

The Hubs menu now closes on a pointer press outside it and the Hubs button,
like the worktree menu and preset picker already do. Right-clicking the
main worktree opened a menu whose only item, Delete worktree, was always
disabled; it now opens none and closes any open one.
…ests

It was filled one printf at a time, so a loaded run could read a partial
argument list (seen as a forwardToHub failure).
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: MotleyAI/worktree-term/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 0295b6ea-4d4f-462e-9bc3-608887a19392
📥 Commits

Reviewing files that changed from the base of the PR and between 2fd1730 and 70c1758.

📒 Files selected for processing: 6
  • src/hub/links/hub.test.ts
  • src/web/ui/app.tsx
  • src/web/ui/view.ts
  • test/e2e/contract.ts
  • test/e2e/hubs.spec.ts
  • test/e2e/sidebar.spec.ts

Included review availability: This review used your included allowance. 2 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

📝 Walkthrough

The change updates Hubs menu dismissal and main worktree context-menu behavior. It adds end-to-end coverage and updates test contract documentation. The fake SSH test now writes captured arguments through a temporary file before renaming it.

Changes: Menu Behavior

Layer / File(s) Summary
Main worktree menu behavior
src/web/ui/view.ts, test/e2e/contract.ts, test/e2e/sidebar.spec.ts
Opening a context menu for the main worktree now leaves the menu closed. End-to-end coverage checks that it does not open a menu and closes an existing worktree menu. The previous disabled-delete control and title assertions were removed.
Hubs menu dismissal
src/web/ui/app.tsx, test/e2e/contract.ts, test/e2e/hubs.spec.ts
The Hubs menu closes on outside pointer presses. End-to-end coverage checks outside-click dismissal and toggling the menu with the Hubs button.

Fake SSH Test Output

Layer / File(s) Summary
Captured argument file update
src/hub/links/hub.test.ts
The fake SSH test writes captured arguments to args.tmp and renames it to args after writing.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 70c17

The change is mergeable with no identified correctness, availability, security, or data-integrity risk.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the two primary changes: closing the Hubs menu on outside presses and preventing a worktree menu on the main checkout.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 6…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 6 files.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@ZmeiGorynych
ZmeiGorynych merged commit 740db07 into main Oct 21, 2026
7 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