Skip to content

Component cleanup: rendering fixes, RadioGroup density, useControllableState adoption#111

Merged
lifeiscontent merged 5 commits into
mainfrom
chore/component-cleanup
Jun 17, 2026
Merged

Component cleanup: rendering fixes, RadioGroup density, useControllableState adoption#111
lifeiscontent merged 5 commits into
mainfrom
chore/component-cleanup

Conversation

@lifeiscontent

Copy link
Copy Markdown
Collaborator

A round of contained component cleanups from a codebase audit plus an independent review. Scoped to self-contained, high-value fixes; the larger node-prop/typography sweeps are deferred.

Fixes

  • Switch / Dropdown rendering — the switch thumb used a default shadow-sm (reset to initial in propel, so it rendered no shadow); swapped to the real shadow-raised-100 token. The dropdown priority-icon colors used raw text-orange-500/amber-500/blue-500 (also reset to initial) and now use the text-label-*-icon tokens.
  • Avatar magnitude — a standalone Avatar with no magnitude and no AvatarGroup fell through to an undefined magnitude, so it rendered with no size class. It now resolves to md (explicit → group → md), and the precedence is documented.

Improvements

  • RadioGroup density — added a density prop (comfortable | compact) so consumers stop reaching for a cryptic [&>[role=radiogroup]]:gap-0 override. The popover display panels now pass density="compact".
  • useControllableState adoptionSearch, ExpandableSearch, and NavItemHeader replaced their hand-rolled controlled/uncontrolled bookkeeping with the shared useControllableState hook.

Stories

  • Added a horizontal-only ScrollArea story (only vertical and both-axis were covered).
  • Deduped repeated scaffolding into local helpers: a TabsFixture (shared three-tab set), a ToggleFooter (display-panel checkbox footer), and an inertAnchor for breadcrumb menu items. The breadcrumb anchors now all swallow their default navigation, so none can tear down the browser test page if a play test later clicks one.

Notes from the independent review (not changed here, with rationale)

  • vitest version mismatch warning — the gate logs a mixed-version warning (vitest@0.1.24 + @vitest/browser@4.1.9). This comes from the Vite+ fork pinning vitest through its own catalog while @vitest/browser-playwright pulls a real vitest peer. It's a toolchain/architecture concern, not safe to pin inside a component PR.
  • Dropdown act(...) warnings — pre-existing console warnings during the dropdown play tests; they're warnings, not failures, and unrelated to this cleanup.
  • No dedicated Popover Figma frame — there's no standalone Popover component in the Global-components file, so the generic surface has no design link to add.
  • Missing "Default" stories on a few components — subjective; the existing first stories already read as the canonical example.

vp check clean; full story gate green (820 tests).

Both rendered blank: the switch thumb used shadow-sm and the dropdown story
icons used text-orange/amber/blue-500, all of which propel resets out of the
default Tailwind scales. Use shadow-raised-100 and the propel label-icon tokens.
Adds density (comfortable | compact) so consumers set row spacing on the group
instead of reaching into it with [&>[role=radiogroup]]:gap-0 from the outside.
The popover panels now pass density="compact".
Replaces the hand-rolled isControlled / internal-useState / commit pattern with
the shared hook, matching Dropdown.
A standalone Avatar with no magnitude (and not inside an AvatarGroup) fell
through to an undefined magnitude, so it rendered with no size class and the
person-icon fallback had no size. Default to "md" when neither an explicit
magnitude nor a group magnitude is present, and document the precedence.
ScrollArea only demoed vertical and both-axis overflow; add a horizontal-only
story so the single horizontal scrollbar is covered on its own.

Pull the repeated scaffolding in three story files into a local helper each:
a TabsFixture for the shared three-tab set, a ToggleFooter for the display
panels' checkbox footer, and an inertAnchor for the breadcrumb menu items.
The breadcrumb anchors now all swallow their default navigation, so none of
them can tear down the browser test page if a play test later clicks one.
Copilot AI review requested due to automatic review settings June 17, 2026 07:28
@github-actions

Copy link
Copy Markdown

📚 Storybook preview: https://pr-111-propel-storybook.vamsi-906.workers.dev

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR applies a set of small, self-contained component and Storybook cleanups in @plane/propel, focused on fixing token usage/rendering edge cases, improving an API pain point (RadioGroup spacing), and standardizing controlled/uncontrolled state handling via the shared useControllableState hook.

Changes:

  • Fixes rendering/token mismatches (Switch thumb shadow token, Dropdown priority icon label tokens, Avatar default magnitude fallback).
  • Adds RadioGroup density prop (comfortable | compact) and updates Popover demos to use it instead of external gap overrides.
  • Refactors several components/stories to reduce duplication and adopt useControllableState for controlled/uncontrolled value bookkeeping.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/propel/src/components/tabs/tabs.stories.tsx Dedupes repeated story scaffolding via a shared TabsFixture/tab item list.
packages/propel/src/components/switch/index.tsx Replaces ineffective thumb shadow utility with the correct shadow token.
packages/propel/src/components/search/index.tsx Migrates Search and ExpandableSearch to useControllableState.
packages/propel/src/components/scroll-area/scroll-area.stories.tsx Adds a horizontal-only ScrollArea story variant.
packages/propel/src/components/radio/radio.stories.tsx Adds a story demonstrating the new RadioGroup density behavior.
packages/propel/src/components/radio/index.tsx Introduces density prop and internal variants for group spacing.
packages/propel/src/components/popover/popover.stories.tsx Dedupes checkbox footer and switches to RadioGroup density="compact" for flush rows.
packages/propel/src/components/nav-item/index.tsx Replaces custom expanded-state logic with useControllableState.
packages/propel/src/components/dropdown/dropdown.stories.tsx Uses label token utilities for priority icon coloring instead of raw Tailwind colors.
packages/propel/src/components/breadcrumb/breadcrumb.stories.tsx Centralizes inert anchor rendering to prevent Storybook navigation teardown.
packages/propel/src/components/avatar/index.tsx Ensures standalone avatars fall back to md magnitude and simplifies fallback icon sizing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lifeiscontent lifeiscontent enabled auto-merge (squash) June 17, 2026 07:59
@lifeiscontent lifeiscontent disabled auto-merge June 17, 2026 07:59
@lifeiscontent lifeiscontent merged commit 704c580 into main Jun 17, 2026
3 checks passed
@lifeiscontent lifeiscontent deleted the chore/component-cleanup branch June 17, 2026 08:00
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.

2 participants