mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
## Summary Extracts desktop UI into apps/desktop-ui package with minimal changes. ## Changes - **What**: - Separates desktop-specific code into standalone package with independent Vite config, router, and i18n - Drastically simplifies the main app router by removing all desktop routes - Adds a some code duplication, most due to the existing design - Some duplication can be refactored to be *simpler* on either side - no need to split things by `isElectron()` - Rudimentary storybook support has been added - **Breaking**: Stacked PR for publishing must be merged before this PR makes it to stable core (but publishing _could_ be done manually) - #5915 - **Dependencies**: Takes full advantage of pnpm catalog. No additional dependencies added. ## Review Focus - Should be no changes to normal frontend operation - Scripts added to root package.json are acceptable - The duplication in this PR is copied as is, wherever possible. Any corrections or fix-ups beyond the scope of simply migrating the functionality as-is, can be addressed in later PRs. That said, if any changes are made, it instantly becomes more difficult to separate the duplicated code out into a shared utility. - Tracking issue to address concerns: #5925 ### i18n Fixing i18n is out of scope for this PR. It is a larger task that we should consider carefully and implement properly. Attempting to isolate the desktop i18n and duplicate the _current_ localisation scripts would be wasted energy.
74 lines
1.6 KiB
TypeScript
74 lines
1.6 KiB
TypeScript
// eslint-disable-next-line storybook/no-renderer-packages
|
|
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
|
|
import HardwareOption from './HardwareOption.vue'
|
|
|
|
const meta: Meta<typeof HardwareOption> = {
|
|
title: 'Desktop/Components/HardwareOption',
|
|
component: HardwareOption,
|
|
parameters: {
|
|
layout: 'centered',
|
|
backgrounds: {
|
|
default: 'dark',
|
|
values: [{ name: 'dark', value: '#1a1a1a' }]
|
|
}
|
|
},
|
|
argTypes: {
|
|
selected: { control: 'boolean' },
|
|
imagePath: { control: 'text' },
|
|
placeholderText: { control: 'text' },
|
|
subtitle: { control: 'text' }
|
|
}
|
|
}
|
|
|
|
export default meta
|
|
type Story = StoryObj<typeof meta>
|
|
|
|
export const AppleMetalSelected: Story = {
|
|
args: {
|
|
imagePath: '/assets/images/apple-mps-logo.png',
|
|
placeholderText: 'Apple Metal',
|
|
subtitle: 'Apple Metal',
|
|
value: 'mps',
|
|
selected: true
|
|
}
|
|
}
|
|
|
|
export const AppleMetalUnselected: Story = {
|
|
args: {
|
|
imagePath: '/assets/images/apple-mps-logo.png',
|
|
placeholderText: 'Apple Metal',
|
|
subtitle: 'Apple Metal',
|
|
value: 'mps',
|
|
selected: false
|
|
}
|
|
}
|
|
|
|
export const CPUOption: Story = {
|
|
args: {
|
|
placeholderText: 'CPU',
|
|
subtitle: 'Subtitle',
|
|
value: 'cpu',
|
|
selected: false
|
|
}
|
|
}
|
|
|
|
export const ManualInstall: Story = {
|
|
args: {
|
|
placeholderText: 'Manual Install',
|
|
subtitle: 'Subtitle',
|
|
value: 'unsupported',
|
|
selected: false
|
|
}
|
|
}
|
|
|
|
export const NvidiaSelected: Story = {
|
|
args: {
|
|
imagePath: '/assets/images/nvidia-logo-square.jpg',
|
|
placeholderText: 'NVIDIA',
|
|
subtitle: 'NVIDIA',
|
|
value: 'nvidia',
|
|
selected: true
|
|
}
|
|
}
|