From b2777fd834da8be62e56f79663d091d78cc15f43 Mon Sep 17 00:00:00 2001 From: Yang Jun Date: Tue, 23 Jun 2026 14:10:22 +0800 Subject: [PATCH] fix(docs): ensure capture indicator colors apply instantly Disable indicator transitions and cancel active animations before setting data-state so pending yellow is not stuck on the prior ok green. Co-authored-by: Cursor --- bin/capture-readme-playground.mjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/capture-readme-playground.mjs b/bin/capture-readme-playground.mjs index bc0e3a6c9..e988967b3 100644 --- a/bin/capture-readme-playground.mjs +++ b/bin/capture-readme-playground.mjs @@ -72,6 +72,7 @@ async function prepareCapture (page, { fullTemplate, fullContext }) { #playground .capture-json .json-string { color: #cf222e; } #playground .pane-indicator { animation: none; + transition: none; transform: none; box-shadow: none; opacity: 1; @@ -122,7 +123,9 @@ async function prepareCapture (page, { fullTemplate, fullContext }) { function setIndicator (area, state) { const el = document.querySelector(area + ' .pane-indicator') - if (el) el.dataset.state = state + if (!el) return + el.getAnimations().forEach((a) => a.cancel()) + el.dataset.state = state } document.querySelector('#playground .playground-hero')?.remove()