feat(desktop): test-connection button for image providers + DX improvements#369
feat(desktop): test-connection button for image providers + DX improvements#369tiegebentley wants to merge 5 commits into
Conversation
Enables running just the renderer at :5175 without Electron, useful for headless Linux dev (no $DISPLAY). Defines __APP_VERSION__ so TopBar renders without the electron-vite pipeline. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Resolves credentials for all three paths (inherited, custom encrypted, ChatGPT OAuth) and probes GET /models on the image baseUrl. Includes UI button with loading/success/error toasts, 5 unit tests, and i18n strings for en/es/zh-CN. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
In-memory implementation of window.codesign so the renderer runs standalone via vite.browser.config.ts with design CRUD, chat, snapshots, and comments all functional. Generation returns a placeholder HTML card. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
When REMOTE_DEBUGGING_PORT is set, pass --remote-debugging-port and --remote-allow-origins=* to Electron so Chrome DevTools can attach from a remote machine. Also fix a pre-existing biome lint warning (useless ternary in AddCustomProviderModal). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
GPT-4o models have a 16384 output token limit, not 32000. The generic fallback caused silent truncation on long generations. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Review mode: initial
Findings
-
[Minor] Missing changeset — the PR adds user-visible features (test connection button, GPT-4o maxTokens fix, i18n keys) that should trigger a changeset for changelog generation. See
CONTRIBUTING.mdor runpnpm changeset.
Suggested fix: runpnpm changesetand commit the generated file. -
[Nit] Browser shim imported unconditionally —
installBrowserShim()is called at the top ofmain.tsx(apps/desktop/src/renderer/src/main.tsx:12). In Electron mode it returns early, but the entire 702‑line module is still parsed and included in the production renderer bundle. This adds no runtime behavior change but wastes a few KB. Consider a dynamic import or a conditional check around the import statement so the module is only loaded when needed.
Suggested fix: wrap the import in a condition likeif (!('electronAPI' in window)) import('./browser-shim').then(...)or restructure the build config to exclude it for Electron builds. -
[Nit] Remote debugging port security —
apps/desktop/scripts/dev.cjs:24sets--remote-allow-origins=*, which opens the debugging port to any origin. This is gated behind an env variable and only runs in dev, but the code comment could mention it must not be used in production or CI runners that expose ports.
No change required, but consider a cautionary comment.
Summary
The PR adds four features: (1) a test‑connection button for image generation providers with full credential resolution (inherited, custom, ChatGPT OAuth), (2) a browser‑mode IPC shim for UI development without Electron, (3) a remote debugging port option via REMOTE_DEBUGGING_PORT, and (4) a GPT-4o maxTokens cap fix. All changes are well‑structured, follow the project stack (Tailwind tokens, i18n, Zustand), and include unit tests for the new resolveImageGenerationTestCredentials function. No security or data‑loss issues introduced. The only material gap is the missing changeset — user‑visible features require one per repo conventions. The browser shim import and remote debugging port are minor polish suggestions.
Testing
- New unit tests cover all credential resolution paths (
image-generation-settings.test.ts). - 1341 existing tests pass, typecheck clean, Biome lint clean.
- No Playwright E2E tests added; the feature is UI‑only and adequately covered by the unit tests.
Open-CoDesign Bot
Summary
GET /modelson the configured image baseUrl. Loading/success/error toasts, 5 unit tests, i18n for en/es/zh-CN.window.codesignso the renderer runs standalone viavite.browser.config.tswithout Electron. Design CRUD, chat, snapshots, and comments all functional; generation returns a placeholder HTML card. Useful for UI development and testing on headless servers.REMOTE_DEBUGGING_PORTenv var is set, passes--remote-debugging-portand--remote-allow-origins=*to Electron so Chrome DevTools can attach from a remote machine.Test plan
pnpm test)image-generation-settings.test.tscovers all credential resolution paths🤖 Generated with Claude Code