Add interlinearizer project storage and createProject command#33
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.
…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
imnasnainaec
left a comment
There was a problem hiding this comment.
@imnasnainaec reviewed 14 files and all commit messages, and resolved 1 discussion.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on alex-rawlings-yyc).
… missing TW classes
… need testing, reintroduce createSourceIsSelect to reopen SelectProjectModal if user cancels project creation
eb96dac to
5842232
Compare
alex-rawlings-yyc
left a comment
There was a problem hiding this comment.
@alex-rawlings-yyc reviewed 16 files and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on alex-rawlings-yyc).
imnasnainaec
left a comment
There was a problem hiding this comment.
@imnasnainaec reviewed 4 files and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on alex-rawlings-yyc).
This change is
Summary by CodeRabbit
New Features
Bug Fixes / Reliability
Tests
Documentation