Skip to content

feat(sections): send title keys on admin sections and default titles - #3728

Merged
Quick104 merged 2 commits into
mainfrom
feat/section-title-keys-gaps
Nov 10, 2026
Merged

Quick104 merged 2 commits into
mainfrom
feat/section-title-keys-gaps

Conversation

@Quick104

@Quick104 Quick104 commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Stacked on #3727. Review and merge that first.

Related issue: N/A
Validation tasks: none affected (#1221 C1 reads profile section settings; every title stays the same)

In a translated interface, the admin Sections page and its show/hide toast still print built-in row names in English, as in "Recently Added in Movies está activada para todos". Admin section definitions don't say which titles are the server's own. Profile home-screen settings have the same gap for a renamed row's "Renamed from …" line, which shows the original title. This change sends the same title keys on those reads.

Approach

AdminSection responses (listAdminSections, getAdminSection, and the create and update answers that return a section) carry the optional title_key and title_args that other section reads gain in #3727, while the title is the server's own text. Profile section settings add default_title_key and default_title_args for default_title. Both come from the key stored with the row, so an administrator's rename drops them. Editors keep editing title; the key only changes what a list or toast shows.

Library section item reads already carry the key in #3727; a new test covers them. /api/v1 bodies are unchanged. The fields widen the meaning of #3727's section_title_keys capability rather than adding a new one, so this must ship with or after #3727.

Validation

  • A Postgres test through the v2 router uses a default library row: the library row read, the admin list and the admin read carry its key, and a PATCH rename drops it from all three. Before this change it failed on the admin reads.
  • A resolver test covers the default title's key, including under a profile's own title.
  • On a sandbox upgraded from an existing database: admin lists for Home and both libraries carried the keys, with library on generated rows, renames dropped them, and /api/v1 had no new member. This ran before the rebase onto current main; the rebase applied without conflicts.
  • Rebased onto current main: the generated-contract checks, the focused package tests and this stack's Postgres pins pass. The full pre-PR gate and every scripts/ci/db-contracts.txt test passed against a freshly migrated scratch database on the previous rebase, apart from two real-FFmpeg tests that fail the same way on main with that host's FFmpeg 6.1.1.

Evidence

Captured end to end on a sandbox running this stack with the web translation stack merged in, before and after: the admin Sections page and the profile's Home Screen settings in English (unchanged), Spanish, Arabic and German, and a renamed row whose "renamed from" line shows the original name translated. The API responses are included. The page names both builds.

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

Risks

None identified. The fields are additive and no migration is involved.

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 says there is none.

Follow-ups

AI Disclosure

  • Harness: Claude Code
  • Tool(s): Claude Code; Codex
  • Model(s): claude-opus-5-5 (code); gpt-6.1-sol (reviews)
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: no plan round, since the change extends feat(sections): send title keys for server-written section titles #3727's fields to two more types. A local high-effort code review fixed a docs error and removed a guard that applied to one field only. An adversarial round with gpt-6.1-sol found nothing. A background gpt-6.1-sol (xhigh) review of cc20aed542 found nothing.

🤖 Generated with Claude Code

Note

Add title_key/title_args to admin sections, defaults, and generated section titles

  • Adds a title_key column (plus JSONB title_args) to page_sections with a migration that backfills built-in and generated library-row titles and clears keys on rename via a BEFORE UPDATE trigger (migration)
  • Default section builders, generated home-library rows, the synthetic Next Up section, and recommendation rows now carry translation keys; profile overrides keep the key only when the override equals the stored admin title (resolver.go, title_keys.go)
  • Exposes the fields in the v2 API: Section, SectionLayoutEntry, AdminSection, and ProfileSectionSetting (with default_title_key/default_title_args), plus a section_title_keys: true capability flag (openapi.json, library_views.go)
  • Risk: the new DB trigger in page_sections_title_key_clear clears title_key/title_args on any update that changes a keyed row's title without changing its key; Repository.syncGeneratedHomeLibraryRecentTitles now matches keyed rows by stored library argument instead of old-name text

Macroscope summarized 35b71b4.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T01:18:42.874480Z b37441a New commits
🔒 Security Review ✅ Completed 2026-11-10T01:20:47.746028Z b37441a 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.

@silo-triage silo-triage Bot added the size/L 200–499 added + deleted lines (all files); change volume, not priority. label Nov 9, 2026
@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 32 minutes.

Check out review usage here.

View limit details

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

Learn how review limits work.

Review configuration:

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: 32246183-2366-4c5a-a750-c92030908e2b
Commits

Reviewing files that changed from the base of the PR and between eaa4d23 and b37441a.

Files selected for processing: 13

  • contracts/api/v2/openapi.json
  • docs/architecture/api-contract.md
  • docs/catalog-api.md
  • internal/api/handlers/sections.go
  • internal/apiv2/admin_sections_types.go
  • internal/apiv2/home.go
  • internal/apiv2/profile_sections.go
  • internal/apiv2/section_title_keys_db_test.go
  • internal/sections/resolver.go
  • internal/sections/resolver_test.go
  • internal/sections/types.go
  • scripts/ci/db-contracts.txt
  • web/src/api/v2/schema.ts

No actionable comments were generated in the recent review.

Walkthrough

Section and profile-setting responses now expose title translation metadata. The resolver retains default-title keys and arguments. API schemas, documentation, and an integration test cover the added fields.

Changes: Section title translation metadata

Layer / File(s) Summary
Retain default-title metadata
internal/sections/types.go, internal/sections/resolver.go, internal/sections/resolver_test.go
ResolvedSection stores the default title’s translation key and arguments. ResolveForSettings copies these values from the admin section, and the resolver test checks them across title overrides.
Expose metadata in API responses
internal/api/handlers/sections.go, internal/apiv2/admin_sections_types.go, internal/apiv2/profile_sections.go, internal/apiv2/section_title_keys_db_test.go, scripts/ci/db-contracts.txt
Section response mapping copies title metadata. Admin section mapping derives SectionTitleKey, and profile settings include default-title keys and arguments. The integration test checks title keys across section reads and admin endpoints, including after a rename.
Document translation metadata
contracts/api/v2/openapi.json, web/src/api/v2/schema.ts, internal/apiv2/home.go, docs/architecture/api-contract.md, docs/catalog-api.md
The API schemas and documentation describe title translation fields on sections and default-title fields on profile settings. The section_title_keys description now covers admin section definitions and default-title metadata.

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

Change: Feature

Possibly related issues

  • Issue 1141 covers the web admin for curated home sections. This change adds title keys to admin section responses.
  • Issue 1137 covers acceptance for curated home sections, including section names and default titles.
  • Issue 1140 covers the server contract for curated home sections. This change adds metadata to admin section responses and profile settings.
  • Issue 1142 covers web rendering of curated home sections. This change adds title keys and default-title keys to the relevant responses.

Possibly related PRs

Suggested labels: enhancement, go, api-v2, javascript

Suggested reviewers: blurbery, rhainland

Merge Risk: Minimal · previous review eaa4d

Clients can fall back to server-provided titles when translation keys are absent. No merge-blocking risk remains identified.

Security architecture risk: Low · up to eaa4d

The change adds optional translation metadata without changing who can read or modify sections. No introduced security issue was established. Incomplete coverage and unverified behavior in external clients leave limited residual uncertainty.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The supported exposure increase is additional display metadata on existing section responses: stored admin definitions and access-filtered profile settings. The inspected flow adds neither a new request-controlled sink nor additional modification authority.

Trust Boundaries and Controls

  • observed — Admin operations retain ClassActingAdmin; profile settings and library reads retain profile/viewer-scoped controls. Central gate composition requires authentication and viewer access, adds acting-admin authorization where declared, and refuses service when a required gate dependency is missing. Existing library identity and access checks precede response mapping.
Pre-merge checks: Passed 4 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Docstring Coverage Inconclusive Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed

Check name Status Explanation
Title check Passed The title "feat(sections): send title keys on admin sections and default titles" matches the main change. The diff adds title_key and title_args to AdminSection responses and default_title_key and def…
Description check Passed The description states the problem, the approach, validation steps, evidence, risks, and follow-ups. It names the changed areas: AdminSection responses, ProfileSectionSetting default title fields, gen…
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.
Full details: Title check

Explanation

The title "feat(sections): send title keys on admin sections and default titles" matches the main change. The diff adds title_key and title_args to AdminSection responses and default_title_key and default_title_args to ProfileSectionSetting, and the PR description describes the same work. The title is specific and uses a conventional commit prefix, so a teammate scanning history can identify the primary change.

Full details: Description check

Explanation

The description states the problem, the approach, validation steps, evidence, risks, and follow-ups. It names the changed areas: AdminSection responses, ProfileSectionSetting default title fields, generated OpenAPI and TypeScript schemas, docs, and the new database contract test. It also explains that the change depends on #3727. This is clearly related to the changeset.

Full details: Docstring Coverage

Explanation

Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 5 functions across 8 files. (5 skipped: 4 unsupported, 1 too large.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • 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: 65abf848-f3ff-4622-9bb3-e9f7d8bd4556
Commits

Reviewing files that changed from the base of the PR and between cc20aed and eaa4d23.

Files selected for processing: 6

  • contracts/api/v2/openapi.json
  • docs/architecture/api-contract.md
  • docs/catalog-api.md
  • internal/apiv2/home.go
  • scripts/ci/db-contracts.txt
  • web/src/api/v2/schema.ts

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

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

Nitpick comments: 2

internal/apiv2/section_title_keys_db_test.go: 1

87-90: Trivial · Data Integrity & Integration · Quick win

Test arguments in admin section responses.

Add a generated home library row and assert its title_args in the admin list and single-section responses. The current test checks only an argument-free row. A regression that drops v.TitleArgs in adminSectionOf can pass the test and leave clients unable to fill the library placeholder.

internal/apiv2/profile_sections.go: 1

364-378: Trivial · Data Integrity & Integration · Quick win

Test default-title metadata in the profile settings response

Add an API response test for a generated row with a translation key and argument. Include a profile title override. Assert that default_title_key and default_title_args remain present while the displayed-title key is absent.

The resolver test does not exercise profileSectionSettingsOf. The current API fixtures have no default-title metadata, so they cannot catch a missing or incorrect mapping.

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: 66fe86ab-abd3-40ba-a099-7fbed5073335
Commits

Reviewing files that changed from the base of the PR and between 85bb5a4 and cc20aed.

Files selected for processing: 13

  • contracts/api/v2/openapi.json
  • docs/architecture/api-contract.md
  • docs/catalog-api.md
  • internal/api/handlers/sections.go
  • internal/apiv2/admin_sections_types.go
  • internal/apiv2/home.go
  • internal/apiv2/profile_sections.go
  • internal/apiv2/section_title_keys_db_test.go
  • internal/sections/resolver.go
  • internal/sections/resolver_test.go
  • internal/sections/types.go
  • scripts/ci/db-contracts.txt
  • web/src/api/v2/schema.ts

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

Comment thread docs/architecture/api-contract.md Resolved
Comment thread docs/catalog-api.md Resolved
@Quick104

Quick104 commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

On the two test nitpicks in the CodeRabbit review (admin-section title_args, and default_title_key/default_title_args in profileSectionSettingsOf): I'm not adding these. Both responses map the stored key and arguments through the same sectionTitleKeyOf(key, args) helper the other section reads use; the new code is a field copy into it. CONTRIBUTING's "Decide what to test" leaves out field copies and adapters that pass values through. The behaviour with real edge cases, a rename dropping the key on the stored row and on the admin reads, is covered by the Postgres test through the v2 router.

@Quick104
Quick104 force-pushed the feat/section-title-keys-gaps branch from a1ad782 to 34cecf7 Compare November 9, 2026 16:14
@silo-triage silo-triage Bot added impact: polish Annoyance, cosmetic, or nice-to-have priority: P2 Limited scope, workaround exists, or polish stacked Base is another open PR; merge in stack order named in the body triaged High-confidence review completed; does not mean fixed, validated, or accepted for release. labels Nov 9, 2026
@Quick104
Quick104 force-pushed the feat/section-title-keys-gaps branch from 34cecf7 to eaa4d23 Compare November 9, 2026 16:46
@Quick104
Quick104 force-pushed the feat/section-title-keys branch from 5d7f575 to 3d561bc Compare November 9, 2026 16:46
@coderabbitai coderabbitai Bot added api-v2 API v2 / Huma migration program (epic #135); long-running, stacked by phase enhancement New feature or request go Pull requests that update go code javascript Pull requests that update javascript code labels Nov 9, 2026

@coderabbitai coderabbitai Bot 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.

Additional comments: 1

internal/apiv2/home.go-115-115: 1

115-115: Minor · Data Integrity & Integration · Quick win

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Do not advertise the new fields through the existing capability.

If #3727 ships first, it reports section_title_keys: true without admin title keys or default-title keys. A client cannot use this flag to distinguish unsupported fields from a renamed title. (raw.githubusercontent.com)

Keep this description scoped to the original fields, or add a separate capability for the new fields.

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: 48f92013-65f9-46ff-9b78-4749696ddeec
Commits

Reviewing files that changed from the base of the PR and between cc20aed and eaa4d23.

Files selected for processing: 6

  • contracts/api/v2/openapi.json
  • docs/architecture/api-contract.md
  • docs/catalog-api.md
  • internal/apiv2/home.go
  • scripts/ci/db-contracts.txt
  • web/src/api/v2/schema.ts

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

@Quick104

Quick104 commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

On the additional comment about internal/apiv2/home.go (advertising the new fields through section_title_keys): this is the same point as the earlier thread on docs/architecture/api-contract.md, which was withdrawn. A missing title_key always means "show title", so a client never needs to tell an older server from a renamed row. The stack ships together, and #3729 documents the flag as informational. No change.

@Quick104
Quick104 force-pushed the feat/section-title-keys-gaps branch 3 times, most recently from 99af664 to 35b71b4 Compare November 9, 2026 17:12
@Quick104
Quick104 force-pushed the feat/section-title-keys branch from ba26987 to 4637ea5 Compare November 10, 2026 00:50
@Quick104
Quick104 changed the base branch from feat/section-title-keys to main November 10, 2026 01:16
@silo-triage silo-triage Bot added the size/XXL 1000–2999 added + deleted lines (all files); change volume, not priority. label Nov 10, 2026
@silo-triage silo-triage Bot removed the size/L 200–499 added + deleted lines (all files); change volume, not priority. label Nov 10, 2026
Quick104 and others added 2 commits November 9, 2026 20:16
The admin section definitions (listAdminSections, getAdminSection and
the responses that answer one) now carry the stored title_key and
title_args while the title is the server's own text, so the admin
Sections page and its toggle toast can show translated row names.
Profile section settings add default_title_key and default_title_args
for default_title, which the web shows when a profile renamed a row
("Renamed from ...").

Both come from the stored page_sections marker, so an admin rename
drops them as it drops title_key on every other read. /api/v1 bodies
are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Quick104
Quick104 force-pushed the feat/section-title-keys-gaps branch from 35b71b4 to b37441a Compare November 10, 2026 01:17
@silo-triage silo-triage Bot added size/L 200–499 added + deleted lines (all files); change volume, not priority. and removed size/XXL 1000–2999 added + deleted lines (all files); change volume, not priority. labels Nov 10, 2026
@silo-kody

silo-kody Bot commented Nov 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 ❌

Comment thread internal/apiv2/home.go Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-v2 API v2 / Huma migration program (epic #135); long-running, stacked by phase enhancement New feature or request go Pull requests that update go code impact: polish Annoyance, cosmetic, or nice-to-have javascript Pull requests that update javascript code priority: P2 Limited scope, workaround exists, or polish size/L 200–499 added + deleted lines (all files); change volume, not priority. stacked Base is another open PR; merge in stack order named in the body triaged High-confidence review completed; does not mean fixed, validated, or accepted for release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant