Show the sound's file name, not "A Recording", in the image audio submenu (BL-16669) - #8235
Conversation
|
[Claude Opus 5 (1M context)] Consulted Devin on 2026-08-25 16:05 up to commit Review came back clean: no Bugs, no Investigate flags, and no Informational items. Nothing to mirror as review threads. |
|
| Filename | Overview |
|---|---|
| src/BloomBrowserUI/bookEdit/toolbox/canvas/canvasControlRegistry.ts | Correctly allows the current sound filename to render and restores its selected-state icon without changing the text-recording path. |
| src/BloomBrowserUI/bookEdit/toolbox/canvas/imageAudioMenuItem.test.ts | Adds direct regression coverage for the image-audio menu metadata and relevant filename edge case. |
| src/BloomBrowserUI/bookEdit/canvas-e2e-tests/helpers/canvasFrames.ts | Extends the toolbox-header locator for the current MUI markup while preserving compatibility with legacy markup. |
Reviews (3): Last reviewed commit: "Show the sound's file name, not "A Recor..." | Re-trigger Greptile
|
[Claude Opus 5 (1M context)] Consulted Devin on 2026-08-25 16:34 up to commit Re-review clean — no Bugs and no Investigate flags, so nothing was mirrored as review threads. One Informational item, not posted as a thread and not acted on: it notes that the menu label strips only a |
JohnThomson
left a comment
There was a problem hiding this comment.
@JohnThomson reviewed 3 files and all commit messages.
Reviewable status: 0 of 3 files reviewed, all discussions resolved.
JohnThomson
left a comment
There was a problem hiding this comment.
@JohnThomson made 1 comment.
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion.
src/BloomBrowserUI/bookEdit/canvas-e2e-tests/helpers/canvasFrames.ts line 79 at r1 (raw file):
const canvasToolHeader = toolboxFrame .locator( '.MuiAccordionSummary-root:has([data-toolid="canvas"]), h3[data-toolid="canvasTool"], h3[data-toolid="canvas"], h3[data-toolid*="canvas"], h3:has-text("Canvas")',
This is an unrelated change that fixes a bug Claude found in e2e testing.
…menu (BL-16669) When a sound is chosen to play when an overlay image or draggable is clicked, the submenu row that plays that sound showed the localized string "A Recording" instead of the chosen file's name, even though the parent menu row shows the name correctly. That row had also lost the check mark showing which sound is currently in effect. The row passed the file name as its englishLabel but also carried l10nId "ARecording", and the localization lookup wins over englishLabel, so the name was never displayed. "A Recording" is the right label for the text case (makeChooseAudioMenuItemForText), where a talking-book recording has no file name to show; the image path picked the id up during the port to the declarative canvas control registry. Before that port the row was built with l10nId null, the file name as its label, and a check mark. Both are restored here. Adds a unit test pinning the labels, plus a guard that a sound file name containing a '%' reaches the label undecoded -- the convention BL-16669 established for these names. The test was verified to fail when the l10nId is put back, so it catches the regression rather than passing vacuously. This required exporting makeChooseAudioMenuItemForImage, since there is no other way to assert these labels without a running Bloom and the canvas e2e suite cannot currently complete a run (BL-16752). Also, unrelated to the bug: repair openCanvasToolTab in the canvas Playwright helpers. It looked for an h3[data-toolid], but the React toolbox now renders tool headers as MUI accordion summaries with the data-toolid on a span, so every canvas e2e test was failing in the fixture before reaching its assertions. The h3 selectors are kept. No localizable strings were added, changed, or removed: the text path still uses ARecording, so its XLF entry stays live. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ce8ddb3 to
8fb0a31
Compare
StephenMcConnel
left a comment
There was a problem hiding this comment.
@StephenMcConnel reviewed 3 files and all commit messages, and resolved 1 discussion.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on JohnThomson).
Problem
When you choose a sound to play when an overlay image (or a draggable) is clicked, the context menu's audio submenu shows a row that plays that sound — and it was labelled "A Recording" instead of the name of the file you chose. The parent menu row above it shows the file name correctly, so the same sound was named two different ways one line apart, and with several sounds around you could not tell from the submenu which one was attached. That row had also lost the check mark showing which sound is currently in effect.
Cause
The submenu row passed the file name as its
englishLabelbut also carriedl10nId: "ARecording". The localization lookup wins overenglishLabel, so the name was never displayed. "A Recording" is the correct label for the text case (makeChooseAudioMenuItemForText), where a talking-book recording has no file name to show; the image path picked that id up when this menu was ported to the declarative canvas control registry. Before the port the row was built withl10nId: null, the file name as its label, and a check mark — the port dropped both.Fix
playCurrentAudioincanvasControlRegistry.tsno longer sets anl10nId, so itsenglishLabel(the chosen sound's file name, minus.mp3) is what renders — the same idiom the parent row already uses.%reaches the label undecoded — the convention this card established for these names. The test was verified to fail when thel10nIdis put back, so it genuinely catches the regression rather than passing vacuously. This required exportingmakeChooseAudioMenuItemForImage.openCanvasToolTabin the canvas Playwright helpers. It looked for the Canvas tool header ash3[data-toolid=...], but the React toolbox now renders tool headers as MUI accordion summaries withdata-toolidon a span, so every canvas e2e test was failing in the fixture before reaching its assertions. Theh3selectors are kept alongside the new one.No localizable strings were added, changed, or removed:
ARecordingis still used by the text path, so its XLF entry stays live.Follow-up to BL-16669 — the sound file names this menu displays are the same unencoded names that card's fix established.
Devin review
This change is