Skip to content

fix(admin): replace raw <select> and <input type="search"> with Kumo components - #950

Merged
ascorbic merged 3 commits into
mainfrom
fix/admin-raw-select-input
May 8, 2026
Merged

ascorbic merged 3 commits into
mainfrom
fix/admin-raw-select-input

Conversation

@ascorbic

@ascorbic ascorbic commented May 8, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Migrates 11 raw <select> elements and 2 <input type="search"> elements across the admin UI to Kumo's Select and Input. These were using hand-rolled Tailwind classes (rounded-md border bg-kumo-base px-3 py-2 ...) that duplicated and sometimes conflicted with what Kumo provides automatically — including focus rings, label association via the Field wrapper, dark-mode tokens, and disabled states.

Files migrated

Selects:

  • MarketplaceBrowse.tsx — capability filter + sort dropdown
  • ThemeMarketplaceBrowse.tsx — sort dropdown
  • Sections.tsx — source filter (re-uses existing sourceLabels MessageDescriptor map)
  • Redirects.tsx — status code form select (paired <Label> removed in favour of Select's label prop), status filter, type filter
  • ContentEditor.tsx — byline picker
  • ContentPickerModal.tsx — collection picker
  • FieldEditor.tsx — sub-field type picker
  • RepeaterField.tsx — repeater sub-field renderer (dynamic options from field def)
  • PortableTextEditor.tsx (DynamicSelect) — plugin field renderer (plugin-supplied labels passed through, not `t``-wrapped)
  • BlockKitFieldWidget.tsx — block-kit select element renderer (same)
  • WordPressImport.tsx — per-user mapping select (one rendered per WP user being imported)
  • routes/bylines.tsx — filter type + linked-user form select

Search inputs:

  • MarketplaceBrowse.tsx and ThemeMarketplaceBrowse.tsx

Approach decisions

  • items prop vs Select.Option children: used items for fixed translatable option sets (e.g. sort modes), and Select.Option children for dynamic data (user lists, plugin-supplied options) where each option needs runtime values rather than a static map.
  • Plugin-supplied labels: passed through as plain strings rather than wrapped in `t``` since they come from external runtime data, not catalog entries.
  • Paired <label> elements: removed where a <Select> could carry the label via its label prop, dropping the <div> wrapper noise.
  • LocaleSwitcher.tsx is intentionally custom — its small/medium size variants don't map cleanly to Kumo's Select API. Left as-is per the original audit recommendation.

What's not in this PR

  • The remaining ~20 <input type="checkbox"> elements (some better as Switch) — design pass first, separate PR.
  • Tab-style buttons (MediaPickerModal, MediaLibrary, Redirects filter tabs) — separate refactor.

Closes #

Type of change

  • Bug fix
  • Feature (requires maintainer-approved Discussion)
  • Refactor (no behavior change)
  • Translation
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool: Claude Opus 4.7 (orchestration) + Claude Haiku 4.5 (simple-tasks sub-agents) via OpenCode

Screenshots / test output

Visual change is minor: focus rings, hover states, and label rendering now go through Kumo's tokens. The selects and search inputs render at the same physical sizes (existing width classes preserved).

Stack: main → #934 (merged) → #937 (merged) → #940 (merged) → #949 (merged) → this PR → (next: checkboxes/switches) → (next: aria-labels) → (next: RTL safety) → (next: semantic tokens) → (last: ESLint enforcement)

…Select / Input

Migrates 11 raw <select> elements (marketplace filters/sort, redirects,
sections filter, content editor byline picker, content picker modal,
field editor type, repeater sub-field, plugin block fields, WordPress
import user mapping, bylines routes) to Kumo Select. Where a paired
<label> existed, drop it and use Select's label prop. Where options come
from plugin/runtime data, use <Select.Option> children to preserve
flexibility; where they're a fixed translatable set, use the items
prop with t-wrapped labels.

Also migrates 2 marketplace search inputs (<input type="search">) to
Kumo Input with type="search". Drops redundant border/bg/padding
classes that Kumo provides automatically.

LocaleSwitcher.tsx is intentionally custom (size variants don't fit the
Select API) and stays as a raw <select>.
Copilot AI review requested due to automatic review settings May 8, 2026 11:50
@changeset-bot

changeset-bot Bot commented May 8, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d14ea32

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@emdash-cms/admin Patch
emdash Patch
@emdash-cms/cloudflare Patch
@emdash-cms/fixture-perf-site Patch
@emdash-cms/perf-demo-site Patch
@emdash-cms/cache-demo-site Patch
@emdash-cms/auth Patch
@emdash-cms/blocks Patch
@emdash-cms/gutenberg-to-portable-text Patch
@emdash-cms/x402 Patch
create-emdash Patch
@emdash-cms/auth-atproto Patch
@emdash-cms/plugin-embeds Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 8, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
docs d14ea32 May 08 2026, 01:37 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 8, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-perf-coordinator d14ea32 May 08 2026, 01:36 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 8, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-i18n d14ea32 May 08 2026, 01:36 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 8, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-demo-cache d14ea32 May 08 2026, 01:37 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 8, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-playground d14ea32 May 08 2026, 01:37 PM

@pkg-pr-new

pkg-pr-new Bot commented May 8, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

npm i https://pkg.pr.new/@emdash-cms/admin@950

@emdash-cms/auth

npm i https://pkg.pr.new/@emdash-cms/auth@950

@emdash-cms/blocks

npm i https://pkg.pr.new/@emdash-cms/blocks@950

@emdash-cms/cloudflare

npm i https://pkg.pr.new/@emdash-cms/cloudflare@950

emdash

npm i https://pkg.pr.new/emdash@950

create-emdash

npm i https://pkg.pr.new/create-emdash@950

@emdash-cms/gutenberg-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/gutenberg-to-portable-text@950

@emdash-cms/x402

npm i https://pkg.pr.new/@emdash-cms/x402@950

@emdash-cms/plugin-ai-moderation

npm i https://pkg.pr.new/@emdash-cms/plugin-ai-moderation@950

@emdash-cms/plugin-atproto

npm i https://pkg.pr.new/@emdash-cms/plugin-atproto@950

@emdash-cms/plugin-audit-log

npm i https://pkg.pr.new/@emdash-cms/plugin-audit-log@950

@emdash-cms/plugin-color

npm i https://pkg.pr.new/@emdash-cms/plugin-color@950

@emdash-cms/plugin-embeds

npm i https://pkg.pr.new/@emdash-cms/plugin-embeds@950

@emdash-cms/plugin-forms

npm i https://pkg.pr.new/@emdash-cms/plugin-forms@950

@emdash-cms/plugin-webhook-notifier

npm i https://pkg.pr.new/@emdash-cms/plugin-webhook-notifier@950

commit: d14ea32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Migrates multiple admin UI form controls from raw HTML <select> and <input type="search"> elements to Kumo’s Select and Input components to standardize styling, focus/disabled states, and accessibility behavior through the design system.

Changes:

  • Replaced raw <select> elements across admin pages/components with Select (mix of items and Select.Option patterns).
  • Replaced raw search inputs in marketplace browse views with Kumo Input.
  • Added a changeset for @emdash-cms/admin documenting the migration.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
packages/admin/src/routes/bylines.tsx Migrates byline filters and linked-user selector to Kumo Select.
packages/admin/src/components/WordPressImport.tsx Migrates per-author mapping <select> to Kumo Select.
packages/admin/src/components/ThemeMarketplaceBrowse.tsx Migrates search input + sort dropdown to Kumo Input/Select.
packages/admin/src/components/Sections.tsx Migrates source filter dropdown to Kumo Select using items.
packages/admin/src/components/RepeaterField.tsx Migrates repeater “select” sub-field renderer to Kumo Select.
packages/admin/src/components/Redirects.tsx Migrates redirect status/type filters and status-code field to Kumo Select.
packages/admin/src/components/PortableTextEditor.tsx Migrates plugin-driven dynamic select field to Kumo Select.
packages/admin/src/components/MarketplaceBrowse.tsx Migrates marketplace search input + capability/sort dropdowns to Kumo components.
packages/admin/src/components/FieldEditor.tsx Migrates repeater sub-field type dropdown to Kumo Select.
packages/admin/src/components/ContentPickerModal.tsx Migrates collection picker dropdown to Kumo Select.
packages/admin/src/components/ContentEditor.tsx Migrates byline picker dropdown to Kumo Select.
packages/admin/src/components/BlockKitFieldWidget.tsx Migrates block-kit select element renderer to Kumo Select.
.changeset/tall-oranges-appear.md Adds a patch changeset describing the UI control migrations.

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

Visual testing revealed that <Select> with only <Select.Option> children
displays the raw value in the trigger (not the label). Kumo's <Select>
needs the items prop (or a renderValue callback) to resolve trigger
labels.

Affected:
- routes/bylines.tsx: filter type select showed raw 'all', linked-user
  select was empty/zero-width
- WordPressImport.tsx: per-user mapping select would show raw user IDs

Both now use items={...} for the label map. Also wraps the bylines
filter Select in a flex-1 container so it grows to fill the row.
- Convert CAPABILITY_LABELS in lib/api/marketplace.ts from plain strings
  to MessageDescriptor map; describeCapability resolves via i18n._(...).
  Fixes the i18n bug where t`${label}` couldn't be extracted by Lingui.
  Updates PluginManager consumers to call t(label) on the descriptor.
- Convert ThemeMarketplaceBrowse SORT_LABELS to MessageDescriptor too,
  matching MarketplaceBrowse pattern.
- Restore w-48 width class on WordPressImport user-mapping Select to
  prevent layout shift in the per-user mapping list.
- Restore empty placeholder option ('Select...') on RepeaterField,
  PortableTextEditor DynamicSelect, and BlockKitFieldWidget select
  renderers so users can clear the field.
- Update e2e/tests/bylines.spec.ts to use combobox + option click
  pattern instead of Playwright's native selectOption (Kumo Select is
  a custom button + popover, not a native select).
@ascorbic
ascorbic enabled auto-merge (squash) May 8, 2026 13:41
@ascorbic
ascorbic merged commit a4968c1 into main May 8, 2026
36 checks passed
@ascorbic
ascorbic deleted the fix/admin-raw-select-input branch May 8, 2026 13:44
@emdashbot emdashbot Bot mentioned this pull request May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants