Skip to content

fix(web): refresh catalog views when the metadata language changes - #2213

Merged
Quick104 merged 7 commits into
Silo-Server:mainfrom
Rhainland:fix/web-metadata-language-refresh
Oct 14, 2026
Merged

Quick104 merged 7 commits into
Silo-Server:mainfrom
Rhainland:fix/web-metadata-language-refresh

Conversation

@Rhainland

@Rhainland Rhainland commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: #1212
Validation tasks: unblocks #1215 C2

Changing the profile's metadata language, or its per-source exceptions, only refreshed the settings reads. Detail pages, Home and other catalog views kept showing titles and descriptions in the old language until their cached data went stale.

Approach

A change to catalog.metadata_language or catalog.metadata_language_overrides, saved in this browser or reported by another device, refreshes the localized media reads: the reads the media surface refresh already covers (catalog, sections, items, people, recommendations, progress, history, favorites, watchlist, library collections), plus collections, episodes, calendar, shuffle cards, collection peeks, the Home-row editor and the Watch Together picker. Requests for those reads that are still in flight are cancelled first, so an old-language answer can't land as fresh data. Then the reads are marked stale and Home's load queue restarts. The save settles once the reads are marked stale; open screens refetch on their own.

Admin and other client-only state is left alone. Switching profile already clears the whole query cache.

Validation

  • Web tests for both keys, an unrelated setting (no invalidation), a Home row and a detail read still loading in the old language, client-only admin state left untouched, shuffle, Home-row editor and Watch Together picker cards, and a save that settles while an open screen is still refetching: pass. The last three fail on the previous head.
  • Runtime (author): German detail text, switch to French in Settings without reloading, go back: this branch shows the source text while French translates, then French. Main kept the German text (desktop and mobile web).
  • Runtime (review, a dev sandbox built from the current head, with German and French text seeded for one movie): the detail page showed German, then French after an in-app switch, then German again after another tab changed it, with no reload. The language control re-enabled about 30 ms after each save. No console errors.

Evidence

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

Risks

The refresh runs twice on the device that saves, once for the save and once for its own realtime echo, as the existing Home and library refreshes already do. Home and library rows refetch but stay in the source language until #2209 localizes section cards.

Follow-up: #2475 (the player treats a failed background refresh of the watch detail as fatal).

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • The Evidence section shows every change a user can see, or says there is none.

AI Disclosure

  • Harness: Claude Code (in T3 Code)
  • Tool(s): Claude Code, Codex
  • Model(s): claude-opus-5-5, gpt-6.1-sol
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: Claude Code /code-review (medium) over the combined diff of all [v1] AI metadata translation #1212 server branches before opening. It found one bug in the on-view language guard (see fix(metadata): limit on-view translation to the viewer's missing language #2211), which is fixed there; nothing in this branch. A later review (Claude multi-agent review plus a Codex gpt-6.1-sol adversarial round, on 8886931) found three defects in this branch, fixed in a5bb7d7. The Codex review bot then found the shuffle, picker, Home-row editor and collection peek cards missing from the refresh, fixed in 4d63860, cef3914 and 295ed1b.

Note

Fix catalog views to refresh when the metadata language setting changes

  • Adds refreshLocalizedMediaQueries in mediaSurfaceRefresh.ts. It cancels matching in-flight reads, invalidates localized media queries (catalog details, shuffle, Home rows, curated lists, collection peeks, Watch Together picker), and bumps the Home refresh signal without waiting for refetches.
  • Adds refreshLocalizedMediaForSetting in settingValues.ts. Only the two metadata-language setting keys trigger the refresh, from both setting writes and realtime settings-change events.
  • Adds tests in settingValuesMutations.test.tsx covering cancellation of pending old-language reads, invalidation of the listed query families, and no-op behavior for unrelated settings and client-only admin state.
  • Behavioral Change: pending reads in the old language are now cancelled, so their responses are no longer cached; Watch Together room presence state is intentionally left untouched.

Macroscope summarized 295ed1b.

@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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: 409bc0b8-f5d5-4766-b9aa-0e7fbcb0dee2
📥 Commits

Reviewing files that changed from the base of the PR and between a5bb7d7 and 295ed1b.

📒 Files selected for processing: 2
  • web/src/hooks/queries/mediaSurfaceRefresh.ts
  • web/src/hooks/queries/settingValuesMutations.test.tsx

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

📝 Walkthrough

Catalog metadata language changes cancel and invalidate localized media queries and signal Home to refresh. Setting mutations and realtime setting changes use this refresh. Tests cover cancellation, cache effects, active-scan state, and pending refetches.

Changes: Localized media refresh

Layer / File(s) Summary
Localized query refresh
web/src/hooks/queries/mediaSurfaceRefresh.ts
Adds a refresh function that cancels matching localized-read and media-surface queries, starts invalidation without waiting for it to complete, and signals Home to refresh.
Setting-change integration and coverage
web/src/hooks/queries/settingValues.ts, web/src/hooks/queries/settingValuesMutations.test.tsx
Refreshes localized media queries when either catalog metadata language setting changes through setting invalidation or realtime events. Tests cover query cancellation and cache behavior, Home refresh signaling, active-scan state, and pending refetches.

Priority: ➖ Normal

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

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant SettingChange
  participant SettingValues
  participant refreshLocalizedMediaQueries
  participant QueryClient
  participant HomeRefreshSignal
  SettingChange->>SettingValues: Report catalog metadata language change
  SettingValues->>refreshLocalizedMediaQueries: Refresh localized media queries
  refreshLocalizedMediaQueries->>QueryClient: Cancel matching requests
  refreshLocalizedMediaQueries->>QueryClient: Start query invalidation
  refreshLocalizedMediaQueries->>HomeRefreshSignal: Signal Home refresh
Loading

Suggested reviewers: quick104

Merge Risk: ⚪ Minimal · up to 295ed

No actionable merge-blocking issue remains; the reported cancellation risk does not affect language-change refreshes.

Pre-merge checks: Passed 5
Passed Passed checks: 5 passed
Check name Status Explanation
Docstring Coverage Passed Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 3 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly and concisely describes the main change: refreshing catalog views when the metadata language changes.
Description check Passed The description directly explains the problem, implementation, validation, risks, and scope of the catalog refresh changes.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@silo-kody

silo-kody Bot commented Oct 10, 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 ❌

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 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 ⚠️ Failed 2026-10-14T21:04:22.816307Z 295ed1b 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.

@Quick104 Quick104 added priority: P2 Limited scope, workaround exists, or polish impact: usability Core flow broken or severely blocked labels Oct 10, 2026 — with Cursor
@macroscopeapp

macroscopeapp Bot commented Oct 10, 2026

Copy link
Copy Markdown

This PR visibly refreshes localized titles and descriptions after a metadata-language change on detail pages, Home, and other media views. The Evidence section currently says the link is forthcoming, so there is no evidence to review.

  • Language change on detail pages and Home: add before-and-after captures of the same item/section and data on desktop and mobile web; include a short recording of the Settings-to-view flow.
  • Other affected catalog, search, collection, and people views: add before-and-after captures for each affected surface on desktop and mobile web.

Name the surfaces and PR build or commit in the evidence, or replace the placeholder with the published evidence page link. No diff.

Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.

Posted via Macroscope — Visible change evidence

Comment thread web/src/hooks/queries/settingValues.ts Resolved

@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: ddc73fa695

ℹ️ 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/settingValues.ts Resolved
Changing the profile's metadata language, or its per-source exceptions,
only refreshed the settings reads. Detail pages, Home and other catalog
views kept showing titles and descriptions in the old language until their
cached data went stale.

A change to either setting, saved here or reported by another device, now
marks every cached media read stale and resets Home's load queue, as
switching profile already does in effect.
@Rhainland
Rhainland force-pushed the fix/web-metadata-language-refresh branch from ddc73fa to 4357315 Compare October 10, 2026 10:13
@silo-kody

silo-kody Bot commented Oct 10, 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 ❌

@Rhainland

Copy link
Copy Markdown
Contributor Author

Evidence is linked in the description now: https://evidence.siloserver.org/r/silo-server/pr-2213/ (the detail page after switching German to French without a reload, desktop and mobile web, before and after). The Validation tasks line now says changes.

Rhainland and others added 2 commits October 13, 2026 10:51
The refresh invalidated every query except settings, so it refetched
client-only admin state (the WebSocket-fed active scans list reset to
empty) and held the settings mutation pending until every active query
in the app had refetched. It also cancelled only Home and library rows,
so a detail read or prefetch already in flight in the old language
still landed as fresh.

Refresh the localized reads only, through the media surface matcher plus
collections, episodes and calendar, cancel every one of them before
invalidating, and let the write settle once they are marked stale.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@Quick104 Quick104 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.

Review of 8886931. The approach is right: a metadata-language change has to refresh the localized reads, and doing it in the settings invalidation path covers both local writes and other devices. I found three defects in how wide the refresh reaches and when it settles. They're on the lines below, and I'm fixing all three in a commit on this branch. I'll follow up with a summary once the fix is verified.

Comment thread web/src/hooks/queries/settingValues.ts Resolved
Comment thread web/src/hooks/queries/settingValues.ts Resolved
Comment thread web/src/hooks/queries/settingValues.ts Resolved
@macroscopeapp

macroscopeapp Bot commented Oct 14, 2026

Copy link
Copy Markdown

The linked evidence is described as covering the detail page on desktop and mobile, but this refresh also affects localized text on other media surfaces.

  • Home sections and catalog/search or recommendation lists: add before-and-after captures of the same section or query, on desktop and mobile where applicable.
  • People, collections, episodes, and calendar views: add before-and-after captures for the affected views, on desktop and mobile where applicable.
  • Settings-to-view refresh flow: add a short recording showing the language change and the updated view without a reload.

No diff.

Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.

Posted via Macroscope — Visible change evidence

@Quick104

Quick104 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Review summary (head 295ed1b)

Fit: 9/10 · Readiness: 9/10 — ready (assuming CI is green)

The change belongs here. A metadata-language change should show up without a reload, and the settings invalidation path is the right place, because it covers both a save in this browser and a change from another device. I fixed three defects in a5bb7d7; the threads on 8886931 have the details.

  • The refresh invalidated every query except settings. That refetched WebSocket-fed admin state (the active scans list reset to empty), admin tables and every loaded page of open lists. It now refreshes the localized reads only, through the existing media surface matcher plus collections, episodes and calendar. A later Codex bot finding added shuffle cards and the Watch Together picker in 4d63860, the Home-row editor in cef3914, and collection peeks in 295ed1b, each with a test that fails without it; an audit of every query key root found no other localized reads left out; 5d4b31b merges main.
  • Only Home and library rows were cancelled, so a detail read or prefetch already in flight in the old language still landed as fresh. Every localized read is now cancelled before it is invalidated.
  • The save waited for every active query in the app to refetch, which kept the Playback settings page disabled. It now settles once the reads are marked stale.

Verification. New web tests cover each defect, and each one fails on 8886931. The focused query, Home and realtime suites pass (164 files, 1015 tests). Lint, typecheck and Prettier are clean. On a dev sandbox built from a5bb7d7, with German and French text seeded for one movie, the open detail page changed language after an in-app switch and after a change from another tab, with no reload. The language control re-enabled about 30 ms after each save. The console showed no errors. The published evidence still holds: it shows the detail page refreshing after a switch, which this head still does.

Remaining, not blocking

  • The device that saves runs the refresh twice, once for the save and once for its own realtime echo. The existing Home and library refreshes already do the same.
  • Home and library rows refetch, but stay in the source language until fix(sections): localize Home and library section cards #2209 localizes section cards.

Found during review, not caused by this PR

Validated features. No passed case is affected. #1215 C2 ("switch language/profile without stale cross-profile values") hasn't been run, and this PR is needed for it to pass, so the body now says unblocks #1215 C2 instead of changes. A profile switch already clears the whole query cache, so the profile half needs nothing more.

User manual. Unaffected. The preferences page already says the metadata language sets titles and descriptions; this makes the web app apply it without a reload.

Apple and Android. This is a web cache fix. I didn't check whether the apps refresh open screens after a language change; their #1212 validation tasks walk the same switch.

Review method. A Claude multi-agent review (three finders and a validation check, Opus 5.5 and Sonnet 5.5) and one Codex gpt-6.1-sol adversarial round on 8886931. Findings were checked against the source before they were posted or fixed.

AI disclosure: this review and the fix commit were written by Claude Code (claude-opus-5-5) in T3 Code, with a Codex (gpt-6.1-sol) review round.

@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: 5d4b31b5d0

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

…ge change

Shuffle cards come from the localized item detail, and the Watch Together
picker's rows, search and recently added lists from the localized catalog.
Neither key family was in the localized refresh, so an open shuffle
post-roll or picker kept the previous language. Room presence and member
state are not localized and stay out.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@macroscopeapp

macroscopeapp Bot commented Oct 14, 2026

Copy link
Copy Markdown

Validation impact

#1215 C2 needs a post-merge re-test. Its Results table still says Not run; the October 10 comment describes German text remaining after a language switch on main and a local stacked run including #2213 at 4357315e5 (no published build ID). This diff cancels and invalidates localized reads after local saves and same-profile realtime updates, addressing that language-switch finding.

Profile switching is a separate path and is not changed here; on this head, selectProfile clears the same QueryClient used by App, so I do not see #2478 as a remaining cache blocker. Please record a human result and published build in #1215 after merge. Validation tasks: unblocks #1215 C2 matches the impact; this check did not validate the case.

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

Posted via Macroscope — v1 validation impact

@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: 4d63860125

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

The Home-row editor's peeks and previews read section cards, and its
curated-title search reads the catalog, under their own key families.
None was in the localized refresh, so an open editor kept the previous
language until the five-minute stale window ran out.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@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: cef3914706

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

Collection poster peeks read the collection's item cards under their own
key family, which the localized refresh missed. An audit of every query
key root in web/src found no other localized card reads outside the
refresh.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Quick104
Quick104 merged commit 7f5c607 into Silo-Server:main Oct 14, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact: usability Core flow broken or severely blocked priority: P2 Limited scope, workaround exists, or polish

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants