mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-14 09:27:41 +00:00
Add inline queue progress bar and summary per the new designs. This adds an inline 3px progress bar in the actionbar container (docked or floating) and a compact summary line below the top menu that follows when floating, both gated by the QPO V2 flag and hidden while the overlay is expanded. https://github.com/user-attachments/assets/da8ec7b7-35f4-4d52-a83b-15c21b484eba ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8271-Add-inline-queue-progress-bar-and-summary-for-QPO-V2-2f16d73d36508132a6dff247f71e11e4) by [Unito](https://www.unito.io) --------- Co-authored-by: github-actions <github-actions@github.com>
29 lines
779 B
TypeScript
29 lines
779 B
TypeScript
import { normalizeI18nKey } from '@/utils/formatUtil'
|
|
|
|
type NodeTitleInfo = {
|
|
title?: string | number | null
|
|
type?: string | number | null
|
|
}
|
|
|
|
type StaticTranslate = (key: string, fallbackMessage: string) => string
|
|
|
|
type ResolveNodeDisplayNameOptions = {
|
|
emptyLabel: string
|
|
untitledLabel: string
|
|
st: StaticTranslate
|
|
}
|
|
|
|
export function resolveNodeDisplayName(
|
|
node: NodeTitleInfo | null | undefined,
|
|
options: ResolveNodeDisplayNameOptions
|
|
): string {
|
|
if (!node) return options.emptyLabel
|
|
|
|
const title = (node.title ?? '').toString().trim()
|
|
if (title.length > 0) return title
|
|
|
|
const nodeType = (node.type ?? '').toString().trim() || options.untitledLabel
|
|
const key = `nodeDefs.${normalizeI18nKey(nodeType)}.display_name`
|
|
return options.st(key, nodeType)
|
|
}
|