feat(views): track View sources independently of Data Links - #454
Open
allison-truhlar wants to merge 9 commits into
Open
allison-truhlar wants to merge 9 commits into
allison-truhlar wants to merge 9 commits into
Conversation
allison-truhlar
added this pull request to stack #429
September 22, 2026 17:57
…Views Postgres cannot compare json columns, so JOIN + DISTINCT failed with 500 on Data Link delete. Filter by an IN-subquery over view_layers.view_id instead.
Layers previously knew their source only through data_link_id, which is nulled when the Data Link is deleted. Store the source directly so broken Views keep showing (and can later be restored by) their path. Backfills existing linked layers.
…k icon Sources now come from layer.fsp_name/path instead of a lookup through the user's Data Links, so a deleted link no longer erases the source line.
Add coverage for the broken-state merge across layers sharing one source and for the em-dash fallback when no layer resolves to a source. Also simplify the broken-link icon to use FgIcon's built-in label prop instead of a hand-built aria-label span.
…alog Pre-fetch with useViewsForDataLinkQuery so the warning renders on open and one click deletes with confirm. The 409 path stays as a race fallback.
…te dialog
Final-review fix wave for ngviews-08-broken-source-tracking:
1. Sources cell no longer treats an empty-string path (FSP-root Data Link) as
an unknown source; only fsp_name/path === null skips a layer.
2. Sources cell reuses datasetKey() from pathHandling instead of a hand-rolled
`${fsp_name}::${path}` key.
3. Broken-link FgIcon uses the color="error" prop instead of a raw className.
4. Tooltip copy now reads "...won't appear in this View." (capital V),
matched in the spec and plan docs.
5. ngViewsColumns test fixtures use the mocked "nrs" FSP with FSP-relative
paths so the prefixed display path is actually exercised; added a case
for an empty-string (FSP-root) path.
6. Removed the dead @/queries/proxiedPathQueries mock from NGViews.test.tsx.
7. Delete button in the Data Link delete dialog is disabled while the
dependent-Views pre-fetch is in flight.
…n-source tooltip Deleting a Data Link only invalidated the proxied-path queries, so the Views table kept its cached layers (30s staleTime) and the broken-link icon did not appear until a page reload. Invalidate the Views queries in the delete mutation's onSuccess. Tooltip now reads: "Data link deleted; source no longer appears in View".
allison-truhlar
force-pushed
the
ngviews-08-broken-source-tracking
branch
from
September 22, 2026 20:06
c121487 to
97da3b9
Compare
allison-truhlar
marked this pull request as ready for review
September 23, 2026 13:54
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.
Dev-feedback branch 08 (items 1-4 of the 3.3.0a0 test-release feedback). Spec:
docs/superpowers/specs/2026-09-16-ngviews-dev-feedback-design.md.What changed
DISTINCTover the JSONng_statecolumn, which 500s on Postgres. Replaced with anINsubquery.view_layersgainsfsp_nameandpath(migration7c3e9a2d5b41, with backfill from the current Data Link), recorded at View creation. Before this a layer knew its source only throughdata_link_id, so deleting the link lost the path.Also includes the spec and plans for branches 08/09/10.
Testing
Backend and frontend suites green. Migration verified on a populated scratch SQLite.