Add interlinearizer project storage and createProject command#33
Add interlinearizer project storage and createProject command#33alex-rawlings-yyc wants to merge 49 commits into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds project persistence with serialized queues, new JSON-RPC project commands, modal UIs plus a ProjectModals coordinator persisted in WebView state, type/model updates (Token.ref, link-based analysis), expanded mocks/Jest config, Tailwind modal utilities, and extensive tests. ChangesInterlinearizer project storage, host commands, types, UI, mocks, and tests
Sequence Diagram (high-level) sequenceDiagram
participant WebView as WebView UI
participant Loader as InterlinearizerLoader
participant Host as Extension Host (main.ts)
participant Storage as projectStorage
participant Backend as `@papi/backend`
WebView->>Loader: open/select/create project
Loader->>Host: sendCommand('interlinearizer.getProjectsForSource', sourceId)
Host->>Storage: getProjectsForSource(token, sourceId)
Storage->>Backend: storage.readUserData(key)
Backend-->>Storage: project JSON / ENOENT
Storage-->>Host: projects JSON
Host-->>Loader: JSON string result
Loader->>WebView: render list
WebView->>Loader: createProject -> sendCommand('interlinearizer.createProject', args)
Loader->>Host: sendCommand('interlinearizer.createProject', args)
Host->>Storage: createProject(token, ...)
Storage->>Backend: storage.writeUserData(projectKey, JSON)
Storage->>Backend: storage.readUserData(indexKey) & storage.writeUserData(indexKey)
Backend-->>Storage: success / error
Storage-->>Host: created project
Host-->>Loader: JSON string (or undefined)
Loader->>WebView: update UI, persist activeProject via useWebViewState
Estimated code review effort 🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
|
e2e2f8a to
3da254f
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
Co-authored-by: alex-rawlings-yyc <alex.rawlings@wycliffe.ca>
…ations on error, disable metadata modal buttons when submitting
…zero-check in ContinuousView explicit
- Add ProjectModals component to own modal state (select/create/metadata) and their transitions, removing this responsibility from InterlinearizerLoader - Add ProjectModals.test.tsx with full coverage of modal visibility and transition flows - Strengthen isPlatformError mock to require platformErrorVersion to be a valid number, not just present - Handle SyntaxError in CreateProjectModal.handleSubmit with a user-visible notification instead of silently failing - Add test for invalid JSON response in CreateProjectModal - Add test for non-string description field in SelectInterlinearProjectModal - Mark isSubmittingRef guard branches with v8 ignore in modals
…Select`, add function to reset storage queues for testing
* Simplify interlinear model: remove InterlinearAlignment/InterlinearText, add ActiveProject * Fix model gaps for lossless LCM / PT9 / BT Extension import * Make `analysisLanguages` required * Add comments about mapping of BT Extension's `sideNum` * Update docs/schema * Further refinement; please see updated description * Suggested model tweak * Model idea: Split linking out from analyses --------- Co-authored-by: D. Ror. <imnasnainaec@gmail.com>
Update components, storage, main, and types to match the model introduced in #63: rename commands, fix return types, update JSDoc, and adjust tests throughout.
…e relevant to prevent silent deletion, docstring audit
…bmission fails, docs adjustments
16a7848 to
054405e
Compare
This change is
Summary by CodeRabbit
New Features
Bug Fixes / Reliability
Tests
Documentation