Files
windmill/frontend/src/lib/components/settings
Ruben FiszelandClaude Opus 5 6d21d30242 fix: bound ScopeSelector badge heights and correct three scope-chip defects (#10523)
* fix: cap ScopeSelector badge container heights

The "Selected Scopes" summary and each domain header rendered their badges
in unconstrained flex-wrap containers. With path-restricted scopes the badge
strings run long, so a handful of them wrapped over many rows and pushed the
scope domain list and the token form's action buttons below the fold.

Cap the summary at 8rem and the per-domain header at 4rem, both scrolling
vertically past that.

Fixes WIN-2318

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: correct scope chip disabled state, summary readability and domain widening

Follow-ups to #10517, all in ScopeSelector:

- The shared scopeChip snippet bound the component-level `disabled` for its remove
  button, but a scope card computes `isDisabled = disabled || isScopeDisabled(...)`.
  A scope superseded by its `:write` sibling greyed out its checkbox and its path
  button while the `x` on its path chips stayed live, so those paths could still be
  destroyed. The effective state is now passed in.

- Truncating a chip hides the paths being granted, which is the point of the
  Selected Scopes summary. Chips there now wrap instead; the tight per-domain header
  and the per-scope path lists keep truncating.

- Ticking a domain checkbox re-added its write and run scopes bare, dropping any
  resource paths configured on them: a token restricted to one path silently became
  a token for the whole domain, and unticking did not bring the paths back. The
  checkbox already reads as checked when those scopes are path-restricted, so it now
  carries the paths over. Both branches of the requires_resource_path conditional it
  replaces pushed the same bare value, so nothing was reading that flag.

- The path popover tooltip explained that no paths means full access but never that
  each path added widens the scope's reach, which is what reads backwards next to
  the "Add path" button.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: correct the path tooltip and drop the domain-header height cap

Review nits from #10523.

The tooltip claimed every path added widens the scope's reach, which is only true
from the second path on: the first replaces a bare, full-access scope with a
path-restricted one, narrowing it. Stating what each state means avoids the
direction question entirely.

The domain header no longer caps its height. Truncation holds every chip to one row
and a domain has a handful of scopes, so the row cannot run away, while the cap put
a 64px scroller inside the scrollable domain list that swallowed wheel events
crossing it — and clipped mid-row, since 64px is not a multiple of the row height.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-04 20:18:50 +02:00
..