-
Notifications
You must be signed in to change notification settings - Fork 433
[feat] Add PostHog data-attr attributes to Upload Model flow #7173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add step-specific data-attr attributes throughout the Upload Model wizard for PostHog analytics tracking and action creation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
📝 WalkthroughWalkthroughThis PR adds Changes
Possibly related PRs
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
🎭 Playwright Test Results⏰ Completed at: 12/05/2025, 12:59:13 AM UTC 📈 Summary
📊 Test Reports by Browser
🎉 Click on the links above to view detailed test results for each browser configuration. |
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 12/05/2025, 12:50:25 AM UTC 🔗 Links🎉 Your Storybook is ready for review! |
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 3.2 MB (baseline 3.2 MB) • ⚪ 0 BMain entry bundles and manifests
Status: 3 added / 3 removed Graph Workspace — 975 kB (baseline 974 kB) • 🔴 +50 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 6.54 kB (baseline 6.54 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 1 added / 1 removed Panels & Settings — 298 kB (baseline 298 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 6 added / 6 removed UI Components — 173 kB (baseline 173 kB) • 🔴 +492 BReusable component library chunks
Status: 6 added / 6 removed Data & Services — 12.5 kB (baseline 12.5 kB) • ⚪ 0 BStores, services, APIs, and repositories
Status: 2 added / 2 removed Utilities & Hooks — 2.94 kB (baseline 2.94 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 1 added / 1 removed Vendor & Third-Party — 8.56 MB (baseline 8.56 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 3.81 MB (baseline 3.81 MB) • ⚪ 0 BBundles that do not match a named category
Status: 17 added / 17 removed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (4)
src/platform/assets/components/AssetBrowserModal.vue(1 hunks)src/platform/assets/components/UploadModelConfirmation.vue(1 hunks)src/platform/assets/components/UploadModelFooter.vue(5 hunks)src/platform/assets/components/UploadModelUrlInput.vue(1 hunks)
🧰 Additional context used
📓 Path-based instructions (12)
**/*.vue
📄 CodeRabbit inference engine (.cursorrules)
**/*.vue: Use setup() function for component logic in Vue 3 Composition API
Utilize ref and reactive for reactive state in Vue 3
Implement computed properties with computed() function
Use watch and watchEffect for side effects in Vue 3
Implement lifecycle hooks with onMounted, onUpdated, etc.
Utilize provide/inject for dependency injection in Vue 3
Use Vue 3.5 style of default prop declaration with defineProps()
Organize Vue components in <script> <style> order
Use Tailwind CSS for styling Vue components
Implement responsive design with Tailwind CSS
Do not use deprecated PrimeVue components (Dropdown, OverlayPanel, Calendar, InputSwitch, Sidebar, Chips, TabMenu, Steps, InlineMessage). Use replacements: Select, Popover, DatePicker, ToggleSwitch, Drawer, AutoComplete, Tabs, Stepper, Message respectively
Implement proper props and emits definitions in Vue components
Utilize Vue 3's Teleport component when needed
Use Suspense for async components in Vue 3
Follow Vue 3 style guide and naming conventions
Never use deprecated PrimeVue components (Dropdown, OverlayPanel, Calendar, InputSwitch, Sidebar, Chips, TabMenu, Steps, InlineMessage)Never use
:class="[]"to merge class names - always useimport { cn } from '@/utils/tailwindUtil'for class merging in Vue templates
**/*.vue: Use TypeScript with Vue 3 Single File Components (.vuefiles)
Name Vue components in PascalCase (e.g.,MenuHamburger.vue)Files:
src/platform/assets/components/UploadModelUrlInput.vuesrc/platform/assets/components/AssetBrowserModal.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/UploadModelConfirmation.vue**/*.{vue,ts,tsx}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{vue,ts,tsx}: Leverage VueUse functions for performance-enhancing utilities
Use vue-i18n in Composition API for any string literals and place new translation entries in src/locales/en/main.jsonFiles:
src/platform/assets/components/UploadModelUrlInput.vuesrc/platform/assets/components/AssetBrowserModal.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/UploadModelConfirmation.vue**/*.{ts,tsx,js,vue}
📄 CodeRabbit inference engine (.cursorrules)
Implement proper error handling in components and services
**/*.{ts,tsx,js,vue}: Use 2-space indentation, single quotes, no semicolons, and maintain 80-character line width as configured in.prettierrc
Organize imports by sorting and grouping by plugin, and runpnpm formatbefore committingFiles:
src/platform/assets/components/UploadModelUrlInput.vuesrc/platform/assets/components/AssetBrowserModal.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/UploadModelConfirmation.vuesrc/**/*.vue
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/**/*.vue: Use the Vue 3 Composition API instead of the Options API when writing Vue components (exception: when overriding or extending PrimeVue components for compatibility)
Use setup() function for component logic
Utilize ref and reactive for reactive state
Implement computed properties with computed()
Use watch and watchEffect for side effects
Implement lifecycle hooks with onMounted, onUpdated, etc.
Utilize provide/inject for dependency injection
Use vue 3.5 style of default prop declaration
Use Tailwind CSS for styling
Implement proper props and emits definitions
Utilize Vue 3's Teleport component when needed
Use Suspense for async components
Follow Vue 3 style guide and naming conventionsFiles:
src/platform/assets/components/UploadModelUrlInput.vuesrc/platform/assets/components/AssetBrowserModal.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/UploadModelConfirmation.vuesrc/**/*.{vue,ts}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/**/*.{vue,ts}: Leverage VueUse functions for performance-enhancing styles
Implement proper error handling
Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.jsonFiles:
src/platform/assets/components/UploadModelUrlInput.vuesrc/platform/assets/components/AssetBrowserModal.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/UploadModelConfirmation.vue**/*.{ts,tsx,js,jsx,vue}
📄 CodeRabbit inference engine (CLAUDE.md)
Use camelCase for variable and setting names in TypeScript/Vue files
Files:
src/platform/assets/components/UploadModelUrlInput.vuesrc/platform/assets/components/AssetBrowserModal.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/UploadModelConfirmation.vue**/*.{vue,html}
📄 CodeRabbit inference engine (CLAUDE.md)
Never use
dark:ordark-theme:Tailwind variants - instead use semantic values fromstyle.csstheme, e.g.bg-node-component-surfaceFiles:
src/platform/assets/components/UploadModelUrlInput.vuesrc/platform/assets/components/AssetBrowserModal.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/UploadModelConfirmation.vue**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx,vue}: Useconst settingStore = useSettingStore()andsettingStore.get('Comfy.SomeSetting')to retrieve settings in TypeScript/Vue files
Useawait settingStore.set('Comfy.SomeSetting', newValue)to update settings in TypeScript/Vue files
Check server capabilities usingapi.serverSupportsFeature('feature_name')before using enhanced features
Useapi.getServerFeature('config_name', defaultValue)to retrieve server feature configurationEnforce ESLint rules for Vue + TypeScript including: no floating promises, no unused imports, and i18n raw text restrictions in templates
Files:
src/platform/assets/components/UploadModelUrlInput.vuesrc/platform/assets/components/AssetBrowserModal.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/UploadModelConfirmation.vuesrc/**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (src/CLAUDE.md)
src/**/*.{ts,tsx,vue}: Sanitize HTML with DOMPurify to prevent XSS attacks
Avoid using @ts-expect-error; use proper TypeScript types instead
Use es-toolkit for utility functions instead of other utility libraries
Implement proper TypeScript types throughout the codebaseFiles:
src/platform/assets/components/UploadModelUrlInput.vuesrc/platform/assets/components/AssetBrowserModal.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/UploadModelConfirmation.vuesrc/**/{composables,components}/**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (src/CLAUDE.md)
Clean up subscriptions in state management to prevent memory leaks
Files:
src/platform/assets/components/UploadModelUrlInput.vuesrc/platform/assets/components/AssetBrowserModal.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/UploadModelConfirmation.vuesrc/**/*.{vue,ts,tsx}
📄 CodeRabbit inference engine (src/CLAUDE.md)
Follow Vue 3 composition API style guide
Files:
src/platform/assets/components/UploadModelUrlInput.vuesrc/platform/assets/components/AssetBrowserModal.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/UploadModelConfirmation.vuesrc/**/{components,composables}/**/*.{ts,tsx,vue}
📄 CodeRabbit inference engine (src/CLAUDE.md)
Use vue-i18n for ALL user-facing strings by adding them to
src/locales/en/main.jsonFiles:
src/platform/assets/components/UploadModelUrlInput.vuesrc/platform/assets/components/AssetBrowserModal.vuesrc/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/UploadModelConfirmation.vue🧠 Learnings (3)
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR Repo: Comfy-Org/ComfyUI_frontend PR: 0 File: src/components/CLAUDE.md:0-0 Timestamp: 2025-11-24T19:47:45.616Z Learning: Applies to src/components/**/*.vue : Replace PrimeVue InputSwitch component with ToggleSwitchApplied to files:
src/platform/assets/components/UploadModelUrlInput.vuesrc/platform/assets/components/UploadModelConfirmation.vue📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR Repo: Comfy-Org/ComfyUI_frontend PR: 0 File: src/components/CLAUDE.md:0-0 Timestamp: 2025-11-24T19:47:45.616Z Learning: Applies to src/components/**/*.vue : Replace PrimeVue Steps component with Stepper without panelsApplied to files:
src/platform/assets/components/UploadModelFooter.vuesrc/platform/assets/components/UploadModelConfirmation.vue📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR Repo: Comfy-Org/ComfyUI_frontend PR: 0 File: src/components/CLAUDE.md:0-0 Timestamp: 2025-11-24T19:47:45.616Z Learning: Applies to src/components/**/*.vue : Replace PrimeVue Dropdown component with SelectApplied to files:
src/platform/assets/components/UploadModelConfirmation.vue⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: test
- GitHub Check: lint-and-format
- GitHub Check: setup
- GitHub Check: collect
🔇 Additional comments (4)
src/platform/assets/components/UploadModelFooter.vue (1)
21-21: Excellent naming consistency across the upload flow.The data-attr naming follows a clear, consistent pattern (
upload-model-step{N}-{action}-button) that will enable reliable PostHog funnel tracking and action selectors. The step-specific attributes align perfectly with the PR objectives for drop-off analysis.Also applies to: 41-41, 57-57, 73-73
src/platform/assets/components/UploadModelConfirmation.vue (1)
29-29: LGTM! Consistent naming for the model type selector.The
data-attr="upload-model-step2-type-selector"follows the established naming convention and correctly identifies this as a step 2 interaction point. This will enable tracking of model type selection during the upload funnel analysis.src/platform/assets/components/AssetBrowserModal.vue (1)
37-37: LGTM! Appropriate entry point tracking.The
data-attr="upload-model-button"correctly identifies the funnel entry point without a step number, which makes sense since this button initiates the upload flow. This will enable tracking of upload flow initiation rates in PostHog.src/platform/assets/components/UploadModelUrlInput.vue (1)
20-20: LGTM! Consistent naming for the URL input field.The
data-attr="upload-model-step1-url-input"follows the established naming convention and correctly identifies this as the step 1 URL input interaction. This will enable tracking of user engagement with the initial input field in the upload funnel.
| <a | ||
| href="#" | ||
| target="_blank" | ||
| class="text-muted-foreground" | ||
| data-attr="upload-model-step1-help-link" | ||
| >{{ $t('How do I find this?') }}</a | ||
| > |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the broken help link.
The help link has href="#" which is a placeholder that doesn't navigate anywhere. This provides a poor user experience, as clicking the "How do I find this?" link will not help users.
Consider one of the following:
- Link to actual documentation (e.g., CivitAI help page explaining how to find model URLs)
- Open a popover/tooltip with inline help text
- Remove the link if documentation isn't ready yet
If you need assistance implementing any of these solutions, I can help generate the code.
🤖 Prompt for AI Agents
In src/platform/assets/components/UploadModelFooter.vue around lines 8 to 14 the
anchor uses href="#" which is a non-functional placeholder; replace it with a
real help action: ideally set href to the appropriate documentation URL (e.g.
the CivitAI help page) and keep target="_blank", add rel="noopener noreferrer"
and an aria-label for accessibility (preserve data-attr and styling), or if docs
aren't available convert the anchor into a button that opens an inline
popover/tooltip component with the help text or simply remove the link;
implement the chosen option consistently and ensure accessibility and security
attributes are included.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah good reminder. need to implement this still
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@luke-mino-altherr, sounds good! Feel free to tag me if you'd like help implementing the help link—whether that's finding the right documentation URL, creating a popover component, or setting up the accessibility attributes. Happy to assist! 🐰
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will implement (or remove) this in a separate pass
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@luke-mino-altherr, sounds good! Since you're planning to address this separately, would you like me to create a GitHub issue to track the help link implementation/removal? I can include a reference to this PR and discussion for context.
| :label="$t('g.back')" | ||
| type="transparent" | ||
| size="md" | ||
| :data-attr="`upload-model-step${currentStep}-back-button`" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Simplify the back button data-attr to a static string.
The back button only appears when currentStep !== 1 && currentStep !== 3, meaning it's exclusively shown on step 2. The dynamic template literal :data-attr="upload-model-step${currentStep}-back-button" will always resolve to "upload-model-step2-back-button", so the dynamic binding adds unnecessary complexity.
Apply this diff to simplify:
- :data-attr="`upload-model-step${currentStep}-back-button`"
+ data-attr="upload-model-step2-back-button"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| :data-attr="`upload-model-step${currentStep}-back-button`" | |
| data-attr="upload-model-step2-back-button" |
🤖 Prompt for AI Agents
In src/platform/assets/components/UploadModelFooter.vue around line 30, the
data-attr for the back button is unnecessarily dynamic even though the button
only appears on step 2; replace the dynamic binding
:data-attr="`upload-model-step${currentStep}-back-button`" with a static
attribute data-attr="upload-model-step2-back-button" (remove the leading colon)
so the markup is simpler and always yields the same string when the button is
rendered.
Summary
Adds step-specific
data-attrattributes throughout the Upload Model wizard to enable PostHog analytics tracking and action creation, following PostHog's recommended best practices for element labeling.Changes
data-attrattributes to all key interactive elements in the Upload Model flow (buttons, inputs, selectors)upload-model-step1-continue-button)Benefits
[data-attr="upload-model-step2-confirm-button"]Review Focus
🤖 Generated with Claude Code
┆Issue is synchronized with this Notion page by Unito