gpui-component icon indicating copy to clipboard operation
gpui-component copied to clipboard

kbd: Add KbdGroup component.

Open elcoosp opened this issue 7 months ago • 0 comments

Description

Add KbdGroup component

Problem: There was no built‑in way to display a sequence of keyboard shortcuts with a visual separator between them (e.g., Ctrl + C or Cmd + Shift + P). Developers had to assemble this manually.

Solution:

  • Introduced KbdGroup, which accepts one or more existing Kbd elements and renders them with a “+” separator.
  • Added a gallery story to show usage examples (single, multiple, and styled groups).
  • Added unit tests ensuring the component creates successfully with one and several children.
  • Added documentation page that mirrors the structure of the Kbd page (imports, usage, platform-adaptive output, examples, styling).
  • Fixed the documentation sidebar to sort alphabetically so KbdGroup appears directly after Kbd.
  • Cleaned up a duplicate gallery entry that was accidentally inserted during the scripted creation.

All changes are purely additive and do not affect existing functionality.

Screenshot

Before After
[Put Before Screenshot here] kbd-group

Break Changes

None.

How to Test

Ran doc story and test

Checklist

  • [x] I have read the CONTRIBUTING document and followed the guidelines.
  • [x] Reviewed the changes in this PR and confirmed AI generated code (If any) is accurate.
  • [x] Passed cargo run for story tests related to the changes.
  • [ ] Tested macOS, Windows and Linux platforms performance (if the change is platform-specific)

elcoosp avatar Apr 28 '26 16:04 elcoosp