docs: Fix tab-switcher keybindings (#65105)

## Summary

Fixes missing keybinding pills in the Tab Switcher documentation on
Linux.

The keybinding processing in `docs/theme/plugins.js` assumed every
`<kbd>` element contained both macOS and Linux variants separated by
`|`. Hand-written keybindings such as `ctrl`, `tab`, and `shift` only
contain a single value, making them render empty on Linux.

This change falls back to the first keybinding when a Linux-specific
value is not provided.

Also removes the `tab_switcher::ToggleAll` keybinding reference from the
documentation, since the action does not have a default keybinding.

Closes #65087.

### Before

<img width="1890" height="942" alt="image"
src="https://github.com/user-attachments/assets/e3d1298e-2e4f-404f-9f64-74e04d53a27f"
/>


### After

<img width="1600" height="797" alt="image"
src="https://github.com/user-attachments/assets/7a3ef09b-0125-4184-8352-bdd174839720"
/>


## Testing

- Ran the Zed documentation locally with `mdbook serve docs`.
- Verified the Tab Switcher documentation on Linux.
- Confirmed that single-sided keybindings (`ctrl`, `tab`, `shift`, etc.)
now render correctly.
- Confirmed that keybindings containing both macOS/Linux variants
continue to render correctly.
- Confirmed the `ToggleAll` entry no longer displays the 'no default
binding' message.

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [ ] Tests cover the new or changed behavior.

Release Notes:

- N/A

---------

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
This commit is contained in:
Sanisa Parag Patrikar 2026-10-03 01:26:05 +00:00 • committed by GitHub
parent 3fec483014
commit badfb8d31f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -30,7 +30,9 @@ function updateKeybindings() {
const isMac = os === "Mac" || os === "iOS";
function processKeybinding(element) {
const [macKeybinding, linuxKeybinding] = element.textContent.split("|");
const [macKeybinding, linuxKeybinding = macKeybinding] =
element.textContent.split("|");
element.textContent = isMac ? macKeybinding : linuxKeybinding;
element.classList.add("keybinding");
}