Add refresh button to menu-bar Model row#224
Merged
Merged
Conversation
The Model picker only got rescanned through Settings or after an app relaunch, so users who dropped a GGUF into the Models folder had to leave the menu-bar surface to pick it up. Add an arrow.clockwise button beside the folder shortcut that triggers the same refresh path as the Settings "Refresh" action. Also truncate the picker label middle-style so two trailing icons fit without crowding longer model names like "Qwen3-0.6B-Q4_K_M.gguf".
NSPopUpButton ignores .lineLimit/.truncationMode on the selected-value label, so the previous per-item modifiers did not actually keep long filenames from pushing the trailing icons off-row. Drop the item-level modifiers and give the Picker .frame(maxWidth: .infinity) so the popup fills remaining row width and AppKit truncates the button label inside its own bounds.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an
arrow.clockwiserefresh button next to the folder shortcut inthe menu-bar Model row so users can rescan the Models folder without
opening Settings or relaunching. The picker label now truncates
middle-style so the second icon fits without crowding longer model names.
Validation
Did not run the UI end-to-end — change is a one-button wire-up using the
exact two-call refresh pattern already used by
SettingsView.refreshModels().Linked issues
None.
Risk / rollout notes
SettingsView(modelDownloadManager.refreshModelStates()+runtimeModel.refreshAvailableModels()), so behavior matches the existing path..lineLimit(1).truncationMode(.middle)so longer filenames (e.g.Qwen3-0.6B-Q4_K_M.gguf) truncate gracefully instead of pushing theicons off-row.
Greptile Summary
This PR adds a refresh button (
arrow.clockwise) alongside the existing folder shortcut in the menu-bar Model row, letting users rescan the local model directory without opening Settings. It also applies.frame(maxWidth: .infinity)to the Picker — the correct way to prevent long filenames from pushing trailing icons off-row on AppKit's native popup button — and includes a///comment explaining why per-item text modifiers are unreliable in this context.modelDownloadManager.refreshModelStates()+runtimeModel.refreshAvailableModels(), mirroring the exact two-call sequence already used bySettingsView.refreshModels()andWelcomeView..frame(maxWidth: .infinity)constrains thePickerto fill remaining row width, matching the approach endorsed in the code comment and consistent with the rest of the layout hierarchy inside the fixed-width (340 pt) menu panel.Confidence Score: 5/5
Safe to merge — the change is a one-button wire-up that delegates to two well-established synchronous refresh calls, with no new state or side-effect paths.
Both refreshModelStates() and refreshAvailableModels() are synchronous, @MainActor-confined, and called identically in SettingsView and WelcomeView. The .frame(maxWidth: .infinity) layout fix is correct and well-documented. No new async work, no new state, no error paths added.
No files require special attention.
Important Files Changed
Sequence Diagram
sequenceDiagram actor User participant MenuBarView participant ModelDownloadManager participant RuntimeBootstrapModel participant LlamaRuntimeManager User->>MenuBarView: Tap refresh button MenuBarView->>ModelDownloadManager: refreshModelStates() Note over ModelDownloadManager: Re-checks download tasks and file presence MenuBarView->>RuntimeBootstrapModel: refreshAvailableModels() RuntimeBootstrapModel->>LlamaRuntimeManager: refreshAvailableModels() Note over LlamaRuntimeManager: Re-scans runtime directories for GGUF files LlamaRuntimeManager-->>RuntimeBootstrapModel: availableModels updated RuntimeBootstrapModel-->>MenuBarView: ObservedObject triggers re-render MenuBarView-->>User: Picker shows updated model listReviews (2): Last reviewed commit: "Constrain model Picker frame instead of ..." | Re-trigger Greptile