Add Interlinearization model, PT9 refactor, and viewing-mode support#11
Add Interlinearization model, PT9 refactor, and viewing-mode support#11alex-rawlings-yyc wants to merge 7 commits intomainfrom
Conversation
…#6) Add interlinear XML parser, minimal WebView integration, and full test coverage - Parse PT9 interlinear XML (`fast-xml-parser`) into typed `InterlinearData` - Public API in `interlinearizer.d.ts` (`StringRange`, `ClusterData`, `VerseData`, etc.) - Register interlinearizer WebView provider and open React WebView on activation - Document PT9 schema and parser behavior in `src/parsers/pt9-xml.md` - Jest unit tests with 100% coverage on parsers, `main`, and web-view - GitHub Actions workflow for test and lint on push/PR to main - Handle `Excluded` flag and numeric/hash validation in parser - Add test-data sample XML and PAPI mocks for tests
|
Caution Review failedAn error occurred during the review process. Please try again later. 📝 WalkthroughWalkthroughRenames parser to Paratext9Parser, normalizes parsed output to camelCase, adds Paratext‑9 TS types, implements conversion to the Interlinearization model and analysis creation, introduces runtime enums, updates the web view to toggle JSON views, and adjusts tests, docs, and path aliases. Changes
Sequence DiagramsequenceDiagram
participant WebView as Web View (interlinearizer.web-view.tsx)
participant Parser as Paratext9Parser
participant Converter as Converter (paratext9Converter)
participant Display as JSON Display
WebView->>Parser: parse(xmlString)
Parser-->>WebView: InterlinearData {glossLanguage, bookId, verses}
WebView->>Converter: convertParatext9ToInterlinearization(InterlinearData)
Converter-->>WebView: Interlinearization {books, segments, occurrences}
WebView->>Converter: createAnalyses(InterlinearData)
Converter-->>WebView: Map<analysisId, Analysis>
WebView->>Display: render(selectedView: InterlinearData|Interlinearization|Analyses)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
a003e33 to
63fbab8
Compare
- Introduce `Interlinearization` data model. - Move internal-only PT9 types to dedicated file and change case of props. - Removed `ScrTextName` prop as it's been deprecated in PT9 since 2020. - Enhance interlinearizer WebView to support switching between viewing modes: InterlinearData and Interlinearization. - Update Jest configuration to include path aliases for types and parsers. - Modify README to clarify the structure of the `src/types/` and `src/parsers/` directories. - Rename `interlinearXmlParser` and related tests to `paratext9parser`. - Add new words to cspell configuration for improved spell checking.
63fbab8 to
8ee1af3
Compare
- Add support for a new JSON view mode displaying analyses derived from parsed data. - Implement functions to describe and label the new view mode. - Update the WebView component to include a button for switching to the analyses view. - Modify tests to cover the new analyses functionality and ensure proper rendering. - Refactor the `createAnalyses` function to generate analysis maps from interlinear data.
- Change role from 'group' to 'radiogroup' for JSON view mode buttons to improve accessibility. - Update button roles to 'radio' and aria attributes to 'aria-checked' for better semantic meaning. - Modify tests to reflect the updated roles and ensure proper functionality of the JSON view mode switch.
f181abe to
7773f28
Compare
- Introduce SHA-256 hashing for consistent book-level text version generation across Node and WebView environments. - Add Web Crypto-based sha256HexWebCrypto for WebView-safe hashing; support injectable hashSha256Hex in converter options for Node (e.g. paranext-core generateHashFromBuffer). - Compute book text version from sorted, concatenated verse hashes via computeBookTextVersion. - Update paratext9Converter and tests to align with hash-generation behavior and remove obsolete code. - Refactor interlinearizer WebView to use useEffect for async conversion and improve JSON view mode buttons. - Update documentation for data structures and types.
7773f28 to
ade5ac1
Compare
alex-rawlings-yyc
left a comment
There was a problem hiding this comment.
@alex-rawlings-yyc resolved 1 discussion.
Reviewable status: 0 of 14 files reviewed, all discussions resolved (waiting on alex-rawlings-yyc).
ade5ac1 to
ca5ee39
Compare
Interlinearizationdata model.ScrTextNameprop as it's been deprecated in PT9 since 2020.src/types/andsrc/parsers/directories.interlinearXmlParserand related tests toparatext9parser.This change is
Summary by CodeRabbit
New Features
Improvements
Documentation
Tests