Skip to content

Commit 6d7e76f

Browse files
committed
Add errors for install dir edge cases (#6733)
## Summary - show explicit validation errors when the install path lives inside the desktop app bundle or updater cache - include the new locale strings for these error prompts so the UI surfaces actionable guidance ## Testing - pnpm typecheck - pnpm lint:fix ## Notes Desktop types still need to be updated to include the new validation flags; see Comfy-Org/desktop#1400 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6733-Add-errors-for-install-dir-edge-cases-2af6d73d3650811bada6fc7dd72ecf68) by [Unito](https://www.unito.io)
1 parent 300c492 commit 6d7e76f

File tree

6 files changed

+57
-24
lines changed

6 files changed

+57
-24
lines changed

apps/desktop-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
"build-storybook": "storybook build -o dist/storybook"
9292
},
9393
"dependencies": {
94-
"@comfyorg/comfyui-electron-types": "0.4.73-0",
94+
"@comfyorg/comfyui-electron-types": "catalog:",
9595
"@comfyorg/shared-frontend-utils": "workspace:*",
9696
"@primevue/core": "catalog:",
9797
"@primevue/themes": "catalog:",

apps/desktop-ui/src/components/install/InstallLocationPicker.vue

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,19 +115,18 @@ import Button from 'primevue/button'
115115
import Divider from 'primevue/divider'
116116
import InputText from 'primevue/inputtext'
117117
import Message from 'primevue/message'
118-
import { type ModelRef, computed, onMounted, ref } from 'vue'
118+
import { computed, onMounted, ref } from 'vue'
119+
import type { ModelRef } from 'vue'
119120
import { useI18n } from 'vue-i18n'
120121
121-
import MigrationPicker from '@/components/install/MigrationPicker.vue'
122-
import MirrorItem from '@/components/install/mirror/MirrorItem.vue'
123-
import {
124-
PYPI_MIRROR,
125-
PYTHON_MIRROR,
126-
type UVMirror
127-
} from '@/constants/uvMirrors'
122+
import { PYPI_MIRROR, PYTHON_MIRROR } from '@/constants/uvMirrors'
123+
import type { UVMirror } from '@/constants/uvMirrors'
128124
import { electronAPI } from '@/utils/envUtil'
129125
import { ValidationState } from '@/utils/validationUtil'
130126
127+
import MigrationPicker from './MigrationPicker.vue'
128+
import MirrorItem from './mirror/MirrorItem.vue'
129+
131130
const { t } = useI18n()
132131
133132
const installPath = defineModel<string>('installPath', { required: true })
@@ -229,6 +228,10 @@ const validatePath = async (path: string | undefined) => {
229228
}
230229
if (validation.parentMissing) errors.push(t('install.parentMissing'))
231230
if (validation.isOneDrive) errors.push(t('install.isOneDrive'))
231+
if (validation.isInsideAppInstallDir)
232+
errors.push(t('install.insideAppInstallDir'))
233+
if (validation.isInsideUpdaterCache)
234+
errors.push(t('install.insideUpdaterCache'))
232235
233236
if (validation.error)
234237
errors.push(`${t('install.unhandledError')}: ${validation.error}`)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
"dependencies": {
121121
"@alloc/quick-lru": "catalog:",
122122
"@atlaskit/pragmatic-drag-and-drop": "^1.3.1",
123-
"@comfyorg/comfyui-electron-types": "0.4.73-0",
123+
"@comfyorg/comfyui-electron-types": "catalog:",
124124
"@comfyorg/design-system": "workspace:*",
125125
"@comfyorg/registry-types": "workspace:*",
126126
"@comfyorg/tailwind-utils": "workspace:*",

pnpm-lock.yaml

Lines changed: 41 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ packages:
44

55
catalog:
66
'@alloc/quick-lru': ^5.2.0
7+
'@comfyorg/comfyui-electron-types': 0.5.5
78
'@eslint/js': ^9.35.0
89
'@iconify-json/lucide': ^1.1.178
910
'@iconify/json': ^2.2.380

src/locales/en/main.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,8 @@
478478
"cannotWrite": "Unable to write to the selected path",
479479
"insufficientFreeSpace": "Insufficient space - minimum free space",
480480
"isOneDrive": "OneDrive is not supported. Please install ComfyUI in another location.",
481+
"insideAppInstallDir": "This folder is inside the ComfyUI Desktop application bundle and will be deleted during updates. Choose a directory outside the install folder, such as Documents/ComfyUI.",
482+
"insideUpdaterCache": "This folder is inside the ComfyUI updater cache, which is cleared on every update. Select a different location for your data.",
481483
"nonDefaultDrive": "Please install ComfyUI on your system drive (eg. C:\\). Drives with different file systems may cause unpredicable issues. Models and other files can be stored on other drives after installation.",
482484
"parentMissing": "Path does not exist - create the containing directory first",
483485
"unhandledError": "Unknown error",

0 commit comments

Comments
 (0)