diff --git a/.changeset/cool-impalas-wink.md b/.changeset/cool-impalas-wink.md new file mode 100644 index 0000000..8557a78 --- /dev/null +++ b/.changeset/cool-impalas-wink.md @@ -0,0 +1,5 @@ +--- +'@qwik.dev/devtools': patch +--- + +refactor: Update iframe theme styles and improve Inspect iframe source handling diff --git a/.gitignore b/.gitignore index c67ca9f..41be1f3 100644 --- a/.gitignore +++ b/.gitignore @@ -65,5 +65,5 @@ testem.log Thumbs.db .vite-inspect .pnpm-store/* -qwik/* +related-qwik/* .cursor/skills/* \ No newline at end of file diff --git a/packages/ui/src/features/inspect/Inspect.tsx b/packages/ui/src/features/inspect/Inspect.tsx index 4915daa..5bdf13b 100644 --- a/packages/ui/src/features/inspect/Inspect.tsx +++ b/packages/ui/src/features/inspect/Inspect.tsx @@ -1,12 +1,25 @@ -import { component$ } from '@qwik.dev/core'; +import { component$, isBrowser } from '@qwik.dev/core'; import { inspectorLink } from './constant'; import { setupIframeThemeSync } from './iframe-theme'; +/** + * Inspect iframe must load under app root (Vite `BASE_URL` + origin), not `location.pathname`, + * so deep routes do not produce `.../nested/route__inspect/`. + * SSR: no `location` — return empty until the client runs. + */ +function getInspectIframeSrc(): string { + if (!isBrowser) { + return ''; + } + const base = new URL(import.meta.env.BASE_URL ?? '/', location.origin); + return new URL(inspectorLink, base).href; +} + export const Inspect = component$(() => { return (