Skip to content

fix: Image tag as select (Stable/Beta/Custom), rebuilt on vendor change (studio#128) - #138

Merged
brettchien merged 1 commit into
mainfrom
fix/image-tag-select-vendor-refresh
Aug 29, 2026
Merged

fix: Image tag as select (Stable/Beta/Custom), rebuilt on vendor change (studio#128)#138
brettchien merged 1 commit into
mainfrom
fix/image-tag-select-vendor-refresh

Conversation

@brettchien

Copy link
Copy Markdown
Contributor

Summary

Two bug reports from Brett live-testing the New Fleet wizard:

  1. "when I select different vendor, the image tag is not changed automatically" — the old <input id="deploy-image"> had its .value silently mutated on vendor change, easy to miss visually.
  2. "for image tag, it should be selections and if select custom then user can input a full image url" — no structured way to pick Stable vs. Beta vs. a full custom URL.

Change

  • console/index.html: <input id="deploy-image"><select id="deploy-image-select"> + a deploy-image-custom-wrap label/input pair, hidden unless "Custom…" is picked.
  • console/src/deploy.ts:
    • loadVendorImage() now rebuilds the <select>'s option list from scratch on every vendor change (via resolve_vendor_image_tags) — Stable and/or Beta as real options (value = resolved tag), plus an always-present "Custom…" sentinel. Rebuilding the whole list (not mutating one field's value) makes the vendor-change effect visible.
    • New applyImageMode() toggles the custom-URL field's visibility (reuses the .compose-form label[hidden] CSS-specificity fix from fix: chat token/secret visibility bug + ACP token field (studio#132/#136) #137 — no new CSS needed, same class).
    • New currentImage() resolves whichever is actually active (resolved tag or the free-text custom URL); the deploy submit handler now calls it instead of reading the old input directly.

No Rust/Tauri/MCP changes — pure console-side fix.

Test plan

  • npm run typecheck clean
  • npm test — 100/100 passing
  • npm run build clean
  • Brett to confirm in a live run: vendor change visibly rebuilds the Image tag options, and Custom reveals a working free-text field

🤖 Generated with Claude Code

…tudio#128)

Brett's live-testing report: switching vendor didn't visibly update the
Image tag field, and there was no way to enter a full custom image URL.

The old implementation silently mutated one text input's `.value` on
vendor change — easy to miss, and offered no structured way to pick
"give me a full custom URL" vs. "use what GHCR resolved".

Replaces the free-text `<input id="deploy-image">` with:
- `<select id="deploy-image-select">`, rebuilt from scratch on every
  vendor change from `resolve_vendor_image_tags`'s Stable/Beta results
  (option value = the real resolved tag, label shows which is which).
  Rebuilding the whole list (not mutating one value) makes the change
  visually obvious.
- A trailing "Custom…" option that reveals a `deploy-image-custom-wrap`
  text field (same `[hidden]` CSS-specificity fix pattern as #137) for
  pasting a full image URL.

`currentImage()` resolves whichever is actually selected; the deploy
submit handler now calls it instead of reading the old input directly.

Verification: npm run typecheck / test (100/100) / build all clean.
Rust/Tauri/MCP untouched — this is a pure console-side change.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@brettchien
brettchien merged commit 716996d into main Aug 29, 2026
2 checks passed
@brettchien
brettchien deleted the fix/image-tag-select-vendor-refresh branch August 29, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant