Skip to content

feat: Neuroglancer Views page (PR 4/6, ngviews-04-views-page) - #425

Draft
allison-truhlar wants to merge 9 commits into
ngviews-03-multiselectfrom
ngviews-04-views-page
Draft

feat: Neuroglancer Views page (PR 4/6, ngviews-04-views-page)#425
allison-truhlar wants to merge 9 commits into
ngviews-03-multiselectfrom
ngviews-04-views-page

Conversation

@allison-truhlar

Copy link
Copy Markdown
Collaborator

Neuroglancer Views — PR 4 of 6 (ngviews-04-views-page)

Stacked on #424 (ngviews-03-multiselect). Read-only scope. Adds the /ngviews page and the state layer PR 5/6 build on.

What's in it

  • viewQueries.ts — types mirroring backend model.py (View/ViewLayer/ViewCreateRequest/…) + CRUD hooks for /api/neuroglancer/views (list unwraps {views:[...]}, 404→[]). Mirrors ngLinkQueries.
  • ViewsContext — provider bundling the CRUD hooks (mirrors NGLinkContext).
  • Layer CartneuroglancerCart stored in the existing user-preference blob (no new table/endpoint), exposed via a thin CartContext (add/remove/clear, dedup on fsp+path+channel) and a standalone useCartCount hook for the nav badge.
  • useNGViewsColumns — Saved Views table columns (name / layers / sharing / updated / actions). Row actions are flat menu items (Open in Neuroglancer, Copy NG link, Download JSON state via the existing downloadTextFile util, Rename, Delete).
  • /ngviews page — local-state tabs: Saved Views (TableCard) + a minimal Layer Cart shell (list + remove + clear). Rename/Delete dialogs. No page-level "New View" button — Views are created by cart checkout (PR 5) / scratch save (PR 6).
  • Nav + routing — "NG Links" → "NG Views" with a passive cart-count badge; /nglinks/ngviews redirect (legacy /ng/{key} short-link serving routes untouched).
  • Removed the obsolete "Neuroglancer Links" guided-tour workflow (the redirect orphaned it; the page it toured is gone).

Deferred / carry items

  • sharing_mode is a stored label only (displayed, not enforced) — per PR 2 decisions.
  • "Open" opens the external Neuroglancer URL as a stand-in; PR 6 repoints it to the embedded /ngview/:read_key viewer.
  • Layer Cart tree + "Create View" checkout are PR 5; embedded viewer is PR 6.
  • Not automated: manual smoke of the redirect + a live cart-badge bump (needs PR 5's cart-mutation UI).

Testing

  • Full frontend suite green: 316/316 (pixi run test-frontend). New unit/component tests for viewQueries, CartContext, ngViewsColumns, NGViews; NavbarBadge test updated. node-check / node-prettier-check / node-eslint-check clean (one pre-existing unrelated lint warning).

Built via subagent-driven development from docs/superpowers/plans/2026-08-07-ngviews-04-views-page.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant