Fix URL parameter leakage from listing pages to DLP + extend listing of parameters on DLP for permalinking#2772
Fix URL parameter leakage from listing pages to DLP + extend listing of parameters on DLP for permalinking#2772yarikoptic wants to merge 9 commits into
Conversation
These tests verify that listing-specific query params (page, sortOption, sortDir, showDrafts, showEmpty, search, pos) do not leak into Dandiset Landing Page URLs when navigating from listing/search pages. Expected to FAIL on current code and PASS after the fix in the next commit. Ref: dandi#1460 Co-Authored-By: Claude Code 2.1.92 / Claude Opus 4.6 <noreply@anthropic.com>
Listing query params (page, sortOption, sortDir, showDrafts, showEmpty, search, pos) were spread into DLP URLs via `...$route.query` in DandisetList.vue, producing ugly unshareable URLs like: /dandiset/000027?page=2&sortOption=0&sortDir=NaN&showDrafts=true&... Fix: move listing navigation context into a Pinia store so the DLP "page through dandisets" feature works without polluting the URL. Add a defensive router guard to strip any listing params that reach the DLP route. Fixes: dandi#1460 Co-Authored-By: Claude Code 2.1.92 / Claude Opus 4.6 <noreply@anthropic.com>
Tests that clicking tabs updates the URL ?tab= param, that navigating directly to ?tab=how-to-cite opens the correct tab, and that the param survives page reload. Expected to FAIL on current code and PASS after the next commit. Co-Authored-By: Claude Code 2.1.92 / Claude Opus 4.6 <noreply@anthropic.com>
The DLP now reflects the selected tab in the URL so links to specific tabs are shareable and survive page reload. The default Overview tab uses no param to keep the base URL clean. Co-Authored-By: Claude Code 2.1.92 / Claude Opus 4.6 <noreply@anthropic.com>
Tests that ?format= reflects the selected citation style on the How to Cite tab, and that ?overlay=meditor opens/closes the metadata editor dialog. Expected to FAIL on current code and PASS after the next commit. Co-Authored-By: Claude Code 2.1.92 / Claude Opus 4.6 <noreply@anthropic.com>
- ?format=bibtex (etc.) on How to Cite tab reflects the selected citation style; default APA uses no param for clean URLs - ?overlay=meditor opens the metadata editor dialog on page load and is removed when the dialog closes Together with ?tab=how-to-cite, this allows full DLP state recall: /dandiset/000027/draft?tab=how-to-cite&format=harvard /dandiset/000027/draft?overlay=meditor Co-Authored-By: Claude Code 2.1.92 / Claude Opus 4.6 <noreply@anthropic.com>
|
before I proceed, query to @dandi/archive-maintainers and @bendichter (potentially for AI PR review ? ;) ) on either I should strive to polish it etc for this direction to not only leak seemingly unused
edit -- detected issue, likely due to killing |
|
@yarikoptic tbh I didn't know about those buttons for stepping through dandisets and honestly I don't think they are that useful. I would be in favor of simply removing that feature and adding params for DLP state ( |
I think they might be useful to review results of the search so you could go through them one by one. And that seems to be how they work when there is search results, e.g. try on https://dandiarchive.org/dandiset/search?search=halchenko But even there it is buggy as |
Replace the Pinia listingContext store with browser history.state to carry search/filter context between listing and DLP. Only ?pos= appears in the URL (lightweight, bookmarkable position indicator); the full listing context (sort, search, filters) travels invisibly via history.state and survives page reload. The listing page now caches identifiers from the current page (up to 8) in history.state so prev/next within that window is instant — no extra API call to discover the next identifier. Outside the cache window the DLP falls back to a single API call. Removes web/src/stores/listingContext.ts (no longer needed). Co-Authored-By: Claude Code 2.1.92 / Claude Opus 4.6 <noreply@anthropic.com>
- Make history.state reads reactive (via computed + route.fullPath dep) so the listing context updates correctly when navigating between dandisets via prev/next - Sync page ref with route.query.pos on route changes - Preserve ?search= on DLP URLs so the search bar shows the query context (matches original master behavior) - Use fully programmatic navigation in DandisetList (remove :to binding) to avoid double-navigation with @click.prevent on router-link - Update e2e tests: search and pos are legitimate DLP params - Fix TypeScript HistoryState compatibility for ListingCtx Co-Authored-By: Claude Code 2.1.92 / Claude Opus 4.6 <noreply@anthropic.com>
- Fix meditor button selector: use getByText("Metadata") instead of
getByRole("button") since Vuetify v-list-item has role="listitem"
- Fix meditor dialog selector: use .v-overlay--active .v-card which
works reliably in Vuetify 3
- Add .stop to StarButton @click to prevent event bubbling to the
parent list-item's @click handler (would cause unwanted navigation)
Co-Authored-By: Claude Code 2.1.92 / Claude Opus 4.6 <noreply@anthropic.com>

Summary
Fixes #1460 — listing query params (
page,sortOption,sortDir,showDrafts,showEmpty,search,pos) were leaking into Dandiset Landing Page URLs when navigating from listing/search pages, producing ugly unshareable URLs like/dandiset/000027?page=2&sortOption=0&sortDir=NaN&showDrafts=true&showEmpty=false.listingContext) to hold listing navigation context in memory, so the DLP "page through dandisets" feature works without URL pollution$route.queryinto DLP links inDandisetList.vue; save position to store via@clickinsteadbeforeEachrouter guard that strips listing params from thedandisetLandingrouteCommits
Add e2e tests for URL parameter isolation between listing and DLPFix URL parameter leakage from listing pages to DLPTest plan
Didn't do the dance locally, might just test on preview:
cd e2e && npx playwright test tests/urlParams.spec.ts/dandiset/XXXXXX→ confirm no pagination controls shown🤖 Generated with Claude Code