Skip to content

feat(search): show people in the quick search dialog - #1601

Merged
Quick104 merged 2 commits into
mainfrom
t3code/quick-search-person-results
Sep 27, 2026
Merged

Quick104 merged 2 commits into
mainfrom
t3code/quick-search-person-results

Conversation

@Quick104

@Quick104 Quick104 commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Closes #1294
Related issue: #1138
Validation tasks: unblocks #1144 C3

The quick search dialog (Ctrl+K) only returned titles. Searching an actor or director by name there gave no way to open that person. #1302 added people to the full search page but not to this dialog, so #1294 stayed open. This change adds people results to the dialog.

Approach

The dialog uses the same people search as the full search page. It follows the profile's Media/Audiobooks/All scope, returns only people the viewer can access, and shows nothing when the server does not advertise that support. The dialog lists up to four people.

People whose name exactly matches the query come first, and only those. For other queries, people come after the titles, so a short query like "chris" does not bury titles under partial names. When both kinds of result appear, "People" and "Titles" each get a heading in the "Request to Add" style, with a divider between them. Title-only searches look the same as before.

Arrow keys and Enter move through both groups. The selection is tied to the chosen result rather than its position, so a selected row stays selected when people results arrive and reorder the list.

Person IDs are opaque strings in the v2 contract, so buildPersonCatalogHref now URL-encodes them. That covers every person link, including cast and crew. Numeric IDs, the only kind in use today, are unchanged. If no title matches and the people search fails, the dialog shows its load error instead of "No matches".

The people search hook moves out of hooks/queries/people.ts into hooks/queries/personSearch.ts. The dialog ships in the app shell, and importing the old module pulled the person refresh and edit hooks into the launch bundle. Even after the split, the dialog code adds 1,165 B brotli over main, which is 40 B past the checker's tolerance. perf-budget.json rises from 317,864 to 318,928 B.

Validation

  • Web: make test-web passed (660 files, 5,353 tests). New dialog tests cover scope and limit, ordering, headings and dividers, keyboard and mouse selection, loading and empty states, and a failed people search.
  • Web lint, format check, build, and budget:check passed with the raised budget. make verify-local-paths passed.
  • src/pages/Catalog.test.tsx, which make test-web excludes, fails the same way on unmodified main. Its only change here is a mock path.
  • Browser, local Vite build against a shared development server: "tom hanks" leads with the person and Enter opens their page. The person ID is larger than 2^53 and stays a string. A query matching one person named just "Chris" shows only that person above the titles. "hanks" lists titles, then people, then Request to Add.
  • Go checks were not run; no Go code changed.

Risks

The launch bundle grows by about 1.2 KB brotli. When the server does not advertise scoped people search, the dialog behaves as before. No API, migration, jellycompat, or native-client change.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.

AI Disclosure

  • Harness: Claude Code
  • Tool(s): Claude Code, GitHub CLI, Playwright MCP
  • Model(s): claude-opus-5-5
  • Involvement: AI-assisted
  • Adversarial review: n/a

🤖 Generated with Claude Code

The quick search dialog (Ctrl+K) now lists matching people next to titles,
using the same scoped, access-filtered people search as the full search page.
An exact name match leads; otherwise people follow the titles. When both kinds
of result appear, each group gets a heading and a divider.

Selection tracks the chosen result rather than its position, so a selected row
stays selected when people results arrive and reorder the list.

The people search hook moves into its own module so the dialog, which ships in
the app shell, does not pull the rest of the people hooks into the launch
bundle. The launch bundle budget rises by 1,064 B brotli for the new dialog
code.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@kody-ai

kody-ai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the `@kody start-review` command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Providing Context (Files & MCPs)

Add these hints in your PR description (or a comment) to unlock deeper checks:

  • Ticket / Acceptance Criteria: `Refs: ABC-123` (Linear/Jira/Asana/ClickUp/Trello) or a direct ticket link.
  • Bugfix Validation: a Sentry/Datadog/Bugsnag event link (or paste the stack trace/error message).
  • Endpoint Risk: mention the route (e.g., `POST /api/payments`) or controller/action name.
  • Attach a repo file as context: use an explicit marker like `@file:docs/guide.mdx#L10-L50` (replace with your real path).
  • API Contract Docs: include `@file:openapi.yaml` or `@file:swagger.json` when changing routes/schemas.
  • Definition of Done / Standards: include `@file:DOD.md` or `@file:CONTRIBUTING.md` if your repo has them.
  • Design System Source of Truth: include `@file:ui/index.ts` (replace with your DS entrypoint path).
  • Feature Flags: include the flag key/name and `@file:flags.ts` / `@file:config.json` (and optionally the PostHog flag name).
  • Edge/CDN Rules: link the Cloudflare rule/zone or describe the intended redirect/header behavior.
  • Attach an MCP tool output: use `@mcp<provider|tool>` (replace with an installed MCP provider + tool, e.g., `@mcp<sentry|events.search>`).
Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

Access your configuration settings here.

@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: f07406be-ec88-4aff-b0c2-a631ca195148

📥 Commits

Reviewing files that changed from the base of the PR and between 265a3bd and 72e9c26.

📒 Files selected for processing (14)
  • web/perf-budget.json
  • web/src/components/GlobalSearch.test.tsx
  • web/src/components/GlobalSearch.tsx
  • web/src/components/collections/CollectionGuidedRulesEditor.test.tsx
  • web/src/components/ui/person-search-select.tsx
  • web/src/hooks/queries/catalogCancellation.test.tsx
  • web/src/hooks/queries/people.test.tsx
  • web/src/hooks/queries/people.ts
  • web/src/hooks/queries/personSearch.ts
  • web/src/pages/Catalog.collectionUnavailable.test.tsx
  • web/src/pages/Catalog.test.tsx
  • web/src/pages/Catalog.tsx
  • web/src/pages/catalogSearchParams.test.ts
  • web/src/pages/catalogSearchParams.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Global search now includes people alongside catalog titles. The people-search hook has a dedicated module, and person catalog URLs encode person IDs.

Changes

People search

Layer / File(s) Summary
People-search hook and consumers
web/src/hooks/queries/personSearch.ts, web/src/hooks/queries/people.ts, web/src/components/ui/person-search-select.tsx, web/src/pages/Catalog.tsx, web/src/hooks/queries/*test.tsx, web/src/components/collections/CollectionGuidedRulesEditor.test.tsx, web/src/pages/Catalog*.test.tsx
The people-search hook and capability fetching move to personSearch.ts. Existing consumers and test mocks import the hook from that module.
Combined search results and person navigation
web/src/components/GlobalSearch.tsx, web/src/components/GlobalSearch.test.tsx, web/src/pages/catalogSearchParams.ts, web/src/pages/catalogSearchParams.test.ts, web/perf-budget.json
Global search queries and displays people with titles, supports selection across both result types, and updates loading, error, empty, and result-count states. Person catalog URLs encode IDs. Tests cover the search behavior, and the eager Brotli budget increases.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature · Severity of issue fixed: Low

Sequence Diagram(s)

sequenceDiagram
  participant GlobalSearch
  participant usePersonSearch
  participant fetchPeopleSearchCapabilities
  participant searchPeople
  participant buildPersonCatalogHref
  GlobalSearch->>usePersonSearch: Query, four-result limit, and media scope
  usePersonSearch->>fetchPeopleSearchCapabilities: Check people-search capabilities
  usePersonSearch->>searchPeople: Search normalized query when supported
  GlobalSearch->>buildPersonCatalogHref: Build person URL from person ID
  buildPersonCatalogHref-->>GlobalSearch: Return URL with encoded person ID
Loading

Suggested reviewers: rhainland

Merge Risk: ⚪ Minimal · up to 72e9c

The supplied evidence identifies no remaining issue that should hold the people-search change back from normal merge checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 72e9c

The dialog adds a way to find people, but it uses the existing viewer-aware search endpoint and does not introduce a new privileged operation. No access-control bypass was identified; detail-page authorization was not fully verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The new dialog caller increases where an authenticated viewer can discover accessible people, but the observed search path does not grant broader catalog access or new service privileges.

Trust Boundaries and Controls

  • observed — The client capability check controls presentation and request issuance; the server owns the viewer identity and catalog-visibility checks for search results.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 13 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Issue #1294 requires matching people in Web search and links to the correct person pages. GlobalSearch.tsx calls usePersonSearch with the active media scope and a four-person limit. It renders peo…
Out of Scope Changes check ✅ Passed The changes stay connected to issue #1294. The new personSearch module supports the search integration. The hook-import updates preserve existing consumers. The URL-encoding change ensures that sele…
Title check ✅ Passed The title clearly and concisely describes the main change: adding people results to the quick search dialog.
Description check ✅ Passed The description directly explains the problem, implementation, validation, and risks for adding people results to the quick search dialog.
Full details: Docstring Coverage

Explanation

Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 13 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-27T23:05:06.238268Z 72e9c26 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Comment thread web/src/components/GlobalSearch.tsx Resolved
Comment thread web/src/components/GlobalSearch.tsx Resolved
@macroscopeapp

macroscopeapp Bot commented Sep 27, 2026

Copy link
Copy Markdown

This PR addresses the remaining #1294 gap in quick search. #1144 C3 is still recorded as Failed / blocked by #1294; the earlier handoff only made it ready to re-test after #1302 added people to the full Catalog search. This change adds people to Ctrl+K quick search, so C3 is ready to re-test on a published build containing this change, not passed.

Suggested fix: Re-test C3 on a published build after merge and update #1144’s Results table; no source diff applies to this validation follow-up.

Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed.

Posted via Macroscope — v1 validation impact

Person IDs are opaque strings in the API contract, so the person page link
now encodes them for every caller of buildPersonCatalogHref. When no title
matches and the people search fails, the quick search dialog shows its load
error instead of "No matches".

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@kody-ai

kody-ai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the `@kody start-review` command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Providing Context (Files & MCPs)

Add these hints in your PR description (or a comment) to unlock deeper checks:

  • Ticket / Acceptance Criteria: `Refs: ABC-123` (Linear/Jira/Asana/ClickUp/Trello) or a direct ticket link.
  • Bugfix Validation: a Sentry/Datadog/Bugsnag event link (or paste the stack trace/error message).
  • Endpoint Risk: mention the route (e.g., `POST /api/payments`) or controller/action name.
  • Attach a repo file as context: use an explicit marker like `@file:docs/guide.mdx#L10-L50` (replace with your real path).
  • API Contract Docs: include `@file:openapi.yaml` or `@file:swagger.json` when changing routes/schemas.
  • Definition of Done / Standards: include `@file:DOD.md` or `@file:CONTRIBUTING.md` if your repo has them.
  • Design System Source of Truth: include `@file:ui/index.ts` (replace with your DS entrypoint path).
  • Feature Flags: include the flag key/name and `@file:flags.ts` / `@file:config.json` (and optionally the PostHog flag name).
  • Edge/CDN Rules: link the Cloudflare rule/zone or describe the intended redirect/header behavior.
  • Attach an MCP tool output: use `@mcp<provider|tool>` (replace with an installed MCP provider + tool, e.g., `@mcp<sentry|events.search>`).
Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

Access your configuration settings here.

@Quick104
Quick104 merged commit fe21614 into main Sep 27, 2026
18 checks passed
@Quick104
Quick104 deleted the t3code/quick-search-person-results branch September 27, 2026 23:06
Quick104 added a commit that referenced this pull request Sep 28, 2026
Brings the branch up to date with main (78 commits) before it merges.

- internal/requests: main's TVDB ID lookup (#1558) runs in the branch's
  claim-based submission: submitClaimed resolves the ID before
  planSubmission drops failed targets, the claim keeps the create call's
  lookup result, and direct and routed submissions explain a missing TVDB
  ID. Main's Retry TVDB tests now expect the branch's flow, where a
  submission error defers the reopened request instead of failing Retry.
- GlobalSearch: main's people results (#1601) and the branch's request
  suggestion rows share one option sequence, keyed by result, with the
  request rows after the library and people results.
- Tests and contracts: both sides' ledger entries and TMDB client tests
  are kept; OpenAPI, fixtures, route inventory and web types regenerated.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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.

[bug] Web search does not expose actor or director results

1 participant