Skip to content

Set a collection's languages through an e2e hook, not by writing XML (BL-16799) - #8300

Closed
hatton wants to merge 3 commits into
BL-16799-page-changefrom
BL-16799-collection-languages
Closed

Set a collection's languages through an e2e hook, not by writing XML (BL-16799)#8300
hatton wants to merge 3 commits into
BL-16799-page-changefrom
BL-16799-collection-languages

Conversation

@hatton

@hatton hatton commented Sep 3, 2026

Copy link
Copy Markdown
Member

A test that needed different collection languages stopped Bloom, composed a
.bloomCollection file by hand, and started Bloom again. No part of Bloom writes that
file that way, so the test exercised a path a user never takes, and it got a different
answer for it: the publish list showed the dropped language's own name for itself
rather than the name the collection remembers.

e2e/setCollectionLanguages takes one to three language tags and does the work of the
Collection Settings dialog's OK button, CollectionSettingsDialog.UpdateLanguageSettings
included. helpers/collection.ts setCollectionLanguages posts to it and restarts Bloom,
which is still needed because Bloom reads the languages when it opens the collection.

Test Case ID 169 therefore runs again. It was skipped on master because it failed on CI
every time, on the language name: Bloom asks LibPalaso for that name "in" the
collection's metadata language, and LibPalaso answers differently depending on whether
a native ICU library is findable. Going through the dialog's own code keeps the
collection's name for the language, so the list reads "Spanish" on every machine and
that lookup is never reached. The lookup itself is a real defect, tracked on BL-16806,
and AUTOMATION-DEBT.md now records both it and the coverage this test no longer gives.

The Settings dialog is still invisible to CDP, so its own entry stays.

This is one of eleven stacked pull requests (BL-16799)

Each one pays down one entry of src/BloomE2E/AUTOMATION-DEBT.md, and each branches off the one before it. Base: BL-16799-page-change. Review only this pull request's own commit; the ones below it are reviewed in their own pull requests. The first six change test and tooling code only; the last five also change product code.

  1. BL-16799-automation-scripts — Make the bloom-automation scripts safe to ask for help
  2. BL-16799-vr-collect-failures — Report every failed image comparison in a visual-regression case, not the first
  3. BL-16799-component-tests-in-ci — Run the component-tester Playwright suites nightly
  4. BL-16799-vite-port — Let an e2e run test the working tree's front end
  5. BL-16799-type-in-one-call — Type into a text box in one call, not one key press per character
  6. BL-16799-page-screenshot — Capture a whole book page from a test
  7. BL-16799-toolbox-registration — Register the toolbox tools from one list both callers share
  8. BL-16799-shell-document — Stop a test attaching to a shell document Bloom does not drive
  9. BL-16799-tab-test-ids — Click a workspace tab by a test id, not by its localized label
  10. BL-16799-page-change — Refuse a page change the Edit tab cannot do, and wait before asking
  11. BL-16799-collection-languages — Set a collection's languages through an e2e hook, not by writing XML

Replaces #8276, which did all of this in one pull request.

Verification of the whole stack, at its tip: the C# suite passes (3338 passed, 13 skipped), the front-end vitest suite passes (781 passed, 5 skipped), and the src/BloomE2E suite passes against a Vite dev server on the working tree (36 passed, 0 skipped, 8.2 minutes). Each pull request also has its own type check and lint.

🤖 Generated with Claude Code

Devin review


This change is Reviewable

A test that needed different collection languages stopped Bloom, composed a
`.bloomCollection` file by hand, and started Bloom again. No part of Bloom writes that
file that way, so the test exercised a path a user never takes, and it got a different
answer for it: the publish list showed the dropped language's own name for itself
rather than the name the collection remembers.

`e2e/setCollectionLanguages` takes one to three language tags and does the work of the
Collection Settings dialog's OK button, `CollectionSettingsDialog.UpdateLanguageSettings`
included. `helpers/collection.ts setCollectionLanguages` posts to it and restarts Bloom,
which is still needed because Bloom reads the languages when it opens the collection.

Test Case ID 169 therefore runs again. It was skipped on master because it failed on CI
every time, on the language name: Bloom asks LibPalaso for that name "in" the
collection's metadata language, and LibPalaso answers differently depending on whether
a native ICU library is findable. Going through the dialog's own code keeps the
collection's name for the language, so the list reads "Spanish" on every machine and
that lookup is never reached. The lookup itself is a real defect, tracked on BL-16806,
and AUTOMATION-DEBT.md now records both it and the coverage this test no longer gives.

The Settings dialog is still invisible to CDP, so its own entry stays.
@hatton
hatton force-pushed the BL-16799-collection-languages branch from 9722757 to a942645 Compare September 3, 2026 19:40
Master moved while this stack was open, so each branch merges the one below it.
Two places in src/BloomE2E/AUTOMATION-DEBT.md conflicted.

This branch deleted the whole "work in progress" block, because in the world it
was written in its own row was the last one in the table. Master's table does
not empty out when this branch lands: it still names e2e-private-user-settings
and e2e-real-library-login, which nobody has opened yet, and three entries still
carry a "being fixed" line pointing at those two. So the block stays here,
without this branch's row, and the sentence that counted the rows now says what
is true of the two that are left.

In the entry about WinForms surfaces being invisible to CDP, master annotated
the promise with the pull request's number, while this branch replaces the
promise with what it did. The branch's text stands.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BaWw4EHWrbFF2fNJvMJVC8
// ChangeTag just computed instead of the English one.
pending[i].SetName(pending[i].Name, false);
pending[i].SetName(pending[i].GetNameInLanguage("en"), true);
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

[Devin] Bug: Language hook creates impossible metadata

When a slot changes language, HandleSetCollectionLanguages retains its old direction and forces an English custom name. Tests can pass against states the Settings chooser never creates.

(src/BloomExe/web/controllers/E2eTestingApi.cs:379)

@hatton

hatton commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

[Claude Opus 5 from Hatton's machine during devin-review]

Consulted Devin on 2026-09-03 22:45 UTC up to commit 6ac27e10aada71bf443fc34a1f8ae6689e4d1bf1.

The e2e documentation told the reader to serve the dev server on 5173, and
to stop a Bloom that already held that port. Both instructions came from a
wrong diagnosis of a failure on 2026-09-02.

--vite-port honours any port. ReactControl.ReplaceViteDevOrigin rewrites the
literal http://localhost:5173 in the HTML of all three Edit frames, including
the two *.vite-dev.pug files that the entry said ignored the flag, and its
three callers have been in place since a170199 (2026-03-13). A run on port
5199 on 2026-09-03 loaded the shell, the toolbox and the page list from 5199;
the page list drew its 53 thumbnails and the toolbox drew the Talking Book
Tool.

What really failed on 2026-09-02 is the other half of the same entry:
BLOOM_E2E_VITE_PORT was unset, so Bloom probed 5173, found nothing, and served
a day-old output/browser that had no duplicate-page-button test id.

So the README now says to set the variable and use any free port, and the
debt entry that blamed the port is gone. The remaining debt, that a run
inherits its front end from whatever else is running, keeps the record.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BaWw4EHWrbFF2fNJvMJVC8
@hatton

hatton commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

[Claude Fable 5.1 following a prompt from Hatton] Closed at Hatton's request. This change is not going in.

@hatton hatton closed this Sep 3, 2026
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