Skip to content

[codex] Fix Brand Kit preview lifecycle guards#4527

Open
PerishCode wants to merge 3 commits into
even-ferryfrom
codex/brand-kit-preview-lifecycle
Open

[codex] Fix Brand Kit preview lifecycle guards#4527
PerishCode wants to merge 3 commits into
even-ferryfrom
codex/brand-kit-preview-lifecycle

Conversation

@PerishCode

Copy link
Copy Markdown
Contributor

Why

This PR fixes brand kit preview lifecycle guards on top of #4260.

The pain being addressed is state reliability: preview cards and the Brands tab need to avoid stale or unsafe lifecycle transitions while brand extraction and refresh state changes are in flight.

What users will see

In the #4260 Brand Kit flow, preview cards and the Brands tab should behave more consistently as extraction and refresh lifecycle state changes.

Surface area

  • UI — Brand Kit preview and Brands tab lifecycle handling in apps/web
  • Keyboard shortcut — new or changed
  • CLI / env var — new od subcommand or flag, new tools-dev / tools-pack / tools-pr 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 — Brand Kit preview lifecycle behavior changes in the Agent-driven brand extraction + two-loop memory overhaul #4260 flow
  • None — internal refactor, docs, tests, or translation update only

Screenshots

Not attached. Lifecycle behavior is covered by focused component tests.

Bug fix verification

Skipped. The branch includes focused component test coverage, but I did not rerun it locally while opening this PR.

Validation

  • Not run locally; PR opened from the existing branch for review.

@lefarcen lefarcen requested a review from mrcfps June 18, 2026 12:20
@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 Jun 18, 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).

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

@PerishCode Thanks for tightening the Brand Kit preview lifecycle guards. I found one merge-safe follow-up in the delete path; the concrete detail is inline.

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

Comment thread apps/web/src/components/BrandPreviewCard.tsx Outdated
Generated-By: looper 0.9.10+codex.autoclean (runner=fixer, agent=codex)
@PerishCode

Copy link
Copy Markdown
Contributor Author

Looper fixer round completead1f3c0

  • ✅ Review comment on apps/web/src/components/BrandPreviewCard.tsx (@mrcfps) — thread
    • Moved onBeforeMutation in apps/web/src/components/BrandPreviewCard.tsx so the parent detail clears only after the DELETE promise resolves, and added a focused failure test in apps/web/tests/components/BrandPreviewCard.test.tsx.
    • reply: failed

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

@lefarcen lefarcen requested a review from AmyShang-alt June 18, 2026 13:03

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

@PerishCode Thanks for following up on the preview lifecycle guard work. I found one merge-safe follow-up in the delete failure path; the concrete detail is inline.

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

Comment thread apps/web/src/components/BrandPreviewCard.tsx
Generated-By: looper 0.9.10+codex.autoclean (runner=fixer, agent=codex)
@PerishCode

Copy link
Copy Markdown
Contributor Author

Looper fixer round completef9ce970

  • ✅ Review comment on apps/web/src/components/BrandPreviewCard.tsx:388 (@mrcfps) — thread
    • Captured the DELETE response in BrandPreviewCard.tsx and throw on non-OK responses before clearing selection or navigating. Added a BrandPreviewCard.test.tsx regression for { ok: false } that keeps the parent detail selected.

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

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

@PerishCode I reviewed the updated Brand Kit preview lifecycle changes in BrandPreviewCard/BrandsTab, including the stale-route guard, delete failure handling, iframe remount keys, and the focused regression coverage added for refresh and delete paths. I did not find any actionable correctness or maintainability issues in the changed ranges. Thanks for tightening this flow and backfilling the follow-up tests.

🔁 Powered by Looper · runner=reviewer · agent=opencode · 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