mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 06:20:11 +00:00
## Summary Next iteration of the integrated tab/top menu ## Changes - **What**: - make integrated default, rename old to legacy - move feedback to integrated - fix user icon shapes - remove comfy cloud text in top bar, move to canvas stats - add chevron to C logo menu - move help back to sidebar - remove now unused help top positioning code ## Screenshots (if applicable) <img width="428" height="148" alt="image" src="https://github.com/user-attachments/assets/725025b7-4982-4f61-be11-8aabb0a1faff" /> <img width="264" height="187" alt="image" src="https://github.com/user-attachments/assets/91fa5e92-df08-4467-9bc5-50a614d9b8aa" /> <img width="1169" height="220" alt="image" src="https://github.com/user-attachments/assets/68c81bea-0cff-48df-8303-a6231a1d2fc4" /> <img width="242" height="207" alt="image" src="https://github.com/user-attachments/assets/5a10f40e-83ae-44c3-9434-3dbe87ba30e2" /> <img width="302" height="222" alt="image" src="https://github.com/user-attachments/assets/27fcc638-5fff-4302-9a1f-066227aafd86" /> --------- Co-authored-by: GitHub Action <action@github.com> Co-authored-by: github-actions <github-actions@github.com>
96 lines
2.9 KiB
TypeScript
96 lines
2.9 KiB
TypeScript
import { storeToRefs } from 'pinia'
|
|
import { computed, onMounted } from 'vue'
|
|
|
|
import { useSettingStore } from '@/platform/settings/settingStore'
|
|
import { useTelemetry } from '@/platform/telemetry'
|
|
import { useReleaseStore } from '@/platform/updates/common/releaseStore'
|
|
import { useHelpCenterStore } from '@/stores/helpCenterStore'
|
|
import { useConflictAcknowledgment } from '@/workbench/extensions/manager/composables/useConflictAcknowledgment'
|
|
import { useConflictDetection } from '@/workbench/extensions/manager/composables/useConflictDetection'
|
|
import { useNodeConflictDialog } from '@/workbench/extensions/manager/composables/useNodeConflictDialog'
|
|
|
|
export function useHelpCenter() {
|
|
const settingStore = useSettingStore()
|
|
const releaseStore = useReleaseStore()
|
|
const helpCenterStore = useHelpCenterStore()
|
|
const { isVisible: isHelpCenterVisible } = storeToRefs(helpCenterStore)
|
|
const { shouldShowRedDot: showReleaseRedDot } = storeToRefs(releaseStore)
|
|
|
|
const conflictDetection = useConflictDetection()
|
|
const { show: showNodeConflictDialog } = useNodeConflictDialog()
|
|
|
|
// Use conflict acknowledgment state from composable - call only once
|
|
const { shouldShowRedDot: shouldShowConflictRedDot, markConflictsAsSeen } =
|
|
useConflictAcknowledgment()
|
|
|
|
// Use either release red dot or conflict red dot
|
|
const shouldShowRedDot = computed((): boolean => {
|
|
const releaseRedDot = showReleaseRedDot.value
|
|
return releaseRedDot || shouldShowConflictRedDot.value
|
|
})
|
|
|
|
const sidebarLocation = computed(() =>
|
|
settingStore.get('Comfy.Sidebar.Location')
|
|
)
|
|
|
|
/**
|
|
* Toggle Help Center and track UI button click.
|
|
*/
|
|
const toggleHelpCenter = () => {
|
|
useTelemetry()?.trackUiButtonClicked({
|
|
button_id: 'sidebar_help_center_toggled'
|
|
})
|
|
helpCenterStore.toggle()
|
|
}
|
|
|
|
const closeHelpCenter = () => {
|
|
helpCenterStore.hide()
|
|
}
|
|
|
|
/**
|
|
* Handle What's New popup dismissal
|
|
* Check if conflict modal should be shown after ComfyUI update
|
|
*/
|
|
const handleWhatsNewDismissed = async () => {
|
|
try {
|
|
// Check if conflict modal should be shown after update
|
|
const shouldShow =
|
|
await conflictDetection.shouldShowConflictModalAfterUpdate()
|
|
if (shouldShow) {
|
|
showConflictModal()
|
|
}
|
|
} catch (error) {
|
|
console.error('[HelpCenter] Error checking conflict modal:', error)
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Show the node conflict dialog with current conflict data
|
|
*/
|
|
const showConflictModal = () => {
|
|
void showNodeConflictDialog({
|
|
showAfterWhatsNew: true,
|
|
dialogComponentProps: {
|
|
onClose: () => {
|
|
markConflictsAsSeen()
|
|
}
|
|
}
|
|
})
|
|
}
|
|
|
|
// Initialize release store on mount
|
|
onMounted(async () => {
|
|
// Initialize release store to fetch releases for toast and popup
|
|
await releaseStore.initialize()
|
|
})
|
|
|
|
return {
|
|
isHelpCenterVisible,
|
|
shouldShowRedDot,
|
|
sidebarLocation,
|
|
toggleHelpCenter,
|
|
closeHelpCenter,
|
|
handleWhatsNewDismissed
|
|
}
|
|
}
|