feat(browser): saved views can be deleted - #959
Merged
Merged
Conversation
The saved-settings DELETE endpoint and API client already existed, but nothing in the UI called them, so a saved view could never be removed. Each saved view in the settings drawer's "Load Saved View" menu now has a trash icon. It opens a "Delete View" confirm dialog naming the view; the click is stopped so it doesn't also load the view. The dialog lives outside the combobox so the menu closing can't unmount it. The item slot keeps Vuetify's role="option" on each entry. The new deleteSavedSettings store action reloads the list even when the delete fails, so a view already deleted in another tab drops out. Adds the first tests for the DELETE endpoint: it removes the view with its filters and last-route rows, and 404s for another user's view, the unnamed current-settings row, and an unknown pk. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
Saved views can now be deleted from the browser settings drawer. Each view in the Load Saved View dropdown has a trash icon. Clicking it opens a Delete View confirm dialog that names the view.
Why
The owner-scoped
DELETE /api/v4/browse/<collection>/saved-settings/<pk>endpoint and thedeleteSavedSettingsAPI client already existed, but nothing in the UI called them. A saved view could never be removed.Changes
stores/browser.js: newdeleteSavedSettings(pk)action. It reloads the list even when the delete fails, so a view already deleted in another tab drops out.browser-settings-saved.vue:#itemslot adds a trash button to each entry.@click.stopkeeps the click from also loading the view, and the entry keeps Vuetify's defaultrole="option".No backend changes.
Tests
tests/test_saved_settings_delete.py: the first tests for the DELETE endpoint. It removes the view along with its filters and last-route rows. It returns 404 for another user's view, the unnamed current-settings row, and an unknown pk.frontend/tests/unit/browser-saved-views-delete.test.js: covers the store action and the component. Clicking the trash icon opens the confirm dialog without loading the view; confirming deletes it. Mutation check: removing.stopfails the "doesn't load the view" test.make fix,make lint,make tyclean. Full suites pass: pytest 1574 passed (1 xfailed), vitest 946 passed.elementFromPointat each trash icon's center hits the button, not the list item.DELETE …/saved-settings/<pk>→ 204 and the list reloads.Reviewer notes
developbefore this change and is being fixed separately.make lintshows two basedpyrightreportUnreachablewarnings incodex/views/browser/annotate/cover.py. That file isn't touched here.🤖 Generated with Claude Code