Skip to content

Conversation

@pranav-n29
Copy link
Contributor

@pranav-n29 pranav-n29 commented Feb 2, 2026

This PR updates the Extra Keys section UI to better match the layout described in the Rein wiki.

Changes:

  • Reordered and grouped extra keys for better usability
  • Improved layout consistency with the Trackpad page design for issue ExtraKeys UI #8

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 2, 2026

📝 Walkthrough

Walkthrough

The ExtraKeys component layout is restructured from a single horizontal row to a multi-row grid format. The internal interaction handler is renamed from handleInteract to press while preserving its behavior. The public component interface remains unchanged.

Changes

Cohort / File(s) Summary
UI Layout Restructuring
src/components/Trackpad/ExtraKeys.tsx
Converted single-row key rendering to multi-row grid layout with vertically stacked rows. Renamed internal handler from handleInteract to press. Updated key sets and styling with centered row alignment. Public API unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰✨ Keys in rows, oh what delight!
Grid-aligned and oh-so-right,
From one long line to many neat,
Organization, fresh and sweet!
A tidy press, a cleaner sight. 🎹

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Extra keys UI' directly relates to the main change in the changeset, which is a UI redesign of the ExtraKeys component from a single-row layout to a multi-row grid layout.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@src/components/Trackpad/ExtraKeys.tsx`:
- Around line 27-33: The button in the ExtraKeys component is missing an
explicit type which can cause accidental form submissions; update the JSX button
element inside the ExtraKeys render (the <button ... onPointerDown={e =>
press(e, k)}>) to include type="button" so each key button does not act as a
submit button; locate the button that uses the key variable k and the press
handler and add the type attribute.
- Around line 24-26: The row mapping uses the array index as a React key which
can cause state/order glitches; update the JSX mapping over ROWS in
ExtraKeys.tsx to use a stable unique identifier instead of the index (e.g., a
precomputed id on each row object or a deterministic string from the row
contents) so replace key={i} with something like key={row.id} or
key={row.map(k=>k.label).join('-')} while preserving the existing ROWS constant
and the inner row.map(k => ...) rendering.

Comment on lines +24 to +26
{ROWS.map((row, i) => (
<div key={i} className="flex gap-2 justify-center">
{row.map(k => (
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Use a stable key for rows (avoid array index).
Line 25 uses the array index as a key, which can cause state glitches if rows ever reorder.

✅ Suggested fix
-      {ROWS.map((row, i) => (
-        <div key={i} className="flex gap-2 justify-center">
+      {ROWS.map(row => (
+        <div key={row.join("|")} className="flex gap-2 justify-center">
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{ROWS.map((row, i) => (
<div key={i} className="flex gap-2 justify-center">
{row.map(k => (
{ROWS.map(row => (
<div key={row.join("|")} className="flex gap-2 justify-center">
{row.map(k => (
🧰 Tools
🪛 Biome (2.3.13)

[error] 25-25: Avoid using the index of an array as key property in an element.

This is the source of the key value.

The order of the items may change, and this also affects performances and component state.
Check the React documentation.

(lint/suspicious/noArrayIndexKey)

🤖 Prompt for AI Agents
In `@src/components/Trackpad/ExtraKeys.tsx` around lines 24 - 26, The row mapping
uses the array index as a React key which can cause state/order glitches; update
the JSX mapping over ROWS in ExtraKeys.tsx to use a stable unique identifier
instead of the index (e.g., a precomputed id on each row object or a
deterministic string from the row contents) so replace key={i} with something
like key={row.id} or key={row.map(k=>k.label).join('-')} while preserving the
existing ROWS constant and the inner row.map(k => ...) rendering.

Comment on lines +27 to +33
<button
key={k}
className="btn btn-sm btn-neutral min-w-14
"
onPointerDown={e => press(e, k)}
>
{k}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add explicit button type to avoid accidental form submits.
Line 27-33 should set type="button" to prevent default submit behavior.

✅ Suggested fix
             <button
               key={k}
+              type="button"
               className="btn btn-sm btn-neutral min-w-14
 "
               onPointerDown={e => press(e, k)}
             >
🧰 Tools
🪛 Biome (2.3.13)

[error] 27-33: Provide an explicit type prop for the button element.

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset

(lint/a11y/useButtonType)

🤖 Prompt for AI Agents
In `@src/components/Trackpad/ExtraKeys.tsx` around lines 27 - 33, The button in
the ExtraKeys component is missing an explicit type which can cause accidental
form submissions; update the JSX button element inside the ExtraKeys render (the
<button ... onPointerDown={e => press(e, k)}>) to include type="button" so each
key button does not act as a submit button; locate the button that uses the key
variable k and the press handler and add the type attribute.

@imxade imxade closed this Feb 11, 2026
@pranav-n29 pranav-n29 deleted the extra-keys-ui branch February 11, 2026 11:53
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.

2 participants