Skip to content

fix(admin): add search to the byline picker and remove the 100-byline cap#1225

Draft
scottbuscemi wants to merge 1 commit into
mainfrom
fix/1217-byline-picker-search
Draft

fix(admin): add search to the byline picker and remove the 100-byline cap#1225
scottbuscemi wants to merge 1 commit into
mainfrom
fix/1217-byline-picker-search

Conversation

@scottbuscemi
Copy link
Copy Markdown
Contributor

Closes #1217.

Problem

On a content entity, the Bylines field rendered a plain Select populated from the first 100 bylines (fetchBylines({ limit: 100 })) with no search. With more than ~30 bylines it was hard to find the right one; past 100 they were unreachable. A credited byline outside that initial page also failed to render (the row resolved undefined and returned null).

Fix

  • Replace the capped Select with a debounced (300ms) server-side search input. fetchBylines already supports search + cursor pagination, so any byline is reachable. The query is enabled only when a search term is present, so there's no extra fetch on mount (the parent-provided initial list is reused when the box is empty).
  • Resolve credited bylines from the saved entry (item.bylines[].byline) via a new selectedBylineDetails prop, merged into a known-byline cache, so a credit outside the initial list still renders its name/slug.
  • Locale-scoped: the search passes the entry's locale, matching the existing per-locale picker behavior.

Testing

  • pnpm lint:quick clean; pnpm --filter @emdash-cms/admin typecheck passes.
  • Added two regression tests in packages/admin/tests/components/ContentEditor.test.tsx: (1) searching surfaces a byline outside the initial list and crediting it works; (2) a credited byline absent from the initial list still renders. These run in the browser (Playwright) test project — validated in CI (couldn't launch a local browser in this environment).

Manual verification

  1. Create 100+ bylines (Admin → Manage → Bylines).
  2. Open a content entity → Bylines field. Type a name in the search box.
  3. Expect: matching bylines appear (including ones past the first 100); clicking one credits it; existing credits always show their names.

… cap

The content-entity byline picker was a plain Select over the first 100
bylines with no search, so bylines past the first page were unreachable
and a credited byline outside that page failed to render at all. Replace
it with a debounced server-side search (fetchBylines already supports
search + cursor) and resolve credited bylines from the saved entry so
they always render. Closes #1217.
@cloudflare-workers-and-pages
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 8681f73 May 29 2026, 10:38 PM

@cloudflare-workers-and-pages
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 8681f73 May 29 2026, 10:39 PM

@cloudflare-workers-and-pages
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 8681f73 May 29 2026, 10:39 PM

@github-actions
Copy link
Copy Markdown
Contributor

PR template validation failed

Please fix the following issues by editing your PR description:

  • This PR does not use the required PR template. Please edit the description to use the PR template. Copy it into your PR description and fill out all sections.

See CONTRIBUTING.md for the full contribution policy.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 29, 2026

Open in StackBlitz

@emdash-cms/admin

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

@emdash-cms/auth

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

@emdash-cms/blocks

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

@emdash-cms/cloudflare

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

emdash

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

create-emdash

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

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

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

@emdash-cms/x402

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

@emdash-cms/plugin-ai-moderation

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

@emdash-cms/plugin-atproto

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

@emdash-cms/plugin-audit-log

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

@emdash-cms/plugin-color

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

@emdash-cms/plugin-embeds

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

@emdash-cms/plugin-forms

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

@emdash-cms/plugin-webhook-notifier

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

commit: 8681f73

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.

Bug - Bylines - On content entities, byline list caps at 100 and needs search functionality

1 participant