mikebridge opened a new pull request, #42845:
URL: https://github.com/apache/superset/pull/42845

   ### SUMMARY
   
   Deleting a semantic layer cascade-deletes every semantic view it owns. The 
cascade itself is intended behavior, but the delete confirmation never 
mentioned it: the modal asked "Are you sure you want to delete *layer*?", the 
user typed DELETE, and the dependent views vanished silently on the next list 
reload — along with the usefulness of any chart built on them.
   
   The confirmation now states the blast radius before the user confirms:
   
   - The delete action first looks up the layer's dependent views through the 
combined datasource list endpoint (`GET /api/v1/datasource/` filtered by 
`semantic_layer_uuid` — the same linkage the backend cascade uses), so the 
warning and the effect cannot disagree.
   - The modal shows a count, the first ten view names, an "... and N others" 
overflow line, and a note that charts built on those views will stop working.
   - If the lookup fails, the modal still opens with an uncounted warning — the 
count is an aid, not a gate on deleting. A layer with no dependent views keeps 
the original short copy.
   - A generation counter drops stale lookup resolutions, so a slow response 
can neither reopen a dismissed modal nor replace a newer row's modal.
   
   The type-to-confirm friction is unchanged.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Captured live against a local stack (flask + webpack dev-server) with a demo 
semantic layer owning three views (`marketing`, `orders`, `sales`).
   
   **Before** — no mention of the three views about to be destroyed:
   
   
![before](https://raw.githubusercontent.com/mikebridge/superset/sc-108418-assets/before-delete-modal.png)
   
   **After** — count, names, and the chart impact, ahead of the type-to-confirm 
gate:
   
   
![after](https://raw.githubusercontent.com/mikebridge/superset/sc-108418-assets/after-delete-modal.png)
   
   ### TESTING INSTRUCTIONS
   
   1. Enable the `SEMANTIC_LAYERS` feature flag and create a semantic layer 
with at least one dependent semantic view (any provider).
   2. Go to **Datasources** (`/databaseview/list/`) and click the delete icon 
on the semantic-layer row.
   3. The confirmation lists the dependent views by name with a count and warns 
that charts built on them will stop working. Confirming (type DELETE) deletes 
the layer and its views exactly as before.
   4. A layer with no dependent views shows the original short confirmation.
   
   Unit coverage: `npm run test -- 
src/pages/DatabaseList/DatabaseList.semanticLayerDelete.test.tsx` (7 tests). 
Control-run: the three warning tests and the stale-lookup test fail against the 
pre-fix component.
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   - [ ] Has associated issue:
   - [x] Required feature flags: `SEMANTIC_LAYERS` (the semantic-layer rows 
this touches only render with the flag on; flag-off behavior is unchanged)
   - [x] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   This PR was developed with AI assistance (Claude Code), including the 
implementation, tests, and the live before/after verification; a human 
(@mikebridge) reviews before undrafting.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to