fix: persist assets sidebar view mode#8299
Conversation
📝 WalkthroughWalkthroughThis PR adds persistent storage to the Assets sidebar's view mode preference using VueUse's Changes
Possibly related PRs
Suggested reviewers
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🎭 Playwright Tests:
|
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 01/24/2026, 09:18:13 PM UTC 🔗 Links🎉 Your Storybook is ready for review! |
2cfeefa to
ebf2179
Compare
There was a problem hiding this comment.
Pull request overview
This PR persists the Assets sidebar's list/grid view mode so that the user's choice survives closing and reopening the sidebar. It does this by switching the transient viewMode state to a useStorage-backed ref keyed in localStorage.
Changes:
- Import
useStoragefrom@vueuse/coreinAssetsSidebarTab.vue. - Replace the local
ref<'list' | 'grid'>('grid')forviewModewith auseStorage<'list' | 'grid'>('Comfy.Assets.Sidebar.ViewMode', 'grid')so view mode is persisted. - Keep existing computed
isListViewlogic andv-model:view-modebindings working against the new storage-backed ref.
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 22.5 kB (baseline 22.5 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 955 kB (baseline 955 kB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 80.7 kB (baseline 80.7 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 9 added / 9 removed Panels & Settings — 440 kB (baseline 440 kB) • 🟢 -8 BConfiguration panels, inspectors, and settings screens
Status: 12 added / 12 removed User & Accounts — 3.94 kB (baseline 3.94 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 3 added / 3 removed Editors & Dialogs — 2.83 kB (baseline 2.83 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 2 added / 2 removed UI Components — 33.7 kB (baseline 33.7 kB) • ⚪ 0 BReusable component library chunks
Status: 5 added / 5 removed Data & Services — 3.17 MB (baseline 3.17 MB) • 🔴 +67 BStores, services, APIs, and repositories
Status: 8 added / 8 removed Utilities & Hooks — 24 kB (baseline 24 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 7 added / 7 removed Vendor & Third-Party — 10.7 MB (baseline 10.7 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 6.42 MB (baseline 6.42 MB) • 🟢 -192 BBundles that do not match a named category
Status: 31 added / 31 removed |
Summary
Persist assets sidebar view-mode preference so list/grid selection survives toggling the sidebar.
Changes
useStorage.Review Focus
┆Issue is synchronized with this Notion page by Unito