Repository navigation
Fix Cmd-W for Task Manager and auxiliary windows - #3734
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a Python CLI linter and Bash CI test that verify all Swift ChangesWindow Identifier Linting System
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error, 1 warning)
✅ Passed checks (12 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/lint_auxiliary_window_close_shortcuts.py`:
- Around line 41-47: The current use of text.find("]", list_start) can stop at
the first ']' (e.g., inside comments), so replace that lookup with a
bracket-counting loop: start from list_start, iterate characters, increment a
counter on '[' and decrement on ']', and when the counter returns to zero record
that index as list_end; keep the same error behavior (raise ValueError
referencing OWNER_LIST_NAME and OWNER_LIST_PATH if no match found) and keep the
downstream logic that builds list_body and uses STRING_LITERAL_RE unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: ea7ad054-a496-4fde-9094-c08d6c38f9f4
📒 Files selected for processing (5)
.github/workflows/ci.ymlSources/Feed/FeedTextEditorDebugWindowController.swiftSources/cmuxApp.swiftscripts/lint_auxiliary_window_close_shortcuts.pytests/test_ci_auxiliary_window_close_shortcuts.sh
Greptile SummaryRegisters Task Manager and other auxiliary
Confidence Score: 5/5Safe to merge — the change is limited to registering window identifiers and adding a CI guard; no production control flow is altered beyond Cmd+W routing for the listed windows. All affected paths are additive: identifiers are appended to an existing set, and cmuxWindowShouldOwnCloseShortcut already handles the routing correctly once an identifier is registered. The lint script correctly strips both line and block comments before scanning, addressing the comment-handling concerns raised in prior review threads. No files require special attention. Important Files Changed
Reviews (5): Last reviewed commit: "Preserve window lint line numbers" | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/lint_auxiliary_window_close_shortcuts.py`:
- Around line 73-76: The current per-line loop using path.open(...) and
IDENTIFIER_ASSIGNMENT_RE.finditer(line) misses assignments split across lines;
instead read the entire file into a single string and run
IDENTIFIER_ASSIGNMENT_RE.finditer(content) so multi-line matches are found
(ensure the regex uses re.MULTILINE/ re.DOTALL as needed), and compute the
match's line number with content.count("\n", 0, match.start()) + 1; replace the
per-line enumerate/for loop that referenced handle, line_number and line with
this single-content approach using IDENTIFIER_ASSIGNMENT_RE.finditer(content).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: b83fc5c4-b35f-4f64-82cc-d00bececb21a
📒 Files selected for processing (2)
scripts/lint_auxiliary_window_close_shortcuts.pytests/test_ci_auxiliary_window_close_shortcuts.sh
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0594219. Configure here.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/lint_auxiliary_window_close_shortcuts.py`:
- Around line 27-31: strip_line_comments currently only removes line comments
(LINE_COMMENT_RE) and ignores Swift block comments, causing false positives in
collect_window_identifier_assignments and STRING_LITERAL_RE matches; update
strip_line_comments to first remove block comments (e.g., a non-greedy regex for
/\*.*?\*/ applied before LINE_COMMENT_RE) so block-commented code is stripped
prior to line-comment stripping, leaving load_close_owner_identifiers' bracket
logic unchanged; use the existing LINE_COMMENT_RE and STRING_LITERAL_RE symbols
and ensure the block-comment removal runs at the start of strip_line_comments to
avoid leaving quoted literals inside block comments.
In `@tests/test_ci_auxiliary_window_close_shortcuts.sh`:
- Around line 59-86: Add a new fixture in the test script to ensure
block-commented assignments are ignored: modify one of the NewWindow.swift
snippets (the ones containing func makeWindow() and window.identifier) to
include a block comment that contains a forbidden assignment like /*
window.identifier = NSUserInterfaceItemIdentifier("cmux.oldWindow") */ and then
run python3 scripts/lint_auxiliary_window_close_shortcuts.py --repo-root
"$TMP_DIR" as the test already does; this verifies the linter
(strip_line_comments fix) does not surface assignments inside /* ... */ comments
while keeping the existing //-comment and cmuxAuxiliaryWindowIdentifiers cases
intact.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 0119dccb-7437-4504-92ab-7af816c489b3
📒 Files selected for processing (2)
scripts/lint_auxiliary_window_close_shortcuts.pytests/test_ci_auxiliary_window_close_shortcuts.sh
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/lint_auxiliary_window_close_shortcuts.py`:
- Around line 81-85: The reported line numbers are computed from the stripped
text (used by IDENTIFIER_ASSIGNMENT_RE and the line_number = text.count("\n", 0,
match.start()) + 1 calculation) but strip_line_comments currently removes block
comments and their newlines; update strip_line_comments so that when it removes
/* ... */ it replaces the entire block comment with the same number of '\n'
characters (preserving original line breaks) so subsequent line counting remains
accurate; ensure this change still removes comment content (so
load_close_owner_identifiers / IDENTIFIER_ASSIGNMENT_RE behavior is unchanged)
and keep LINE_COMMENT_RE handling as-is.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 4894c364-81d3-4117-a09e-13f975891248
📒 Files selected for processing (2)
scripts/lint_auxiliary_window_close_shortcuts.pytests/test_ci_auxiliary_window_close_shortcuts.sh
Resolved by follow-up commits through d844e04; all CodeRabbit threads are resolved and the latest CodeRabbit review on the current head is non-blocking.

Summary:
Testing:
Notes:
Note
Low Risk
Low risk: changes are limited to window identifier registration and adds a CI lint/test guard, with minimal runtime impact outside Cmd+W behavior for auxiliary windows.
Overview
Ensures standalone auxiliary cmux windows reliably own the standard close shortcut (Cmd+W) by expanding the
cmuxAuxiliaryWindowIdentifiersregistry (including Task Manager and several debug/lab windows).Adds a new Python lint (
lint_auxiliary_window_close_shortcuts.py) plus CI coverage to fail PRs when a Swiftwindow.identifier = NSUserInterfaceItemIdentifier("cmux.*")assignment isn’t registered (with an explicit ignore forcmux.bootstrap).Assigns a concrete
window.identifierto the Feed Text Editor debug window so it participates in the same shortcut-ownership rule.Reviewed by Cursor Bugbot for commit d844e04. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Fixes Cmd+W for Task Manager and other standalone
cmuxwindows by registering them as close-shortcut owners. Adds a CI lint that enforces this rule, handles comments and multiline assignments, reports file:line, and ignorescmux.bootstrap.Bug Fixes
cmuxAuxiliaryWindowIdentifiersso Cmd+W closes them; setcmux.feedTextEditorDebugon the Feed Text Editor debug window.New Features
scripts/lint_auxiliary_window_close_shortcuts.pywith file:line reporting; wired into CI viatests/test_ci_auxiliary_window_close_shortcuts.sh. Lint strips line and block comments, ignores commented-out owners, handles multilinewindow.identifier, and allows an explicit ignore forcmux.bootstrap.Written for commit d844e04. Summary will update on new commits.
Summary by CodeRabbit
Tests
Chores
Bug Fixes