Repository navigation
feat(cli): add close to shut tabs Browser Hand opened - #32
autohub-claude[bot] wants to merge 2 commits into
Conversation
`browser-hand close` closes a tab through the existing Target.closeTarget
path. It needs an explicit selector (--page-name, --query, --target-*, or
--group-title) and never falls back to the active tab. A selector that
matches several tabs is refused unless --all is passed; a lone
--group-title closes the whole Browser Hand tab group.
Safety default: only tabs Browser Hand opened are closed. The relay now
stamps `browserHandOwned` on Target.getTargets entries (created by the
relay and not adopted from an existing page), and the extension stamps
`groupTitle`. A tab the user had open is refused, or skipped and listed
under `skipped` for --all / --group-title, unless --include-user-tabs is
given. A relay that predates ownership tracking fails closed.
The result is { closed, targetId, url, title }. `closed` is only true once
the tab has left Chrome's live list, because the relay answers a close of
an adopted tab with success without closing it. Multi-tab closes return a
`tabs` list plus `skipped`.
Closes #31
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dc457ee61b
ℹ️ 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".
`close` selected tabs through the http(s)-only inventory filter, but the extension also lists about:blank and file:// pages. A Browser Hand tab that had not navigated yet was refused by `--target-id`, and `--group-title` on a mixed group dropped those tabs before ownership was checked. They were neither closed nor listed under `skipped`, and `closed` still came back true. planCloseTargets now selects from every controllable page target. tabs, snapshot and click keep their http(s)-only filtering. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Babysit stopped — What fails. Why it is unrelated. No file under Where the fix already is. #30 changes Passing at Review state. Codex reviewed Decision for a human: land the Verified head: Agent: Claude Code (claude-sonnet-5-5) via the AutoHub kernel worker; GitHub identity: autohub-claude GitHub App. |
Summary
Adds
browser-hand close, a user-facing way to close a tab through the existingTarget.closeTargetpath. By default it only closes tabs Browser Hand opened, never one the user already had open.Closes #31
Changes
cli-js/src/cli.js,cli-js/src/tool.js): newcloseoperation. It needs an explicit selector (--page-name,--query,--target-*, or--group-title) and never falls back to the active tab. A selector that matches several tabs is refused unless--allis passed. A lone--group-titlecloses the whole Browser Hand tab group. Returns{ closed, targetId, url, title }.skippedfor--all/--group-title.--include-user-tabsis the explicit override and sendsforce: trueonTarget.closeTarget.relay/src/relay.ts): stampsbrowserHandOwnedonTarget.getTargetsentries (created by the relay and not adopted from an existing page), and honorsforceonTarget.closeTargetfor the override. Playwright never sendsforce, so its behavior is unchanged.extension/services/TabManager.ts,extension/utils/types.ts): stampsgroupTitleon listed targets so--group-titlecan find a session's tabs.closedis onlytrueonce the tab has left Chrome's live list, because the relay answers a close of an adopted tab with success without closing it.closed: falsecarries anerrorand the CLI exits 1.skills/browser-hand/SKILL.md,skills/browser-hand/references/extension-cli.md.cli-js/test/close-tab.test.js(selection, ambiguity, ownership, fail-closed, result shape) andextension/__tests__/TabManager.test.ts(group titles).Test plan
cd cli-js && node --test "test/*.test.js": 183 pass, 0 failcd extension && npm test: 56 pass, 0 failnpm run build:relay: cleannpm run doctorand a live Chromeopenthencloseround trip: not run in this branch's finalizer pass. Needs a rebuilt relay and a reloaded unpacked extension, so a reviewer with a live profile should run it before merge.daemon/andcli/are untouchedNotes for reviewers
browserHandOwnedfield, andclosefails closed with a clear error instead of guessing.--include-user-tabs. This errs toward not closing.openadopts an already-open tab on the same URL, that tab counts as a user tab. This holds even for a--page-namebound to it.closenever focuses a tab or window.main, not from the PR feat: target the connected browser, not Chrome by default (#29) #30 branch.Implementation harness: Claude Code (claude-sonnet-5-5) via the AutoHub kernel worker. GitHub identity: autohub-claude GitHub App.
🤖 Generated with Claude Code