Repository navigation
GLOOK-60: hold the vulnerabilities page still when filters change - #76
Merged
Merged
Conversation
Filter changes on /vulnerabilities scrolled the page to the top, and with that fixed the page still jumped: almost every panel sized itself to its current data, so a team, repo, baseline or chip change resized it and moved everything below. Near the bottom of the page the browser then clamped the scroll position. - useUrlState gains an opt-in `scroll: false`; the vulnerabilities page's URL state uses it. Other pages are unchanged. - The "By team" pivot reads its own unfiltered summary, so selecting a team highlights a row instead of collapsing the table. - Deltas show a "vs <date>" caption naming the baseline snapshot, so a fallback to an older snapshot is visible. - Every filter-driven slot keeps a fixed size: the alerts table reserves a page of rows (or the expanded page, which now persists across filters) with fixed column widths and one-line cells; the team line, KPI captions, pivot delta caption and trend legend/note always render; the Repo select has a fixed width. 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.
Summary
Fixes GLOOK-60. The Vulnerabilities page jumped whenever a filter changed. Fixing that took two steps:
useUrlStatecalledrouter.push/router.replacewithoutscroll: false, so every filter change scrolled the page to the top.The fix follows one rule: a filter change may change what a slot shows, never the slot's size or where a control sits. Growth the user asks for, such as "Show 20 more" or expanding a coverage list, is exempt.
What changed
UrlSchemagains an opt-inscroll?: false. The five URL-state fields on this page set it. Other pages keep their current behaviour.teamparam, and highlights the selected row. The KPI tiles, trend, alerts and coverage stay scoped to the team. With no team selected, the two SWR keys are identical and dedupe to one request.vs <date>caption naming the snapshot it compares against. A fallback to an older snapshot is now visible.table-fixed, with fixed column widths that fit without horizontal scroll from 1024px up. Package is the one flexible column.Visible copy changes
Not covered
Testing
Suite:
npm test: 197 suites and 1969 tests pass.npx tsc --noEmitandnpm run buildare clean.New tests:
scroll: false;jsdom has no layout engine, so these tests guard structure: slots, inline sizes and node identity. The real layout check was in a browser.
Mutation check: each fix was deliberately broken to confirm its tests fail. Every mutation jsdom can observe is caught.
Browser check: headless Chrome at 1440px and 1024px, against the mock server and a synthetic fixture. The fixture has 12 teams, a 45-alert team, a zero-alert team, long names, and deltas both available and unavailable. It also runs with responses delayed 800ms. Across 137–178 actions per run, it checked:
All six runs pass. The same gates fail on the code before this change.
🤖 Generated with Claude Code