Skip to content

Add e2e test for All Format Controls (Notion test case 357); Format text color reaches all languages (BL-16803) - #8288

Open
JohnThomson wants to merge 1 commit into
masterfrom
JohnThomson/BL-16803-All-Format-Controls-357
Open

Add e2e test for All Format Controls (Notion test case 357); Format text color reaches all languages (BL-16803)#8288
JohnThomson wants to merge 1 commit into
masterfrom
JohnThomson/BL-16803-All-Format-Controls-357

Conversation

@JohnThomson

@JohnThomson JohnThomson commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Problem

The Format dialog's Characters tab promises that a change made on a text box in the collection's first language applies to the style as a whole, so every other language of that style follows. Every control on the tab keeps that promise except Color: a text color chosen on the first-language box changed only that language, and the same style's boxes in the other languages kept their old color (BL-16803).

Separately, the manual test "All Format Controls" (Notion test case 357), which walks every control on all four tabs of the dialog and checks where each change lands, had no automated equivalent.

What the PR does

  • Fixes BL-16803. The Color control now writes the color the way bold, size and spacing do: into the language-specific rule always, and into the style's language-independent rule too when the box is in the first language. Two unit tests in StyleEditorSpec.ts pin that down. Font is deliberately left per language, as before.
  • Automates Notion test case 357 as src/BloomE2E/tests/all-format-controls.spec.ts. It builds a Basic Book with the three pages the card names (four text boxes, eight once the second language is on), then drives every control: Characters tab on a first-language box (each change checked on the box at once, then on all eight boxes across the three pages), a custom font size typed into the size box, Characters changes on a second-language box (only its four boxes change), the Paragraph tab (all eight), the Highlighting tab (the colors the Talking Book tool then highlights with), creating a style, changing it, and applying it to another box.
  • Adds the helper layer for the Format dialog's controls, the toolbox handle, the Talking Book highlight, and reading a page's text-box formatting, so later tests spell out none of that.
  • Also fixes a second gap the test exposed: creating a new style copied every setting of the box except a font the user had set explicitly on the Characters tab (that copy was lost in the 2022 font-control rewrite, BL-10388), so the box fell back to the collection's font. The new style now carries such a font, per language as the font control writes it, for every language in the box's group (the whole group moves to the new style). A box whose font comes from the language settings still gets no font in its new style. Three unit tests cover these cases.

Automates Notion test case 357 (All Format Controls): https://app.notion.com/p/All-Format-Controls-3904bb19df1281ae8491f08a28684211

Bloom production code changes

src/BloomBrowserUI/bookEdit/StyleEditor/StyleEditor.ts: changeColor also writes the language-independent rule for a first-language box (BL-16803); createStyle carries an explicitly set font into the new style. StyleEditorSpec.ts: five unit tests for those two changes.

The fix is deliberately not being taken to Version6.5 (a long-standing "live with it"; not worth the risk in a near-beta version).

Ref: https://issues.bloomlibrary.org/youtrack/issue/BL-16803

Devin review


This change is Reviewable

@JohnThomson

Copy link
Copy Markdown
Contributor Author

[Claude Fable 5.1] Consulted Devin on 2026-09-03 00:06 UTC up to commit 659135d. Devin's review completed with no bugs and no flags (0 informational items). CI (pr-automation) passed.

Comment thread src/BloomBrowserUI/bookEdit/StyleEditor/StyleEditor.ts Outdated
Comment thread src/BloomE2E/helpers/formatDialog.ts
@JohnThomson

Copy link
Copy Markdown
Contributor Author

[Claude Fable 5.1] Consulted Devin on 2026-09-03 05:58 UTC up to commit 4b2e961. Devin's review of the previous commit raised one bug (sibling languages losing their chosen fonts when a style is created), fixed in this commit and now marked resolved by Devin; its one flag (explicit waits in the e2e helpers) was answered on its thread and resolved. Re-review of this commit: clean, bots quiet. CI (pr-automation) passed.

…mat text color reach all languages (BL-16803)

The Format dialog's Characters tab promises that a change made on a text box in the
collection's first language applies to the style as a whole, so the other languages follow.
Color was the one control that broke that promise: it wrote only the language-specific rule.
changeColor now also writes the style's language-independent rule for a first-language box,
as bold, size and spacing do. Font stays per language, as before.

Automating the manual test exposed a second gap: creating a new style copied every setting
of the box except a font the user had set explicitly, so the box (and the other languages
of its group, which move to the new style too) fell back to the collection's font. A box's
font normally comes from the language settings, so the new style names a font only where
the old style set one explicitly, per language, for every language in the group.
Five unit tests in StyleEditorSpec.ts cover the two fixes.

The new edge-to-edge test, src/BloomE2E/tests/all-format-controls.spec.ts, builds a Basic
Book with three pages in two languages (eight text boxes) and drives every control on all
four tabs of the Format dialog, checking where each change lands: on the box at once, on all
eight boxes across the pages, or in one language only; the Talking Book tool's highlight
colors; and creating, changing and applying a style. Helpers for the dialog's controls, the
toolbox handle, the Talking Book highlight, reading a page's text-box formatting and CSS unit
conversion are new; clickInGroup/typeInGroup take a group index and typeInGroup makes a
paragraph break from a newline.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@JohnThomson
JohnThomson force-pushed the JohnThomson/BL-16803-All-Format-Controls-357 branch from 4b2e961 to f55ed2a Compare September 3, 2026 13:58
@JohnThomson
JohnThomson marked this pull request as ready for review September 3, 2026 13:58
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