Skip to content

fix(web): preserve prompt template media metadata - #7102

Open
YUHAO-corn wants to merge 1 commit into
nexu-io:mainfrom
YUHAO-corn:yuhao/fix-home-template-media-metadata-7088
Open

fix(web): preserve prompt template media metadata#7102
YUHAO-corn wants to merge 1 commit into
nexu-io:mainfrom
YUHAO-corn:yuhao/fix-home-template-media-metadata-7088

Conversation

@YUHAO-corn

Copy link
Copy Markdown
Contributor

Refs #7088

Why

Choosing an image prompt template from Home could produce a contradictory project: the template said gpt-image-2 and 3:4, while the stored project metadata still said the default Vela model and 16:9. The mismatch was especially easy to hit when prompt templates arrived after the Home composer had already mounted, and it could reappear after a rejected create was retried.

This PR implements only the independently approved template-propagation slice from #7088. The broader user-level media defaults, runtime propagation, Cloud authentication, catalog labels, and migration work remain out of scope.

What users will see

Image projects created from Home now keep the selected prompt template's supported model and aspect ratio through initial selection, delayed template loading, project creation, and retry. Users can still change the model or aspect afterward without the template silently pinning it again.

Surface area

  • UI — new page / dialog / panel / menu item / setting / empty state in apps/web or apps/desktop (including Electron menu bar)
  • Keyboard shortcut — new or changed
  • CLI / env var — new od subcommand or flag, new tools-dev / tools-pack flag, or new OD_* env var
  • API / contract — new /api/* endpoint, new SSE event, or changed shape in packages/contracts
  • Extension point — new entry under skills/, design-systems/, design-templates/, or craft/, or change to the skills protocol
  • i18n keys — added new translation keys (see TRANSLATIONS.md for the locale workflow)
  • New top-level dependency — adding any new entry to the root package.json (dependencies or devDependencies); workspace-package package.json files are out of scope. Include a paragraph on what we get vs. what bytes we ship (see CONTRIBUTING.md → Code style)
  • Default behavior change — changes what existing users experience without opting in (default model, default setting, file/SQLite schema, auto-network on startup, auto-install)
  • None — internal refactor, docs, tests, or translation update only

Screenshots

N/A — this changes the project metadata emitted by the existing Home template flow, without changing its layout or controls. The submitted payload is covered by the HomeView integration test.

Bug fix verification

  • Test paths: apps/web/tests/home-media-surfaces.test.ts and apps/web/tests/components/HomeView.media-options.test.tsx
  • The focused specs went red on the pre-fix code and green after the source changes.
  • Coverage includes initial selection, delayed template hydration, template switching, later user overrides, dynamic AIHubMix model ids, invalid catalog values, submit-time input stripping, and rejected-create retry.

Validation

  • pnpm --filter @open-design/web exec vitest run -c vitest.config.ts tests/home-media-surfaces.test.ts tests/components/HomeView.media-options.test.tsx --maxWorkers=2 (29 passed)
  • pnpm --filter @open-design/web test
  • pnpm --filter @open-design/web typecheck
  • pnpm guard
  • pnpm typecheck
  • git diff --check

Implementation and test drafting were AI-assisted. I reviewed the final diff and independently verified the behavior and validation results above.

@YUHAO-corn
YUHAO-corn marked this pull request as ready for review August 19, 2026 02:01
@lefarcen
lefarcen requested a review from nettee August 19, 2026 02:03
@lefarcen lefarcen added size/L PR changes 300-700 lines risk/medium Medium risk: regular code changes type/bugfix Bug fix needs-validation Runtime change detected; needs human or /explore agent validation. labels Aug 19, 2026
@lefarcen

Copy link
Copy Markdown
Contributor

🧪 This PR has changes that need a manual QA pass before merge — please hold off self-merging for now; we'll loop QA in once it's merge-ready (and design/product have signed off, where applicable).

@nettee nettee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@YUHAO-corn

I reviewed the changed Home media state and metadata paths and verified the initial, delayed-template, template-switch, override, and rejected-create retry flows. The focused Home media suite passes all 29 tests, and the full web suite, workspace typecheck, and guard are clean. Nice work closing the metadata gap while keeping the deferred run inputs intact—this is a thoughtful, well-covered fix.

🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.

@github-actions

Copy link
Copy Markdown
Contributor

Visual regression review

Head: a444fd0 · Base: b084ab0

⚠️ 1 case(s) failed during diff generation; partial captures are shown below.

0 changed · 21 unchanged · 0 new without baseline · 1 failed

Capture or diff failures

Unchanged cases
Case Main PR Diff
visual-design-system-detail
0 px (0.00%)
main pr diff
visual-design-systems
0 px (0.00%)
main pr diff
visual-home
0 px (0.00%)
main pr diff
visual-home-catalog
0 px (0.00%)
main pr diff
visual-home-context-picker
0 px (0.00%)
main pr diff
visual-home-context-picker-popover
0 px (0.00%)
main pr diff
visual-home-plugin-filter
0 px (0.00%)
main pr diff
visual-home-plugin-use-staged
0 px (0.00%)
main pr diff
visual-home-plugin-use-with-query
0 px (0.00%)
main pr diff
visual-home-staged-attachment
0 px (0.00%)
main pr diff
visual-integrations
0 px (0.00%)
main pr diff
visual-integrations-mcp
0 px (0.00%)
main pr diff
visual-integrations-use-everywhere
0 px (0.00%)
main pr diff
visual-new-project-modal
0 px (0.00%)
main pr diff
visual-onboarding-cloud
0 px (0.00%)
main pr diff
visual-plugin-details
0 px (0.00%)
main pr diff
visual-plugin-share-menu
0 px (0.00%)
main pr diff
visual-plugin-share-menu-popover
0 px (0.00%)
main pr diff
visual-plugins
0 px (0.00%)
main pr diff
visual-projects
0 px (0.00%)
main pr diff

Visual diff is advisory only and does not block merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-validation Runtime change detected; needs human or /explore agent validation. risk/medium Medium risk: regular code changes size/L PR changes 300-700 lines type/bugfix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants