From ee47e8ec1f45533b999b3070ca5babe3d618ce3e Mon Sep 17 00:00:00 2001 From: Emil Hvitfeldt Date: Wed, 2 Sep 2026 16:50:37 -0700 Subject: [PATCH 1/2] Load render-components for revealjs documents in Hub ReactRenderer's customComponentsCode gate only allowed format === 'q2-debug' | 'q2-preview', so render-components: silently never loaded for revealjs presentations even though the CLI's q2-preview-spa has no such restriction. revealjs converged onto the same Q2PreviewIframe/dispatcher tree as q2-preview a while back (bd-vwp4y5ku), but this gate was never updated to match. --- .../render/ReactRenderer.integration.test.tsx | 29 +++++++++++++++++++ .../src/components/render/ReactRenderer.tsx | 13 ++++++--- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/hub-client/src/components/render/ReactRenderer.integration.test.tsx b/hub-client/src/components/render/ReactRenderer.integration.test.tsx index 3c2bf1560..11b0ec0bb 100644 --- a/hub-client/src/components/render/ReactRenderer.integration.test.tsx +++ b/hub-client/src/components/render/ReactRenderer.integration.test.tsx @@ -300,6 +300,35 @@ describe('ReactRenderer render-components gate (Plan 2A item 13)', () => { }); }); + it('extracts customComponentsCode for revealjs format', () => { + // revealjs renders through the same Q2PreviewIframe/dispatcher tree as + // q2-preview (see ReactRenderer format routing describe block above), + // so render-components: must apply there too. The gate at the top of + // customComponentsCode's useMemo previously only allowed + // 'q2-debug' | 'q2-preview', silently skipping revealjs documents even + // though revealjs converged onto this same tree (bd-vwp4y5ku) — that + // convergence just never extended to this particular gate. + const fileContents = new Map([ + ['elliot/simple.tsx', 'export const Para = () => null;'], + ]); + + render( + {}} + setAst={() => {}} + format="revealjs" + />, + ); + + expect(lastCapturedPreviewCode()).toEqual({ + '/elliot/simple.tsx': 'JS:export const Para = () => null;', + }); + }); + it('q2-debug behavior unchanged (regression baseline)', () => { const fileContents = new Map([ ['elliot/simple.tsx', 'export const Para = () => null;'], diff --git a/hub-client/src/components/render/ReactRenderer.tsx b/hub-client/src/components/render/ReactRenderer.tsx index 9732acf05..9c15bd825 100644 --- a/hub-client/src/components/render/ReactRenderer.tsx +++ b/hub-client/src/components/render/ReactRenderer.tsx @@ -198,12 +198,17 @@ function ReactRenderer({ ); // Extract component paths - only recompute when the list of paths - // changes. The gate covers both q2-debug and q2-preview because both - // load user TSX overrides via the iframe's + // changes. The gate covers q2-debug, q2-preview, and revealjs because + // all three load user TSX overrides via the iframe's // `LOAD_CUSTOM_COMPONENTS` postMessage handler. Plan 2A item 13 - // extended the q2-debug-only gate to also include q2-preview. + // extended the q2-debug-only gate to also include q2-preview. revealjs + // later converged onto the same Q2PreviewIframe tree (bd-vwp4y5ku), but + // this gate wasn't updated to match, so render-components: silently + // never loaded for revealjs documents in Hub, even though the CLI's + // q2-preview-spa has no such gate at all. That gap itself isn't tracked + // under any strand as of this fix. const componentPathsKey = useMemo(() => { - if (format !== 'q2-debug' && format !== 'q2-preview') { + if (format !== 'q2-debug' && format !== 'q2-preview' && format !== 'revealjs') { return ''; } From 7be9bc57ba345c1cb5a63e15abc8079ba39ee377 Mon Sep 17 00:00:00 2001 From: Emil Hvitfeldt Date: Wed, 2 Sep 2026 16:52:11 -0700 Subject: [PATCH 2/2] changelog: fix render-components not loading for revealjs (ee47e8ec) --- hub-client/changelog.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hub-client/changelog.md b/hub-client/changelog.md index 282a27a50..db4227cf4 100644 --- a/hub-client/changelog.md +++ b/hub-client/changelog.md @@ -23,6 +23,10 @@ WASM rebuild is needed for a changelog-only edit. --> +### 2026-09-02 + +- [`ee47e8ec`](https://github.com/quarto-dev/q2/commits/ee47e8ec): Fix `render-components:` custom TSX overrides silently not loading for revealjs presentations. + ### 2026-09-01 - [`a4c3fb9c`](https://github.com/quarto-dev/q2/commits/a4c3fb9c): The experimental branch bar's Merge button now uses the app's standard accent color in both themes, and its branch-name input shows the standard keyboard focus ring.