fix(ui): match settings height to list mode + CI uses latest Xcode

UI fix (SDK-agnostic):
- SettingsView height 480 → 620 so the settings mode panel size matches
  list mode at maximum. Avoids MenuBarExtra's NSPanel not shrinking when
  switching between list and settings views.
- Drop the .id(showSettings) hack — it forced view rebuild but the panel
  is managed by AppKit and does not respond to SwiftUI view recreation.

CI hardening:
- Use maxim-lobanov/setup-xcode@v1 with latest-stable so the runner Xcode
  is as close to local (Xcode 26.5) as available, minimizing SwiftUI SDK
  behavior drift.
- Run xcodebuild test before building the DMG; release will fail-fast on
  test regressions instead of shipping broken binaries.

Root cause analysis of v1.3.4 regression:
Local Xcode 26.5 produced a 5.2MB binary linking to macOS 26 SwiftUI
symbols; GH macos-latest with default Xcode 16 produced a 5.0MB binary
linking to macOS 15 SwiftUI. The .id() hack happened to look correct in
the SDK 26 build but not in SDK 15 — same source, different runtime
behavior. The height:620 approach works in both.
This commit is contained in:
vgearen
2026-05-14 11:30:52 +08:00
parent bb00d4379f
commit d8904f4acb
4 changed files with 29 additions and 8 deletions
-1
View File
@@ -105,6 +105,5 @@ struct DropdownView: View {
.frame(width: 320)
.fixedSize(horizontal: false, vertical: true)
.background(Color(nsColor: .windowBackgroundColor))
.id(showSettings)
}
}
+3 -1
View File
@@ -258,7 +258,9 @@ struct SettingsView: View {
.padding(8)
}
.scrollIndicators(.never)
.frame(width: 284, height: 480)
// 高度与列表模式(ProfitSummary + stockListView maxHeight 520 + Toolbar 等)相当,
// 避免切换 list↔settings 时 NSPanel 大小不一致导致下方空白。
.frame(width: 284, height: 620)
}
// MARK: - 排序辅助