feat: replace BookChapterControl with dialog-based CommandNavigator#2131
Draft
Sebastian-ubs wants to merge 9 commits intomainfrom
Draft
feat: replace BookChapterControl with dialog-based CommandNavigator#2131Sebastian-ubs wants to merge 9 commits intomainfrom
Sebastian-ubs wants to merge 9 commits intomainfrom
Conversation
Replace the popover-based BookChapterControl with a new CommandNavigator component inspired by MP-BCV-control. The new component uses a centered modal dialog (command palette pattern) with direct match banners, responsive chapter grid, navigation history, footer hints, and full keyboard navigation. - Add CommandNavigator component in platform-bible-react - Make BookChapterControl a thin wrapper for backward compatibility - Enhance CommandDialog with shouldFilter prop - Enhance CommandInput with customizable icon prop - Export CommandDialog and CommandNavigator from index.ts - Update toolbar to use CommandNavigator Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update element identification in interaction tests to match the new
CommandNavigator implementation:
- Change CHAPTER_BUTTON_ROLE from 'option' to 'button' (chapters now use Button)
- Add { hidden: true } to trigger getByRole calls (Radix Dialog aria-hidden)
- Use querySelectorAll('[data-chapter-btn]') for chapter counting
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adapt interaction tests to CommandNavigator's dialog-based patterns: - Replace click-on-top-match with Enter keypress (banner has no onClick) - Update text matchers from book codes to English names (JHN→John, etc.) - Update verseNum expectations to 1 (CommandNavigator drops verse from input) - Change single-chapter book tests to include chapter in search query (DC books have fetchEndChapter=-1, so chapter grid would be empty) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adapt interaction tests to CommandNavigator's dialog-based patterns: - Replace click-on-top-match with Enter keypress (banner has no onClick) - Verify direct match banner via ENTER badge text - Update verseNum expectations to 1 (CommandNavigator drops verse from input) - Change single-chapter book tests to include chapter in search query - Wait for dialog full unmount in expectPopoverToBeClosed (fixes pointer-events timing) - Add expectPopoverToBeClosed between Smart Parsing reopen steps - Rework keyboard navigation: ArrowDown first to enter chapter grid - Fix BookSearchAndNavigation: type-to-navigate instead of click-book-item - Fix back button identification with data-chapter-btn filter Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The BookChapterControl now uses a Dialog (CommandNavigator) instead of a Popover. Update the toolbar E2E test to: - Use [role="dialog"] input[cmdk-input] instead of [data-radix-popper-content-wrapper] input - Check for chapter grid buttons instead of cmdk-item (typing "Gen" triggers chapter view) - Press Escape twice to close (first clears search, second closes dialog) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace null with undefined in useRef calls, remove non-null assertion and as-type assertions, use querySelectorAll<HTMLElement> generics, replace ++ with += 1, and iterate sections array instead of Object.entries. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
React's DOM ref typing requires null, not undefined. Add no-null/no-null eslint-disable comments matching project conventions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace nested ternary with if/else for chapter button variant. Remove non-null assertion on backButton in story test. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


see https://discord.com/channels/892072317436448768/1485647003634499675
Summary
BookChapterControlwith a newCommandNavigatorcomponent using a centered modal dialog (command palette pattern, inspired by MP-BCV-control)BookChapterControlis now a thin wrapper aroundCommandNavigatorfor backward compatibility — all existing consumers (toolbar, web-view, platform-scripture-editor, hello-rock3) continue to work unchangedChanges
command-navigator.component.tsxcommand-navigator.types.tscommand.tsxCommandDialog(shouldFilter prop) andCommandInput(icon prop)book-chapter-control.component.tsxindex.tsCommandDialog,CommandNavigatorexportsplatform-bible-toolbar.tsxCommandNavigatoraliasTest plan
🤖 Generated with Claude Code
This change is