Compare commits

...

3 Commits

Author SHA1 Message Date
github-actions
962afa35af Update locales [skip ci] 2025-05-13 21:52:51 +00:00
filtered
05534184a6 nit - match setting name style 2025-05-14 07:49:19 +10:00
filtered
a0a00bacdd Allow users to opt-out of changing favicon 2025-05-14 07:44:06 +10:00
10 changed files with 67 additions and 11 deletions

View File

@@ -1,23 +1,41 @@
import { useFavicon } from '@vueuse/core'
import { watch } from 'vue'
import { type WatchHandle, ref, watch } from 'vue'
import { useExecutionStore } from '@/stores/executionStore'
import { useSettingStore } from '@/stores/settingStore'
export const useProgressFavicon = () => {
const defaultFavicon = '/assets/images/favicon_progress_16x16/frame_9.png'
const favicon = useFavicon(defaultFavicon)
const executionStore = useExecutionStore()
const settingsStore = useSettingStore()
const totalFrames = 10
watch(
[() => executionStore.executionProgress, () => executionStore.isIdle],
([progress, isIdle]) => {
if (isIdle) {
favicon.value = defaultFavicon
} else {
const frame = Math.floor(progress * totalFrames)
favicon.value = `/assets/images/favicon_progress_16x16/frame_${frame}.png`
const watchHandle = ref<WatchHandle>()
function watchProgress() {
watchHandle.value = watch(
[() => executionStore.executionProgress, () => executionStore.isIdle],
([progress, isIdle]) => {
if (isIdle) {
favicon.value = defaultFavicon
} else {
const frame = Math.floor(progress * totalFrames)
favicon.value = `/assets/images/favicon_progress_16x16/frame_${frame}.png`
}
}
}
)
}
watch(
() => settingsStore.get('Comfy.Window.TabIconProgress'),
(showProgress) => {
if (showProgress) {
watchProgress()
} else {
watchHandle.value?.stop()
}
},
{ immediate: true }
)
}

View File

@@ -828,5 +828,14 @@ export const CORE_SETTINGS: SettingParams[] = [
type: 'boolean',
defaultValue: false,
versionAdded: '1.19.1'
},
{
id: 'Comfy.Window.TabIconProgress',
name: 'Show progress in browser tab icon (favicon)',
tooltip:
'Updates the browser tab icon to show the progress of the current task.',
type: 'boolean',
defaultValue: true,
versionAdded: '1.20.0'
}
]

View File

@@ -332,6 +332,10 @@
"after": "after"
}
},
"Comfy_Window_TabIconProgress": {
"name": "Show progress in browser tab icon (favicon)",
"tooltip": "Updates the browser tab icon to show the progress of the current task."
},
"Comfy_Window_UnloadConfirmation": {
"name": "Show confirmation when closing window"
},

View File

@@ -332,6 +332,10 @@
},
"tooltip": "Controla cuándo se actualizan los valores del widget (aleatorizar/incrementar/decrementar), ya sea antes de que se encole el aviso o después."
},
"Comfy_Window_TabIconProgress": {
"name": "Mostrar progreso en el icono de la pestaña del navegador (favicon)",
"tooltip": "Actualiza el icono de la pestaña del navegador para mostrar el progreso de la tarea actual."
},
"Comfy_Window_UnloadConfirmation": {
"name": "Mostrar confirmación al cerrar la ventana"
},

View File

@@ -332,6 +332,10 @@
},
"tooltip": "Contrôle quand les valeurs du widget sont mises à jour (randomize/increment/decrement), soit avant que l'invite ne soit mise en file d'attente, soit après."
},
"Comfy_Window_TabIconProgress": {
"name": "Afficher la progression dans licône donglet du navigateur (favicon)",
"tooltip": "Met à jour licône de longlet du navigateur pour afficher la progression de la tâche en cours."
},
"Comfy_Window_UnloadConfirmation": {
"name": "Afficher une confirmation lors de la fermeture de la fenêtre"
},

View File

@@ -332,6 +332,10 @@
},
"tooltip": "ウィジェットの値が更新されるタイミングを制御します(ランダム化/インクリメント/デクリメント)、プロンプトがキューに入れられる前または後のいずれかです。"
},
"Comfy_Window_TabIconProgress": {
"name": "ブラウザータブアイコン(ファビコン)に進行状況を表示",
"tooltip": "現在のタスクの進行状況をブラウザータブのアイコンに表示します。"
},
"Comfy_Window_UnloadConfirmation": {
"name": "ウィンドウを閉じるときに確認を表示"
},

View File

@@ -332,6 +332,10 @@
},
"tooltip": "위젯 값이 업데이트되는 시점을 제어합니다 (무작위화/증가/감소), 프롬프트가 큐에 추가되기 전 또는 후입니다."
},
"Comfy_Window_TabIconProgress": {
"name": "브라우저 탭 아이콘(파비콘)에 진행 상황 표시",
"tooltip": "현재 작업의 진행 상황을 브라우저 탭 아이콘에 표시합니다."
},
"Comfy_Window_UnloadConfirmation": {
"name": "창 닫을 때 확인 표시"
},

View File

@@ -332,6 +332,10 @@
},
"tooltip": "Управляет тем, когда обновляются значения виджета (случайные/увеличение/уменьшение), либо до того, как запрос будет поставлен в очередь, либо после."
},
"Comfy_Window_TabIconProgress": {
"name": "Показывать прогресс в значке вкладки браузера (favicon)",
"tooltip": "Обновляет значок вкладки браузера, чтобы показывать прогресс текущей задачи."
},
"Comfy_Window_UnloadConfirmation": {
"name": "Показать подтверждение при закрытии окна"
},

View File

@@ -332,6 +332,10 @@
},
"tooltip": "控制组件值的更新时机(随机/增加/减少),可以在执行工作流之前或之后。"
},
"Comfy_Window_TabIconProgress": {
"name": "在浏览器标签图标中显示进度",
"tooltip": "更新浏览器标签图标以显示当前任务的进度。"
},
"Comfy_Window_UnloadConfirmation": {
"name": "关闭窗口时显示确认"
},

View File

@@ -463,7 +463,8 @@ const zSettings = z.object({
'main.sub.setting.name': z.any(),
'single.setting': z.any(),
'LiteGraph.Node.DefaultPadding': z.boolean(),
'LiteGraph.Pointer.TrackpadGestures': z.boolean()
'LiteGraph.Pointer.TrackpadGestures': z.boolean(),
'Comfy.Window.TabIconProgress': z.boolean()
})
export type EmbeddingsResponse = z.infer<typeof zEmbeddingsResponse>