Skip to content

feat(home): reorder and hide Home rows for the profile on the server - #878

Closed
Rhainland wants to merge 12 commits into
Silo-Server:mainfrom
Rhainland:feat/home-row-order-server
Closed

Rhainland wants to merge 12 commits into
Silo-Server:mainfrom
Rhainland:feat/home-row-order-server

Conversation

@Rhainland

@Rhainland Rhainland commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: Silo-Server/silo-server#1137
Validation tasks: unblocks #305 C2; unblocks #306 C2, C5

The Apple apps have no way to reorder or hide Home rows. #739 removed the old editors because they kept the choices on the device, where they never reached other devices or the admin. Curated home sections requires that each profile can reorder its own rows, that the order persists per profile, and that an admin can see and set it (#1137 AC3), and the iOS and tvOS validation tasks check this on each device.

This brings a Home Sections editor back on iPhone, iPad, Mac and Apple TV. It reads and saves the profile's layout on the server, the same layout the web app's Settings > Home Screen and the admin's per-profile Home sections card use, so a change made here shows on every device and to the admin. Home still renders /api/v2/home/sections in server order; nothing is stored on the device.

Approach

  • iPhone, iPad, Mac: Settings > Interface > Home Sections. Edit enables drag to reorder; each row has an eye button to show or hide it. Move Up and Move Down are in each row's context menu and are VoiceOver actions, so rows can be moved without dragging.
  • Apple TV: Settings > General > Home Sections opens a full-screen sheet with Edit, Move Up, Move Down and a show/hide button per row. Focus starts on Done, follows a moved row, and Back closes the sheet and returns focus to the Home Sections button.
  • Saving: each change saves at once through GET /api/v2/profile/sections and PUT /api/v2/profile/sections, keeping the profile's renamed rows, rows it added, rows it removed, and hidden rows. Saves from every editor run one at a time on one shared queue and survive closing the editor, so an editor opened during a save reads the layout after it lands. A failed save reads the layout back, because the server may have stored it before the reply was lost, and Home refreshes if it did. A reload waits for pending saves.
  • Text: the editor's text comes from the home.profileEditor.* catalog keys in feat(catalog): add the Apple Home Sections editor text for a layout saved to the profile silo-translations#165, and row names show in the app language through title_key, as on Home.
  • Positions: like the web editor, a profile stores row positions only once it has reordered its rows. Hiding a row alone does not pin the order, so the profile keeps following the admin's later reorders.

Validation

  • Maintainer review: merged main, then ran HomeSectionsEditorModelTests, ProfileHomeLayoutTests and ProfileSectionsAPITests on an iOS simulator at 2538c48 (22 passed). The two new tests for a save whose reply is lost and an editor reopened during a save fail on 88965cc, before the fix. SiloTV and SiloMac build at 2538c48. The translations are pinned to the catalog pull request's translated commit until its release is out.
  • New unit tests cover building the saved layout (positions, renames, added and removed rows), the three API calls, and the editor: saving, refused saves, edits queued behind a save after the editor closes, and reloads that overlap edits.
  • Full SiloTests and SiloTVTests: the only failures are 4 tests that also fail on main (ArtworkURLTests, ImageSizeCapabilityTests, two PlaybackProtocolV3Tests watch party tests). SiloMac builds.
  • iPhone, iPad and Apple TV simulators against a sandbox server:
    • Reorder, hide and show all saved and were still there after relaunch.
    • Each profile kept its own order across profile switches.
    • Changes made on Android and the web showed in the editor.
    • A hide-only change on a fresh profile saved one override without a position, and that profile followed a later admin reorder.
    • Two quick edits followed by closing the editor saved both.
  • Apple TV with the remote only: rapid moves in every direction kept focus inside the sheet, and Back returned to the Home Sections button.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-apple/pr-878/

Risks

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.

AI Disclosure

  • Harness: Claude Code
  • Tool(s): Claude Code; OpenAI Codex CLI (review only)
  • Model(s): claude-opus-5-5; gpt-6.1-sol (review only)
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: two rounds of independent reviews by claude-opus-5-5 and gpt-6.1-sol for correctness, repository standards, and the feat(ios): switch library pages from a dock above the tab bar on iPhone #1137 criteria. Findings fixed: queued saves dropped when the editor closed, reloads overwriting newer edits (including an edit queued while a reload waited), hide-only changes pinning every row's position, a misleading variable name, and a tvOS focus handler that reclaimed focus on any empty focus. A reviewer's concern that tvOS focus could escape the sheet during fast swipes was checked on the simulator and did not happen. After the PR opened, bot review found that a refused save rolled back an edit queued behind it; that is fixed, and the follow-up was reviewed again by both models with no findings.

Note

Add profile-scoped Home section reordering and hiding synced to the server

  • Adds a Home sections editor on iOS (HomeSectionsCustomizationView) and tvOS (TVHomeSectionsCustomizationSheet), reachable from Interface settings and tvOS General Settings. Users can reorder rows, toggle visibility, and edits save as a full override set to the server via PUT (expects 204).
  • New API client methods in APIv2Client+ProfileSections.swift fetch section settings and overrides with scope=home, refuse empty or duplicate row IDs, and fence requests to the captured profile owner.
  • ProfileHomeLayout.swift builds the replacement override array: saved overrides keep their fields, positions save only when the page is ordered, and overrides for removed rows are retained.
  • The editor model in HomeSectionsEditorModel.swift serializes saves, drops reads made stale by edits, and shows save errors with restore of the saved order.
  • Adds localized strings for the editor and extensive tests for the model, layout builder, and API client.
  • Behavioral Change: saves replace the entire Home override set for the profile (replaceProfileHomeSectionOverrides); old home.recipe.* localization entries are removed from Localizable.xcstrings.

Macroscope summarized 2538c48.

Bring back a Home Sections editor in Settings > Interface (iPhone, iPad,
Mac) and Settings > General (Apple TV). Unlike the device-local editor
removed in Silo-Server#739, it reads and writes the profile's own layout through
/api/v2/profile/sections, the same layout the web app and the admin's
per-profile Home sections card edit, so the order and visibility follow
the profile to every device. Home still renders /api/v2/home/sections in
server order and refreshes after each save.

A save replaces the profile's whole override set, so it keeps every saved
rename, added row and removed row and changes only position and
visibility. A refused save shows the error and puts the last saved order
back.
… never drop a queued edit

A show/hide no longer pins every Home row's position. Like the web editor,
the Apple editors write positions only once the profile has ordered the
page (this change reorders rows, or a saved override already holds a
position); until then a hide stores only that row's visibility, so the
profile keeps following the admin's later reorders.

Queued saves keep the editor's model alive, so closing the editor while
an earlier save is in flight no longer loses the later edit. A reload
waits for pending saves and drops its result when an edit lands while it
reads, so the screen never falls back to an older layout.

On Apple TV, the Home Sections sheet restores focus only when the focused
control itself went away, instead of reclaiming it whenever focus is nil.
@silo-kody

silo-kody Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

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

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

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

This change adds profile-scoped Home section layout reads and saves, override generation, and an editor model. It also adds iOS and tvOS settings interfaces for changing Home row order and visibility.

Changes: Home sections customization

Layer / File(s) Summary
Profile-scoped Home layout API
iosApp/iosApp/Networking/APIv2/APIv2ProfileSectionModels.swift, iosApp/iosApp/Networking/APIv2/APIv2Client+ProfileSections.swift, iosApp/iosApp/Networking/APIv2/APIv2Client.swift, iosApp/iosApp/Networking/SiloAPI.swift, iosApp/Tests/ProfileSectionsAPITests.swift
Adds models and API operations to read Home settings and overrides and replace the complete override set. Requests use captured profile ownership. Tests cover request scope, decoding, ownership checks, and response handling.
Build saved overrides
iosApp/iosApp/Screens/Home/ProfileHomeLayout.swift, iosApp/Tests/ProfileHomeLayoutTests.swift
Builds overrides from current rows and saved data, including order, visibility, generated IDs, and retained entries. Tests cover override generation and encoding.
Queue edits and save layout
iosApp/iosApp/Screens/Home/HomeSectionsEditorModel.swift, iosApp/Tests/HomeSectionsEditorModelTests.swift
Adds editor loading, queued edits and saves, reload handling, error recovery, and Home refresh after successful saves. Tests cover save ordering, overlapping reloads, failures, and model lifetime.
Add iOS and tvOS settings editors
iosApp/iosApp/Screens/Settings/InterfaceCustomizationView.swift, iosApp/iosApp/Screens/Settings/HomeSectionsCustomizationView.swift, iosApp/iosApp/tvOS/Screens/Settings/TVGeneralSettingsView.swift, iosApp/iosApp/tvOS/Screens/Settings/TVSettingsView.swift
Adds Home section settings entry points and editors. Both interfaces show layout states and provide controls to reorder rows and change visibility.

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant SettingsView
  participant HomeSectionsEditorModel
  participant SiloAPI
  participant APIv2Client
  participant HomeSectionsAPI
  SettingsView->>HomeSectionsEditorModel: Load layout
  HomeSectionsEditorModel->>SiloAPI: Read profile Home layout
  SiloAPI->>APIv2Client: Fetch settings and overrides
  APIv2Client->>HomeSectionsAPI: GET Home settings and sections
  HomeSectionsAPI-->>APIv2Client: Return layout items
  APIv2Client-->>SiloAPI: Return decoded layout
  SiloAPI-->>HomeSectionsEditorModel: Return layout and captured owner
  SettingsView->>HomeSectionsEditorModel: Change row order or visibility
  HomeSectionsEditorModel->>SiloAPI: Save complete override set
  SiloAPI->>APIv2Client: Replace profile overrides
  APIv2Client->>HomeSectionsAPI: PUT complete override set
  HomeSectionsAPI-->>APIv2Client: Return HTTP 204
  HomeSectionsEditorModel-->>SettingsView: Update saved state and refresh Home
Loading

Suggested reviewers: quick104

Merge Risk: Moderate · up to 665b9

If a save is refused while another edit is pending, the newer edit can disappear without being saved. Fix this before merging.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: adding server-backed reordering and hiding of Home rows for each profile.
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.
Description check Passed The description is specific and on-topic. It explains the Home Sections editor on iPhone, iPad, Mac and Apple TV, the server endpoints used for reads and saves, the save queue behaviour, and the valid…
Full details: Description check

Explanation

The description is specific and on-topic. It explains the Home Sections editor on iPhone, iPad, Mac and Apple TV, the server endpoints used for reads and saves, the save queue behaviour, and the validation performed. It matches the changeset as summarized, so it is not generic or off-topic.

Finishing Touches

🧪 Generate unit tests (beta)

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

⚙️ Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f67b7b81-390d-433a-a2b9-106628544c26
📥 Commits

Reviewing files that changed from the base of the PR and between 755a101 and 665b90a.

📒 Files selected for processing: 13

  • iosApp/Tests/HomeSectionsEditorModelTests.swift
  • iosApp/Tests/ProfileHomeLayoutTests.swift
  • iosApp/Tests/ProfileSectionsAPITests.swift
  • iosApp/iosApp/Networking/APIv2/APIv2Client+ProfileSections.swift
  • iosApp/iosApp/Networking/APIv2/APIv2Client.swift
  • iosApp/iosApp/Networking/APIv2/APIv2ProfileSectionModels.swift
  • iosApp/iosApp/Networking/SiloAPI.swift
  • iosApp/iosApp/Screens/Home/HomeSectionsEditorModel.swift
  • iosApp/iosApp/Screens/Home/ProfileHomeLayout.swift
  • iosApp/iosApp/Screens/Settings/HomeSectionsCustomizationView.swift
  • iosApp/iosApp/Screens/Settings/InterfaceCustomizationView.swift
  • iosApp/iosApp/tvOS/Screens/Settings/TVGeneralSettingsView.swift
  • iosApp/iosApp/tvOS/Screens/Settings/TVSettingsView.swift

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

@silo-triage silo-triage Bot added the size/XXL 1000–2999 added + deleted lines (all files); change volume, not priority. label Oct 22, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 22, 2026

Copy link
Copy Markdown

Evidence is incomplete:

  • The Home Sections settings/editor UI (InterfaceCustomizationView.swift, HomeSectionsCustomizationView.swift, and TVGeneralSettingsView.swift) reaches iPhone, iPhone Duo folded and open, iPad, Mac, and Apple TV. The evidence note names iPhone, iPad, and Apple TV; add before/after screenshots for both Duo states and Mac. The note says Mac was compile-checked only, but this UI is compiled for macOS.
  • Home row visibility and order (HomeSectionsEditorModel.swift and ProfileHomeLayout.swift) change on those same devices. The evidence note mentions Home in the new order but does not identify before/after captures of the same Home screen with the same data; include those pairs for each affected device.
  • The Apple TV editor changes focus and is a multi-step flow. Add a short recording showing the editor flow, row movement/focus behavior, and closing back to Settings.

The linked evidence page should cover iPhone, iPhone Duo folded and open, iPad, Mac, and Apple TV.

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

Posted via Macroscope — Visible change evidence

@silo-triage silo-triage Bot added enhancement New feature or request evidence-required Needs before-and-after evidence before the Evidence check passes priority: P2 Limited scope, workaround exists, or polish labels Oct 22, 2026
confirmedRows = sent
Self.refreshHome()
} catch {
rows = confirmedRows

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Kody Rules high

Edit loss occurs when a newer edit updates rows and queues another save while this request is suspended: unconditionally restoring confirmedRows removes the unsettled edit from the display and causes its queued save to return because rows equals confirmedRows. Roll back only if the displayed rows still match this failed request; otherwise, retain the newer queued state so its save can run.

Kody rule violation: Project every unsettled settings operation into the displayed state

if rows == sent {
    rows = confirmedRows
}
Prompt for LLM

File iosApp/iosApp/Screens/Home/HomeSectionsEditorModel.swift:

Line 137:

Edit loss occurs when a newer edit updates `rows` and queues another save while this request is suspended: unconditionally restoring `confirmedRows` removes the unsettled edit from the display and causes its queued save to return because `rows` equals `confirmedRows`. Roll back only if the displayed rows still match this failed request; otherwise, retain the newer queued state so its save can run.

Suggested Code:

            if rows == sent {
                rows = confirmedRows
            }

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 9446a29, the same change as the comment above. It uses the edit generation rather than comparing rows, so an edit that returns the rows to the sent list still counts as newer.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this in 9446a29e. Using the edit generation is stronger than comparing rows == sent: newer edits can return the rows to the same values, but they must still prevent the failed request from rolling back that newer state.

The generation guard addresses that edge case while preserving the queued save.

…ng it back

A refused save put the last confirmed rows back even when a later edit was queued, so that edit's save found nothing to send and the change was lost. The rollback now happens only when no edit came after the refused save; otherwise the queued save sends the newer rows, refused change included. A successful save clears the error.
@silo-kody

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

On the evidence coverage note:

  • iPhone Duo (folded and open): not available on the test host. Settings > Interface and the editor use the same SwiftUI views as iPhone and iPad, so the iPhone and iPad captures cover both layouts.
  • Mac: the Settings view is the same one iPad uses. SiloMac builds with this change, but it wasn't run against the sandbox, so there are no Mac captures. A validator's run on a Mac should cover it.
  • Home before and after: Home still renders /api/v2/home/sections in server order. What changes is that the profile can now change that order from the device. On main the same profile's Home shows the same rows in the same order, so there is no Home difference to capture for a given server state.
  • Apple TV recording: the editor in edit mode is captured with focus on a Move Down button. I don't have a recording of the focus flow. The steps the validation task checks (focus starts on Done, follows a moved row, Back returns to the Home Sections button) were walked with the remote only and are described in the PR body.

@Rhainland

Copy link
Copy Markdown
Contributor Author

@Quick104, heads-up since this touches your #739. #739 removed the Home Sections editors because their choices stayed on the device. This PR brings an editor back on iPhone, iPad, Mac and Apple TV, but it reads and saves the profile's layout on the server (/api/v2/profile/sections), the same layout the web app and the admin's Home sections card use. Nothing is stored locally, and Home still renders /api/v2/home/sections in server order, as #739 left it.

The reason is the curated home sections criterion that each profile can reorder its own rows (Silo-Server/silo-server#1137 AC3), which the iOS and tvOS validation tasks (#305 C2, #306 C2) check on the device. If you'd rather this went another way, say so here.

main removed the Primary Menu and Top Menu editors from these settings
screens and moved Apple text to the translation catalog, so only the
Home Sections entries survive the conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Quick104 and others added 3 commits November 24, 2026 03:50
main now reads all Apple text from silo-translations. The editor's text
uses the home.profileEditor keys from Silo-Server/silo-translations#165,
synced with --local until that release is out. Row names show in the
app language through title_key, as Home shows them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e queue

A save whose reply is lost may still have been stored, so a failed save
with no newer change queued now reads the layout back instead of putting
the cached rows back. When a newer change is queued, that save sends its
rows even if they match the last confirmed layout.

Every editor now shares one save queue, so an editor opened while a
closed one's save is in flight reads the layout after that save lands.

Also: a cancelled reload no longer leaves the editor on a spinner, the
unused isSaving flag is gone, the delayed tvOS focus move checks its
target still exists, and Try Again on Apple TV sits in a full-width
focus section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…'s profile only

The server sets positions and customized once it stores a change, so a
save whose reply was lost compared unequal on whole rows and still showed
as failed. Compare row order and hidden flags instead. Skip the read-back
after a profile switch, which would have loaded another profile's layout
into this editor. Show the save error on Apple TV with the warning footer
the other settings panes use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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

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

Maintainer review of 9446a29. The server-backed editor is the right shape, and the override builder and wire models hold up against the server's write schema. The findings below are on the save path and the tvOS sheet. I'm fixing every one of them in commits on this branch, so there's no need to change anything yourself.

One more finding has no diff line: main now reads all Apple interface text from the translation catalog, and merging it conflicts in three files. I'm merging main and moving the editor's text to new home.profileEditor.* keys (Silo-Server/silo-translations#165). Row names will also show in the app language through title_key, as Home shows them.

The open product questions (the "Shown on Home" line on rows that are empty, Home when a profile hides every row, and the direction after #739) are for the maintainers and go in the summary comment.

Task { await model.load() }
}
.buttonStyle(TVHomeSectionsControlButtonStyle())
.focused($focusedControl, equals: .retry)

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.

Low: Try Again may be hard to reach with the remote. After a failed first load, focus starts on Done at the trailing edge, and Try Again sits below at the leading edge, outside any focus section. The focus engine may not move down to it.

Repair: put Try Again in a full-width focus section. I'm fixing this in a commit on this branch, so there's no need to change it yourself. I haven't confirmed it on a device yet.

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.

Changed in f693cb9: Try Again is now full width inside its own focus section. SiloTV builds, but I haven't confirmed the remote reaches it on a simulator or device, so I'm leaving this thread open until someone does.

@silo-triage silo-triage Bot added size/XXXL 3000+ 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 24, 2026
@silo-kody

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

@macroscopeapp

macroscopeapp Bot commented Nov 24, 2026

Copy link
Copy Markdown

The current head adds visible localized row names/editor copy and changes the Apple TV save-failure presentation to a warning (APIv2ProfileSectionModels.swift, TVGeneralSettingsView.swift). The evidence note describes the editor generally but does not identify captures of these current-head details. Please ensure the linked evidence includes the localized editor on iPhone, iPhone Duo folded and open, iPad, Mac, and Apple TV, plus the Apple TV save-warning state.

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

Posted via Macroscope — Visible change evidence

Quick104 and others added 2 commits November 24, 2026 04:08
…me on any change

The read-back checked the owner and then read for whoever was acting, so
a profile switch in between could load another profile's layout into the
editor. It now reads for the failed save's captured owner, which the
client refuses once that owner is no longer acting. Home also refreshes
whenever the read-back layout differs from what it last had, including
when the server holds an earlier save rather than the one that failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…anslations

Synced with --local from Silo-Server/silo-translations#165 after its
translation pass. Re-pin to the release it publishes before merging.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@silo-kody

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

// rather than loading someone else's layout.
let layout: APIv2ProfileHomeLayoutRead?
if let auth {
layout = try? await api.profileHomeLayout(owner: auth)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Kody Rules high

Read-back can publish a layout after its owner changes

A response can be published after the active profile changes, even when the request uses the captured owner. Recheck that auth is still the active owner after api.profileHomeLayout returns and before adopting the result or refreshing Home.

Kody rule violation: Fence asynchronous results by scope and invalidation generation

Prompt for LLM
File iosApp/iosApp/Screens/Home/HomeSectionsEditorModel.swift, line 180:

Read-back can publish a layout after its owner changes

Recheck that `auth` is still the active owner after the read suspends and before adopting its result or refreshing Home. Passing the captured owner into the request does not by itself prevent a response from being published after the profile changes.

Kody rule violation: [Fence asynchronous results by scope and invalidation generation](https://kodus.siloserver.org/settings/code-review/1247142423/kody-rules/ce041253-02ac-48cb-9576-81de9b2f41ef?teamId=ba9922fc-c0ea-4cf8-87bb-9d4f42ffc73e)

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

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.

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

Not changing this. The recheck is already there: SiloAPI.profileHomeLayout(owner:) calls requireCurrentOwner(auth) after both reads return and before it hands back the layout, so a read whose owner changed while it was in flight throws, and readBack puts the confirmed rows back. Each request also refuses to start once the session acts as someone else and runs inside the owner fence, which discards a response whose owner changed. The read-back and the adopt both run on the main actor with no suspension between the owner check returning and adopt.

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.

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

Correction to my last sentence: returning from the SiloAPI actor to the main actor is itself a hop, so a switch could still land between the owner check and adopt. That window is the same one every other owner-checked read in the app has, including this editor's own load(). If it happens, the editor shows the old profile's layout and its next save is refused by the request layer's owner check, so nothing is written to the wrong profile.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The correction supports the original finding. If the profile can change between the API’s owner check and the main-actor code adopting the result, the request-layer fence prevents a wrong-profile write, but it does not prevent stale profile data from being displayed or Home from being refreshed after a profile switch.

The fact that other reads may have the same window does not make this one safe. I would keep the suggestion and check ownership on the main actor immediately before publishing the read-back result or refreshing Home, with no suspension between that check and the publication. The same concern may warrant a separate review of load() and the successful-save path.

I couldn’t verify the full implementation: the PR file-content lookup did not return the file. The assessment is therefore based on the supplied diff and discussion. A regression test should switch profiles after the API’s owner check but before the result is adopted, then assert that the old layout is not published and Home is not refreshed for it.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing check narrows the race, but I don’t think it closes it.

SiloAPI is an actor separate from HomeSectionsEditorModel’s main actor. After profileHomeLayout(owner:) checks requireCurrentOwner(auth) and returns, the suspended caller must resume on the main actor. A profile switch could happen between that check and the caller’s resumption. The fact that readBack has no suspension after it resumes does not eliminate that gap.

So I would keep the concern, though I’d refine the proposed fix: an additional asynchronous owner check could have the same gap. The publication needs to be fenced against the profile-switch invalidation at the point of adoption—for example, with a generation checked synchronously on the same actor that processes profile changes.

The diff confirms the separate actor boundary and the final check in SiloAPI; it does not, by itself, establish how profile changes are synchronized. That synchronization would determine the appropriate fix.

// rather than loading someone else's layout.
let layout: APIv2ProfileHomeLayoutRead?
if let auth {
layout = try? await api.profileHomeLayout(owner: auth)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Kody Rules high

Failed post-save read-back leaves editing authorized

A failed read-back becomes nil while phase remains .loaded, allowing apply to write an unconfirmed layout. Keep the confirmed rows if needed, but revoke edit authorization until an authoritative read for the same identity succeeds.

Kody rule violation: Authorize settings edits from identity-specific support and authoritative reads

Prompt for LLM
File iosApp/iosApp/Screens/Home/HomeSectionsEditorModel.swift, line 180:

Failed post-save read-back leaves editing authorized

If this post-save read-back fails, keep the displayed confirmed rows if needed but revoke edit authorization until an authoritative read for the same identity succeeds. Currently the failure becomes `nil`, `phase` remains `.loaded`, and `apply` permits another write using an unconfirmed layout.

Kody rule violation: [Authorize settings edits from identity\-specific support and authoritative reads](https://kodus.siloserver.org/settings/code-review/1247142423/kody-rules/5e6d4aa8-1709-4ec0-b32f-f33c54df0071?teamId=ba9922fc-c0ea-4cf8-87bb-9d4f42ffc73e)

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

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.

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

Not changing this. After a failed save and a failed read-back, the editor shows the last confirmed rows and the error, and it marks the server state as uncertain. The next edit then sends the whole layout as it is on screen, so the server ends up with exactly what the user sees, whatever the failed save did. That's the same reasoning as the earlier thread on a failed reload: locking edits would leave the editor worse off without protecting anything. A profile switch is the case that needs a refusal, and the request layer already refuses a save whose owner is no longer acting.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would keep the finding, though I’d frame the risk as overwriting unconfirmed server state, rather than as a profile-identity issue.

If a reorder reaches the server but its response is lost, and the read-back also fails, the editor restores the last confirmed rows. A subsequent hide-only edit builds a replacement override set from those rows and the old saved overrides. It can therefore erase the reorder that actually landed. It could also overwrite changes made by another editor in the meantime. The replacement is built from the last confirmed overrides, not a fresh server read (ProfileHomeLayout.swift:26–66).

serverMayDiffer ensures that the next edit is sent; it doesn’t establish what the server holds (HomeSectionsEditorModel.swift:144–149, 184–188). Likewise, the owner check prevents writing to the wrong profile, but it doesn’t prevent a stale replacement for the right profile.

I agree that keeping the confirmed rows visible is useful. But because the failed save’s outcome is unknown, I’d disable further saves until a same-owner read succeeds, with a clear retry action. If continued editing is preferred, the client needs a reconciliation or conflict strategy before replacing the server’s override set.

Home may already have read an earlier save whose reply was lost, so a
stored save that puts the last confirmed layout back still refreshes it.
The read-back now takes the failed save's owner as a parameter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@silo-kody

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

Copy link
Copy Markdown
Contributor

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

Maintainer review summary

Reviewed head: 2538c48

Fit: 8/10 · Readiness: 5/10 — not ready (assuming CI is green)

A Home editor that saves to the profile on the server, rather than the device, is the right shape. The order and visibility then follow the profile everywhere, and the admin's Home sections card shows them, which is what the curated home sections criterion (Silo-Server/silo-server#1137 AC3) and the Apple validation cases ask for. Fit stays at 8 because this brings back an editor that #739 removed, and the maintainers still have to confirm that direction. Readiness is held down by the same open problem as the Android pair: the editor says "Shown on Home" for rows that aren't on Home. The captures on the evidence page also predate the main merge.

What I changed on the branch

  • Merged main (965c48d). main removed the Primary Menu and Top Menu editors from these settings screens, so only the Home Sections entries survive the three conflicts.
  • Moved the editor's text to the catalog (88965cc). main now reads all Apple text from silo-translations, so the editor uses new home.profileEditor.* keys from feat(catalog): add the Apple Home Sections editor text for a layout saved to the profile silo-translations#165. That pull request has its translations and has to merge first. This branch is pinned to that pull request's translated commit (synced in c5eb19d) until then and needs a re-pin to the release it publishes. The sync also brings in catalog changes merged since main's last pin, which any re-pin would bring too. Row names now show in the app language through title_key, as on Home.
  • A failed save reads the layout back (f693cb9, 3d26065, 7a83f2b, 2538c48) instead of putting the cached rows back, so a save the server stored before its reply was lost stays on screen and Home refreshes. The check compares row order and visibility, since the server rewrites positions once it stores a change. The read uses the failed save's own profile, so after a profile switch it's refused instead of loading someone else's layout.
  • One save queue for every editor (f693cb9), so an editor reopened during a save reads the layout after that save lands.
  • Smaller fixes (f693cb9, 3d26065): an undo during a failed save still reaches the server; a cancelled reload no longer leaves a spinner; the unused isSaving is gone; the delayed tvOS focus move checks its target; Try Again on Apple TV is in a full-width focus section; and the Apple TV save error uses the warning footer.

Left for the maintainers

  1. "Shown on Home" on rows that are empty. The editor lists every Home row of the profile, including rows with no titles, which Home leaves out. The Apple TV status line, the VoiceOver value on iPhone, iPad and Mac, and the footers all say such a row is shown on Home. fix(home): save Home row order and visibility to the profile on the server silo-android#664 has the same open question; any wording change goes through silo-translations#165 and feat(player): bound budget-parked origin streams with detach and ranged resume #100.
  2. Every row hidden. When a profile hides every row, Home shows "Nothing to watch yet" and tells the viewer to add media, which is wrong for a profile that has hidden its rows. Hiding is now saved per profile, so this can also come from another device or the admin's card. Keep it, or point to Home Sections from the empty state, matching whatever Android does.
  3. Direction. refactor(home): remove app-side Home section hiding and reordering #739 removed the Apple editors because their choices stayed on the device. This pull request and silo-android#664 instead bring server-backed editors to both apps. The two should land together. Confirm this is the direction you want.
  4. Two editors at once. If another device, another window, or the admin's card changes the layout while an editor is open, that editor's next save writes back its own view of the whole layout. The web editor works the same way. The real fix is a revision check on PUT /api/v2/profile/sections on the server, outside this pull request.
  5. A save that fails after the editor closed reports nowhere, since the editor that would show the error is gone.
  6. A pre-existing server problem makes a bad read possible. GET /api/v2/profile/sections/settings ignores a failure to read the profile's saved overrides and answers 200 with the administrator's layout. If that happens while the editor's second read succeeds, the editor shows the admin layout, and its next save writes that back over the profile's hidden rows and order. The web editor has the same exposure. The fix belongs in silo-server, outside this pull request.
  7. Evidence. The captures on the evidence page were taken before the main merge, so Settings > Interface in them still shows the Primary Menu that main removed. They need retaking at this head, with a remote-only check that Try Again on Apple TV is reachable after a failed load.

Verification

  • Tests: HomeSectionsEditorModelTests, ProfileHomeLayoutTests and ProfileSectionsAPITests pass on an iOS simulator at 2538c48 (22 tests). The two new tests, for a lost reply after a stored save and for an editor reopened during a save, fail on 88965cc, before the fix. SiloTV and SiloMac build at 2538c48. I did not run the editor live against a server.
  • Validated features: I checked the v1.0 board. No passed case changes. Apple TV settings focus (Device & override auditing — tvOS #335 C3) gains one focusable row in Settings > General, which a tester may want to look at. Validation tasks: unblocks #305 C2; unblocks #306 C2, C5 is right.
  • User manual: docs: cover reordering and hiding Home rows in the Apple and Android apps siloserver.org#279 already covers this change and waits for this pull request and silo-android#664.
  • Other apps: Android is silo-android#664 (open). Roku and the web need nothing; the web already has this editor.

Council

Round Head Sol Opus Gemini
Code 1 9446a29 6/10 7/10 7/10
Code 2 3d26065 7/10 7/10 8.5/10
Code 3 c5eb19d 8/10 9/10 9.5/10
Code 4 2538c48 9/10 9/10 9.5/10

All three members found the lost-reply and reopened-editor problems in round 1. Rounds 2 and 3 found a gap in the read-back after a profile switch and two cases where Home missed a refresh; all are fixed above, and round 4 found nothing new. Rounds 2 and 3 also flagged the local translation pin, which needs the release re-pin described above.

@Quick104

Copy link
Copy Markdown
Contributor

superseded by #1266

@Quick104 Quick104 closed this Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request evidence-required Needs before-and-after evidence before the Evidence check passes 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.

2 participants