Repository navigation
Add host sessions - #485
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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 |
3a50239 to
46afec0
Compare
1436214 to
5d5d1cf
Compare
alex-rawlings-yyc
left a comment
There was a problem hiding this comment.
@alex-rawlings-yyc made 2 comments and resolved 2 discussions.
Reviewable status: 11 of 22 files reviewed, 14 unresolved discussions (waiting on alex-rawlings-yyc and imnasnainaec).
src/__tests__/analysis-repository-conformance.ts line 703 at r3 (raw file):
Previously, imnasnainaec (D. Ror.) wrote…
⛏️
/** The analysis that
Done.
src/__tests__/types/read-only-analysis-error.test.ts at r3 (raw file):
Previously, imnasnainaec (D. Ror.) wrote…
❓ Is this types test worth adding?
Removed: type files don't need their own suite.
alex-rawlings-yyc
left a comment
There was a problem hiding this comment.
@alex-rawlings-yyc made 2 comments and resolved 2 discussions.
Reviewable status: 20 of 22 files reviewed, all discussions resolved (waiting on alex-rawlings-yyc).
src/__tests__/services/pt9ImportRepository.test.ts line 22 at r4 (raw file):
Previously, imnasnainaec (D. Ror.) wrote…
⛏️
readProjectis documented to read afresh, but this returns the same object on every call. A copy keeps the fake to that contract:return new Pt9ImportRepository( 'import-id', async () => project && (JSON.parse(JSON.stringify(project)) as InterlinearProject), );
Done, without the cast, which the repo's no-type-assertion rule forbids; the constructor's parameter type already types the result. The fake in analysisSessions.test.ts also handed back a shared object, so it now copies the project on every read too.
src/services/pt9ImportRepository.ts line 24 at r4 (raw file):
Previously, imnasnainaec (D. Ror.) wrote…
⛏️ When #487 caches an index, a shared object would let an exported draft alias the index's records. Spelling out that the read returns a new object:
* @param readProject - Reads the project stored under that id afresh, as a new object the * repository may hand out, resolving `undefined` when none is stored.
Done.
imnasnainaec
left a comment
There was a problem hiding this comment.
@imnasnainaec reviewed 3 files and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on imnasnainaec).
8100cde to
74d865d
Compare
imnasnainaec
left a comment
There was a problem hiding this comment.
@imnasnainaec reviewed 1 file and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on alex-rawlings-yyc).
Closes #440. Part of #426. Stacked on #469.
Summary
Sessions in the host, over a source project's draft, a draft paired with its interlinear project, or a Paratext 9 import, read-only. The WebView doesn't call them yet.
AnalysisRepository.capabilities.readOnly.Pt9ImportRepositoryserves an import through the seam and refusesreplaceAllandmarkClean. The conformance suite runs over both repositories and checks the refusal.runEditrefuses them on a read-only session.hasFreeTranslationsuses the loader's own check, moved intoanalysisHasFreeTranslations.getDraftandsaveDraftgo throughopenDraftRepository, the queued handle sessions use, so the two never overlap. The handle counts its writes for Save, assaveDraftdid.Evidence
tscclean.setAnalysisLanguagepasses a parity test against the reducer.Decisions with a strong alternative
setAnalysisLanguagestores nothing, and works on an import's session. Alternative: write the draft's analysis languages. Why not: the reducer only changes the store's working language, and the import view switches languages too.SessionScope).exportAllandreplaceAllkeep the draft's shape. Alternative: a repository-level record pairing the draft with its project. Why not: 4c removes the whole-draft calls, and Move Save and Save As into the host #475's host Save already owns the project half.onDidCloseWebView. Why not: no WebView opens a session yet, so none belongs to a view. A save that lands after a close still loses nothing, since a released repository loads the stored draft before its first save. Reopening reloads, so perf seeding still sees what it wrote.und, as the loader falls back.Merge Danger
Door: two-way
Nothing calls the new commands. The draft load and save path now runs through the queued handle, with the same behavior apart from one extra read: a repository that hasn't loaded the draft loads it before its first save.
Blast Radius: draft load and save in
projectStorage; the loader's free-translation check🤖 Generated with Claude Code
This change is
Summary by CodeRabbit