Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/renderer/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ const themeOverrides = {
Select: {
peers: {
InternalSelectMenu: {
color: 'rgba(20, 20, 20, 0.9)', // Darker menu for contrast
optionTextColor: 'white',
color: 'rgba(255, 255, 255, 0.95)', // Darker menu for contrast

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The comment // Darker menu for contrast is no longer accurate after changing the color to rgba(255, 255, 255, 0.95), which is a very light color. Please update the comment to reflect that this is now a light menu to avoid confusion for future developers.

        color: 'rgba(255, 255, 255, 0.95)', // Light menu for contrast

optionTextColor: 'black',
optionTextColorActive: '#007AFF',
borderRadius: '16px',
padding: '8px',
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/src/store/zimageStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ export const useZImageStore = defineStore(
// Future models can be added here
])

const checkModel = async (modelName = 'z-image-turbo'): Promise<boolean> => {
console.log(`[Store] Checking model status for: ${modelName}`)
const checkModel = async (modelName = 'z-image-turbo', fastCheck = true): Promise<boolean> => {
console.log(`[Store] Checking model status for: ${modelName} (Fast: ${fastCheck})`)

try {
// Pass modelFolder if available
const result = await ipcRenderer.invoke(IpcChannelInvoke.CHECK_MODEL_STATUS, modelName, false, modelFolder.value)
const result = await ipcRenderer.invoke(IpcChannelInvoke.CHECK_MODEL_STATUS, modelName, fastCheck, modelFolder.value)
console.log(`[Store] Check result:`, result)

modelStatus.value[modelName] = result
Expand Down
44 changes: 26 additions & 18 deletions src/renderer/src/views/ZImageGenerate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,33 @@ const galleryRef = ref<HTMLElement | null>(null)
const containerWidth = ref(1200) // Default start width
let resizeObserver: ResizeObserver | null = null

// Validation
const canGenerate = computed(() => {
if (isGenerating.value)
return true // Allow stopping
return !!modelFolder.value && !!outputFolder.value
})
Comment on lines +64 to +68

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The logic in canGenerate is confusing. The if (isGenerating.value) branch and the // Allow stopping comment are misleading because this computed property is only used to validate starting a generation, not stopping it. This makes the code harder to understand and maintain. For better clarity, canGenerate should only contain logic relevant to its actual use case.

const canGenerate = computed(() => {
  return !!modelFolder.value && !!outputFolder.value
})


const validationMessage = computed(() => {
if (!modelFolder.value)
return t('validation.modelFolderRequired')
if (!outputFolder.value)
return t('validation.outputFolderRequired')
return ''
})

// Lifecycle
onMounted(async () => {
await fetchModels()
checkAllModels() // Check all zoo models status

// Initial validation check to guide user
if (validationMessage.value) {
message.warning(validationMessage.value, { duration: 5000 })
// Optional: Auto-open settings if critical config missing?
// showSettings.value = true
}

// If we have a selected model, check it specifically (in case it's local custom)
if (selectedModel.value && !availableModels.value.includes(selectedModel.value)) {
checkModel(selectedModel.value)
Expand Down Expand Up @@ -117,20 +139,6 @@ watch(logs, () => {
})

// Actions
// Validation
const canGenerate = computed(() => {
if (isGenerating.value)
return true // Allow stopping
return !!modelFolder.value && !!outputFolder.value
})

const validationMessage = computed(() => {
if (!modelFolder.value)
return t('validation.modelFolderRequired')
if (!outputFolder.value)
return t('validation.outputFolderRequired')
return ''
})

function handleGenerate(): void {
if (!prompt.value)
Expand Down Expand Up @@ -503,8 +511,8 @@ const gridStyle = computed(() => {
transform-origin="center"
>
<NCard
class="glass-panel"
style="width: 400px;"
class="ios-glass-dark"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Using the ios-glass-dark class here creates a dark background for the download modal. However, the text colors for the download progress information have been changed to black (in lines 808 and 814), which will result in very poor contrast and make the text unreadable. It seems the intention was to have a light-themed modal. To fix this, you should use a class that provides a light background, such as glass-panel which was used previously.

        class="glass-panel"

style="width: 400px; --n-color: transparent;"
:title="t('common.downloading')"
:bordered="false"
size="huge"
Expand Down Expand Up @@ -797,13 +805,13 @@ const gridStyle = computed(() => {
align-items: center;
margin-bottom: 8px;
font-size: 13px;
color: rgba(255, 255, 255, 0.9);
color: #333;
}

.download-size {
font-variant-numeric: tabular-nums;
font-weight: 600;
color: white;
color: #000;
}
}
</style>