Skip to content

Commit ff01e0f

Browse files
feat(ui): add command notifications, terminal search, and command palette (#68)
## Summary Implements all 3 open UI enhancement issues in a single PR: ### Command Completion Notification (#62) - Browser notifications when commands finish in background tabs - Silence-timer heuristic (3s idle after output burst) - 🔔 toggle in top bar, persisted in localStorage - Opt-in via Notification API permission prompt ### Terminal Search (#64) - In-terminal text search using xterm.js SearchAddon - `Ctrl+F` / `Cmd+F` opens floating search bar overlay - Input field, match count, prev/next navigation, regex toggle - Styled with theme system CSS variables ### Command Palette (#65) - Slide-out tool panel from right edge - `Ctrl+K` / `Cmd+K` or floating ⚙️ FAB button - 6 categories: Session, Search, View, Share, Notifications, System - Integrates with search (#64) and notifications (#62) ### Additional - Fixed silenceTimer memory leak on session cleanup - 20 new integration tests (346 total, all passing) - Updated all documentation (README, getting-started, architecture, configuration, security) Closes #62 Closes #64 Closes #65 --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8ef42b4 commit ff01e0f

15 files changed

Lines changed: 1204 additions & 157 deletions

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ termbeam --no-password # disable password protection
7979
- **Initial command** — optionally launch a session straight into `htop`, `vim`, or any command
8080
- **Shell detection** — auto-detects your shell on all platforms (PowerShell, cmd, bash, zsh, Git Bash, WSL)
8181
- **QR code on startup** for instant phone connection
82+
- **Command completion notifications** — get browser notifications when a command finishes in a background tab; toggle with the bell icon in the toolbar (opt-in, requires browser permission)
83+
- **Terminal search** — press <kbd>Ctrl+F</kbd> / <kbd>Cmd+F</kbd> to open a search overlay with regex support, powered by xterm.js SearchAddon
84+
- **Command palette** — press <kbd>Ctrl+K</kbd> / <kbd>Cmd+K</kbd> (or tap the ⚙️ button) to open a slide-out tool panel with categorized actions: Session, Search, View, Share, Notifications, and System
8285
- **Light/dark theme** with persistent preference
8386
- **Adjustable font size** via status bar controls, saved across sessions
8487
- **Port preview** — reverse-proxy a single local web server port and preview it in the browser (HTTP only; no WebSocket/HMR; best with server-rendered apps)

docs/architecture.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ termbeam/
2121
│ └── version.js # Smart version detection
2222
├── public/
2323
│ ├── index.html # Session manager (mobile UI)
24-
│ ├── terminal.html # Terminal view (xterm.js)
24+
│ ├── terminal.html # Terminal view (xterm.js, search, notifications, command palette)
2525
│ ├── sw.js # Service worker (PWA caching)
2626
│ ├── manifest.json # Web app manifest
2727
│ └── icons/ # PWA icons
@@ -93,6 +93,14 @@ Handles automatic installation of the DevTunnel CLI when it's not found on the s
9393

9494
Smart version that shows `1.0.0` for npm installs and `1.0.0-dev (git-hash)` for local development.
9595

96+
### Client-Side Features (`terminal.html`)
97+
98+
The terminal page includes several client-side features that run entirely in the browser:
99+
100+
- **Terminal search** — <kbd>Ctrl+F</kbd> / <kbd>Cmd+F</kbd> opens a search bar overlay powered by the xterm.js `SearchAddon`. Supports regex matching with next/previous navigation.
101+
- **Command completion notifications** — uses the browser Notification API to alert when a command finishes in a background tab. Toggled via a bell icon; preference stored in `localStorage` (`termbeam-notifications`).
102+
- **Command palette** — <kbd>Ctrl+K</kbd> / <kbd>Cmd+K</kbd> (or the floating ⚙️ button) opens a slide-out tool panel with categorized actions (Session, Search, View, Share, Notifications, System).
103+
96104
## Data Flow
97105

98106
```

docs/configuration.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,18 @@ description: All TermBeam CLI flags and options — ports, passwords, tunnels, s
4646
!!! info "Legacy Variables"
4747
The environment variables `PTY_PASSWORD` and `PTY_CWD` are also supported as fallbacks for `TERMBEAM_PASSWORD` and `TERMBEAM_CWD` respectively.
4848

49+
## Client-Side Settings (localStorage)
50+
51+
The browser UI stores the following preferences in `localStorage`:
52+
53+
| Key | Description | Default |
54+
| ------------------------ | --------------------------------------------------------- | ------- |
55+
| `termbeam-notifications` | Command completion notifications enabled (`true`/`false`) | `true` |
56+
| `termbeam-fontsize` | Terminal font size | `14` |
57+
| `termbeam-theme` | Light/dark theme preference | `dark` |
58+
59+
These settings are per-browser and persist across sessions. They can be cleared by the user via the browser's developer tools or the Refresh button in the toolbar.
60+
4961
## Subcommands
5062

5163
### `termbeam service`

docs/getting-started.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,25 @@ termbeam
9494
- **Swipe up/down** to scroll through terminal history on touch devices
9595
- Scrollbar is hidden to save space but scrolling works normally
9696

97+
### Search
98+
99+
- Press <kbd>Ctrl+F</kbd> / <kbd>Cmd+F</kbd> to open the **search bar** overlay
100+
- Supports **regex** matching with next/previous navigation
101+
- Press <kbd>Escape</kbd> to close the search bar
102+
103+
### Command Palette
104+
105+
- Press <kbd>Ctrl+K</kbd> / <kbd>Cmd+K</kbd> (or tap the **⚙️** button) to open the **command palette**
106+
- Browse categorized actions: **Session**, **Search**, **View**, **Share**, **Notifications**, **System**
107+
- A quick way to discover all available features and shortcuts
108+
109+
### Notifications
110+
111+
- Tap the **🔔 bell icon** in the toolbar to enable **command completion notifications**
112+
- When enabled, you'll receive a browser notification whenever a command finishes in a background tab
113+
- Preference is saved in `localStorage` and persists across sessions
114+
- Requires browser notification permission (requested on first enable)
115+
97116
### Share & Refresh
98117

99118
- Tap the **share button** (↗) to copy a shareable auto-login link to your clipboard; falls back to a manual-copy dialog when clipboard access is unavailable

docs/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ Built for developers who need quick remote terminal access without the hassle of
2020
- **Built for mobile** — touch bar, swipe gestures, zoom, touch scrolling
2121
- **Tabbed sessions** — switch, split, reorder, and preview multiple terminals
2222
- **Session colors & activity indicators** for at-a-glance status
23+
- **Terminal search** — <kbd>Ctrl+F</kbd> / <kbd>Cmd+F</kbd> with regex support
24+
- **Command palette** — <kbd>Ctrl+K</kbd> / <kbd>Cmd+K</kbd> for quick access to all actions
25+
- **Command notifications** — browser alerts when commands finish in background tabs
2326
- **Share & refresh buttons** for easy link sharing and PWA cache updates
2427
- **One command to start**`npx termbeam`
2528
- **Secure by default** — password auth, rate limiting, tunnel encryption

docs/security.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,14 @@ Every response includes:
147147
| `Cache-Control` | `no-store` | Prevent caching |
148148
| `Referrer-Policy` | `no-referrer` | No referrer leaks |
149149

150+
### Client-Side Features
151+
152+
The following UI features are entirely client-side and introduce **no new server-side attack surface**:
153+
154+
- **Command completion notifications** — uses the browser [Notification API](https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API), which requires explicit user permission (opt-in). No data is sent to external services; notifications are generated locally in the browser.
155+
- **Terminal search** — runs in the browser via the xterm.js SearchAddon. Search queries never leave the client.
156+
- **Command palette** — a client-side UI panel that triggers existing actions. No new endpoints or permissions required.
157+
150158
### Network Binding
151159

152160
- **Default:** Binds to `127.0.0.1` (localhost only)

0 commit comments

Comments
 (0)