feat: neuroglancer view (1/6): data model — views + view_layers tables - #422
Draft
allison-truhlar wants to merge 7 commits into
Draft
feat: neuroglancer view (1/6): data model — views + view_layers tables#422allison-truhlar wants to merge 7 commits into
allison-truhlar wants to merge 7 commits into
Conversation
Design spec for the Neuroglancer Views feature, scoped to read-only Views with editable Views deferred to a follow-up stack. Covers the data model, API, frontend architecture, and a six-PR gh stack breakdown. Distills the .scratch decision log, ADR-0001, and wireframes.
The design docs cited c1f9a4e7b2d8 as the current Alembic head; on main that revision already has a child and the true sole head is e7b2a9c4f130. Correct the spec and plan references and note that the head advances as PRs merge, so it must be verified live before generating a migration.
This was referenced Aug 7, 2026
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.
Neuroglancer Views — PR 1 of 6 (stacked)
Foundation of the Neuroglancer Views feature: a Neuroglancer View becomes a
first-class saved object (NG state + the datasets it shows + sharing settings).
This PR is the bottom of a 6-PR stack and is pure-additive — new tables,
models, and DB helpers only. No routes, no behavior change.
Design spec and plan (included in this PR):
docs/superpowers/specs/2026-08-07-neuroglancer-views-design.mddocs/superpowers/plans/2026-08-07-ngviews-01-model.md(Scope note: this stack ships read-only Views; editable Views are a later
stack.
edit_keyis reserved in the schema now so that stack needs no secondmigration.)
What's in this PR
viewstable (ViewDB):short_key,read_key,edit_key(reserved,unused),
name,ng_state(JSON),sharing_mode(private|read),owner, timestamps.view_layerstable (ViewLayerDB): the many-to-many join between a Viewand a Data Link (
proxied_paths).data_link_idis nullable and each row hasa
brokenflag, so a future "mark broken" Data-Link deletion can null thelink without deleting the View.
neuroglancer_stateshelpers):create_view,get_view_by_short_key,get_view_by_read_key,get_views,update_view,delete_view(cascades to layers), andget_views_for_data_link(dependent-Views lookup, powers the delete guard andthe "Appears in N Views" discovery in later PRs).
View/ViewLayer/ViewResponse.Viewdeliberatelydoes not expose
edit_key.1e8dc304b4f2creating both tables (FK-safe, reversible),chained off the current head
e7b2a9c4f130.Testing
pixi run -e test test-backend→ 777 passed. New tests cover thecreate/get/list/update round-trip, owner-scoping on update/delete, the cascade
delete (asserts join rows are removed), the
get_views_for_data_linkDISTINCTpath (two layers → one View), and the Pydantic from-ORM round-trip incl.
edit_keybeing absent.Stack
/ngview/{key}read link, dependent-views endpoint, Data-Link delete modes)