Skip to content

feat(tools): pick individual tools inside a picker group - #264

Merged
artempartos merged 1 commit into
developfrom
artempartos/feat-tool-selection-granular
Sep 17, 2026
Merged

artempartos merged 1 commit into
developfrom
artempartos/feat-tool-selection-granular

Conversation

@artempartos

Copy link
Copy Markdown
Contributor

Problem

The three tool pickers (workflow Base Resources, step session editor, New Session) offered a
tag group as a single atom: one entry that attached every member, with the members never
listed individually. A session that needed two of the twelve board tools could not say so.

There was a bug underneath, too. toolPickerValue marked a group as selected when any member
was selected, and toolIdsFromPickerValue expanded that group token back into every member id
— so a partial selection silently inflated to the whole group on the next edit. This was live in
dev data: a step with 2 of 12 board tools rendered as the full group and would have been saved
back as all 12.

What changed

A tag group is now a collapsible section, not an atom:

  • the header attaches or clears the whole family in one click (mixed checkbox + 2/12 counter);
  • the tools under it are each attachable on their own;
  • tools carrying no UI-visible tag fall into a trailing Ungrouped section — and when a project
    offers no groups at all, the picker is a plain flat list, exactly as before;
  • a group selected in full collapses to a single chip; any subset shows one chip per tool, which
    is the only honest rendering of a partial selection.

No schema change. The value was always a flat list of tool ids (baseToolIds,
step.toolIds, session toolIds) — the group token existed only inside the picker. The Ruby
diff in this PR is comments only.

Files

  • app/frontend/shared/lib/toolPicker.ts — rewritten: toolPickerSections / sectionState /
    toggleSection / toggleTool / toolPickerPills / filterSections. No group token, so a
    half-selected group survives a round trip.
  • app/frontend/shared/components/ToolPicker.tsx — new shared component on Mantine Combobox.
  • Wired into BaseResourcesTab, SessionEditorPanel, SessionNewForm.
  • TagCatalog / PickerGroups / controller comments updated — they still described groups as
    one-click atoms whose members are "never offered one by one".

Validation

Driven in a real browser against the dev stack, on all three screens, including the full
click → PATCH → Postgres path (verified workflow.config['base_tool_ids'] and step.tool_ids).

Four defects were found and fixed that way:

Defect Fix
The None added placeholder stayed next to the chips hidden once any chip is present
Clicking the group header folded the list away under the cursor current fold state is pinned
No chevron — the field did not read as a picker next to its sibling Selects rightSection={<Combobox.Chevron />}
While filtering, the counter read 6/6 — i.e. "group fully attached" reads 6/6 matched

Tests

  • 16 new unit tests on the picker logic, 11 on the component.
  • The existing group tests in SessionNewForm.test.tsx and BuilderPage.test.tsx were updated
    to the section model, each gaining a case that a subset reaches the API as that subset —
    the regression the old token model could not express.
  • make fe_check_all green (eslint / typescript / fsd / vitest, coverage 81.01%),
    make rubocop and make brakeman clean.

The backend suite was left to CI: the Ruby diff is comment-only, and a parallel rails test
from a worktree does not share the main checkout's flock.

🤖 Generated with Claude Code

The tool pickers offered a tag group as a single atom: one entry that
attached every member, with the members never listed. A session that
needed two of the six board tools could not say so.

Each group is now a collapsible section — the header attaches or clears
the whole family in one click, and the tools under it are attachable one
by one. The value stays a flat list of tool ids, so a half-selected group
survives a round trip: the old picker read any selected member as the
whole group and silently expanded it back to every id.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>
@artempartos
artempartos merged commit a050dc7 into develop Sep 17, 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