Skip to content

feat(devknobs): grab many elements at once, with notes - #112

Merged
mertbuilds merged 7 commits into
mainfrom
feat/grab-multi
Nov 26, 2026
Merged

mertbuilds merged 7 commits into
mainfrom
feat/grab-multi

Conversation

@mertbuilds

Copy link
Copy Markdown
Collaborator

Summary

  • grab can now pick many elements at once: drag a box around them, or shift and a click. Each pick gets a numbered badge on the page.
  • a small tray at the bottom lists the picks, with an optional note for each one and one note for all, a remove button per row and a "Copy N" button. n jumps into a note, shift and enter picks the boxed element, backspace takes it out, enter, c, cmd+enter or the button copies them all.
  • the copy is numbered, each note under its element and the note for all last. One element with no note copies exactly the same text as before. The JSON clipboard type carries note on each entry and on the payload.
  • letting go of shift no longer copies, so there is time to write notes. Inspect mode is unchanged.
  • docs (/docs/grab and its reference page) and the changelog's Unreleased section are updated. No version bump, no release.

License note

The idea comes from agentation's multi-select. agentation is licensed under PolyForm Shield 1.0.0, and knobs grab is a competing tool, so nothing from it was copied, ported or imported: no code, styles or assets. Only its behavior was studied, from a screen recording. This implementation is written from scratch.

Proof

Real browser (ego, Chromium), https://knobs.localhost dev server from this branch, landing page "try it here" stage:

  1. Drag a box around the scheme card, shift and a click on "Send link", n, type a note, click "Note for all", type, cmd+enter. Clipboard text:
1. [<section aria-labelledby="_R_7db6_" data-card="half" /> in Card (at src/lib/card.tsx:128:5) in SchemeCard (at src/demo/look.tsx:346:5) in Stage (at src/demo/stage.tsx:25:7)]
2. [<span aria-hidden="true" /> in ContrastCard (at src/demo/look.tsx:388:9) in Stage (at src/demo/stage.tsx:26:7) in Landing (at src/routes/index.tsx:310:11)]
   Note: make this the accent color

Note: same spacing for all of these
  1. Enter, the tray button and cmd+enter each call execCommand("copy") once (traced in the page).
  2. Click × on row 1, then enter: copies the remaining pick (before the round-1 review fix: copied nothing and removed the next pick).
  3. Tray width at 390 px wide: 358 px (100vw - 32px); at 1280 px: 380 px. With prefers-reduced-motion: reduce the tray's animation is none, otherwise tray-in 150 ms.
  4. The extension build (packages/extension, bun run build) bundles the tray in dist/content.js.

Recordings and screenshots (light, dark, 390 px, mid-drag preview) are local: ~/.claude/orchestrator/queue/assets/knobs-multi-grab/ (multi-grab-light.mp4, multi-grab-dark.mp4, light-3-tray.png, dark-3-tray.png, phone-3-picks.png, drag-preview.png).

Tests: bun test in packages/devknobs, 4699 pass, 0 fail (new: numbered output and notes, the drag box selection, tray note alignment, drag never copies, shift release never copies, shift and enter, backspace, n, keys typed in the tray are left to it, a removed element takes its own note). pnpm typecheck clean, pnpm build ok.

Weakened checks

None.

Risk

Tier: normal. Area: grab's keyboard and pointer handling on the user's page (capture phase), the clipboard. Dev tool only, no release in this PR.

How to revert

Revert the merge commit. Nothing is released; the next release picks up whatever is on main.

Test plan

  • drag a box, shift and a click, notes, copy (light and dark)
  • tray buttons do not take keys away from grab
  • one element with no note copies the same text as before
  • Mert tries it on https://knobs.localhost and on Sugikit before the next release

@mertbuilds
mertbuilds merged commit b6c46ff into main Nov 26, 2026
3 checks passed
mertbuilds added a commit that referenced this pull request Nov 26, 2026
Multi-element grab with one note (#112 to #115) and the page under
the bar fix (#111). The compare pages name 0.7.6 as the latest release.

Co-authored-by: Mert Duzgun <46185450+mert-duzgun@users.noreply.github.com>
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