Commit Graph

3 Commits

Author SHA1 Message Date
Benjamin Lu
35f15d18b4 feat: add job history and assets sidebar badge behavior (#9050)
## Summary
Add sidebar badge behavior for queue/asset visibility updates:
- Job History tab icon shows active jobs count (`queued + running`) only
when the Job History panel is closed.
- Assets tab icon no longer mirrors active jobs; when QPO V2 is enabled
it now shows the number of assets added since the last time Assets was
opened.
- Opening Assets clears the unseen added-assets badge count.

## Changes
- Added `iconBadge` logic to Job History sidebar tab.
- Replaced Assets sidebar badge source with new unseen-assets counter
logic.
- Added `assetsSidebarBadgeStore` to track unseen asset additions from
history updates and reset on Assets open.
- Added/updated unit tests for both sidebar tab composables and the new
store behavior.


https://github.com/user-attachments/assets/33588a2a-c607-4fcc-8221-e7f11c3d79cc



┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-9050-fix-add-job-history-and-assets-sidebar-badge-behavior-30e6d73d365081c38297fe6aac9cd34c)
by [Unito](https://www.unito.io)

---------

Co-authored-by: Johnpaul Chiwetelu <49923152+Myestery@users.noreply.github.com>
Co-authored-by: GitHub Action <action@github.com>
2026-02-22 01:05:39 -08:00
Jin Yi
7bf9d51d1d [bugfix] Show active job count in assets sidebar badge (#9015)
## Summary
Assets sidebar badge now shows total active jobs (pending + running)
instead of only pending jobs, making it consistent with the "X active
jobs" label inside the panel.

## Changes
- **What**: Changed `iconBadge` in `useAssetsSidebarTab` from
`pendingTasks.length` to `activeJobsCount` (pending + running)
- Badge still hidden when QPO V2 is disabled (legacy queue)

## Review Focus
- Whether `activeJobsCount` (pending + running) is the correct metric
for the badge

<img width="1718" height="1327" alt="스크린샷 2026-02-20 오후 7 46
40(2)"
src="https://github.com/user-attachments/assets/4d0d2bed-8be9-44d7-bd62-4dd8c075d265"
/>

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-9015-bugfix-Show-active-job-count-in-assets-sidebar-badge-30d6d73d365081c287a6ce9bc0a60244)
by [Unito](https://www.unito.io)
2026-02-20 20:02:10 +09:00
Benjamin Lu
030d4fd4d5 fix: hide assets sidebar badge when legacy queue is enabled (#8708)
### Motivation
- The Assets sidebar shows a notification-style badge immediately when a
job is queued using the legacy queue, which is misleading because that
badge is intended for the newer Queue Panel V2 experience.

### Description
- Gate the Assets sidebar `iconBadge` on the `Comfy.Queue.QPOV2` setting
by importing `useSettingStore` and returning `null` when QPO V2 is
disabled; otherwise show `pendingTasks.length` as before
(`src/composables/sidebarTabs/useAssetsSidebarTab.ts`).
- Add a focused unit test that mocks the settings and queue store to
verify the badge is hidden when QPO V2 is disabled and shows the pending
count when enabled
(`src/composables/sidebarTabs/useAssetsSidebarTab.test.ts`).
- Keep the Assets component import mocked in the test to avoid
bootstrapping the full UI during unit runs.

### Testing
- Ran the new unit test with `pnpm vitest
src/composables/sidebarTabs/useAssetsSidebarTab.test.ts` and it passed
(2 tests).
- Ran type checking with `pnpm typecheck` and it completed successfully.
- Ran linting with `pnpm lint` and no errors were reported.

------
[Codex
Task](https://chatgpt.com/codex/tasks/task_e_69867f4ceaac8330b9806d5b51006a6a)

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8708-fix-hide-assets-sidebar-badge-when-legacy-queue-is-enabled-3006d73d3650818eb809de399583088e)
by [Unito](https://www.unito.io)
2026-02-06 20:21:16 -08:00