Repository navigation
Conversation
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.
…or fail by timing
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
Evidence is incomplete:
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 |
| confirmedRows = sent | ||
| Self.refreshHome() | ||
| } catch { | ||
| rows = confirmedRows |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
On the evidence coverage note:
|
|
@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 ( 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>
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
left a comment
There was a problem hiding this comment.
🤖 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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
The current head adds visible localized row names/editor copy and changes the Apple TV save-failure presentation to a warning ( Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
…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 — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
| // rather than loading someone else's layout. | ||
| let layout: APIv2ProfileHomeLayoutRead? | ||
| if let auth { | ||
| layout = try? await api.profileHomeLayout(owner: auth) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
🤖 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.
There was a problem hiding this comment.
🤖 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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
🤖 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.
There was a problem hiding this comment.
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 — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
🤖 Claude Code (claude-opus-5-5) Maintainer review summaryReviewed 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 What I changed on the branch
Left for the maintainers
Verification
Council
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. |
|
superseded by #1266 |
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/sectionsin server order; nothing is stored on the device.Approach
GET /api/v2/profile/sectionsandPUT /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.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 throughtitle_key, as on Home.Validation
main, then ranHomeSectionsEditorModelTests,ProfileHomeLayoutTestsandProfileSectionsAPITestson 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.ArtworkURLTests,ImageSizeCapabilityTests, twoPlaybackProtocolV3Testswatch party tests). SiloMac builds.Evidence
Evidence: https://evidence.siloserver.org/r/silo-apple/pr-878/
Risks
Checklist
AI Disclosure
Note
Add profile-scoped Home section reordering and hiding synced to the server
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 viaPUT(expects 204).scope=home, refuse empty or duplicate row IDs, and fence requests to the captured profile owner.replaceProfileHomeSectionOverrides); oldhome.recipe.*localization entries are removed from Localizable.xcstrings.Macroscope summarized 2538c48.