block / block/buzz

Polish sidebar collapse shortcut and community rail animation

Open
#5,655 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
32.7k
Forks
4.3k
Avg merge
1d 13h
Merged PRs (30d)
253

Description

## Problem

The sidebar toggle currently uses `Cmd+S` on macOS and `Ctrl+S` on Windows/Linux. This is surprising because those chords conventionally mean Save, while users of developer tools commonly expect `Cmd/Ctrl+B` to toggle the primary sidebar.

Buzz also uses `Cmd/Ctrl+B` for bold formatting in the message composer, so the sidebar shortcut must respect editing context.

## Desired behavior

- When focus is outside a text editor or editable control, `Cmd/Ctrl+B` toggles the primary sidebar.
- When focus is inside the message composer or another rich-text editor, `Cmd/Ctrl+B` continues to toggle bold formatting.
- Retain `Cmd/Ctrl+S` as a compatibility alias unless product review decides to remove it.
- Update the keyboard-shortcut reference to describe the contextual behavior.

## Acceptance criteria

- Sidebar visibility toggles with `Cmd/Ctrl+B` outside editable controls.
- Bold formatting still works with `Cmd/Ctrl+B` inside the composer.
- The shortcut does not interfere with typing in inputs, textareas, or contenteditable elements.
- Automated coverage verifies both focus contexts.

## Relevant code

- `desktop/src/shared/ui/sidebar.tsx`
- `desktop/src/shared/lib/keyboard-shortcuts.ts`
- `desktop/src/features/messages/lib/useRichTextEditor.ts`

---

## Collapse animation overlaps the community rail

### Problem

When multiple communities are present, collapsing the primary sidebar animates its navigation content across the fixed community rail. Search, Inbox, Pulse, Projects, Agents, Workflows, and channel rows temporarily cover the community icons instead of disappearing behind the rail.

The stacking order currently places the app sidebar above the rail:

- `AppSidebar` uses `z-index: 100`.
- `SidebarProvider` uses `z-index: 10` with visible overflow.
- `CommunityRail` uses `z-index: 0`.
- The off-canvas sidebar animates for 200 ms.

The existing E2E coverage checks that the community rail remains technically visible after collapse, but it does not detect visual occlusion during the transition.

### Desired behavior

- The community rail remains fixed and visually unobstructed throughout sidebar expansion and collapse.
- Sidebar navigation slides behind the rail or is clipped at the rail boundary.
- Community icons remain readable and interactive during the transition.

### Acceptance criteria

- No sidebar navigation content paints over the community rail at any point in the collapse or expansion animation.
- The final expanded and collapsed layouts remain unchanged.
- A visual or hit-testing E2E assertion covers the transition state rather than relying only on `toBeVisible()`.

### Relevant code

- `desktop/src/features/sidebar/ui/AppSidebar.tsx`
- `desktop/src/features/sidebar/ui/CommunityRail.tsx`
- `desktop/src/app/AppShell.tsx`
- `desktop/src/shared/ui/sidebar.tsx`
- `desktop/tests/e2e/community-rail.spec.ts`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.