feat: offline mode detection with local asset cache#117
Merged
Conversation
Implement a disk-based cache for board images and vendor logos with
ETag-based conditional refresh. Assets are served cache-first with
background staleness checks after 24 hours.
- Store assets under {cache_dir}/assets/boards/ and vendors/
- Track ETags, Last-Modified, and URLs in meta.json
- Atomic metadata updates with mutex-protected read-modify-write
- Background pre-population of all assets on app startup
- Serve cached images as base64 data URIs for cross-platform support
- Semaphore-limited concurrency (5 parallel downloads)
- Path traversal protection on asset keys
Add check_connectivity Tauri command that performs a HEAD request to the Armbian API with a 5-second timeout. Uses a static shared HTTP client to avoid rebuilding on each 30-second poll cycle.
Save the armbian-images.json API response to disk after each successful fetch. When the API is unreachable, fall back to the cached copy. Uses atomic temp-file-plus-rename writes to prevent partial reads from concurrent access.
Add get_cached_board_image and get_cached_vendor_logo Tauri commands that serve cached assets as base64 data URIs. Register all new commands and spawn background asset refresh on app startup. Remove unused get_board_image_url command (replaced by cache-first approach).
Add useConnectivity hook that polls the backend every 30 seconds to detect online/offline state. Add IPC wrappers for connectivity check, cached board images, and cached vendor logos. Remove unused getBoardImageUrl wrapper.
Redesign the home page with context-aware layouts: - Offline (no selection): show custom image and cached images buttons with compact offline badge in header - Detected Armbian custom/cached image: show 4 read-only info buttons - Generic custom image: show OS + Storage buttons only - Normal flow: standard 4-step wizard Hide MOTD tips when offline. Reset API-dependent selections when connectivity is lost. Show reconnection toast on recovery.
Replace remote URL-based image loading with cache-first approach across all components: - BoardModal: load board thumbnails from local cache - FlashProgress: load board image from cache - useVendorLogos: load vendor logos from cache with remote fallback - App.tsx: use cached board image for Armbian detection modal Guard Armbian board detection when offline and support detected boards in the cached image reuse flow.
Load board data optionally in CacheManagerModal — gracefully degrade to filename-based metadata when the API is unreachable. Export CacheManagerModal from settings barrel for standalone use in the offline homepage layout.
Add translation keys across all 18 locale files: - home.offlineBanner: offline warning message - home.connectionRestored: reconnection toast - home.offlineHint: offline layout description - home.cachedImages: cached images button label - home.changeCachedImage: change cached image button - common.offline: compact offline badge label
Replace removed get_board_image_url reference with the new get_cached_board_image and get_cached_vendor_logo commands.
🧪 Test BuildsVersion:
ℹ️ About these builds
|
Member
Author
|
Tested on Windows 11, works as expected, @igorpecovnik i wait your confirm on Linux |
Member
igorpecovnik
approved these changes
Mar 20, 2026
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
Changes
Backend (Rust)
picture_cache.rs— New module: ETag-based asset cache with conditional refresh, atomic metadata updates, background pre-populationimages/mod.rs— API response saved to disk for offline board detection (atomic temp+rename writes)commands/system.rs—check_connectivitycommand with static shared HTTP clientcommands/scraping.rs—get_cached_board_image/get_cached_vendor_logocommands serving base64 data URIsget_board_image_urlcommandFrontend (React/TypeScript)
useConnectivityhook — polls backend every 30s, optimistic defaulti18n — 6 new keys across all 18 languages
Testing
Tested on macOS ARM64 (M2 Pro) in dev environment.