Skip to content

fix(backup): show restore change lists in the interface language - #4757

Merged
Quick104 merged 5 commits into
mainfrom
fix/restore-change-lists-translated
Nov 21, 2026
Merged

Quick104 merged 5 commits into
mainfrom
fix/restore-change-lists-translated

Conversation

@Quick104

@Quick104 Quick104 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A
Validation tasks: none
Other clients: N/A (only the web admin has a restore screen; silo-apple, silo-android, and silo-roku have none)

On the Restore page, the "What changes:" list under a differing home or library section, or a template collection, stayed in English in every interface language. The heading was translated, but each entry ("item limit", "web only", "featured", "3 collection items", "sort order", "libraries", ...) came from the server as English display text, and RestoreRows.tsx printed it unchanged. This change makes the server send codes and the web show each one from the translation catalog.

Approach

  • internal/backup (sectionChanges, customizeTemplate, the template libraries entry) emits change codes such as item_limit, web_only, title_translation, collection_replaced, sort_order, sync_schedule, and collection_items, instead of English words. The section's missing-item count moves out of the string into PreviewHomeSection.MissingCollectionItems, set only alongside collection_items.
  • /api/v2: both changes arrays (AdminBackupRestoreHomeSection, AdminBackupRestoreCollection) declare their codes as enums, and the home section gains optional missing_collection_items. This changes the values of an existing field before the 1.0 lock. Only the web restore flow reads them, and it ships in the same binary. Both operations that return a restore set (getAdminBackupRestoreSet, getAdminBackupUploadRestoreSet) are affected, and contracts/api/v2/breaking-approvals.json approves the enum additions on each.
  • Web: RestoreRows.tsx maps each code to a web.admin.backups.restore.rows.change.* key, with a plural for the collection item count. The map is typed over the generated enum, so a code without a label fails the typecheck, and a value the bundle doesn't know shows as sent. The keys came from feat(catalog): name what a restore changes in a section or template collection silo-translations#134, now in release 2026.11.21-0719c45.
  • The row's English message ("Replaces the section here: item limit, web only.") keeps its exact wording through a small helper that turns codes back into the old words. Translating row messages is [bug] Restore explanations in the expanded row and report stay in English #4669's subject, and this change uses the same codes-and-catalog approach that issue can reuse. An unverified backup's withheld source and sync schedule also stay English, since only that message uses them.
  • docs/backups-api.md and docs/architecture/backups.md list the codes.

Validation

  • Live on a dev-builder sandbox, the same backup and data before (main 3516fb41) and after (a4a43860): with the profile in German, the restore set API returned ['item limit', 'web only'] before and ['item_limit', 'web_only'] after. The page showed English entries under the German heading before, and "Maximale Anzahl an Elementen", "Nur Web", "Hervorgehoben", "Aktiviert", "Titel" after. English shows "Item limit", "Web only", and so on. The translation pin commit after that build changes only Arabic and Hebrew strings outside this page.
  • TestManagedSectionPointedElsewhereIsRestoredDB now also removes an item from a managed section's collection after the backup and checks the wire shape: changes: ["collection_items"] with missing_collection_items: 1. It failed on the base, which sent ["1 collection items"] and no count. The sandbox data has no section that manages a collection, so this test is the only check of that entry.
  • internal/backup with Postgres, internal/apiv2, internal/contractspec: pass. Web typecheck, eslint, prettier, and the full vitest suite: pass. make lint-changed, verify-apiv2-openapi, verify-apiv2-web-types, verify-apiv2-contract, verify-apiv2-fixtures, verify-route-inventory, verify-local-paths, verify-size-ratchet: pass. The full make test-go was not run.

Evidence

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

Surface and build: web admin, Restore page, desktop, tablet, and phone widths; before main 3516fb41, after a4a43860. The row subtitles differ between the two captures because of #4710 and #4715 on main, not this change.

Risks

During a rolling upgrade, a bundle and API on different versions show the other side's raw values (item_limit, or the old English words) instead of translated labels, never blanks. No migration, and nothing stored changes: row messages and restore reports keep their English wording.

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.

Council review

Rounds: 2, last reviewed 53b502b

Member Round 1 Round 2
Sol (gpt-6.2-sol, xhigh) 7/10 9/10
Opus (claude-opus-5-5, high) 7/10 9/10
Gemini (gemini-4-neon, xhigh) unavailable (quota) 9.5/10

Visual review: 1 round, captures from a4a4386

Member Round 1
Sol better, 8/10
Opus better, 7/10
Gemini unavailable (quota)

Fixed: the translation pin's new warning-toggle messages need an amount value; the rebase onto main brought #4737, which passes it (also raised by Codex). An unknown change code, or an older server's English word during a rolling upgrade, now shows as sent instead of a blank bullet, as the contract asks of response enums.
Round 2 found nothing; Gemini's one nit, a doc comment naming the wrong struct, is fixed.
Answered: the English row message above the translated list stays, because restore reports keep only that message and show it after the restore; translating messages is #4669. The visual findings (row subtitles, phone captions, a long URL, the list heading's weight) concern parts of the row this change doesn't touch; the subtitle changes come from #4710 and #4715 on main.

AI Disclosure

  • Harness: Claude Code, in T3 Code
  • Tool(s): Claude Code; T3 Code delegated reviews (Codex, Claude Code, Antigravity)
  • Model(s): claude-opus-5-5 (implementation); plan and visual reviews by gpt-6.2-sol, claude-opus-5-5, gemini-4-neon
  • Involvement: Fully AI-generated; verified by the agent on a sandbox and with tests, not yet by a person
  • Adversarial review: see Council review above; the plan was also reviewed by Sol, Opus, and Gemini before implementation.

🤖 Generated with Claude Code

Note

Show restore change lists in the interface language

  • Restore previews now report changes as underscore-separated codes instead of English phrases. The planner returns codes and a missing collection-item count from planner.sectionChanges in selective_sections.go, and a changeWords formatter in selective_plan.go keeps English output working server-side.
  • The web client maps codes to localized labels via the new CHANGE_LABELS map and changeLabel helper in RestoreRows.tsx. Added restore-change message entries to all locale catalogs, with per-language plural forms for the collection-item count.
  • The home-section restore-set response gains an optional integer missing_collection_items and enum constraints on the Changes fields in openapi.json; docs and breaking-approval records are updated.
  • Behavioral Change: API consumers now see change codes (e.g. sync_schedule, collection_items) instead of space-separated English labels, plus a new missing_collection_items response property. Unmapped codes are shown as-is in the UI.

Macroscope summarized c6c74d1.

@silo-triage silo-triage Bot added the size/XXXL 3000+ added + deleted lines (all files); change volume, not priority. label Nov 21, 2026
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

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 1 minute.

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: 5db32709-bd9e-4ae0-9d2d-b58a8f10579b
Commits

Reviewing files that changed from the base of the PR and between f964c3a and c6c74d1.

Files selected for processing: 56

  • .silo-translations
  • contracts/api/v2/breaking-approvals.json
  • contracts/api/v2/openapi.json
  • docs/architecture/backups.md
  • docs/backups-api.md
  • internal/apiv2/admin_backup_restore.go
  • internal/backup/selective_apply_test.go
  • internal/backup/selective_plan.go
  • internal/backup/selective_postgres_test.go
  • internal/backup/selective_sections.go
  • internal/backup/selective_templates.go
  • web/src/api/v2/adminBackupRestore.ts
  • web/src/api/v2/schema.ts
  • web/src/locales/ar-XB.json
  • web/src/locales/ar.json
  • web/src/locales/bg.json
  • web/src/locales/ca.json
  • web/src/locales/cs.json
  • web/src/locales/da.json
  • web/src/locales/de.json
  • web/src/locales/el.json
  • web/src/locales/en-XA.json
  • web/src/locales/en.json
  • web/src/locales/es.json
  • web/src/locales/et.json
  • web/src/locales/fi.json
  • web/src/locales/fr.json
  • web/src/locales/he.json
  • web/src/locales/hi.json
  • web/src/locales/hr.json
  • web/src/locales/hu.json
  • web/src/locales/id.json
  • web/src/locales/it.json
  • web/src/locales/ja.json
  • web/src/locales/keys.ts
  • web/src/locales/ko.json
  • web/src/locales/lt.json
  • web/src/locales/lv.json
  • web/src/locales/ms.json
  • web/src/locales/nb.json
  • web/src/locales/nl.json
  • web/src/locales/pl.json
  • web/src/locales/pt-BR.json
  • web/src/locales/pt-PT.json
  • web/src/locales/ro.json
  • web/src/locales/ru.json
  • web/src/locales/sk.json
  • web/src/locales/sl.json
  • web/src/locales/sv.json
  • web/src/locales/th.json
  • web/src/locales/tr.json
  • web/src/locales/uk.json
  • web/src/locales/vi.json
  • web/src/locales/zh-Hans.json
  • web/src/locales/zh-Hant.json
  • web/src/pages/admin-backups/RestoreRows.tsx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 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-21T02:02:51.367242Z 89a993b New commits
🔒 Security Review ✅ Completed 2026-11-21T02:43:39.084291Z c6c74d1 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-kody

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

@silo-triage silo-triage Bot added bug Something isn't working 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 labels Nov 21, 2026

@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: 1b5fdcc14d

ℹ️ 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/locales/en.json Resolved
Quick104 and others added 3 commits November 20, 2026 20:58
The Restore page's change list under a differing home or library section,
or template collection, stayed in English in every language: the server
sent English words ("item limit", "3 collection items") and the web
printed them. The restore set now sends change codes (item_limit,
collection_items, ...), declared as enums on both changes arrays, with
missing_collection_items carrying the count. The web shows each code
from the translation catalog. Row messages keep their English wording.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Quick104
Quick104 force-pushed the fix/restore-change-lists-translated branch from d20b316 to 89a993b Compare November 21, 2026 02:00
@silo-kody

silo-kody Bot commented Nov 21, 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 ❌
⚠️ 4 Kody Rule(s) were not evaluated

These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:

  • Preserve optional store capabilities through production wrappers
  • Detach mandatory cleanup from request cancellation and bound its lifetime
  • Preserve durable media identity and share identity-evidence precedence
  • Bound decoder throughput trades and share direct-play eligibility

Response enums are additive, so a code the bundle has no label for, or an
older server's English word during a rolling upgrade, shows as sent
instead of a blank bullet.

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

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

@Quick104
Quick104 merged commit f0c80d2 into main Nov 21, 2026
18 checks passed
@Quick104
Quick104 deleted the fix/restore-change-lists-translated branch November 21, 2026 02:47
Quick104 added a commit that referenced this pull request Nov 21, 2026
#4757 approved its own restore change enums, which main now has, so against
main those approvals match nothing and the contract check refuses them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Quick104 added a commit that referenced this pull request Nov 21, 2026
…ent (#4668)

* feat(config): set backups, Discord, MDBList and more from the environment

Thirteen more server settings can be set from environment variables, with
the checks an admin save runs: the nightly backup schedule and contents
(SILO_BACKUP_*), the Discord application (SILO_DISCORD_*), the MDBList key,
the Meilisearch index, the web media origin, the prepared-download budget
and realtime library monitoring. A deployment kept in version control no
longer needs the admin UI for them.

The web admin shows each of these fields read-only with the variable that
sets it, as it does for the existing variables. The Discord card leaves
keys the environment sets out of its saves and its clear action, which the
server would refuse.

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

* fix(backup): apply only SILO_BACKUP_ENABLED before migrations, in both entry points

The backup before migrations laid every SILO_BACKUP_* value over the
stored settings. A lower SILO_BACKUP_KEEP then rotated nightly copies
away before the migrations had succeeded, under a value startup had not
stored yet. Only SILO_BACKUP_ENABLED decides that backup now; retention
waits for startup.

A migration job (--migrate-only) read no environment settings, so on the
deploy that first sets SILO_BACKUP_ENABLED=true over a stored false it
migrated without a backup. It now reads them for this one value, and an
invalid value elsewhere falls back to the stored settings with a warning
instead of stopping the migration.

Also drop a test that repeated the env table's invalid-value check.

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

* fix(config): keep env-set Discord drafts and the index field out of saves

- The Discord card left env-set keys out of its saves, but a client
  secret or bot token typed before the environment took that key over
  still went into the batch, and the server refused the whole save. Each
  draft now counts only while its key is editable.
- The Search page's Meilisearch index stayed editable when the
  sensitive-status read failed, unlike the other three Meilisearch
  fields there.
- A migration job read every environment setting for its one use,
  SILO_BACKUP_ENABLED, so an invalid unrelated variable dropped that
  value. It now reads that variable alone.
- The before-upgrade backup's comment and doc now say it reads
  SILO_BACKUP_ENABLED.

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

* feat(config): declare AI providers and recommendations in the deployment

A deployment kept in Compose, Kubernetes or NixOS files could set
recommendations only by scripting the admin API after first start: the AI
provider registry is machine-managed and provider ids were random.

The plugin provisioning document is now the deployment document, read from
SILO_CONFIG or SILO_CONFIG_FILE (SILO_PLUGINS and SILO_PLUGINS_FILE still
work). Its plugins section is optional, and a new ai_providers section
declares providers keyed by the id they keep, with keys given as fromFile or
fromEnv references. An API server stores them at start, in the same
transaction as the environment's settings, so SILO_RECOMMENDATIONS_PROVIDER,
SILO_RECOMMENDATIONS_MODEL and SILO_RECOMMENDATIONS_ENABLED can name one and
the recommendation engine starts with them on that start.

A declared provider replaces the stored one with its id; one no longer
declared stays connected and becomes editable again; an empty section
releases them all, and a document without the section leaves them alone.
Admin updates and deletes of a declared provider are refused with
managed_by_environment, and the API reports managed_by_env_var. Web admin
shows declared providers and env-set recommendation fields read-only.

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

* fix(web): keep provider select choices apart from declared provider ids

The provider selects used "add" and "none" as their own choices. An
admin-created provider's id is always <type>-<hex>, but a deployment
document chooses its providers' ids, and both words match the id
pattern. A provider declared as "none" or "add" would have read as no
provider, or opened the add form. The choices now contain underscores,
which no provider id can.

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

* fix(config): keep a declared provider's type; show the stored one when locked

- A declaration that kept a provider's id but changed its type replaced
  it in place, so the models bound to it (another type's) went to the
  new endpoint. The admin API already refuses a type change; a
  declaration now does too, asking for a new id.
- A provider the deployment took over while an admin had edits open
  kept showing, and testing, those edits. A locked panel now shows and
  tests the stored provider.

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

* refactor(config): share the document's secret budget; drop dead guards

- AI keys counted against a 1 MiB budget of their own instead of the
  document's one budget its comment described. They now share it, and
  a key comes straight from its captured reference, the only form the
  schema allows.
- Drop guards nothing can reach: --migrate-only before the frontend
  document read, an env-set model commit from a disabled field, and a
  repeated suggestion check.
- The Recommendations page shows the variable note only on the toggle,
  the one field there a variable sets.

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

* fix(config): refuse empty capabilities and blank keys in declarations

- `capabilities: []` passed the schema and a known type then silently
  took its own set; the schema now asks for at least one capability.
- A key file or variable holding only whitespace became no key at all,
  which a provider with an optional key accepted without a word; it now
  stops startup.
- Test that the admin API lists a declared provider with its variable
  and refuses to edit or remove it.

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

* fix(web): keep env-taken drafts and a chatgpt id from steering AI settings

- The text provider select used "chatgpt" for the ChatGPT plan, so a
  provider declared with that id read as the plan. The select's value
  is now "__chatgpt__"; the auth mode keeps "chatgpt".
- A provider panel remounts when the deployment takes the provider over
  or releases it, so no draft or test result from before carries
  across; a locked panel shows the stored provider.
- The Recommendations page ignores a provider or model draft for a key
  the environment took over, in what it shows and in Check Connection.
- A name clash suggests taking the other provider over only when it has
  the declared type, and the type-change error asks for a new name as
  well as a new id, since the released provider keeps its name.

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

* fix(config): check only bindings the deployment can break at startup

A document that changes the AI provider registry, or a recommendations
variable, made startup check every stored provider binding, so one a restore
into another deployment left naming a removed provider stopped the server,
which an admin can't fix while it's down. Startup now checks the bindings the
environment sets and those naming a provider the document declares; declaring
never removes a provider, so the rest are as valid as before. A text binding
the ChatGPT plan leaves idle is no longer checked against its provider, as
AIProviderUsers already treats it, and the auth mode joins the binding group.

The Recommendations page also replaced a draft for a key only while the
environment set it, so the draft came back, and could be saved on blur, once
the variable was removed. A key the environment sets now takes the server's
value over any draft.

docs/admin-settings-api.md says how declared providers are released.

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

* chore(apiv2): drop the approvals #4757 left that this change doesn't use

#4757 approved its own restore change enums, which main now has, so against
main those approvals match nothing and the contract check refuses them.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working 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/XXXL 3000+ added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant