Repository navigation
Web: fix Patinae colour replay, command policy and picks, session recovery and the CIF tokenizer - #24
AtharvaTilewale wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
Thanks — addressed in the latest commit. On a terminal display failure (CIF/render parse error), the host is now notified on both the open path and the restore path, while the caller still rejects, and exactly one notification is sent when recovery succeeds. Three new session-lifecycle tests cover both failure paths and the no-duplicate guard. |
7c86fce to
564fa39
Compare
|
Thanks. On the two summary notes (no open threads):
Branch rebased onto the updated #20. |
A workspace setting could point the Studio webview at an arbitrary server. Only pythonPath was listed in restrictedConfigurations.
… CIF tokenizing - Patinae colors: record the document atoms a selection color targets when it is applied and replay those (not the later contents of "sele"); "color all" supersedes earlier colors; clear the replay list on clearAllVisuals, comparison loads and destroy. - Patinae commands: move the Studio command policy into studio/patinae-commands.ts and block catalog commands that create, rename or re-bond objects or move/drop coordinates (align, biounit, copy, delete_states, materialize, reinitialize, set_name, setup_ccd, split_states, symexp). A unit test classifies every command in the vendored catalog. - Patinae picks on objects that are not in the document identity map are ignored instead of being reported as the same-numbered document atom. - Session restore: forget the session id after a failed restore; only drop storage on 404/403, and keep a session whose GET succeeded but whose display failed savable. - Open: keep a session that cannot be displayed persisted with Download/Close enabled. - Combine: run the combine POST and refresh inside the viewer update queue. - CIF tokenizer: quotes close only before whitespace/EOF and cannot span lines, '#' starts a comment only at token start, and semicolon text fields drop the final line terminator. The bundled assets under packages/api/annotation_studio/web/ are not rebuilt here.
When opening or restoring a session whose structure cannot be displayed,
execution previously skipped notifyHost("ready") on the terminal-failure
path, so an embedded host (e.g. VS Code) never received the session id and
timed out. Notify the host on both the open and restore failure paths while
still rejecting for the caller, and send exactly one notification when
recovery succeeds. Covered by new session-lifecycle regression tests.
…y point main.ts and the Patinae adapter now import the design card, refold panel and embed API, call requestAnimationFrame and read the page theme. The two harnesses that load them under Node stub the new UI modules, resolve directory imports to index.ts, substitute the __STUDIO_VERSION__ build constant as Vite does, and give the fake window the dispatchEvent the embed API uses. No assertions changed.
564fa39 to
50e245d
Compare
|
Rebased onto current Two conflicts needed porting rather than merging:
The two Node test harnesses also needed to follow |

What this fixes
Patinae viewer
setColorloggedcolor X, seleandapplyBaseStylereplayed it against whateverselewas at replay time. Colours drifted to later selections and leaked into other documents. Colours are now recorded against the document atom indices selected when they were applied. The list is cleared on open, combine, structural edits and restore, andcolor allsupersedes earlier entries. This adds an optionalViewerAdapter.clearColors(); Mol* is unaffected.studio/patinae-commands.ts. The deny-list gainsalign,biounit,copy,delete_states,materialize,reinitialize,set_name,setup_ccd,split_statesandsymexp, which create, rename or re-bond objects or move coordinates and so desync the viewer from the document. A test classifies all 91 commands in the shipped catalog.Session lifecycle
sessionId. Stored state is forgotten only on 404/403, so other errors can be retried. A session that loads but fails to display stays active and closable.WASM CIF tokenizer (
packages/core/src/lib.rs), per CIF 1.1'N'-ACE'works.#starts a comment only at the start of a token, soA#1is one value.VS Code
annotationStudio.serverUrlis added torestrictedConfigurations, so an untrusted workspace can no longer point the webview at an arbitrary server.Validation
packages/web/tests/*.test.ts, each failing on Fix CI: open rebuilt examples as Annotated CIF and protonate them #20's code.cargo test: 10 passed, with 4 new tokenizer tests.cargo fmtandclippy -D warningsare clean.tsc --noEmitis clean.backend-parity(no browser or WebGPU here), and the realwasm-packbuild.tscran against a temporary.d.tsfor the WASM module, which is not committed. The adapter tests use a recording stub in place of the WebGPU renderer, so CI's browser jobs are the real check for this PR.Please note
packages/api/annotation_studio/web/is unchanged, so installed users get these fixes only aftermake build. Tell me if you'd like the rebuilt bundle in this PR.expected_revisionon the serverCombineMutation.?session=links.