feat(settings): pull-to-refresh re-fetches the model list#21
Open
sypherin wants to merge 1 commit into
Open
Conversation
The installed-model list (Model Manager on the Settings tab) only re-fetched when the server or app mode changed, so models installed or removed outside the app (via the Lemonade server itself or another client) never showed up without an app restart. Wrap the Settings tab ListView in a RefreshIndicator that awaits the same fetchModels() the screen already relies on, matching the existing pull-to-refresh pattern in omni_router_screen / account_screen / admin_models_tab. AlwaysScrollableScrollPhysics so the pull works even when the content fits on screen.
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.
Problem
The installed-model list (Model Manager on the Settings tab, Local AI / Mesh modes)
only re-fetches from the server when the selected server or app mode changes —
ModelsNotifiersets upref.listenon those two providers and nothing elsere-triggers
fetchModels()on that screen. If you install or remove a modeloutside the app (via the Lemonade server itself,
lemonade-server pull, or anotherclient), the list goes stale and the only way to see the change is to switch
servers or kill and restart the app.
Fix
Wrap the Settings tab's
ListViewin aRefreshIndicatorwhoseonRefreshawaits
ref.read(modelsProvider.notifier).fetchModels()— the exact same fetchthe screen already uses — so the spinner dismisses when the re-fetch completes.
AlwaysScrollableScrollPhysicsis set so the pull gesture works even when thecontent fits on screen.
This mirrors the pattern the app already uses elsewhere
(
omni_router_screen.dart,account_screen.dart,admin_models_tab.dart):RefreshIndicator+ the screen's existing fetch.One file changed:
lib/screens/nexus/settings_tab.dart(+1 import, wrap theexisting
ListView).How verified
flutter analyze(Flutter 3.44.4 stable, afterdart run build_runner buildfor the gitignored Isar
*.g.dartfiles): no issues in the changed file;the 20 reported issues (infos/warnings in
models_provider.dart,voice_mode_provider.dart, etc.) are pre-existing onmain— verified bystashing the change and re-running analyze (same 20).
flutter build apk --release --target-platform android-arm64(and--split-per-abi) both build successfully; the arm64-v8a APK passesapksigner verify. Not yet exercised on a physical device — behavior belowis by code path.
refresh spinner,
fetchModels()re-hits the models endpoint on the selectedserver, and the Models/Collections sections rebuild from the updated provider
state (
ModelManagerwatchesmodelsProvider, so no other wiring wasneeded).
fetchModels()catches its own errors (stale list becomes empty onfailure, same as existing behavior everywhere else it's called), so the
indicator always completes.
Scope kept to the models screen only, per the gap being reported — other tabs
were left untouched.
lemonade-server pullof a new model → list refreshes and the new model appears.AI-assisted change, human-reviewed and verified on real hardware (Ryzen AI MAX 395 dev box + physical Android device) per the project's AI contribution policy.
🤖 Generated with Claude Code