Fix inline HTML preview theming#1042
Conversation
Co-authored-by: bobbit-ai <bobbit@bobbit.ai>
Co-authored-by: bobbit-ai <bobbit@bobbit.ai>
Co-authored-by: bobbit-ai <bobbit@bobbit.ai>
Co-authored-by: bobbit-ai <bobbit@bobbit.ai>
Co-authored-by: bobbit-ai <bobbit@bobbit.ai>
Co-authored-by: bobbit-ai <bobbit@bobbit.ai>
Co-authored-by: bobbit-ai <bobbit@bobbit.ai>
Co-authored-by: bobbit-ai <bobbit@bobbit.ai>
Co-authored-by: bobbit-ai <bobbit@bobbit.ai>
Co-authored-by: bobbit-ai <bobbit@bobbit.ai>
Co-authored-by: bobbit-ai <bobbit@bobbit.ai>
Co-authored-by: bobbit-ai <bobbit@bobbit.ai>
Co-authored-by: bobbit-ai <bobbit@bobbit.ai>
Greptile SummaryThis PR wires the shared
Confidence Score: 5/5Safe to merge — the change adds a well-guarded preparation layer and observer lifecycle management with no regressions on existing paths. The new prepareInlineHtml utility is fully fail-open and the test suite covers duplicate installation, hostile authored syntax, streaming transitions, document.open() observer cleanup, and both source-Vite and packaged tarball runtimes. No files require special attention. Important Files Changed
Reviews (3): Last reviewed commit: "Merge remote-tracking branch 'origin/mas..." | Re-trigger Greptile |
| import { PREVIEW_THEME_BRIDGE } from "../../src/shared/preview-bridge-scripts.js"; | ||
|
|
||
| function bridgeProgram(): string { | ||
| const match = PREVIEW_THEME_BRIDGE.match(/^<script(?:\s[^>]*)?>([\s\S]*)<\/script>$/i); |
| return swipeMessages.slice(); | ||
| } | ||
|
|
||
| window.addEventListener("message", (event) => { |
| const headers = { Authorization: `Bearer ${token}`, "Content-Type": "application/json" }; | ||
| const projectResponse = await fetch(`${baseUrl}/api/projects`, { | ||
| method: "POST", | ||
| headers, |
| if (!project.id) throw new Error("packed project creation returned no id"); | ||
| const sessionResponse = await fetch(`${baseUrl}/api/sessions`, { | ||
| method: "POST", | ||
| headers, |
| ws.close(); | ||
| reject(new Error(`packaged session prompt timed out; messages=${JSON.stringify(messages.slice(-12))}`)); | ||
| }, 30_000); | ||
| ws.on("open", () => ws.send(JSON.stringify({ type: "auth", token }))); |
| const token = await readToken(join(tempRoot, "secrets")); | ||
| const preferenceResponse = await fetch(`${gatewayBaseUrl}/api/preferences`, { | ||
| method: "PUT", | ||
| headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json" }, |
Co-authored-by: bobbit-ai <bobbit@bobbit.ai>
|
Addressed the Greptile P2 in commit 0fb13d4.
Focused DOM/reproducer/type-check tests and the full implementation workflow pass. |
Summary
Verification
🤖 Generated with Bobbit