mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-20 06:44:32 +00:00
feat: default to Getting Started category for new users in templates modal (#8599)
## Summary Updates the templates modal to default to the "Getting Started" category for new users. ## Changes - Add `initialCategory` prop to `WorkflowTemplateSelectorDialog` component - Integrate `useNewUserService` in the dialog composable to detect first-time users - New users automatically see the "basics-getting-started" category - Existing users continue to see "all" templates as default - Allow explicit category override via options parameter ## Testing - Added unit tests covering all scenarios (new user, non-new user, undetermined, explicit override) - 6 tests pass Fixes COM-9146 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8599-feat-default-to-Getting-Started-category-for-new-users-in-templates-modal-2fd6d73d365081d4a5fad2abdb768269) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -422,8 +422,9 @@ import { createGridStyle } from '@/utils/gridUtil'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const { onClose: originalOnClose } = defineProps<{
|
||||
const { onClose: originalOnClose, initialCategory = 'all' } = defineProps<{
|
||||
onClose: () => void
|
||||
initialCategory?: string
|
||||
}>()
|
||||
|
||||
// Track session time for telemetry
|
||||
@@ -547,7 +548,7 @@ const allTemplates = computed(() => {
|
||||
})
|
||||
|
||||
// Navigation
|
||||
const selectedNavItem = ref<string | null>('all')
|
||||
const selectedNavItem = ref<string | null>(initialCategory)
|
||||
|
||||
// Filter templates based on selected navigation item
|
||||
const navigationFilteredTemplates = computed(() => {
|
||||
|
||||
Reference in New Issue
Block a user