Skip to content

fix(search): show scoped people results with exact matches first - #1302

Merged
Quick104 merged 3 commits into
mainfrom
t3code/e0c27964
Sep 22, 2026
Merged

Quick104 merged 3 commits into
mainfrom
t3code/e0c27964

Conversation

@Quick104

@Quick104 Quick104 commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: #1294
Fixes #1294

Web search did not offer actor or director results. Alphabetical people search could also rank a combined credit ahead of an exact person name, and converting person IDs to numbers could open the wrong page.

Approach

Add a People row using the existing search hook and carousel. Keep person IDs as strings through navigation. V2 people search ranks exact names first and filters by media scope and viewer access before applying the limit. Scope forms part of the Web cache key. The catalog search capability advertises support, and Web checks it before every people request, including All. Episode credits inherit library visibility and rating limits from their parent series. Update the API documentation and generated contracts.

Validation

  • Full Linux CI passed on f2c9444: Go tests, lint, contract checks, Web build/lint/format, and both Web test shards.
  • Shared-dev API and desktop browser: actor/director search, exact-name ranking, Media/Audiobooks/All switching, person navigation, and existing title results passed.
  • 54 focused Web tests passed after the review fixes; the full Web gate previously passed (599 files, 4,601 tests). Catalog tests ran explicitly because the existing full-suite configuration excludes them.
  • PostgreSQL regression passed with the race detector, covering ranking before the limit, credit scopes, library restrictions, disabled-library membership, rating limits, excluded media types, duplicate suppression, episode parent visibility, and v1 ordering. Focused API and handler tests passed.
  • Go build, vet, lint, Web lint/format/build, and generated contract checks passed.
  • Full Go testing hit the existing macOS TestAdminResourceCapabilitiesAndScope failure, reproduced against the original source. TestResolveViewerScopeParity also timed out under concurrent checks and passed on a standalone rerun.
  • Mobile browser verification remains incomplete because viewport automation timed out.

Risks

Web hides people results in every scope when the server does not advertise support. V1 retains its existing alphabetical, unscoped search. No migration is required. Combined audiobook credits stored as one person remain a separate ingestion issue. Finding credited titles from an actor/director name is tracked separately in #1303.

Apple has no current people-search consumer. Android's existing unscoped cast lookup receives the improved ranking. Jellycompat uses its own video visibility and exact-name paths; no client or compatibility changes are required.

Checklist

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

AI Disclosure

  • Harness: OpenAI Codex.
  • Tool(s): Codex, GitHub CLI, T3 browser automation, Modern Go Guidelines CLI.
  • Model(s): GPT-6; a more specific runtime model identifier was not exposed.
  • Involvement: AI-assisted; implementation and verification performed by the agent at the maintainer's request.
  • Adversarial review: the same agent reviewed SQL parameterization, ranking and filtering before the limit, duplicate credits, scope cache isolation, large person IDs, error states, v1 behavior, and native-client/Jellycompat consumers. Regression tests and live API/browser checks covered the changed behavior. Codex GitHub review then found missing viewer access filtering and capability advertisement. Those findings and the follow-up review findings for the All tab and episode parent access were reproduced with failing tests and fixed with PostgreSQL access regressions and older-server Web tests. Codex re-review returned a thumbs-up with no further findings after f2c9444. Validation limits are listed above; the GitHub reviewer did not expose its model identifier.

@greptile-apps greptile-apps Bot 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.

Quick104 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 72366f3f-b530-4168-86e1-4c993dfdcf44

📥 Commits

Reviewing files that changed from the base of the PR and between 661578e and f2c9444.

📒 Files selected for processing (27)
  • contracts/api/v2/fixtures/get_catalog_search_capabilities_ok.json
  • contracts/api/v2/fixtures/get_system_info_ok.json
  • contracts/api/v2/openapi.json
  • docs/catalog-api.md
  • internal/api/handlers/admin_people_service_test.go
  • internal/api/handlers/catalog_actions_service.go
  • internal/api/handlers/people.go
  • internal/apiv2/catalog_actions.go
  • internal/apiv2/catalog_actions_test.go
  • internal/apiv2/catalog_search_capabilities.go
  • internal/apiv2/catalog_search_capabilities_test.go
  • internal/apiv2/router.go
  • internal/catalog/person_repo.go
  • internal/catalog/person_search_db_test.go
  • web/src/api/types.ts
  • web/src/api/v2/catalog.ts
  • web/src/api/v2/people.test.ts
  • web/src/api/v2/people.ts
  • web/src/api/v2/schema.ts
  • web/src/hooks/queries/admin/people.v2.test.ts
  • web/src/hooks/queries/catalogCancellation.test.tsx
  • web/src/hooks/queries/keys.ts
  • web/src/hooks/queries/people.test.tsx
  • web/src/hooks/queries/people.ts
  • web/src/pages/Catalog.test.tsx
  • web/src/pages/Catalog.tsx
  • web/src/pages/PersonDetail.tsx

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 22, 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-22T15:50:02.008973Z f2c9444 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7399c89b76

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/catalog/person_repo.go Resolved
Comment thread internal/apiv2/catalog_actions.go Resolved
@Quick104

Copy link
Copy Markdown
Contributor Author

@codex review

Both findings are addressed in 122dfc1. Please recheck viewer access filtering and capability-gated scoped people search.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 122dfc1dcf

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread web/src/hooks/queries/people.ts Resolved
Comment thread internal/catalog/person_repo.go Resolved
@Quick104

Copy link
Copy Markdown
Contributor Author

@codex review

Please recheck f2c9444 after the All-tab capability guard and episode parent-access fixes. Both findings have failing-before/passing-after regressions; PostgreSQL race tests and 54 focused Web tests pass.

@Quick104
Quick104 merged commit 80112fd into main Sep 22, 2026
9 checks passed
@Quick104
Quick104 deleted the t3code/e0c27964 branch September 22, 2026 16:03
@Quick104 Quick104 mentioned this pull request Sep 23, 2026
5 tasks done
@zZebrahz zZebrahz mentioned this pull request Sep 27, 2026
10 tasks done
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