Skip to content

Inspector: replace bind toggle with inline binding chip#17

Merged
avanelsas merged 1 commit intomainfrom
feat/inline-binding-chip
May 1, 2026
Merged

Inspector: replace bind toggle with inline binding chip#17
avanelsas merged 1 commit intomainfrom
feat/inline-binding-chip

Conversation

@avanelsas
Copy link
Copy Markdown
Owner

Summary

  • Replaces two binding-UI helpers (build-bind-toggle for attributes, build-text-content-bind for text) with a single reusable bind-chip-and-popover factory.
  • Inline chip on the field-label row shows current binding state; click opens the picker popover.
  • Two new public formatters (attr-binding-label, text-bind-label) — pure, unit-tested.

Test plan

  • clj-kondo --lint src test scripts — 0/0
  • cljfmt check — clean
  • npx shadow-cljs compile test — 589 tests / 1818 assertions, 0 fail
  • npx shadow-cljs release app — 0 warnings
  • Manual: select a node with bindable attrs/text, confirm chip renders in both bound and unbound states; confirm popover opens, picks, and closes

🤖 Generated with Claude Code

The old per-attribute bind UI lived as a full row beneath each widget
— a 🔗 button, a bound-label row, or an expanded picker depending on
state. Vertical noise on every attribute, and the bind affordance
sat far from the label it modified.

The chip moves the affordance inline with the field label:
- Unbound: small 🔗 button on the label row.
- Bound: rounded pill with "↔ owner.field" + × to unbind.
- Click chip → the picker panel pops up below the widget; pick a
  field → panel hides and the binding commits in two clicks.

Same model for both attribute bindings and text-content (:text-field)
bindings, so the visual language is one. The picker logic
(`build-bind-picker-panel`) is unchanged — only the trigger surface
moves.

`attr-binding-label` and `text-bind-label` are extracted as pure
helpers and exposed for unit tests; five new deftests pin the label
format for the explicit-owner, doc-walk-fallback, and missing-owner
cases.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@avanelsas avanelsas merged commit 6fecd82 into main May 1, 2026
1 check passed
@avanelsas avanelsas deleted the feat/inline-binding-chip branch May 1, 2026 09:50
@avanelsas avanelsas mentioned this pull request May 2, 2026
4 tasks
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