|
| 1 | +/** |
| 2 | + * Mobile-first tips shown in the SessionsHub when the user has zero |
| 3 | + * sessions. Curated list — every tip points at a feature that actually |
| 4 | + * exists today and is meaningful for someone driving TermBeam from a |
| 5 | + * phone or tablet on the go. |
| 6 | + * |
| 7 | + * Add new tips to the end of the array. Tips with leading icons are |
| 8 | + * fine; keep the body short enough to read in one breath. |
| 9 | + */ |
| 10 | +export interface Tip { |
| 11 | + /** 1-3 character emoji or symbol shown to the left. */ |
| 12 | + icon: string; |
| 13 | + /** Short headline (≤ 40 chars works best on a phone). */ |
| 14 | + title: string; |
| 15 | + /** Body. One sentence. No trailing period required. */ |
| 16 | + body: string; |
| 17 | +} |
| 18 | + |
| 19 | +export const HUB_TIPS: Tip[] = [ |
| 20 | + { |
| 21 | + icon: '⌨️', |
| 22 | + title: 'TouchBar is your secret weapon', |
| 23 | + body: 'Esc, Tab, Ctrl, arrows — all live one tap away on the bar above the keyboard', |
| 24 | + }, |
| 25 | + { |
| 26 | + icon: '🎤', |
| 27 | + title: 'Talk to your terminal', |
| 28 | + body: 'Drop a Mic key into the TouchBar to dictate commands hands-free', |
| 29 | + }, |
| 30 | + { |
| 31 | + icon: '🤏', |
| 32 | + title: 'Pinch to resize', |
| 33 | + body: 'Two-finger pinch on the terminal scales the font — and we remember the size', |
| 34 | + }, |
| 35 | + { |
| 36 | + icon: '↕️', |
| 37 | + title: 'Stack more keys', |
| 38 | + body: 'Drag the TouchBar handle upward to add up to 3 rows for vim, tmux, or your own combos', |
| 39 | + }, |
| 40 | + { |
| 41 | + icon: '⚙️', |
| 42 | + title: 'Customize every key', |
| 43 | + body: 'Open Tools (▦) → Settings → Touch Bar → Customize to set what each key types', |
| 44 | + }, |
| 45 | + { |
| 46 | + icon: '🔗', |
| 47 | + title: 'Beam this terminal anywhere', |
| 48 | + body: 'Hit the share button to copy a URL — open it on any device with the password', |
| 49 | + }, |
| 50 | + { |
| 51 | + icon: '📱', |
| 52 | + title: 'Add to Home Screen', |
| 53 | + body: 'Install TermBeam as a PWA from your browser for full-screen, app-like access', |
| 54 | + }, |
| 55 | + { |
| 56 | + icon: '🗂️', |
| 57 | + title: 'Save a workspace', |
| 58 | + body: 'Group your favorite sessions into a workspace from Tools → Save Workspace, then re-launch with one tap', |
| 59 | + }, |
| 60 | + { |
| 61 | + icon: '↺', |
| 62 | + title: 'Pick up where you left off', |
| 63 | + body: 'Resume Agent reattaches to running Claude Code, Codex, or other agent sessions with full history', |
| 64 | + }, |
| 65 | + { |
| 66 | + icon: '⌘K', |
| 67 | + title: 'Keyboard-shortcut everything', |
| 68 | + body: 'Cmd/Ctrl+K opens the Tools panel, Cmd/Ctrl+, opens Settings — handy with a Bluetooth keyboard', |
| 69 | + }, |
| 70 | + { |
| 71 | + icon: '⏯', |
| 72 | + title: 'Hold an arrow to repeat', |
| 73 | + body: 'Long-press the arrow keys on the TouchBar for fast cursor movement, just like a real keyboard', |
| 74 | + }, |
| 75 | + { |
| 76 | + icon: '🛰️', |
| 77 | + title: 'Cellular access on the go', |
| 78 | + body: 'A persistent dev tunnel lets you reach this terminal from your phone over LTE, no VPN needed', |
| 79 | + }, |
| 80 | +]; |
| 81 | + |
| 82 | +/** |
| 83 | + * Returns a tip chosen at random from {@link HUB_TIPS}. The optional |
| 84 | + * `seed` lets tests pin a deterministic pick. In production we generate |
| 85 | + * a fresh seed once per render so the tip stays stable while the user |
| 86 | + * looks at it but rotates on the next visit. |
| 87 | + */ |
| 88 | +export function pickRandomTip(seed: number = Math.random()): Tip { |
| 89 | + const idx = Math.floor(seed * HUB_TIPS.length) % HUB_TIPS.length; |
| 90 | + return HUB_TIPS[idx]!; |
| 91 | +} |
0 commit comments