[backport cloud/1.36] feat: Stale-while-revalidate pattern for AssetBrowserModal#7889
Merged
luke-mino-altherr merged 1 commit intocloud/1.36from Jan 8, 2026
Merged
Conversation
## Summary Implements stale-while-revalidate pattern for AssetBrowserModal to show cached assets immediately while refreshing in background. ## Changes ### AssetBrowserModal.vue - Reads assets directly from store cache via computed properties - Shows loading spinner only when loading AND no cached data exists - Simplified refresh logic: single `refreshAssets()` call on mount ### assetsStore.ts - Added `updateModelsForTag(tag)` for tag-based fetching - Added `updateModelsForKey()` internal helper to unify node type and tag fetching - Cache key convention: node types as-is, tags prefixed with `tag:` - Added `isEqual` check before cache updates to prevent unnecessary re-renders ### useModelUpload.ts - Simplified signature from `UseAsyncStateReturn<...>['execute']` to `() => Promise<unknown> | void` ## UX Improvement | Scenario | Before | After | |----------|--------|-------| | First open | Spinner → Assets | Spinner → Assets | | Re-open same type | Spinner → Assets | Instant + silent refresh | | Re-open after download | Spinner → Assets | Cached + auto-update | ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7880-feat-Stale-while-revalidate-pattern-for-AssetBrowserModal-2e16d73d365081ba93f4d6e0415ebfae) by [Unito](https://www.unito.io) --------- Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 01/08/2026, 12:31:57 AM UTC 🔗 Links🎉 Your Storybook is ready for review! |
🎭 Playwright Test Results⏰ Completed at: 01/08/2026, 12:41:15 AM UTC 📈 Summary
📊 Test Reports by Browser
🎉 Click on the links above to view detailed test results for each browser configuration. |
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.
Backport of #7880 to
cloud/1.36Automatically created by backport workflow.
┆Issue is synchronized with this Notion page by Unito