Catalogue the SingleCellExperiments a session can switch between - #58
Open
david-priest wants to merge 2 commits into
Open
david-priest wants to merge 2 commits into
david-priest wants to merge 2 commits into
Conversation
GateLabR binds to one object at launch. The GateLabR-specific Shiny interface let a user move between the SCEs already in their session; that went missing when the React interface replaced it in 1.4.0. The host contract never lost the ability -- its datasets field is a list and GateLabHostDatasetPort.listDatasets() returns an array. Only the launcher and the app collapsed it to one. R/sce_catalogue.R list SCEs in an environment and describe them cheaply host_bridge.R manifest carries availableDatasets alongside datasets launch_react.R an activate-dataset request swaps sce_state and resends Listing is deliberately cheap: dimensions, assay names and whether a workspace is already stored in metadata(), never assay data. The expensive part, the per-sample binary resources, is still registered for one object at a time and re-registered on a switch. Activation refuses a name that is not an SCE, and refuses to switch unless the request says the current workspace has been saved. The whole workspace lives in metadata(sce), so switching without a save loses it, and R cannot check that for itself -- an explicit acknowledgement turns a silent loss into an error. The React dataset picker that consumes availableDatasets is not in this commit. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…are per object, the reply reaches the browser The first cut of the catalogue switched sce_state but left everything else on the launch object. Every write went to the launch-time name, so after a switch the second object overwrote the first in the global environment; the dataset id and the resource names never changed, so the first object's workspace and memberships could be written into the second and its resource URLs served the second's data; the activate reply nested `ok` inside `result`, which the browser's response parser discards, so every switch timed out after 30 s; the state was swapped before the manifest was built, so a failure left the session on an object it could not describe; a running compensation Apply committed its matrix into whichever object was loaded when it finished; and the switched object never got the precompensation note the launch prints. active_name now lives beside sce_state at app level and every write, request and job uses it; each object has its own dataset id (.gatelabr_dataset_id_for) and therefore its own resource names; the reply carries ok at the top level; the manifest is built for the replacement before the state swaps; a switch is refused while an Apply is running; the switch prints the writeback name and the precompensation note. The catalogue marks objects the descriptor would refuse, with the reason, and recognises a workspace saved in the older plain JSON form. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Owner
Author
|
Second commit (89f918c) reworks the switch after the 2026-09-11 review found the first cut switched
GateLab has no picker for the catalogue yet — 🤖 Generated with Claude Code |
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.
Replaces #57, which closed when the branch it was based on was deleted after merging. The commit is unchanged, and it merges into
mainwithout conflicts.Stacked on #56 so the diff reads clean; retarget to
mainonce that merges.R side only. The React dataset picker that consumes
availableDatasetsis not here yet.Why
GateLabR binds to one object at launch. The GateLabR-specific Shiny interface let a user move between the SCEs already in their session, and that went missing when the React interface replaced it in 1.4.0 (
launchLegacyGateLabRrecords the retirement).The host contract never lost the ability — its
datasetsfield is a list andGateLabHostDatasetPort.listDatasets()returns an array. Only the launcher and the app collapsed it to one.What this adds
R/sce_catalogue.RR/host_bridge.RavailableDatasetsbesidedatasetsR/launch_react.Ractivate-datasetrequest swapssce_state()and resendsListing is deliberately cheap — dimensions, assay names, and whether a workspace is already stored in
metadata(), never assay data. The expensive part, the per-sample binary resources, is still registered for one object at a time and re-registered on a switch.Two refusals worth reviewing
SingleCellExperiment, and usesinherits = FALSEso a name in an attached package cannot masquerade as a session object — activating one would write results somewhere the user cannot see.metadata(sce), so switching without a save loses it, and R cannot verify the app saved. An explicit acknowledgement turns a silent loss into an error. If you would rather R flushed it itself, say so; that is a different and arguably better design.Tests
test-sce-catalogue.Rcovers enumeration (non-SCEs excluded), catalogue contents, the object launched from an expression with no name in the environment, and the activation refusals.devtools::test(filter="sce-catalogue")before merging.🤖 Generated with Claude Code