Add e2e test for the font chooser's marks (Notion test case 358) - #8289
Open
JohnThomson wants to merge 4 commits into
Open
Add e2e test for the font chooser's marks (Notion test case 358)#8289JohnThomson wants to merge 4 commits into
JohnThomson wants to merge 4 commits into
Conversation
The font chooser shows, beside each installed font, whether Bloom may use it in a published book: a check mark for a usable font, an exclamation mark for one it may not use (a Microsoft font, or one whose metadata forbids embedding), a question mark when it cannot tell. The unusable and unknown fonts are dimmed in the list but can still be chosen; hovering a mark opens the information pane with the verdict, a summary of the font with its links, and (except for usable fonts) an icon that shows the raw metadata. The chosen font's mark shows in the closed chooser in colour. font-chooser.spec.ts drives all of that in the Edit tab's Format dialog, on a font of each kind picked at run time from fonts/metadata (Andika, Times New Roman, Baskerville Old Face and Euclid when the machine has them). The Settings dialog route the card also names is WinForms, so it stays on the card's manual portion; AUTOMATION-DEBT.md records it under the WinForms entry. New helpers: helpers/fontChooser.ts (the chooser, its list, and its information pane), showFormatDialogTab in formatDialog.ts (the dialog opens on Style Name; the chooser is on Characters), and getFontFamilyInGroup in bookMaking.ts. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
JohnThomson
force-pushed
the
tc358-font-chooser
branch
from
September 3, 2026 15:37
70e933d to
9945f5d
Compare
The e2e fixture launches output/Debug/x64/Bloom.exe ahead of Debug/AnyCPU, so a stale x64 build silently runs an old Bloom; and notion_automation.py still needs a Python that not every machine has (seen again, now with the card split the skill asks for). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
JohnThomson
marked this pull request as ready for review
September 3, 2026 15:41
A windows-latest runner has only Microsoft fonts and the few Bloom ships: 66 fonts, of which Bloom calls 5 usable and 51 Microsoft, and none unknown or non-Microsoft unsuitable. So the font chooser test could not find a font of each kind there (nightly run 33781388018). bloom-testing-inputs now carries two genuinely free fonts that Bloom sorts into exactly those verdicts because of how their metadata is written: Alef (OFL; 'All rights reserved' and no license field, so unsuitable) and Luciole (CC BY 4.0 in a form the heuristics do not read, so unknown). The pin advances to that commit. scripts/install-test-fonts.ps1 installs every font under output/testing-inputs/fonts for the current user (per-user folder, registry entry, AddFontResource) and fails unless GDI+, which is what Bloom reads, lists them afterwards; the nightly workflow runs it before the e2e suite. pickFont now takes a list of preferred names, and the test asks for Alef and Luciole first so that it behaves the same on a developer machine that has them and on the runner. The pane reader ignores the empty-href link the pane renders for a font with no manufacturer, which Luciole exposed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
WPF's GlyphTypeface constructor failed with a null reference on the second font in the nightly runner's non-interactive session (run 33786373678). GDI+'s PrivateFontCollection is what Bloom lists fonts with anyway, so use it for the family name, and take the style part of the registry value name from the file name. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automates Notion test case 358 (New Font Chooser): https://app.notion.com/p/New-Font-Chooser-3904bb19df12811dab13eb2df088c16d
Bloom production code changes
None in Bloom itself. Outside
src/BloomE2Ethe PR touches.github/workflows/nightly.yml(a step that installs the test fonts before the e2e suite) andbuild/testing-inputs.pin(advanced to the bloom-testing-inputs commit that carries the fonts, BloomBooks/bloom-testing-inputs#3). Nothing that ships in Bloom or builds it changes.Fonts for the nightly runner
A
windows-latestrunner has 66 fonts: 5 Bloom calls usable, 51 Microsoft, and none it calls unknown or non-Microsoft unsuitable, so the first dispatch of the nightly e2e suite on this branch could not find a font of each kind. bloom-testing-inputs now carries, underfonts/, two genuinely free fonts whose internal metadata lands them in exactly those verdicts: Alef (SIL OFL; metadata says only "All rights reserved", so unsuitable) and Luciole (CC BY 4.0, stated in a form Bloom's heuristics do not read, so unknown).src/BloomE2E/scripts/install-test-fonts.ps1installs everything under that folder for the current user and fails unless GDI+, which is what Bloom's font list reads, lists them afterwards; the workflow runs it after fetching the inputs. The test prefers Alef and Luciole, then the fonts the card names, then any font of the kind, so it behaves the same on a developer machine that has them and on the runner.Merge order: BloomBooks/bloom-testing-inputs#3 first, then this PR. The pin already names that branch's commit, which stays reachable after the merge.
Purpose
Protects what the font chooser tells a user about each installed font: fonts Bloom may embed in a published book get a check mark and stay enabled; fonts it may not use (a Microsoft font, or one whose metadata forbids embedding) get an exclamation mark, and fonts it cannot judge a question mark, dimmed in the list yet still choosable. Hovering a mark opens the information pane with the right verdict, a summary of the font with its links, and, for anything but a usable font, the information icon that shows the raw metadata. The chosen font's mark shows in the closed chooser in colour (red, gold, Bloom blue) with the same pane.
The chooser is the same React component in the Format dialog and in the Settings dialog's Book Making tab. The test drives it in the Format dialog. The Settings dialog is a WinForms surface CDP cannot reach, so the card is split: the original keeps its id as
New Font Chooser [Automated portion], and the Settings route isNew Font Chooser [Manual portion](Test Case ID 811), linked both ways.Steps
fonts/metadatafor a font of each kind, preferring the ones the card names (Andika, Times New Roman, Baskerville Old Face, Euclid) and taking another of the same kind when the machine lacks one. A machine with no font of a kind fails plainly, as the card asks.showFormatDialogTab).How it verifies the result
Reads the DOM of the list, the pane and the chooser (MUI's icon
data-testids name the marks; computed colours are mapped to the theme's named colours), the box's computedfont-family, andfonts/metadataas the oracle for the pane's summary (name, styles, version, and exactly the links whose URLs the metadata carries). Eleven serial tests in one Bloom; three green runs in a row locally, no Bloom.exe left behind.New helpers
helpers/fontChooser.ts:pickFont,getFontsMetadata,getFontMetadata,openFontList,isFontListOpen,getFontListItems,hoverFontMarkInList,hoverChosenFontMark,readFontInformationPane,closeFontInformationPane,showFontDetails,chooseFont,getChosenFont.helpers/formatDialog.ts:showFormatDialogTab.helpers/bookMaking.ts:getFontFamilyInGroup.Problems
AUTOMATION-DEBT.md"WinForms surfaces are invisible to CDP" has a new seen-again line).kBloomBlue), and the test asserts the product's colour.hreffor a font whose metadata has no manufacturer at all (Luciole). The pane reader ignores it; it is a small product oddity, not a test problem.🤖 Generated with Claude Code
This change is
Devin review