Open
Conversation
- 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.
- 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.
- 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.
This comment was marked as resolved.
This comment was marked as resolved.
…tionality - Add Node.js version requirement (>=18) to package.json and package-lock.json. - Improve interlinearizer WebView by implementing keyboard navigation for JSON view modes, allowing users to switch between modes using arrow keys. - Refactor related tests to ensure proper functionality of the new keyboard navigation feature. - Update README to reflect the new Node.js requirement and clarify usage of test data paths.
…avigation improvements - Export `JsonViewMode` type and add a sentinel for conversion status to indicate when interlinearization is in progress. - Implement `formatJsonPreContent` function to display "Converting..." during the conversion process. - Refactor keyboard navigation handling for JSON view modes, improving the separation of concerns and testability. - Update tests to verify the new conversion status display and ensure keyboard navigation functionality works as expected.
Contributor
Author
alex-rawlings-yyc
left a comment
There was a problem hiding this comment.
@alex-rawlings-yyc resolved 1 discussion.
Reviewable status: 0 of 17 files reviewed, all discussions resolved (waiting on alex-rawlings-yyc).
… gloss lookup functionality - Enhance the interlinearizer WebView to utilize a Lexicon XML file for gloss text lookup, allowing for more accurate display of glosses in analyses. - Modify the `createAnalyses` function to accept an optional gloss lookup, improving the generation of analysis objects with real gloss text. - Update Jest tests to cover new gloss lookup scenarios, ensuring proper handling of gloss text retrieval and fallback mechanisms. - Revise README to include details about Lexicon XML structure and its integration with the interlinearizer.
- Update the interlinearizer WebView to return `undefined` instead of `result` for better clarity in async handling. - Simplify gloss lookup handling in `createAnalyses` by removing unnecessary nullish coalescing. - Add a new test to ensure deterministic sorting of items with the same index by length and kind in the paratext9 converter. - Improve error handling tests in the paratext9 parser for missing attributes in XML data.
Contributor
Author
alex-rawlings-yyc
left a comment
There was a problem hiding this comment.
@alex-rawlings-yyc resolved 3 discussions.
Reviewable status: 0 of 25 files reviewed, all discussions resolved (waiting on alex-rawlings-yyc).
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.
Summary
This branch adds the Interlinearization data model, refactors Paratext 9 (PT9) parsing into a dedicated converter with hash-based text versions, extends the interlinearizer WebView with multiple viewing modes and an analyses view, and improves accessibility and async behavior.
Major changes
Interlinearization model and types
Interlinearizationtype insrc/types/interlinearizer.d.ts: structured model for interlinear data (id, books, segments, occurrences, analyses, etc.) consumed by the WebView and converter.src/types/interlinearizer-enums.tsand expanded.d.tsfor books, segments, analyses, and alignment.Paratext 9 parser and converter
interlinearXmlParser→paratext9Parser; PT9-specific code lives undersrc/parsers/paratext-9/(parser, converter, types,pt9-xml.md).paratext9Converter: converts PT9 parser output into theInterlinearizationshape (book-level data with verse entries, assignment status, and a book-level text version for change detection).crypto.subtle.digest('SHA-256', …)so the converter runs in the WebView without Node.hashSha256Hexin converter options so the host (e.g. paranext-core) can supply a matching hasher (e.g.generateHashFromBuffer('sha256', 'hex', …)) for consistency.paratext-9-types.ts; deprecatedScrTextNameremoved (deprecated in PT9 since 2020); prop casing aligned with PT9.WebView: viewing modes and analyses
createAnalysesbuilds analysis maps). Button added to switch between interlinear and analyses views.Interlinearizationis async; WebView usesuseEffectfor loading and state so the UI stays correct when data arrives late.radiogroup/radiowitharia-checkedinstead ofgroupfor clearer semantics and screen readers.This change is
Summary by CodeRabbit
New Features
Tests
Documentation
Types/API