Skip to content

Surface keyboard shortcuts and cap label overflow#35

Merged
fakechris merged 2 commits into
mainfrom
redesign/keyboard-affordance
May 18, 2026
Merged

Surface keyboard shortcuts and cap label overflow#35
fakechris merged 2 commits into
mainfrom
redesign/keyboard-affordance

Conversation

@fakechris
Copy link
Copy Markdown
Owner

@fakechris fakechris commented May 18, 2026

Summary

Three small affordance improvements following Linear's "teach the muscle memory, don't bury the chord" pattern.

  • Global T handler for theme toggle (App.tsx). The command palette advertises T for toggle-theme but the global key handler had no T branch — pressing T on the board was a no-op until you opened ⌘K. All palette shortcut: fields now have working global handlers.
  • Visible kbd hints on sidebar nav (App.tsx, app.css). Inline <kbd> for I (Inbox), M (My Issues), W (Views), P (Projects), E (Members), rendered at opacity: 0.5 and brightening to 1 on hover / active / :focus-visible. Native title="Go to Inbox · G I" tooltips spell out the full G-prefix chord for discoverability and screen-reader users. Pattern matches the existing Search ⌘K and Create issue C chips already in the chrome.
  • Label overflow cap (IssueCard.tsx). Cards render the first 2 labels, then a +N chip with a title attribute listing the hidden names. Previously SON-432's 4 labels (OAuth/Deploy/Infra/Design) all stacked, breaking the dense rhythm — now shown as OAuth Deploy +2.

Test plan

  • tsc --noEmit clean
  • vite build succeeds
  • All web unit tests pass (IssueCard.test.tsx fixture has 1 label, well under the cap)
  • Visually verified via Playwright snapshot against mocked GraphQL — kbd hints render at 50%, brighten on the active link, label cap shows +2 and +1 chips
  • Smoke test live: T toggles theme; G I jumps to inbox; hovering each nav item shows the chord in the tooltip; cards with >2 labels show overflow chip

Summary by CodeRabbit

  • New Features
    • Added keyboard shortcut t to toggle between dark and light themes
    • Added keyboard shortcut c for quick exit from the create-issue surface
    • Sidebar navigation links now display keyboard shortcut hints with enhanced visual feedback on hover and focus
    • Issue cards now display the first two labels with a count indicator for additional labels

Review Change Stack

Three small affordance improvements following the Linear-style design pass:

- App.tsx: wire the advertised T shortcut to toggle theme (was in the
  command palette as "T" but had no global handler). All palette
  shortcuts now have working global handlers.
- App.tsx + app.css: render sidebar nav items with an inline kbd hint
  (Inbox=I, My Issues=M, Views=W, Projects=P, Members=E) at 0.5 opacity,
  brightening to full on hover/active/focus. Also adds native `title`
  tooltips with the full G-prefix chord ("Go to Inbox · G I") so screen
  readers and keyboard-curious users learn the muscle-memory chord.
- IssueCard.tsx: cap visible labels at 2 with a "+N" overflow chip
  whose title attribute lists the hidden label names. Prior render
  pushed all labels onto the card, which broke the density rhythm.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Warning

Rate limit exceeded

@fakechris has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 49 minutes and 39 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b73ea309-0ce5-4ae2-bfd1-ab11e15e07fc

📥 Commits

Reviewing files that changed from the base of the PR and between f0484f0 and d14075a.

📒 Files selected for processing (1)
  • packages/web/src/App.tsx
📝 Walkthrough

Walkthrough

This PR introduces keyboard shortcuts for theme toggling and enhanced create-issue workflows, adds visual shortcut hints to sidebar navigation links, and limits issue card label display to reduce visual clutter with a "+N" overflow indicator.

Changes

Keyboard Shortcuts and Navigation Hints

Layer / File(s) Summary
Global keyboard handlers for theme toggle and shortcuts
packages/web/src/App.tsx
Pressing t toggles the app theme between dark and light modes via setTheme. Pressing c opens the create-issue surface and returns early from the keydown handler.
Sidebar navigation shortcuts and styling
packages/web/src/App.tsx, packages/web/src/styles/app.css
Sidebar navigation links (Inbox, My Issues, Views, Projects, Members) render kbd elements showing their keyboard shortcuts alongside title tooltips. CSS rules transition the kbd element opacity on hover, active, and :focus-visible states.

Issue Card Label Limiting

Layer / File(s) Summary
Label display limiting and overflow indicator
packages/web/src/components/IssueCard.tsx
IssueCard renders only the first two labels. When more labels exist, a neutral "+N" summary pill is added with a title tooltip listing the remaining label names joined by comma-space.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • fakechris/Involute#26: Previous overhaul of App.tsx keyboard navigation shortcuts and sidebar/nav structure.
  • fakechris/Involute#30: Related theme toggle feature using sidebar button (this PR adds keyboard shortcut alternative).

Poem

🐰 Shortcuts now leap, t toggles the night,
c creates with a bound, kbd hints in sight,
Labels trim down to two, with a "+N" tail,
The burrow grows nimble—this PR won't fail!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly matches the main objectives: surfacing keyboard shortcuts in the sidebar nav with kbd hints, and capping label overflow in IssueCard.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch redesign/keyboard-affordance

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new keyboard shortcut ('t') for toggling the theme and enhances the navigation sidebar by adding visual keyboard shortcut indicators and descriptive titles to navigation links. Additionally, it updates the IssueCard component to limit the display of labels to two, using a badge to indicate the count of hidden labels. The review feedback suggests adding a return statement to the new theme shortcut handler in App.tsx to maintain consistency with existing shortcut logic and optimize event handling.

Comment thread packages/web/src/App.tsx
Comment on lines +714 to 717
if (event.key.toLowerCase() === 't' && !event.metaKey && !event.ctrlKey && !event.altKey && !event.shiftKey) {
event.preventDefault();
setTheme((currentTheme) => (currentTheme === 'dark' ? 'light' : 'dark'));
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The new 'T' shortcut handler should include a return; statement to exit the function early upon a match. This maintains consistency with the 'C' handler logic updated in this PR and prevents unnecessary evaluation of any future shortcut conditions added below this block.

      if (event.key.toLowerCase() === 't' && !event.metaKey && !event.ctrlKey && !event.altKey && !event.shiftKey) {
        event.preventDefault();
        setTheme((currentTheme) => (currentTheme === 'dark' ? 'light' : 'dark'));
        return;
      }

Mirrors the early-return guard on the C handler so future shortcut
branches added below cannot accidentally run after T fires.
No current behavioral change since T is the last branch.

Addresses gemini-code-assist review feedback on PR #35.
@fakechris fakechris merged commit 119fd29 into main May 18, 2026
2 checks passed
@fakechris fakechris deleted the redesign/keyboard-affordance branch May 18, 2026 02:10
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