Skip to content

fix(web): hide the Filters sheet's Advanced sort on a search - #4507

Merged
Quick104 merged 1 commit into
Silo-Server:mainfrom
Rhainland:fix/4453-search-sheet-relevance-sort
Nov 19, 2026
Merged

Quick104 merged 1 commit into
Silo-Server:mainfrom
Rhainland:fix/4453-search-sheet-relevance-sort

Conversation

@Rhainland

@Rhainland Rhainland commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Closes #4453
Related issue: N/A
Validation tasks: none

Other clients: Apple N/A (web-only Filters sheet); Android N/A (web-only Filters sheet); Roku N/A (web-only Filters sheet)

On the web search page, the Filters sheet's Advanced view showed a sort the search was not using. Results were ranked by relevance, and the toolbar said Relevance, but Advanced → Sort by read Date Added / Descending, or Title with sort=relevance in the URL. Picking Date Added there did nothing. This change removes the Sort by row from Advanced on the search page, as the Guided view already does, so the toolbar is the only sort control there.

Approach

The search page already sets relevanceSort on CatalogFiltersPanel. The panel now tells the sheet to hide the Advanced Sort by when that prop is set, and the rules editors take an optional flag to hide it. Every other use of the rules editors keeps its sort: library browsing, lists and collections, and the collection and row rule editors.

Nothing is lost on a search. The Advanced list and the toolbar list come from the same getCollectionSortOptions, and only the toolbar can offer Relevance. Adding Relevance to the Advanced list was the other option, but that list is shared with the collection and rule editors, where Relevance does not apply.

Validation

  • Web lint (no new warnings), Prettier, type check, build and bundle budget pass; make test-web passes (286 files).
  • verify-local-paths, verify-case-collisions and verify-size-ratchet pass. No Go changes, so the Go checks were not run.
  • No test added: the change hides a control on one surface, which "Decide what to test" leaves untested.
  • Checked in headless Chromium on a local server running the production web bundle, with a synthetic ten-title movie library, at 1440px and 390px. Searching "alien", with and without sort=relevance in the URL, then opening Filters → Advanced: before, the sheet showed Date Added / Descending (Title / Descending with sort=relevance) while the toolbar showed Relevance; after, the sheet has no Sort by and the toolbar shows Relevance.
  • Same server and data, after the fix: library browse still shows Advanced Sort by; on a search, picking Title in the toolbar re-sorts alphabetically and picking Relevance restores relevance order; changing the media type in Advanced keeps sort=relevance.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-server/pr-4507/

Surface and build: web app, desktop (1440px) and mobile (390px), search page with the Filters sheet on Advanced. Before = e8de1117e, after = this branch, same server and library.

Risks

On the search page, a viewer who used Advanced to pick a sort now uses the toolbar, which offers the same sorts plus Relevance.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
  • The Evidence section shows every change a user can see, or how I checked a change nobody sees.

AI Disclosure

  • Harness: Claude Code (via T3 Code); Codex CLI for code review
  • Tool(s): Claude Code; Codex CLI (review only); Playwright with headless Chromium (verification)
  • Model(s): claude-opus-5-5; gpt-6.2-sol, gpt-6.2-astra, claude-fable-5-2 (code review)
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: four independent reviews of the final diff for correctness, repository standards and the issue's requested behaviour (gpt-6.2-sol, gpt-6.2-astra, claude-opus-5-5 and Claude Fable 5.2), reconciled against the code. None found a correctness or spec problem. One low-severity note, a code comment that still said Advanced always has a Sort by, was fixed. A note on the flag being named differently at the sheet and in the editors was left as is, since the sheet name says which of its two editors it affects.

A text search ranks by relevance and sorts from the toolbar, which offers
Relevance. The sheet's Advanced Sort by has no Relevance entry, so it showed
the Date Added placeholder (or Title with sort=relevance) while results were
ranked by relevance, and picking Date Added there did nothing. Hide it on
the search page, as the Guided view already does.

Closes Silo-Server#4453
@silo-triage silo-triage Bot added the size/S 0–49 added + deleted lines (all files); change volume, not priority. label Nov 18, 2026
@silo-kody

silo-kody Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Catalog filter editors now support hiding sort controls. Advanced Sort is hidden when relevance sorting is active, while existing defaults keep sort controls visible in other cases.

Changes: Catalog Sort Visibility

Layer / File(s) Summary
Configurable sort controls
web/src/components/FilterRuleEditor.tsx, web/src/components/collections/CollectionRulesEditor.tsx, web/src/components/catalog/CatalogFilterSheet.tsx
FilterRuleEditor conditionally renders sort controls using showSortControls. CollectionRulesEditor and CatalogFilterSheet expose and forward visibility props, which default to enabled. Guided mode continues to hide sort controls.
Relevance search wiring
web/src/components/catalog/CatalogFiltersPanel.tsx
CatalogFiltersPanel sets showAdvancedSort to false when relevanceSort is active. The container forwards the prop to CatalogFilterSheet.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant CatalogFiltersPanel
  participant CatalogFilterSheetContainer
  participant CatalogFilterSheet
  participant CollectionRulesEditor
  participant FilterRuleEditor
  CatalogFiltersPanel->>CatalogFilterSheetContainer: Pass showAdvancedSort based on relevanceSort
  CatalogFilterSheetContainer->>CatalogFilterSheet: Forward showAdvancedSort
  CatalogFilterSheet->>CollectionRulesEditor: Pass showSortControls
  CollectionRulesEditor->>FilterRuleEditor: Pass showSortControls
  FilterRuleEditor->>FilterRuleEditor: Render sort label and controls only when enabled
Loading

Possibly related PRs

Suggested reviewers: quick104, blurbery

Merge Risk: Minimal · up to 78911

This hides the Advanced Sort row on relevance-sorted searches so it no longer conflicts with the toolbar. Other pages keep their sort controls. No merge-blocking risk is identified.

Security architecture risk: Minimal · up to 78911

The change hides a redundant search sort control while preserving existing visibility defaults elsewhere. No introduced risk affecting security, failure containment, rollback, or ownership was identified in the inspected change.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the Filters sheet's Advanced Sort by row is hidden on a search page. The changeset adds showSortControls and showAdvancedSort props, and CatalogFiltersPanel passes sho…
Linked Issues check Passed [#4453] The issue requires the Filters sheet Advanced view to agree with the toolbar on a text search. It allows either showing Relevance or hiding Sort by on search, as the Guided view does. The PR t…
Out of Scope Changes check Passed The changes touch four web files: FilterRuleEditor.tsx (optional showSortControls flag, default true), CatalogFilterSheet.tsx (optional showAdvancedSort forwarded to CollectionRulesEditor), CatalogFil…
Description check Passed The description states the problem (Advanced Sort by on web search page showing a sort the search does not use), the approach (hide Sort by in Advanced when relevanceSort is set, via a new optional fl…
Full details: Title check

Explanation

The title names the main change: the Filters sheet's Advanced Sort by row is hidden on a search page. The changeset adds showSortControls and showAdvancedSort props, and CatalogFiltersPanel passes showAdvancedSort={!relevanceSort}, which matches the title. The title uses the fix(web) prefix and is 60 characters long, within a reasonable range.

Full details: Linked Issues check

Explanation

[#4453] The issue requires the Filters sheet Advanced view to agree with the toolbar on a text search. It allows either showing Relevance or hiding Sort by on search, as the Guided view does. The PR takes the hide option. At the reviewed head, CatalogFiltersPanel passes showAdvancedSort={!relevanceSort} to CatalogFilterSheetContainer, which forwards it to CatalogFilterSheet. CatalogFilterSheet forwards it to CollectionRulesEditor, which passes showSortControls to FilterRuleEditor. FilterRuleEditor omits the Sort by label and FilterSortControls when showSortControls is false. On a search, the Advanced view therefore shows no stale Date Added or Title sort. The toolbar remains the only sort control there, and it offers Relevance. The relevanceSort prop is present at the reviewed head in CatalogFiltersPanel. The changed files do not add it, so it comes from the base. The issue's note about explicit_sort on sheet picks does not apply, because the sheet offers no sort control on a search. The change is coding-only; the PR's manual browser checks are not coding requirements and were not scored. Automated tests were not added. The issue does not require a test, and the code path is small and visible in the diff. Limit: the browser evidence is self-reported and was not re-run.

Full details: Out of Scope Changes check

Explanation

The changes touch four web files: FilterRuleEditor.tsx (optional showSortControls flag, default true), CatalogFilterSheet.tsx (optional showAdvancedSort forwarded to CollectionRulesEditor), CatalogFiltersPanel.tsx (showAdvancedSort={!relevanceSort} and the container prop), and CollectionRulesEditor.tsx (optional showSortControls forwarded to FilterRuleEditor). Each change is a pass-through of one flag that hides the Advanced Sort by row on search. Defaults keep Sort by for library browsing, lists, collections and the collection and row rule editors. No unrelated behavior, refactor, or Go change appears in the summary. The PR description's claim that no Go changes were made matches the changed-file list.

Full details: Description check

Explanation

The description states the problem (Advanced Sort by on web search page showing a sort the search does not use), the approach (hide Sort by in Advanced when relevanceSort is set, via a new optional flag on the rules editors), the validation performed, and the risks. It is directly related to the changeset, which adds showSortControls and showAdvancedSort props to the filter sheet, rules editors, and panel. The description is specific and on-topic, so it passes the lenient check.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0d6d513f-d6fc-4569-9daf-3d3518cfde5c
Commits

Reviewing files that changed from the base of the PR and between e8de111 and 789119d.

Files selected for processing: 4

  • web/src/components/FilterRuleEditor.tsx
  • web/src/components/catalog/CatalogFilterSheet.tsx
  • web/src/components/catalog/CatalogFiltersPanel.tsx
  • web/src/components/collections/CollectionRulesEditor.tsx

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

@silo-triage silo-triage Bot added bug Something isn't working impact: polish Annoyance, cosmetic, or nice-to-have javascript Pull requests that update javascript code priority: P2 Limited scope, workaround exists, or polish labels Nov 18, 2026
@Quick104

Copy link
Copy Markdown
Contributor

🤖 Claude Code (claude-opus-5-5)

Maintainer review of 789119d282: no findings. On the search page, the Filters sheet's Advanced view no longer shows a Sort by that disagrees with the toolbar. Library browsing, lists, collections and the collection and row rule editors keep their Sort by: only SearchResults sets relevanceSort, and the new props default to showing the sort.

What I checked

  • Main hasn't changed these files since the branch point, and [bug] Web search: the Filters sheet's Advanced sort shows Date Added while results rank by relevance #4453 is still open, so the PR is still needed.
  • Hiding the row is one of the two fixes [bug] Web search: the Filters sheet's Advanced sort shows Date Added while results rank by relevance #4453 proposes. The other, adding Relevance to the Advanced list, would put Relevance in the collection and rule editors, which share that list and can't use it.
  • updateDefinition's keepRelevance is still needed. Both sheet editors re-normalize the sort when the media type changes, even with the sort row hidden.
  • Focused web tests and the type check pass locally, and CI is green on this head. The PR adds no tests, which fits "Decide what to test" for hiding a control on one surface.
  • Behavior: the author's evidence page shows before and after on this head. I didn't re-run it.
  • Cross-provider round (gpt-6.2-sol, one round) raised two candidates. Neither comes from this PR:
    • Changing the media type in the sheet can replace a series-only sort (for example Latest Episode Added becomes Title when the scope goes to All Media). Main does the same in both the Advanced and Guided editors through normalizeQuerySortForScope, and the "all" scope drops series-only sorts on purpose. The toolbar still shows the resulting sort.
    • Picking Latest Episode Air Date in the toolbar switches Series to Episodes. That comes from the sort's preferredMediaScope, which also applies when browsing a library. Switching back to Series keeps the sort.

Validated features: none affected. Movies — Web (#199) and Series — Web (#1252) C1 cover searching and filtering by type, which this change leaves alone.

User manual: unaffected. The search page in the manual doesn't describe the Advanced sort.

Other clients: the PR's N/A entries hold. This sheet exists only in the web app.

Fit: 9/10 · Readiness: 9/10 — ready

Fit: it removes a control that showed the wrong value, adds no surface area, and keeps one sort control on the search page. Readiness: the change is small, every other caller keeps its default, and the evidence on this head shows the behavior before and after.

@Quick104
Quick104 merged commit 002a6c6 into Silo-Server:main Nov 19, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working impact: polish Annoyance, cosmetic, or nice-to-have javascript Pull requests that update javascript code priority: P2 Limited scope, workaround exists, or polish size/S 0–49 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Web search: the Filters sheet's Advanced sort shows Date Added while results rank by relevance

2 participants