Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions hub-client/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
<ReactRenderer
astJson={astWithRenderComponents(['/elliot/simple.tsx'])}
currentFilePath="elliot/index.qmd"
files={[]}
fileContents={fileContents}
onNavigateToDocument={() => {}}
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;'],
Expand Down
13 changes: 9 additions & 4 deletions hub-client/src/components/render/ReactRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 '';
}

Expand Down