mac: Settings panes get fixed frames — General regrows after Updates (#379)
General → Updates → General left the window shrunk to Updates' height: the Settings window sizes itself per tab, and height-flexible panes don't reliably regrow it. Both panes now declare fixed frames at one width (General 420×400 — the grouped Form scrolls if it ever outgrows it; Updates 420×100, which also stops the window jumping widths, it was 360 wide before). Also renames the Updates pane UpdatesSettingsView — it was GeneralSettingsView, while the actual General pane is MacSettingsView.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3 files changed,
+14
−4
ios/LChatMac/LChatMacApp.swift+1 −1ios/LChatMac/MacSettingsView.swift+5 −1ios/LChatMac/UpdaterUI.swift+8 −2
diff --git a/ios/LChatMac/LChatMacApp.swift b/ios/LChatMac/LChatMacApp.swift| index 631176a..8bb1328 100644 |
| --- a/ios/LChatMac/LChatMacApp.swift |
| +++ b/ios/LChatMac/LChatMacApp.swift |
| @@ -88,7 +88,7 @@ struct LChatMacApp: App { |
| TabView { |
| MacSettingsView() |
| .tabItem { Label("General", systemImage: "gearshape") } |
| - GeneralSettingsView(updater: appDelegate.updaterController.updater) |
| + UpdatesSettingsView(updater: appDelegate.updaterController.updater) |
| .tabItem { Label("Updates", systemImage: "arrow.down.circle") } |
| } |
| .environmentObject(app) |
diff --git a/ios/LChatMac/MacSettingsView.swift b/ios/LChatMac/MacSettingsView.swift| index 17bd63f..d2efb14 100644 |
| --- a/ios/LChatMac/MacSettingsView.swift |
| +++ b/ios/LChatMac/MacSettingsView.swift |
| @@ -53,7 +53,11 @@ struct MacSettingsView: View { |
| } |
| } |
| .formStyle(.grouped) |
| - .frame(width: 420) |
| + // Fixed height (not just width): the Settings window sizes per tab, and |
| + // after visiting the short Updates pane a height-flexible pane stays |
| + // shrunk instead of regrowing. The grouped Form scrolls if it ever |
| + // outgrows this. |
| + .frame(width: 420, height: 400) |
| .onAppear { |
| selectedInstanceID = instance?.id |
| name = instance?.screenName ?? "" |
diff --git a/ios/LChatMac/UpdaterUI.swift b/ios/LChatMac/UpdaterUI.swift| index 647b519..8cbd033 100644 |
| --- a/ios/LChatMac/UpdaterUI.swift |
| +++ b/ios/LChatMac/UpdaterUI.swift |
| @@ -31,7 +31,9 @@ struct CheckForUpdatesView: View { |
| // updates (rather than separate "check" and "download" toggles) — "Check for |
| // Updates…" in the app menu always works for a manual kick-off regardless of |
| // this setting. |
| -struct GeneralSettingsView: View { |
| +// The Updates pane of Settings. (Formerly misnamed GeneralSettingsView — the |
| +// General pane is MacSettingsView.) |
| +struct UpdatesSettingsView: View { |
| let updater: SPUUpdater |
| @State private var automaticUpdates: Bool |
| @@ -52,6 +54,10 @@ struct GeneralSettingsView: View { |
| } |
| } |
| .padding(20) |
| - .frame(width: 360) |
| + // A FIXED frame, matching the General pane's width: SwiftUI's Settings |
| + // window sizes itself per tab, and a content-sized pane doesn't reliably |
| + // regrow the window when you switch back to a taller tab — explicit |
| + // heights make every switch land on the right size. |
| + .frame(width: 420, height: 100) |
| } |
| } |