Skip to content

Comments

Improve dataframe column selection UX#279

Open
revmischa wants to merge 5 commits intomeridianlabs-ai:mainfrom
METR:feature/column-selection-ux
Open

Improve dataframe column selection UX#279
revmischa wants to merge 5 commits intomeridianlabs-ai:mainfrom
METR:feature/column-selection-ux

Conversation

@revmischa
Copy link
Contributor

@revmischa revmischa commented Feb 11, 2026

Screenshot 2026-02-18 at 4 27 56 PM

Summary

  • Bug fix: Corrected scan_tokens_totalscan_total_tokens naming mismatch in the column picker that prevented toggling that column
  • Column presets: Users can save/load/delete named column presets, persisted to localStorage via Zustand
  • URL sharing: Column selection syncs to a cols query parameter, so URLs can be shared with specific column configurations
  • Copy Link button: New toolbar button copies the current URL (with column selection) to clipboard
  • Bug fix: handleTabChange now preserves existing URL params instead of clobbering them
  • Refactor: Extracted shared useOperationStatus hook from duplicated code in CSV buttons

Files Changed

File Change
ScannerDataframeColumnsPopover.tsx Bug fix, URL sync hook, preset UI
ScannerDataframeColumnsPopover.module.css Preset styles
url.ts cols query param helpers
store.ts ColumnPreset type, preset state/action
ScannerDataframeCopyLinkButton.tsx New copy link button
useOperationStatus.ts Extracted shared hook
ScannerDataframeCSVButtons.tsx Uses shared hook
ScanPanelBody.tsx Wire copy link button, fix tab change URL handling

Test plan

  • Open a scan with dataframe results, open "Choose Columns", verify scan_total_tokens appears (not scan_tokens_total), toggle it on/off
  • Select custom columns → verify URL updates with cols param → copy URL → open in new tab → verify same columns applied
  • Save a preset → reload page → verify preset persists → load it → verify columns match → delete it → verify removal
  • Click Copy Link → paste → verify URL includes column selection
  • Switch tabs (Results/Info/JSON) → verify cols param preserved in URL
  • With custom columns, verify Copy CSV and Download CSV export only visible columns
  • pnpm check, pnpm build, pnpm test all pass

🤖 Generated with Claude Code

Fix scan_tokens_total naming mismatch in column picker, add saveable
column presets persisted to localStorage, sync column selection to URL
via `cols` query param for shareable links, and add a Copy Link toolbar
button. Also fix handleTabChange clobbering other URL params, and
extract shared useOperationStatus hook.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@revmischa revmischa force-pushed the feature/column-selection-ux branch from 6a2b786 to ad55030 Compare February 18, 2026 23:14
Add eslint-disable for intentional mount-only useEffect in
useColumnsUrlSync hook, apply prettier formatting, and rebuild
dist output to match rebased source.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@revmischa revmischa marked this pull request as ready for review February 19, 2026 00:28
revmischa and others added 3 commits February 19, 2026 14:32
- Use localStorage instead of NoPersistence for server deployments so
  column presets survive page refresh
- Fix race condition where URL cols param was stripped on mount before
  the store could re-render with URL-sourced columns
- Use replace:true for tab changes to avoid polluting browser history

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Presets saved within the 2s debounce window were lost on page refresh
because the pending localStorage write hadn't fired yet. Add a flush()
method to the debounce utility and call it on beforeunload to ensure
all state is persisted before the page navigates away.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The 2000ms window was too long—saving a preset and refreshing within
that window lost data. Combined with the beforeunload flush from the
previous commit, this makes persistence robust even on tab crash or
mobile (where beforeunload may not fire). The serialized state is ~3 KB
so 500ms has negligible perf impact.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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