Repository navigation
fix(desktop): keep image generation model row visible without candidates - #2568
Conversation
The GenerateImages IMAGE_NOT_CONFIGURED error sends the user to Settings > Models > Image generation model, but both the settings page and the row hid themselves while no image-capable model existed, turning the pointer into a dead end (vastsa#2563). Render the section unconditionally and show an explicit no-candidates state in the row; the row already had the same pattern for an unset default. The error copy now also states that MCP image tools are separate and never back the built-in tool.
|
@pi review code |
|
Pi finished @Tioit-Wang's task —— View job VerdictDirection is right and the zero-candidate fix is correct, but I would not merge this as-is: the fix leaves the same dead end reachable, contradicts the pinned E2E scenario doc, and the new test almost certainly cannot run (it was never executed locally). Blocking1. The row still disappears when candidates exist but none are runnable — the same #2563 dead end
if (!options.some((option) => !option.disabled)) return null;
2. The behavior change contradicts the E2E scenario doc
3. The fixture string at Non-blocking
What I verified as sound
Run details · 2m 23s · 835.2k tokens · ≈$0.063
|
Keep the settings row visible when every marked model is unavailable. Exercise the empty, unavailable, and runnable states in Electron CI and update the settings scenario to match the actual navigation and UI.
Summary / 概要
The built-in GenerateImages error (
IMAGE_NOT_CONFIGURED) sends the user to Settings → Models → Image generation model, but that settings block hid itself entirely while no image-capable model existed:ModelConfigPagegated the section onimageGenerationCandidates.length > 0andImageGenerationModelRowreturnednullfor an empty candidate list. The error pointer landed on nothing (#2563, reported on Windows; the logic is platform-independent).Changes:
model-default-emptypattern the row already uses for an unset default), pointing at where to mark a model.imageModelNoneAvailablecopy to all nine locales.IMAGE_NOT_CONFIGUREDnow also states that MCP image tools are separate tools and cannot back the built-in tool, so an installed MCP image service no longer reads as a broken backend.image-generation-row-empty-state.test.mjspins both states (empty list → visible row, no picker; real candidates → normal picker).Out of scope: a formal provider protocol for MCP image services to back the built-in tool (product decision requested in the issue).
Requirement link / 需求关联
Closes #2563(The two UI boxes are left unchecked: I could not run the app locally to capture before/after screenshots; the rendered empty-state markup is pinned by the new test.)
Validation / 验证
Task candidate: branch
fix/image-model-row-visible-2563, HEADc0f6df855, based onorigin/main8ac4a9f495d5b1e5fa7957acdf157aa9567462bc(merge-base --is-ancestorverified).pnpm build:js— passpnpm --filter @pi-desktop/desktop typecheck— passpnpm lint— passnode --test test/image-generation.test.mjs test/provider-model-config.test.mjs test/settings-general.test.mjs— 54/54 passnode --test test/model-advanced-capabilities.test.mjs— 18/18 pass (its source assertion pinning the old hidden-row behavior was updated to pin the new empty-state behavior)node --test test/image-generation-row-empty-state.test.mjs— NOT RUN locally: the Electron binary is missing because dependencies were installed with--ignore-scripts; the test code was verified by bundling it with the same esbuild config (0 errors) and by a throwawayreact-dom/serverrender of the row component asserting both states. It will run in CI.Rollback / 回滚
Single commit; revert it to restore the previous conditional rendering and error copy.