Skip to content

test(html): read a few files in a second config - #699

Merged
andiwand merged 1 commit into
mainfrom
test/html-output-config-variants
Aug 18, 2026
Merged

test(html): read a few files in a second config#699
andiwand merged 1 commit into
mainfrom
test/html-output-config-variants

Conversation

@andiwand

@andiwand andiwand commented Aug 18, 2026

Copy link
Copy Markdown
Member

The reference output renders every file in one config, so a toggle that config does not set is covered nowhere. Nothing renders dark, and the page margins we turn on here hide the reflowed text document the library actually ships by default — the 3mm inset added in #698 appears in no reference file at all.

The mechanism

A test file may now carry a ConfigVariant — a name plus a deviation applied last to the config — and is rendered a second time into a sibling directory suffixed with that name. pdf_text_mode was the one hand-rolled case of this and becomes the first row of the table, keeping its -single path byte for byte.

The suffix keeps every output directory at the same depth, so the link to the shared resources/ is identical in the variant and in the default.

What is covered now

Variant Config Files
single pdf_text_mode = single_layer one pdf (as before)
dark color_scheme = dark one file per view: odt, odp, ods, txt, zip, otf
system color_scheme = system txt — the media-query wrapper around the same styles
reflow text_document_margin = false odt, docx
read-only editable = false odt

Dark mode is pinned per view, not per format — document, spreadsheet, text, filesystem and font each carry their own dark stylesheet. The pdf view honors no color scheme (FileTypeCapabilities::color_scheme says so), and no test file reaches the image view at all, so that one stays uncovered.

Verified

Every pre-existing reference file is byte-identical after the change — the refactor moves nothing. Each new output was inspected in a browser: dark renders dark and readable in all five views, system differs from dark only by media="(prefers-color-scheme: dark)", reflow drops the page box and picks up .odr-text-flow{padding:3mm}, and read-only drops contenteditable and data-odr-path.

Reference output

The shipped resources were a few pull requests behind: document.css missed the 3mm inset and the dark stylesheets, text.js the batched line-number sizing from #696. Regenerated with this, so the pins move for those too.

🤖 Generated with Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e8f0e0c5f4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread test/src/html_output_test.cpp
The reference output renders every file in one config, so a toggle the
config does not set is covered nowhere: nothing rendered dark, and the
margins we turn on here hid the reflowed text document the library ships by
default.

A test file may now carry a `ConfigVariant` — a named deviation applied last
— and is rendered once more into a sibling directory suffixed with the
name. The pdf text mode was the one case of this and becomes the first row
of the table, keeping its path.

Added: `dark` for one file per view that carries a dark stylesheet
(document, slides, spreadsheet, text, filesystem, font), `system` for the
media-query wrapper around it, `reflow` for a text document kept out of its
page box, and `read-only` for the output a reader gets. The pdf view honors
no color scheme, and no test file reaches the image view at all.

The reference resources were a few pull requests behind — document.css
missed the 3mm inset and the dark stylesheets, text.js the batched
line-number sizing — and are regenerated with this.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EPasn1P1Y4xGehbRdWWFwY
@andiwand
andiwand force-pushed the test/html-output-config-variants branch from e8f0e0c to 515d775 Compare August 18, 2026 13:49
@andiwand
andiwand merged commit ecbf7d5 into main Aug 18, 2026
36 checks passed
@andiwand
andiwand deleted the test/html-output-config-variants branch August 18, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant