feat: add session download tracking to assetDownloadStore#8213
Conversation
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 01/21/2026, 10:58:19 PM UTC 🔗 Links🎉 Your Storybook is ready for review! |
🎭 Playwright Tests:
|
📝 WalkthroughWalkthroughAdds session-level download tracking and UI surfacing: assets gain an Changes
Sequence Diagram(s)sequenceDiagram
participant Downloader as Downloader (download process)
participant Store as AssetDownloadStore
participant Composable as useAssetBrowser
participant Modal as AssetBrowserModal (UI)
Downloader->>Store: record completed download (asset_id) [acknowledged = false]
Store->>Store: update unacknowledgedDownloads, sessionDownloadCount
Modal->>Composable: render / mount
Composable->>Store: read sessionDownloadCount
Store-->>Composable: return sessionDownloadCount
Composable-->>Modal: provide navItems with badge (count)
Modal->>Modal: display badge on "Imported" nav item
Possibly related PRs
Suggested reviewers
✨ Finishing touches
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 |
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 22.3 kB (baseline 22.3 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.02 MB (baseline 1.02 MB) • ⚪ 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 — 430 kB (baseline 430 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 8 added / 8 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.8 kB (baseline 2.8 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 2 added / 2 removed UI Components — 32.8 kB (baseline 32.8 kB) • ⚪ 0 BReusable component library chunks
Status: 5 added / 5 removed Data & Services — 3.05 MB (baseline 3.05 MB) • 🔴 +1.81 kBStores, services, APIs, and repositories
Status: 7 added / 7 removed Utilities & Hooks — 18.1 kB (baseline 18.1 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 4 added / 4 removed Vendor & Third-Party — 10.4 MB (baseline 10.4 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 6.28 MB (baseline 6.28 MB) • ⚪ 0 BBundles that do not match a named category
Status: 22 added / 22 removed |
Amp-Thread-ID: https://ampcode.com/threads/T-019bdfa1-0746-72d8-b898-ca16ec54155f Co-authored-by: Amp <amp@ampcode.com>
d9127b1 to
0494cb6
Compare
- Add 'Imported' nav item with badge showing session download count - Refactor useAssetBrowser to use selectedNavItem for nav selection - Add i18n keys for imported, byType, and emptyImported messages - Update tests for new nav-based ownership filtering Amp-Thread-ID: https://ampcode.com/threads/T-019be2a9-fcd7-703a-a2ca-26b30b837c7a Co-authored-by: Amp <amp@ampcode.com>
|
|
||
| export type OwnershipOption = 'all' | 'my-models' | 'public-models' | ||
|
|
||
| type NavId = 'all' | 'imported' | (string & {}) |
There was a problem hiding this comment.
This is just for type hinting, right? I vaguely recall you sharing that 'all' | 'imported' | string gets simplified by typescript into string
There was a problem hiding this comment.
Exactly, it accepts any string but autocomplete will suggest the known values first.
## Summary Add session download tracking to track which assets were downloaded during the current session. This enables UI features like: - Badge count on "Imported" nav showing newly downloaded assets - Visual indicator on asset cards for recently downloaded items ## Changes - Add `acknowledged` flag to `AssetDownload` interface - Add `unacknowledgedDownloads` computed for filtering - Add `sessionDownloadCount` computed for badge display - Add `isDownloadedThisSession(identifier)` to check individual assets - Add `acknowledgeDownload(identifier)` to mark assets as seen ## Testing - 6 new unit tests covering all session tracking functionality - Run: `pnpm test:unit -- src/stores/assetDownloadStore.test.ts` ## Related - Part of Asset Browser improvements (#8090) ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8213-feat-add-session-download-tracking-to-assetDownloadStore-2ef6d73d365081538045e8544d26bafa) by [Unito](https://www.unito.io) --------- Co-authored-by: Amp <amp@ampcode.com>
## Summary Add session download tracking to track which assets were downloaded during the current session. This enables UI features like: - Badge count on "Imported" nav showing newly downloaded assets - Visual indicator on asset cards for recently downloaded items ## Changes - Add `acknowledged` flag to `AssetDownload` interface - Add `unacknowledgedDownloads` computed for filtering - Add `sessionDownloadCount` computed for badge display - Add `isDownloadedThisSession(identifier)` to check individual assets - Add `acknowledgeDownload(identifier)` to mark assets as seen ## Testing - 6 new unit tests covering all session tracking functionality - Run: `pnpm test:unit -- src/stores/assetDownloadStore.test.ts` ## Related - Part of Asset Browser improvements (#8090) ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8213-feat-add-session-download-tracking-to-assetDownloadStore-2ef6d73d365081538045e8544d26bafa) by [Unito](https://www.unito.io) --------- Co-authored-by: Amp <amp@ampcode.com>
…nloadStore (#8233) Backport of #8213 to `cloud/1.37` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8233-backport-cloud-1-37-feat-add-session-download-tracking-to-assetDownloadStore-2f06d73d36508147b5fadd98af2a602e) by [Unito](https://www.unito.io) Co-authored-by: Alexander Brown <drjkl@comfy.org> Co-authored-by: Amp <amp@ampcode.com>
…8213) ## Summary Add session download tracking to track which assets were downloaded during the current session. This enables UI features like: - Badge count on "Imported" nav showing newly downloaded assets - Visual indicator on asset cards for recently downloaded items ## Changes - Add `acknowledged` flag to `AssetDownload` interface - Add `unacknowledgedDownloads` computed for filtering - Add `sessionDownloadCount` computed for badge display - Add `isDownloadedThisSession(identifier)` to check individual assets - Add `acknowledgeDownload(identifier)` to mark assets as seen ## Testing - 6 new unit tests covering all session tracking functionality - Run: `pnpm test:unit -- src/stores/assetDownloadStore.test.ts` ## Related - Part of Asset Browser improvements (Comfy-Org#8090) ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8213-feat-add-session-download-tracking-to-assetDownloadStore-2ef6d73d365081538045e8544d26bafa) by [Unito](https://www.unito.io) --------- Co-authored-by: Amp <amp@ampcode.com>
Summary
Add session download tracking to track which assets were downloaded during the current session. This enables UI features like:
Changes
acknowledgedflag toAssetDownloadinterfaceunacknowledgedDownloadscomputed for filteringsessionDownloadCountcomputed for badge displayisDownloadedThisSession(identifier)to check individual assetsacknowledgeDownload(identifier)to mark assets as seenTesting
pnpm test:unit -- src/stores/assetDownloadStore.test.tsRelated
┆Issue is synchronized with this Notion page by Unito