You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(sections): send title keys on admin sections and default titles - #3728
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.
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
Web: the admin Sections list, toggle toasts, batch-failure titles and "Renamed from" read the new fields in the web translation stack. Apple, Android and Roku have no admin Sections screen and don't use default_title.
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.
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
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).
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.
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.
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.
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: 4 · 1
Failed checks: 1 inconclusive
Check name
Status
Explanation
Resolution
Docstring Coverage
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 checks: 4 passed
Check name
Status
Explanation
Title check
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
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
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
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.
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.
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.
silo-triageBot
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
coderabbitaiBot
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
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.
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.
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
api-v2API v2 / Huma migration program (epic #135); long-running, stacked by phaseenhancementNew feature or requestgoPull requests that update go codeimpact: polishAnnoyance, cosmetic, or nice-to-havejavascriptPull requests that update javascript codepriority: P2Limited scope, workaround exists, or polishsize/L200–499 added + deleted lines (all files); change volume, not priority.stackedBase is another open PR; merge in stack order named in the bodytriagedHigh-confidence review completed; does not mean fixed, validated, or accepted for release.
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
AdminSectionresponses (listAdminSections,getAdminSection, and the create and update answers that return a section) carry the optionaltitle_keyandtitle_argsthat other section reads gain in #3727, while the title is the server's own text. Profile section settings adddefault_title_keyanddefault_title_argsfordefault_title. Both come from the key stored with the row, so an administrator's rename drops them. Editors keep editingtitle; 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/v1bodies are unchanged. The fields widen the meaning of #3727'ssection_title_keyscapability rather than adding a new one, so this must ship with or after #3727.Validation
libraryon generated rows, renames dropped them, and/api/v1had no new member. This ran before the rebase onto currentmain; the rebase applied without conflicts.main: the generated-contract checks, the focused package tests and this stack's Postgres pins pass. The full pre-PR gate and everyscripts/ci/db-contracts.txttest passed against a freshly migrated scratch database on the previous rebase, apart from two real-FFmpeg tests that fail the same way onmainwith 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
Follow-ups
default_title.AI Disclosure
cc20aed542found nothing.🤖 Generated with Claude Code
Note
Add
title_key/title_argsto admin sections, defaults, and generated section titlestitle_keycolumn (plus JSONBtitle_args) topage_sectionswith a migration that backfills built-in and generated library-row titles and clears keys on rename via a BEFORE UPDATE trigger (migration)Section,SectionLayoutEntry,AdminSection, andProfileSectionSetting(withdefault_title_key/default_title_args), plus asection_title_keys: truecapability flag (openapi.json, library_views.go)page_sections_title_key_clearclearstitle_key/title_argson any update that changes a keyed row's title without changing its key;Repository.syncGeneratedHomeLibraryRecentTitlesnow matches keyed rows by stored library argument instead of old-name textMacroscope summarized 35b71b4.