Skip to content

Collection Settings in React: Languages page (BL-16739) - #8502

Draft
andrew-polk wants to merge 1 commit into
BL-16735-team-collection-settingsfrom
BL-16739-languages-page
Draft

andrew-polk wants to merge 1 commit into
BL-16735-team-collection-settingsfrom
BL-16739-languages-page

Conversation

@andrew-polk

@andrew-polk andrew-polk commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The new React Collection Settings dialog still shows a placeholder on its Languages page. Collection languages, their fonts and their script settings can only be changed in the old WinForms dialog, spread over its Languages tab, the Book Making tab and the Special Script Settings dialog. The alphabet and sentence punctuation for the reader tools can only be changed in Reader Setup.

Fix

  • The Languages page (settingsPages/LanguagesPage.tsx) has a group each for Language 1, 2, 3 and the Sign Language. Each shows its language with Change…, which opens the existing language chooser as a nested React dialog. Language 3 and the Sign Language also offer Set… and Remove. Each written language has its Default Font (the font picker, with suitability warnings) and a More sub-page, which uses Config-R's sub-pages. More holds the tool font size, line spacing, Asian word breaking and right-to-left. A missing Language 3 shows only its language row.
  • Reader tools, Language 1 only. Language 1's More page also edits the reader tools' alphabet and sentence-ending punctuation. On save, C# writes just those two keys into ReaderToolsSettings-<L1 tag>.json in the collection folder and keeps the stages and levels; it writes nothing if they didn't change. The two fields are disabled while Language 1 itself is being changed, because the file is named for Language 1. An edited alphabet is cleaned the way Reader Setup cleans it. If the reader tools file is damaged, those two fields are disabled with an explanation, so the rest of the settings still save and the file is never written over.
  • Page Numbering Style is at the bottom of the page (plan Q5). In the dialog's JSON it moved from frontBackMatter to languages; the collection file is unchanged. Its choices come in the dialog's own settings GET, not from the old dialog's settings/numberingStyle, so that endpoint can go with the old dialog.
  • Small supporting changes:
    • The GET now sends defaultFontName for a newly added Language 3, and the page numbering styles.
    • LanguageChooserDialog can hand its pick to a callback, and gets its WinForms frame's size when it has no frame.
    • The reader tools' default settings JSON and cleanSpaceDelimitedList moved where both callers can use them, unchanged.

ScriptSettingsDialog and the Book Making font controls stay until the old dialog is removed at cutover.

The More pages need Config-R 1.0.0-alpha.31 or later (sillsdev/config-r#31); BL-16733 brings in alpha.33. Before it, any edit on a More page threw the user back to the Languages page, because Config-R reset the focused page whenever the dialog re-rendered, and this dialog re-renders on every edit.

Screenshots

The Languages page:

The Languages page: Local Language and Language 2 with Change buttons, Default Font pickers and More rows; Language 3 with only a Set button

Language 1's More page, with the reader tools' fields:

Language 1's More page: line spacing, the Script group's two checkboxes, and the Reader Tools group with the alphabet and sentence punctuation

Change… opens the language chooser over the dialog:

The Choose Language dialog open over Collection Settings, with English selected

Risk Evaluation

  • Shared paths:
    • The dialog's save path now cleans an edited alphabet as well as trimming edited text, and the restart check uses the same function.
    • ReadersApi now builds the reader tools' default settings through the shared method; the JSON is the same.
    • The WinForms dialog's language chooser takes the same path as before when no callback is given.
  • Reader tools file. The new C# writes that file only when the alphabet or punctuation actually changed, and it writes them into the file read when the dialog opened, keeping everything else in it.
  • The rest is new code reached only from the new page.

Ecosystem Impact

  • Collection file: no format change. PageNumberStyle is stored as before.
  • Reader tools file: unchanged in shape. Team Collections already sync it as a collection file, and it is written before the collection is saved.
  • Localization: 13 new translate="no" strings. The labels are in Bloom.xlf and the descriptions in BloomMediumPriority.xlf; existing translated strings were reused wherever the text fit.
  • Dependency: none changed here; this relies on the Config-R 1.0.0-alpha.33 that BL-16733 brings in.
  • No published output or Bloom Player changes.

Automated Tests

  • collection-settings-languages.spec.ts (e2e, new): the journey through the Languages page described below.
  • LanguagesPage.test.ts (new): what a language picked in the chooser becomes in the collection's settings.
  • CollectionSettingsDialog.test.tsx: the Languages page's rows, Set/Remove, the More pages, the locked reader-tools fields, the restart check, and the badge request for a sign language added in the dialog.
  • CollectionSettingsUpdaterTests.cs: the reader tools' alphabet and punctuation written into their file keeping the rest, a file made from the defaults, and a damaged file left alone; CollectionSettingsApiTests.cs checks that Page Numbering Style and the alphabet are among the values whose change restarts Bloom.

Test of the change: collection-settings-languages.spec.ts, with the Languages-page tests in CollectionSettingsDialog.test.tsx, LanguagesPage.test.ts and CollectionSettingsUpdaterTests.cs

E2E Coverage

  • Languages page: collection-settings-languages.spec.ts, a journey through the real dialog: Language 1's Default Font, then on its More page a line spacing and a new alphabet; Restart; then the collection file, the reader tools' settings (stages kept) and the reopened dialog. It fails with Config-R alpha.30 at its first edit on a More page; that is how the Config-R bug was found.
  • Badge preview: the Front & Back Matter page's preview follows a language changed on this page before it is saved (BL-16733 built that); the dialog's vitest suite checks that it asks for the badge of a sign language added in the dialog, and collection-settings-front-back-matter.spec.ts passes on this branch.
  • Not covered end to end: Language 3 and Sign Language Set/Remove, the language chooser itself, and the locked reader-tools fields; the dialog's vitest suite covers those.
  • Live checks: none at the current code. (The screenshots above were taken in a running Bloom on an earlier commit of this branch.)

Notion Test Suite

Preflight report: https://bloombooks.github.io/dev-process-artifacts/deciders/bloomdesktop-bl-16739-languages-page.html

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

🤖 Generated with Claude Code

Devin review


This change is Reviewable

@andrew-polk
andrew-polk added this pull request to stack #8498 October 23, 2026 17:39
@greptile-apps

greptile-apps Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in Greptile

[Medium impact] The PR appears safe to merge; no new blocking issues were found.

Summary

Adds the Languages page with language selection, fonts, script settings, reader-tool fields, and page numbering. The badge preview now follows draft language choices.

  • The Collection Settings dialog lets people change languages and their settings.
  • Language 1’s More page now includes reader-tool alphabet settings.
  • The badge preview follows the language selected in the open dialog.

Reviews (4) · Last reviewed commit: "Collection Settings in React: Languages ..." · Reviewed by Greptile

Comment thread src/BloomExe/web/controllers/CollectionSettingsTypes.cs
Comment thread src/BloomBrowserUI/collection/settingsPages/LanguagesPage.tsx Outdated
Comment thread src/BloomBrowserUI/collection/settingsPages/LanguagesPage.tsx
Comment thread src/BloomBrowserUI/collection/settingsPages/LanguagesPage.tsx
Comment thread src/BloomBrowserUI/collection/settingsPages/LanguagesPage.tsx
@andrew-polk

Copy link
Copy Markdown
Contributor Author

[Claude Opus 5.5 during preflight] @greptile-apps review

@andrew-polk

Copy link
Copy Markdown
Contributor Author

[Claude Opus 5.5 during preflight] Consulted Devin on 2026-10-23 18:06 UTC up to commit e5fbca0. It raised three findings, each with its own thread: the props type (fixed in e5fbca0), the uncancelled fetches (not an issue; replied), and the QR badge preview using the saved language (left open for a decision). No Investigate flags. The later commit e084157 only changes the plan document.

@andrew-polk

Copy link
Copy Markdown
Contributor Author

[Claude Opus 5.5 during preflight] @greptile-apps review

@andrew-polk

Copy link
Copy Markdown
Contributor Author

[Claude Opus 5.5 during preflight] Consulted Devin on 2026-10-23 18:44 UTC up to commit 1186b23. Nothing new: it now marks the QR badge preview finding resolved (fixed in 1186b23) along with the props type; the uncancelled-fetch finding is a repeat, already answered on its thread. No Investigate flags.

@andrew-polk
andrew-polk force-pushed the BL-16739-languages-page branch from 1186b23 to 576fe22 Compare October 23, 2026 21:23
@andrew-polk

Copy link
Copy Markdown
Contributor Author

[Claude Opus 5.5 during preflight] @greptile-apps review

Comment thread src/BloomExe/web/controllers/CollectionSettingsApi.cs Outdated
@andrew-polk

Copy link
Copy Markdown
Contributor Author

[Claude Opus 5.5 during preflight] Consulted Devin on 2026-10-23 21:29 UTC up to commit 576fe22 (the branch squashed onto the rewritten stack). It reviewed the four conflict-resolved files and raised one new finding, the default caption's translation in the badge preview (thread left open for Andrew's decision). Its earlier findings stay closed. No Investigate flags.

@andrew-polk

Copy link
Copy Markdown
Contributor Author

[Claude Opus 5.5 during preflight] Consulted Devin on 2026-10-23 22:09 UTC up to commit c25469c (adds the e2e test only). Nothing new; the default-caption thread stays open for Andrew's decision. No Investigate flags.

@andrew-polk
andrew-polk force-pushed the BL-16739-languages-page branch from f9135d1 to 330705a Compare October 23, 2026 23:18
@andrew-polk

Copy link
Copy Markdown
Contributor Author

[Claude Opus 5.5 during preflight] Consulted Devin up to 330705a (after the rebase onto BL-16735 01c8b47 and the Config-R alpha.32 bump): no new findings. The four it still lists come from earlier commits, and their threads here are already settled.

@andrew-polk

Copy link
Copy Markdown
Contributor Author

[Claude Opus 5.5 during preflight] Consulted Devin up to e4d6a05 (the merge of BL-16735 with BL-16733's one-GET Front & Back Matter page): no new findings. The four it still lists come from earlier commits, and their threads here are already settled; the default-caption comment moved with the code to DefaultQrcodeCaption in the settings GET.

@andrew-polk
andrew-polk force-pushed the BL-16739-languages-page branch 2 times, most recently from c8b803b to 109515f Compare October 26, 2026 22:53
Comment thread src/BloomBrowserUI/collection/settingsPages/LanguagesPage.tsx
@andrew-polk

Copy link
Copy Markdown
Contributor Author

[Claude Opus 5.5 during preflight] Consulted Devin up to c8b803b (the restack on BL-16735 8dd7cb3 and the simplifications). One new finding, NumberSelect showing no value for a line spacing or tool font size outside its list: answered and resolved (same as the old dialog; only a hand-edited file can hold one). Its other four findings are from earlier commits and were already settled. 109515f after it only restores a missing XML summary tag.

@andrew-polk
andrew-polk force-pushed the BL-16739-languages-page branch from 109515f to 132be44 Compare October 28, 2026 19:15
The new dialog's Languages page: Language 1, 2, 3 and the Sign Language, each with the existing language chooser opened as a nested dialog (Set and Remove for the optional ones), a Default Font picker, and a More sub-page with the tool font size, line spacing, Asian word breaking and right-to-left. Language 1's More page also edits the reader tools' alphabet and sentence punctuation, written into ReaderToolsSettings-<L1>.json without touching its stages and levels; locked while Language 1 is being changed or when that file is damaged. Page Numbering Style moves to this page (only in the dialog's JSON). An e2e test saves a language's font, line spacing and alphabet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@andrew-polk
andrew-polk force-pushed the BL-16739-languages-page branch from 132be44 to abcf4ef Compare October 28, 2026 19:23
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