Skip to content

fix web clone prompt seed across type switches - #7140

Open
open-design-crew[bot] wants to merge 2 commits into
mainfrom
codex/fix-home-tab-prompt-seed
Open

fix web clone prompt seed across type switches#7140
open-design-crew[bot] wants to merge 2 commits into
mainfrom
codex/fix-home-tab-prompt-seed

Conversation

@open-design-crew

@open-design-crew open-design-crew Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Why

I hit this while verifying the Chinese Home creation-type tabs. Website clone inserts a localized URL scaffold into an empty composer, but switching to Prototype or another type preserved that scaffold as if it were user-authored text. A reload made the problem sticky because the restored non-empty draft was marked as user-edited.

Follow-up UI verification found a second part of the same user flow: manually deleting the Website-clone scaffold worked only for the current page session. Reloading or restarting restored the scaffold, despite the user's explicit deletion.

What users will see

An untouched Website-clone URL scaffold is cleared when the user switches to another creation type. If the user adds a URL or edits the scaffold, the draft remains intact.

If the user manually deletes the scaffold, it stays dismissed across type switches, Home remounts, page reloads, and a full local daemon/web restart. The dismissal is scoped to the current Home composer draft and is cleared after a successful creation, together with the rest of that draft.

Drafts leaked by the previous behavior are cleaned up on the first fixed load, and the system-owned/user-owned distinction survives a real unmount and remount.

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.
  • Default behavior change — changes what existing users experience without opting in
  • None — internal refactor, docs, tests, or translation update only

Screenshots

Before/after browser verification screenshots are attached in the QA comments. The latest comment shows the empty Website-clone composer after manual deletion and confirms it remains empty after reload and a full local service restart.

Bug fix verification

  • Test path that reproduces the bug: apps/web/tests/components/HomeView.web-clone-tracking.test.tsx
  • Did the tests go red before the fix and green on this branch? yes
  • Original red result: expected an empty composer after switching to Prototype, received 想要复刻的网站链接:.
  • Follow-up red result: after manual deletion, type switch, unmount/remount, and returning to Website clone, expected an empty composer but received 想要复刻的网站链接:.
  • Green coverage verifies untouched-seed cleanup, manual dismissal persistence, user-edited URL preservation, unmount/remount restoration, and cleanup of a leaked legacy draft.

Validation

  • pnpm --filter @open-design/web test — 631 files passed; 6680 tests passed, 1 expected fail, 11 skipped
  • pnpm --filter @open-design/web typecheck
  • pnpm guard
  • Focused Home composer regression group — 45/45 passed
  • Local browser verification in Simplified Chinese:
    • untouched Website-clone scaffold clears on every other creation-type tab
    • manual deletion stays empty after switching away and back
    • manual deletion stays empty after page reload
    • manual deletion stays empty after stopping and restarting both local daemon and web services
    • edited https://example.com URL remains across type switches and reload
    • legacy leaked scaffold clears after reload

@open-design-crew

Copy link
Copy Markdown
Contributor Author

QA browser verification (Simplified Chinese)

  1. Website clone inserts the localized URL scaffold.
  2. Switching to Prototype clears the untouched scaffold.
  3. Editing the scaffold with https://example.com preserves the user draft across the same switch.
  4. A legacy leaked scaffold is removed after reload.

Automated validation: 631 test files passed; 6679 tests passed, 1 expected fail, 11 skipped. Typecheck and guard passed.

01-web-clone-seed.jpg

02-prototype-cleared.jpg

@lefarcen
lefarcen requested a review from PerishCode August 19, 2026 16:01
@lefarcen lefarcen added size/M PR changes 100-300 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).

@PerishCode PerishCode 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.

The persisted prompt-ownership marker can become stale across an existing live handoff, which makes the new remount logic delete a real user prompt. Please make marker revocation part of every non-scaffold prompt replacement and cover that remount path.

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

&& !(
pendingChipRestore?.chipId === 'web-clone'
&& (
pendingChipRestore.promptSeedKind === 'web-clone'

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.

Revoke a stale scaffold marker before treating every restored prompt as system-owned. The existing HOME_COMPOSER_SEED_EVENT path at onSeed replaces the prompt and marks it edited, but it does not clear active.promptSeedKind; the persistence effect therefore saves { chipId: 'web-clone', promptSeedKind: 'web-clone' } beside the handed-off prompt. After a real unmount/remount, this branch marks that arbitrary non-empty prompt unedited solely because the marker exists, and switching away from Website clone then clears it. This loses the prompt passed by seedHomeComposerPrompt, a documented cross-surface flow. Clear promptSeedKind whenever a non-scaffold prompt replaces the seed (including the live seed event), or centralize prompt replacement so the marker can only remain while the prompt is exactly the scaffold. Add a regression that selects Website clone, dispatches a different live seed, unmounts/remounts, switches to Prototype, and verifies the handed-off prompt remains.

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

@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Visual regression review

Head: 88eedd1 · Base: 057b0f4

0 changed · 49 unchanged · 0 new without baseline · 0 failed

Unchanged cases
Case Main PR Diff
visual-avatar-local-agent-list
0 px (0.00%)
main pr diff
visual-avatar-local-agent-list-panel
0 px (0.00%)
main pr diff
visual-avatar-menu
0 px (0.00%)
main pr diff
visual-avatar-menu-panel
0 px (0.00%)
main pr diff
visual-avatar-open-design-model-picker
0 px (0.00%)
main pr diff
visual-critical-settings
0 px (0.00%)
main pr diff
visual-critical-workspace
0 px (0.00%)
main pr diff
visual-critical-workspace-preview
0 px (0.00%)
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 diff is advisory only and does not block merging.

@open-design-crew

Copy link
Copy Markdown
Contributor Author

Follow-up QA for manual Website-clone scaffold dismissal:

  • real keyboard deletion: empty after switching to Prototype and back
  • page reload: remains empty
  • full local daemon + web stop/start: remains empty
  • edited URL draft still survives type switches and reload

Automated validation: focused Home regressions 45/45; full web 6680 passed, 1 expected fail, 11 skipped; web typecheck and root guard passed.

01-delete-switch-back-empty.jpg

02-after-reload-still-empty.jpg

03-after-full-restart-still-empty.jpg

@PerishCode PerishCode 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.

The persisted Website-clone seed ownership can still survive a live prompt handoff and cause a real user prompt to be deleted after remount. Please revoke seed ownership for every non-scaffold prompt replacement and add the live-handoff remount regression before merge.

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

Comment on lines +2114 to +2115
if (active?.promptSeedKind) {
setActive({ ...active, promptSeedKind: null });

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.

Clear seed ownership for programmatic prompt replacements too. These changed lines revoke promptSeedKind only when handlePromptChange processes an editor edit, but the existing HOME_COMPOSER_SEED_EVENT handler replaces the prompt with setPrompt(prompt) and marks it user-edited without clearing active.promptSeedKind. The persistence effect then stores the handed-off prompt beside promptSeedKind: 'web-clone'; after unmount/remount, the new restore logic treats that arbitrary prompt as system-owned, and switching to Prototype deletes it. Update the live seed handler (and preferably centralize all non-scaffold prompt replacement) to clear promptSeedKind, then add a regression that selects Website clone, calls seedHomeComposerPrompt with different text while mounted, unmounts/remounts, switches to Prototype, and verifies that text remains.

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

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/M PR changes 100-300 lines type/bugfix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants