From 95e13aa60a7f9bca681bc0ef114ca589def73999 Mon Sep 17 00:00:00 2001 From: J1coding Date: Wed, 5 Aug 2026 16:55:32 +0200 Subject: [PATCH] iOS: shorten the longest comment blocks in the settings code Cuts the fifteen line block on Setting, the eight line one on NumberSetting and the seven line one in NumberRow's accessory column down to the two or three lines each of them needed. No code changes. --- .../app/src/main/swift/Models/Setting.swift | 19 +++++-------------- .../src/main/swift/Models/SettingsStore.swift | 12 +++++------- .../main/swift/Views/Settings/NumberRow.swift | 10 +++------- 3 files changed, 13 insertions(+), 28 deletions(-) diff --git a/platforms/ios/app/src/main/swift/Models/Setting.swift b/platforms/ios/app/src/main/swift/Models/Setting.swift index 44d9a7bfac..fb2aaaa5cc 100644 --- a/platforms/ios/app/src/main/swift/Models/Setting.swift +++ b/platforms/ios/app/src/main/swift/Models/Setting.swift @@ -3,21 +3,12 @@ import Foundation -/// One INI-backed setting. The @Observable macro owns the stored property; -/// `didSet` hands the value to `commit`. +/// One INI-backed setting. The @Observable macro owns the stored property, `didSet` +/// hands the value to `commit`, and every `EmuCore/GS` key nudges the running VM +/// after it is written unless it is boot only. /// -/// `suppressible` catches nothing today, and is still worth keeping. init()'s -/// own assignments do not run their observers, so a launch reaches `commit` -/// zero times either way. That is measured, with a control in the same run, -/// not read off the language reference. Leave the flag alone rather than tidy -/// it away: it is what would catch a setting assigned from a helper `init()` -/// calls, where the observers do fire, and it costs one `&&`. -/// -/// Every `EmuCore/GS` setting nudges the running VM after it is written. That -/// used to be an opt-in closure, which is how the sprite hacks, the user hacks -/// and the OSD flags ended up writing the INI and never reaching the running -/// VM: a new setting inherited whatever the one above it happened to declare. -/// Boot-only keys opt out. +/// `suppressible` catches nothing today. Keep it: it would catch a setting assigned +/// from a helper `init()` calls, where the observers do fire, and it costs one `&&`. struct Setting { let section: String let key: String diff --git a/platforms/ios/app/src/main/swift/Models/SettingsStore.swift b/platforms/ios/app/src/main/swift/Models/SettingsStore.swift index 569c1e421c..489ed85a0a 100644 --- a/platforms/ios/app/src/main/swift/Models/SettingsStore.swift +++ b/platforms/ios/app/src/main/swift/Models/SettingsStore.swift @@ -98,14 +98,12 @@ enum StickSide: String, CaseIterable, Identifiable { var id: String { rawValue } } -/// Every numeric setting a screen can show, described once, next to the ranges below that most of -/// them are built from. A call site names the setting and hands over its binding; it has nothing -/// left to spell differently, which is how the FPS target ended up with two sets of bounds, the -/// queue size and the sharpness with two names each, and the four shade boost rows with two more. +/// Every numeric setting a screen can show, described once next to the ranges below. A +/// call site names the setting and hands over its binding, so there is nothing left for +/// it to spell differently. /// -/// Stops sit where the useful values are rather than spread evenly over the range — a linear track -/// put 15 ms at five percent of its width and 60 fps at forty-three — and every list contains the -/// default, so the reset arrow always lands on one. Typing still reaches anything in between. +/// Stops sit where the useful values are rather than spread evenly, and every list holds +/// the default so the reset arrow lands on one. Typing reaches anything in between. @MainActor extension NumberSetting { static let targetFPS = NumberSetting( diff --git a/platforms/ios/app/src/main/swift/Views/Settings/NumberRow.swift b/platforms/ios/app/src/main/swift/Views/Settings/NumberRow.swift index eca4d84395..a60f0c549f 100644 --- a/platforms/ios/app/src/main/swift/Views/Settings/NumberRow.swift +++ b/platforms/ios/app/src/main/swift/Views/Settings/NumberRow.swift @@ -497,13 +497,9 @@ struct NumberRow: View { HStack(spacing: rowStyle.horizontalSpacing) { label Spacer(minLength: rowStyle.horizontalSpacing) - // Inboard of the number on purpose. The number is then the last thing in every row: the - // same column as a hand-written value row, and the same column as the track's own upper - // bound directly underneath, which it used to sit thirty-six points inside of. - // - // Still kept in the layout when hidden, because the reset arrow appears and disappears - // as you drag past the default and the value must not jump when it does. Here that - // costs nothing, since the reserved space falls inside the gap. + // Inboard of the number, so the number stays the last thing in every row and lines + // up with the track's upper bound underneath. Kept in the layout when hidden, or the + // value jumps as the reset arrow comes and goes while you drag past the default. if let accessory { accessoryButton(accessory) .opacity(accessory.isVisible ? 1 : 0)