From 7ed4157d24ea2c4626d9bdd1a74adbe45096a4d3 Mon Sep 17 00:00:00 2001 From: alex-rawlings-yyc Date: Fri, 15 May 2026 15:14:32 -0600 Subject: [PATCH 1/3] Introduce menu item that retokenizes current book on selection --- __mocks__/platform-bible-react.tsx | 82 +++++++++++++++++- contributions/localizedStrings.json | 3 +- cspell.json | 1 + .../components/InterlinearizerLoader.test.tsx | 86 ++++++++++++++++++- .../hooks/useInterlinearizerBookData.test.ts | 32 +++++++ src/components/InterlinearizerLoader.tsx | 57 +++++++++++- src/hooks/useInterlinearizerBookData.ts | 11 ++- 7 files changed, 261 insertions(+), 11 deletions(-) diff --git a/__mocks__/platform-bible-react.tsx b/__mocks__/platform-bible-react.tsx index ba354760..cbe04b04 100644 --- a/__mocks__/platform-bible-react.tsx +++ b/__mocks__/platform-bible-react.tsx @@ -17,24 +17,62 @@ interface SerializedVerseRef { export const BOOK_CHAPTER_CONTROL_STRING_KEYS: string[] = []; +interface MenuItemContainingCommand { + command: string; + label?: string; +} + +type SelectMenuItemHandler = (selectedMenuItem: MenuItemContainingCommand) => void; + +/** + * Stub for `TabToolbar`. Renders start and end children, and one ` ); } +/** + * Stub for `Switch`. Renders a checkbox input so tests can toggle boolean settings without the real + * component. + * + * @param props - Component props. + * @param props.checked - Whether the switch is on. + * @param props.disabled - Whether the switch is disabled. + * @param props.id - HTML id attribute for label association. + * @param props.onCheckedChange - Handler called with the new boolean value on change. + */ export function Switch({ checked, disabled, @@ -105,6 +170,15 @@ export function Switch({ ); } +/** + * Stub for `Label`. Renders a plain `