Skip to content

fix(web): hoist RunsTable SortIcon + forward view scope in FilterPanel#12

Merged
iaj6 merged 1 commit into
mainfrom
fix/runs-ui-nits
Jun 8, 2026
Merged

fix(web): hoist RunsTable SortIcon + forward view scope in FilterPanel#12
iaj6 merged 1 commit into
mainfrom
fix/runs-ui-nits

Conversation

@iaj6

@iaj6 iaj6 commented Jun 8, 2026

Copy link
Copy Markdown
Owner

What

The two low-priority UI cleanups from the audit follow-ups.

1. RunsTable — hoist SortIcon

It 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/sortDir as props — mirrors the existing SessionsTable SortIcon. Behavior-identical.

2. FilterPanel — forward the view scope

Its 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 active view/userId scope (via useSearchParams) and re-fetches when it changes.

  • No data leak: a member stays self-scoped server-side via resolveViewScope regardless of the forwarded param (verified — only admins reach the userId branch).
  • A 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

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]>
@iaj6 iaj6 merged commit 4e42e14 into main Jun 8, 2026
3 checks passed
@iaj6 iaj6 deleted the fix/runs-ui-nits branch June 8, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant