Skip to content

feat(ledger): add keyboard-driven row selection and range-copy (Closes #466) - #580

Open
laurentketterle-hub wants to merge 1 commit into
RevoraOrg:masterfrom
laurentketterle-hub:feat/keyboard-row-selection-466
Open

feat(ledger): add keyboard-driven row selection and range-copy (Closes #466)#580
laurentketterle-hub wants to merge 1 commit into
RevoraOrg:masterfrom
laurentketterle-hub:feat/keyboard-row-selection-466

Conversation

@laurentketterle-hub

Copy link
Copy Markdown
Contributor

Summary

Implements keyboard-driven row selection and range-copy for the Ledger table as requested in Issue #466.

Features

  • Click to select/deselect individual rows
  • Shift+click for range selection between anchor and target
  • Ctrl+A to select all visible rows on the current page
  • Ctrl+C to copy selected rows as TSV (tab-separated values) with headers
  • Arrow keys navigation with Shift for range extension
  • Escape to clear all selection
  • Visual feedback: blue highlight (bg-blue-50) with ring indicator on selected rows
  • Selection count badge in header with "Copied!" feedback on Ctrl+C
  • ✅ Full keyboard accessibility: tabIndex={0}, aria-selected, data-row-id
  • ✅ Click on expand/collapse buttons does NOT trigger row selection

Changes

  • src/pages/Ledger.tsx: +169 lines (selection state, keyboard handler, visual styling, TSV copy)
  • src/pages/Ledger.test.tsx: +167 lines (12 new keyboard selection tests)

Test Results

Tests: 59 passed (59)
- All 47 existing tests still pass
- 12 new keyboard selection tests covering:
  click select, click deselect, multi-select, selection count,
  Ctrl+A select all, Escape clear, Ctrl+C copy TSV,
  no-copy when empty, "Copied!" feedback, Shift+click range,
  blue highlight styling

Verification

npm install && npx vitest run src/pages/Ledger.test.tsx

…evoraOrg#466)

- Click to select/deselect individual rows
- Shift+click for range selection between anchor and target
- Ctrl+A to select all visible rows
- Ctrl+C to copy selected rows as TSV (with headers)
- Arrow key navigation with Shift for range extension
- Escape to clear selection
- Visual: blue highlight (bg-blue-50) with ring indicator
- Selection count badge in header with Copied! feedback
- Full keyboard accessibility: tabIndex, aria-selected, data-row-id
- 12 new tests covering all interaction patterns
- 59/59 tests passing
@laurentketterle-hub

Copy link
Copy Markdown
Contributor Author

I claim this bounty. PR ready for review.

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