Add Engine & Model parent and Apple Intelligence / Open Source sub-panes#365
Conversation
| Text(foundationModelAvailabilityService.userVisibleMessage) | ||
| .foregroundStyle(foundationModelAvailabilityService.isAvailable ? .green : .orange) | ||
| } | ||
| case .llamaOpenSource: |
There was a problem hiding this comment.
Missing text modifiers on availability label
The sibling AppleIntelligencePaneView applies .multilineTextAlignment(.trailing).fixedSize(horizontal: false, vertical: true) to the same userVisibleMessage text. Without those modifiers here, long unavailability strings (e.g. "Apple Intelligence requires macOS 26 or later. Use Open Source on this Mac.") can be truncated or misaligned in the parent overview pane — the first thing a user sees when switching engines.
| HStack(spacing: 8) { | ||
| let lmStudioURL = FileManager.default.homeDirectoryForCurrentUser | ||
| .appendingPathComponent(".lmstudio/models") | ||
| let lmStudioAvailable = FileManager.default.fileExists(atPath: lmStudioURL.path) | ||
| let isUsingCustomPath = BundledRuntimeLocator.customModelDirectoryURL() != nil | ||
| Button("Use LM Studio") { |
There was a problem hiding this comment.
Calling
FileManager.default.fileExists(atPath:) and BundledRuntimeLocator.customModelDirectoryURL() directly inside the view body means a synchronous filesystem syscall runs on the main thread on every SwiftUI re-render. Extracting these into computed properties (or @State populated in .onAppear/button actions) avoids the repeated I/O and makes the intent clearer.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Re-opened after base branch deletion. Rebased onto current main (includes tooltip removal #362), cotabbyHelp calls stripped. Build/lint clean locally.
Greptile Summary
This PR implements three new settings panes —
EngineAndModelPaneView(parent overview with the engine picker),AppleIntelligencePaneView(on-device availability + one-tap switch), andOpenSourcePaneView(local llama model management lifted verbatim from the legacy view) — and wires them intoSettingsContainerView, replacing the previousPlaceholderPaneViewfallback.EngineAndModelPaneViewowns the sole engine picker and shows a live status summary for whichever engine is selected; sub-panes are linked via sidebar rows.AppleIntelligencePaneViewshows theFoundationModelAvailabilityServicestate with a warning callout when the selected engine is unavailable.OpenSourcePaneViewlifts the full model-management UI (download catalog, Hugging Face browser, folder controls, installed-model list with delete confirmation) from the legacy settings view with no behavioral changes.Confidence Score: 4/5
Safe to merge; all new panes are additive UI-only changes with no new business logic or data mutations beyond what already existed in the legacy settings view.
The three new panes are straightforward view decompositions that wire correctly into the container. The only noteworthy gap is that EngineAndModelPaneView omits the .fixedSize and .multilineTextAlignment modifiers present in the sibling AppleIntelligencePaneView, which can cause unavailability messages to be truncated in the parent overview. Everything else — engine switching, model deletion flow, callout logic — is consistent and correct.
EngineAndModelPaneView.swift — the availability Text display could truncate on narrow windows; OpenSourcePaneView.swift — inline filesystem calls inside body are inherited from legacy code but worth cleaning up.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD SCV[SettingsContainerView] -->|selection == .engineAndModel| EMP[EngineAndModelPaneView] SCV -->|selection == .appleIntelligence| AIP[AppleIntelligencePaneView] SCV -->|selection == .openSource| OSP[OpenSourcePaneView] EMP -->|reads/writes| SS[SuggestionSettingsModel\n.selectedEngine] EMP -->|reads| FMAS[FoundationModelAvailabilityService\n.userVisibleMessage / .isAvailable] EMP -->|reads| RBM[RuntimeBootstrapModel\n.state.summary] EMP -->|.onAppear| FMAS AIP -->|reads| SS AIP -->|selectEngine .appleIntelligence| SS AIP -->|reads| FMAS AIP -->|.onAppear| FMAS OSP -->|reads| SS OSP -->|selectEngine .llamaOpenSource| SS OSP -->|reads/calls| RBM OSP -->|reads/calls| MDM[ModelDownloadManager] OSP -->|reads/calls| HFS[HuggingFaceSearchService]Reviews (1): Last reviewed commit: "Address Greptile feedback: align engine ..." | Re-trigger Greptile