fix(web): hoist RunsTable SortIcon + forward view scope in FilterPanel#12
Merged
Conversation
Two low-priority UI cleanups from the audit follow-ups. 1. RunsTable: SortIcon was defined inside the component body (re-created every render, and a nested-component smell the react-hooks 7.1 rules discourage). Hoisted to module scope, taking field/sortBy/sortDir as props — mirrors the existing SessionsTable SortIcon. Behavior-identical. 2. FilterPanel: its filter-options request (POST /api/runs/search) sent no scope, so an admin viewing a specific user (?userId=) still saw the team-wide repo/branch chip lists. Now forwards the active view scope (view / userId, read via useSearchParams) and re-fetches when it changes. Members remain self-scoped server-side via resolveViewScope regardless of the forwarded param (no data leak — verified). A cancelled-flag guard keeps a stale response from clobbering a newer scope's options. Verification: web lint 0/0 (react-hooks 7.1 clean), build green, 1250 tests pass. Adversarial 2-lens review (behavior-preservation + correctness/security) confirmed no data leak and no hooks violation. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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
The two low-priority UI cleanups from the audit follow-ups.
1.
RunsTable— hoistSortIconIt was defined inside the component body (re-created every render, and a nested-component pattern the react-hooks 7.1 rules discourage). Moved to module scope, taking
field/sortBy/sortDiras props — mirrors the existingSessionsTableSortIcon. Behavior-identical.2.
FilterPanel— forward the view scopeIts filter-options request (
POST /api/runs/search) sent no scope, so an admin viewing a specific user (?userId=) still saw team-wide repo/branch chips. Now forwards the activeview/userIdscope (viauseSearchParams) and re-fetches when it changes.resolveViewScoperegardless of the forwarded param (verified — only admins reach theuserIdbranch).cancelled-flag guard prevents a stale response from clobbering a newer scope's options.Verification
web lint 0/0 (react-hooks 7.1 clean), build green, 1250 tests pass. Adversarial 2-lens review (behavior-preservation + correctness/security): no data leak, no hooks violation; the one finding (stale-response race) is fixed in this PR.
🤖 Generated with Claude Code