Refactor Svelte live guidance into adapter reference#196
Draft
abdulwahabone wants to merge 16 commits into
Draft
Refactor Svelte live guidance into adapter reference#196abdulwahabone wants to merge 16 commits into
abdulwahabone wants to merge 16 commits into
Conversation
a56bc2f to
af0a045
Compare
Contributor
Author
|
Found another bug. fixing |
a781543 to
e70b707
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
docs/plans/live-svelte-guidance-refactor.mdas the first commit on this branch.skill/reference/live-svelte.mdsoskill/reference/live.mdstays framework-neutral.guidanceRefs: ["reference/live-svelte.md"]to the Svelte adapter paths fromlive-inject,live-wrap, andlive-insert;live.mjspreserves those refs in the boot payload.live-svelte.mdonly for Svelte component-preview runs while still passing the per-runcssAuthoringcontract.data-testidare preferred over generatedsvelte-*classes, and mounted state checkpoints after binding.{expenses.length} offen, so generated variants preserve the static label while binding only the dynamic segment.<span>{expenses.length}</span><span>offen</span>, by capturing live prop values before DOM replacement and matching significant text nodes structurally instead of by raw global text-node index.data-p-*="true", and Svelte accept cleanup keeps matching boolean/legacy truthy selector branches.body/html, the shader now captures the selected card directly and composites it over the resolved page backdrop color instead of rendering/cropping the full document root.site/pages/shader-lab/index.astrowith the alpha-aware shader proxy logic so the Svelte framework-proxy fixture remains a faithful repro harness.{#if},{:else}, and{/if}are not emitted as props, duplicate prop names are avoided, and hidden branch text no longer shifts LLM prop substitution.bun run build.tmp/framework-tests/.Validation On Current Branch
git diff --checkbun run buildnode --test tests/live-svelte-component.test.mjs tests/live-browser-regression.test.mjs tests/live-e2e-agent-output.test.mjsnode --test tests/live-browser-regression.test.mjs tests/live-e2e-agent-output.test.mjs tests/live-svelte-component.test.mjsbun test tests/live-reference.test.mjsnode --test tests/framework-fixtures.test.mjsIMPECCABLE_E2E_ONLY=vite8-sveltekit bun run test:live-e2eIMPECCABLE_E2E_ONLY=vite8-sveltekit-stateful bun run test:live-e2eIMPECCABLE_E2E_ONLY=vite8-sveltekit IMPECCABLE_E2E_AGENT=llm IMPECCABLE_E2E_LLM_PROVIDER=deepseek DEEPSEEK_API_KEY=... bun run test:live-e2eIMPECCABLE_SVELTE_DEEPSEEK_ARTIFACT_DIR=/tmp/impeccable-svelte-open-count-fixed-final DEEPSEEK_API_KEY=... node --test --test-timeout=600000 --test-name-pattern "open-count text emphasis" tmp/framework-tests/live-svelte-adapter-deepseek.test.mjsIMPECCABLE_SVELTE_DEEPSEEK_ARTIFACT_DIR=/tmp/impeccable-svelte-split-count-fixed DEEPSEEK_API_KEY=... node --test --test-timeout=600000 --test-name-pattern "split open-count state" tmp/framework-tests/live-svelte-adapter-deepseek.test.mjsIMPECCABLE_SVELTE_DEEPSEEK_ARTIFACT_DIR=/tmp/impeccable-svelte-shader-crop-repro DEEPSEEK_API_KEY=... node --test --test-timeout=600000 --test-name-pattern "movie-card shader crop" tmp/framework-tests/live-svelte-adapter-deepseek.test.mjsIMPECCABLE_SVELTE_DEEPSEEK_ARTIFACT_DIR=/tmp/impeccable-svelte-shader-crop-fixed DEEPSEEK_API_KEY=... node --test --test-timeout=600000 --test-name-pattern "movie-card shader crop" tmp/framework-tests/live-svelte-adapter-deepseek.test.mjsIMPECCABLE_SVELTE_DEEPSEEK_ARTIFACT_DIR=/tmp/impeccable-svelte-framework-proxy-repro DEEPSEEK_API_KEY=... node --test --test-timeout=600000 --test-name-pattern "framework proxy" tmp/framework-tests/live-svelte-adapter-deepseek.test.mjsIMPECCABLE_SVELTE_DEEPSEEK_ARTIFACT_DIR=/tmp/impeccable-svelte-framework-proxy-fixed DEEPSEEK_API_KEY=... node --test --test-timeout=600000 --test-name-pattern "framework proxy" tmp/framework-tests/live-svelte-adapter-deepseek.test.mjsIMPECCABLE_SVELTE_DEEPSEEK_ARTIFACT_DIR=/tmp/impeccable-svelte-movie-card-shader-after-proxy-fix DEEPSEEK_API_KEY=... node --test --test-timeout=600000 --test-name-pattern "movie-card" tmp/framework-tests/live-svelte-adapter-deepseek.test.mjsIMPECCABLE_SVELTE_DEEPSEEK_ARTIFACT_DIR=/tmp/impeccable-svelte-movie-heading-bleed-repro DEEPSEEK_API_KEY=... node --test --test-timeout=600000 --test-name-pattern "movie-card" tmp/framework-tests/live-svelte-adapter-deepseek.test.mjsIMPECCABLE_SVELTE_DEEPSEEK_ARTIFACT_DIR=/tmp/impeccable-svelte-movie-heading-bleed-fixed DEEPSEEK_API_KEY=... node --test --test-timeout=600000 --test-name-pattern "movie-card" tmp/framework-tests/live-svelte-adapter-deepseek.test.mjsIMPECCABLE_SVELTE_DEEPSEEK_ARTIFACT_DIR=/tmp/impeccable-svelte-movie-accept-duplicate-repro DEEPSEEK_API_KEY=... node --test --test-timeout=600000 --test-name-pattern "movie-card accept" tmp/framework-tests/live-svelte-adapter-deepseek.test.mjsIMPECCABLE_SVELTE_DEEPSEEK_ARTIFACT_DIR=/tmp/impeccable-svelte-movie-accept-duplicate-fixed DEEPSEEK_API_KEY=... node --test --test-timeout=600000 --test-name-pattern "movie-card accept" tmp/framework-tests/live-svelte-adapter-deepseek.test.mjsIMPECCABLE_SVELTE_DEEPSEEK_ARTIFACT_DIR=/tmp/impeccable-svelte-framework-proxy-after-heading-fix DEEPSEEK_API_KEY=... node --test --test-timeout=600000 --test-name-pattern "framework proxy" tmp/framework-tests/live-svelte-adapter-deepseek.test.mjsbun run testDeepSeek / Visual Evidence
deepseek-v4-flash./tmp/impeccable-svelte-open-count-fixed-final./tmp/impeccable-svelte-split-count-fixed./tmp/impeccable-svelte-shader-crop-fixed./tmp/impeccable-svelte-framework-proxy-fixed./tmp/impeccable-svelte-movie-card-shader-after-proxy-fix./tmp/impeccable-svelte-movie-heading-bleed-fixed./tmp/impeccable-svelte-movie-accept-duplicate-fixed./tmp/impeccable-svelte-framework-proxy-after-heading-fix./Users/abdulwahab/impeccable-live-svelte, captures original/proxy/shader/variant screenshots, and verifiesdebugState().shaderCapture.strategy === "ancestor-crop"with capture root.shader-proxy-shell, zero rect drift, and painted shader pixels..movie-grid > li:first-child .movie-card, captures original card, heading, selected chrome, generating shader, and both variants, asserts the shader rect matches the selected card within 2px, asserts the shader crop is visually closer to the card than to theFilms (API practice)heading, and now verifies document-backed translucent cards usedirect-composited-backdropwith capture rootarticle.movie-cardrather thanbody/html.Castle in the Skyappears once immediately after Accept.2 offenbrowser path, captures original and variant screenshots, asserts every mounted Svelte variant renders exact normalized text2 offen, verifies the numeric text run has nonzero bounds/painted pixels, and discards cleanly./tmp/impeccable-live-svelte-external-pr196-2026-06-02T23-28-51-245Z.tmp/framework-tests/per request and is not part of this PR diff.Svelte App Install Check
/Users/abdulwahab/impeccable-live-svelteunder.cursor/skills/impeccableand.agents/skills/impeccable.live-browser.jscopies containdirect-composited-backdrop,captureElementDirectCompositedForShader,cssColorAlpha, andpaintsOpaqueOwnShaderSurface.live-svelte-component.mjscopies contain the updated Svelte expression extraction path.Draft Status
This PR remains draft for reviewer/maintainer inspection.
Note
Medium Risk
Large changes to in-browser live mode (DOM binding, accept, shader capture) on a critical user path; scope is preview/UX tooling rather than auth or persistence, with mirrored skill copies increasing review surface.
Overview
This PR extracts Svelte/SvelteKit live-mode rules into
reference/live-svelte.md, keepslive.mdframework-neutral, and has wrap/insert/inject (and boot vialive.mjs) emitguidanceRefsso agents load the adapter doc whenpreviewModeissvelte-component.Runtime and accept-path hardening in
live-browser.jsandlive-svelte-component.mjsincludes: requiring a visible mounted Svelte variant before cycling (with remount recovery), richer anchor resolution (stable attrs, ignoringsvelte-*classes), structural mapping of live text topropContract, toggle params usingdata-p-*="true", Tune panel hit-testing viacomposedPath, and shader capture strategies (direct, composited backdrop, ancestor crop) with debug metadata for translucent Svelte surfaces.Accept cleanup for Svelte component previews now tears down preview wrappers without leaving duplicate DOM beside HMR output; prop extraction skips control blocks and deduplicates prop names; accepted CSS sanitization aligns boolean param selectors with live preview.
Reviewed by Cursor Bugbot for commit ebafd00. Bugbot is set up for automated code reviews on this repo. Configure here.