From f0e26e4a0af696fe5e18c6c73a872639a8a39801 Mon Sep 17 00:00:00 2001 From: Calmcacil Date: Mon, 12 Jan 2026 23:24:02 +0100 Subject: [PATCH] bd sync: 2026-01-12 23:24:02 --- .beads/issues.jsonl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index 595063d..4d8f169 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -22,7 +22,7 @@ {"id":"wg-admin-ddl","title":"Debug connectivity status showing Disconnected incorrectly","description":"Debug why connectivity status shows 'Disconnected' when client is actually connected. Investigate the finalizePeerStatus logic and the 3-minute threshold for connection status.","status":"closed","priority":1,"issue_type":"bug","owner":"Calmcacil@Raion","created_at":"2026-01-12T19:14:49.564914056+01:00","created_by":"Calmcacil","updated_at":"2026-01-12T19:17:12.292551145+01:00","closed_at":"2026-01-12T19:17:12.292551145+01:00","close_reason":"Fixed q key handling to only quit from list screen, increased connection timeout threshold to 5 minutes"} {"id":"wg-admin-dho","title":"Fix 'q' key to go back to list instead of quitting app","description":"Fix key handling in detail screen so 'q' returns to list instead of quitting the entire application. Currently pressing 'q' in detail view closes the app entirely.","status":"closed","priority":1,"issue_type":"bug","owner":"Calmcacil@Raion","created_at":"2026-01-12T19:14:49.562771127+01:00","created_by":"Calmcacil","updated_at":"2026-01-12T19:17:12.284907523+01:00","closed_at":"2026-01-12T19:17:12.284907523+01:00","close_reason":"Fixed q key handling to only quit from list screen, increased connection timeout threshold to 5 minutes"} {"id":"wg-admin-e07","title":"Implement Dracula color scheme theme","description":"Add Dracula color scheme to the theme registry. Use the official Dracula color palette: Background #282A36, Primary (purple) #BD93F9, Success (green) #50FA7B, Warning (orange) #FFB86C, Error (red) #FF5555, Muted #6272A4.","status":"closed","priority":1,"issue_type":"feature","owner":"Calmcacil@Raion","created_at":"2026-01-12T19:07:40.305419584+01:00","created_by":"Calmcacil","updated_at":"2026-01-12T19:08:50.621690085+01:00","closed_at":"2026-01-12T19:08:50.621690085+01:00","close_reason":"Implemented Dracula and Everforest color schemes and set Everforest as default theme"} -{"id":"wg-admin-ee9","title":"Add text selection and copy capability to terminal UI","description":"\n# Add Text Selection and Copy Capability to Terminal UI\n\n## Problem\n\nUsers need to copy text from TUI application, but text selection and copying functionality is limited or non-existent. Users cannot control which text gets selected when dragging over it with mouse.\n\n## Current State\n\n### Terminal Selection Behavior\n- **Mouse selection is terminal-controlled**: The terminal emulator, not the application, controls text selection\n- **No programmatic control**: Applications can't specify which text is selectable\n- **Selection mode varies**: Different terminals have different selection behavior (word, line, block, etc.)\n- **Copy varies**: Copy mechanism depends on terminal/OS combination\n\n### Current Application Support\n- **No clipboard integration**: The app has no clipboard access library\n- **Removed clipboard feature**: We replaced \"Copy Public Key\" with config display modal\n- **Scrollable modals**: Config display and other modals are scrollable but text can still be selected\n\n## Terminal Limitations (Research Results)\n\n### What We CAN'T Control\n\n**Based on Bubble Tea Issue #162** (tracked since Nov 2021):\n1. **Selection boundaries**: Can't specify which text is selectable\n2. **Selection mode**: Can't force word/line/block selection\n3. **Copy action**: Can't programmatically trigger copy\n4. **Selection persistence**: Can't control how long selection persists\n5. **Multi-selection**: Can't control multiple selection regions\n\n### What We CAN Control\n\n1. **Text content**: We control what text is displayed\n2. **Visual highlighting**: We can highlight specific text regions\n3. **Copy buttons**: We can add \"copy\" functionality (requires clipboard API)\n4. **Alternative outputs**: We can export/save content in other ways\n\n### The Mouse Mode Tradeoff\n\nBubble Tea applications have a **binary limitation**:\n\n| Mouse Mode | Native Selection | App Mouse Events |\n|-------------|-------------------|-------------------|\n| OFF (default) | ✓ Works | ✗ None |\n| WithMouseAllMotion | ✗ Disabled | ✓ Full control |\n\n**Evidence**: When using `WithMouseAllMotion()`, native terminal text selection is completely disabled. There is no middle ground.\n\n## Industry Standard Solution: SHIFT Key Workaround\n\n### How Other TUIs Handle This\n\n| Application | Approach | Documentation |\n|-------------|-----------|----------------|\n| **GDB TUI** | Hold SHIFT while dragging | GDB docs: \"Hold SHIFT to access terminal's native mouse copy/paste\" |\n| **tmux** | Hold SHIFT to bypass tmux mouse | tmux docs: Standard practice |\n| **ROCGDB TUI** | Hold SHIFT to access terminal | Same as GDB |\n| **lazygit** | Documents SHIFT requirement | Users request native selection (issue #5034) |\n\n**This is the universal workaround** for TUI applications.\n\n### How It Works\n\n1. User holds **SHIFT key** on keyboard\n2. User drags mouse to select text\n3. Terminal treats this as a **native mouse event** (bypasses TUI)\n4. Terminal emulator's native selection works normally\n5. User copies with terminal-specific shortcut (Ctrl+Shift+C, Cmd+C, etc.)\n\n### Platform-Specific Copy Shortcuts\n\n| Platform | Shortcut | Notes |\n|----------|----------|-------|\n| Linux/WSL | Ctrl+Shift+C | Most terminal emulators |\n| macOS | Cmd+C | Terminal.app |\n| Windows | Click right | Terminal selection context menu |\n| SSH | Depends on client terminal | Not controlled by app |\n\n## Recommended Implementation\n\n### Phase 1: Document SHIFT Workaround (Immediate)\n\n**Add to application help and README:**\n\n```\nText Selection\n--------------\nTo select text for copying from modals or lists:\n• Hold SHIFT key while dragging mouse with left button\n• This bypasses TUI mouse handling and enables terminal's native text selection\n• Then use your terminal's copy shortcut:\n • Linux/WSL: Ctrl+Shift+C (or terminal-specific shortcut)\n • macOS: Cmd+C\n • Windows: Click right (or use terminal copy)\n```\n\n**Benefits:**\n- Works on all terminals (standard behavior)\n- No code changes needed\n- Full native selection control (word, line, block modes)\n- Zero performance impact\n\n### Phase 2: Add Explicit Copy Button (Enhancement)\n\nAdd copy buttons in modals that use clipboard API:\n\n**For Config Display Modal:**\n- Add \"[C] Copy Full Config\" action\n- Copy entire config to system clipboard\n- Works over SSH with X11 forwarding if available\n- Fallback to SHIFT selection if clipboard unavailable\n\n**Implementation approach:**\n```go\n// Add clipboard library\nimport \"github.com/charmbracelet/x/exp/clipboard\"\n\n// In ConfigDisplayModel Update()\ncase \"c\", \"C\":\n // Copy to clipboard with error handling\n if err := clipboard.WriteAll(m.config); err != nil {\n return m, func() tea.Msg {\n return errMsg{err: fmt.Errorf(\"clipboard not available: %w\", err)}\n }\n }\n m.clipboardCopied = true\n return m, nil\n```\n\n**Platform compatibility:**\n- ✓ macOS - Native clipboard access\n- ✓ Linux (native) - X11/Wayland required\n- ✓ WSL - Windows clipboard access\n- ✗ SSH (plain) - X11 forwarding required (ssh -X)\n- ✓ SSH (-X flag) - Uses local clipboard\n\n### Phase 3: Add Export Feature (Optional Enhancement)\n\nAdd ability to export configuration to file:\n\n```go\ncase \"s\", \"S\":\n return m, func() tea.Msg {\n err := os.WriteFile(s.configPath, m.config, 0644)\n if err != nil {\n return errMsg{err: err}\n }\n return ConfigSavedMsg{Path: s.configPath}\n }\n```\n\n## Implementation Details\n\n### Step 1: Document SHIFT Workaround\n\n**Files to update:**\n1. **README.md** - Add text selection section\n2. **Help screen** (internal/tui/screens/help.go) - Add SHIFT key documentation\n3. **Config display modal help** - Add \"Hold SHIFT to select\" note\n\n**Example help text:**\n```\nText Selection \u0026 Copying\n-------------------------\n• Hold SHIFT + drag mouse to select text (native selection)\n• Then use terminal copy shortcut (Ctrl+Shift+C / Cmd+C)\n• Or press [C] to copy to clipboard (when available)\n```\n\n### Step 2: Add Clipboard Library (Optional)\n\n**If implementing explicit copy:**\n\n1. **Add dependency** to go.mod:\n ```\n go get github.com/charmbracelet/x/exp/clipboard\n ```\n\n2. **Update ConfigDisplay component** (internal/tui/components/config-display.go):\n - Import clipboard library\n - Add clipboardCopied field\n - Handle 'C' key to copy\n - Show success/error feedback\n - Add to help text\n\n3. **Handle clipboard errors** - Gracefully degrade when clipboard unavailable\n\n## Search Box Note (Separate Issue)\n\n**Regarding the user's comment about search:**\n\nThe search functionality on the list screen should work independently. It's activated with '/' key and filters the client list. When config modal is open in the detail screen, the search in the list screen is not relevant (different screen).\n\nSearch functionality investigation is covered by issue **wg-admin-v7g** (Fix search box functionality on main client list screen).\n\n## Files to Modify\n\n**Documentation (Required):**\n1. **README.md** - Add text selection instructions\n2. **internal/tui/screens/help.go** - Add SHIFT key to help screen\n\n**Implementation (Optional - if adding explicit copy):**\n3. **internal/tui/components/config-display.go** - Add clipboard copy functionality\n4. **internal/tui/screens/detail.go** - Handle clipboard copied messages\n5. **go.mod** - Add clipboard dependency\n\n## Success Criteria\n\n1. SHIFT key workaround documented in README and help\n2. Users understand how to select text for copying\n3. (Optional) Explicit copy button works when clipboard API available\n4. (Optional) Graceful degradation when clipboard unavailable\n\n## Technical Notes\n\n**Bubble Tea Mouse Mode Tradeoff:**\n- `WithMouseAllMotion()` enables app mouse events but disables native selection\n- There is no partial mouse mode\n- DEC terminal modes are terminal-wide, not per-application\n- This is a fundamental terminal limitation, not Bubble Tea specific\n\n**Industry Standard:**\n- SHIFT key bypass is documented by GDB, tmux, and standard TUI applications\n- Works universally across terminals\n- Zero code changes required for basic functionality\n\n## Dependencies\n\n**For SHIFT workaround:** None (documentation only)\n\n**For explicit copy (optional):**\n- `github.com/charmbracelet/x/exp/clipboard` - Cross-platform clipboard\n\n## Priority\n\n**MEDIUM (P2)** - SHIFT workaround is industry standard and works immediately; explicit copy is enhancement but has platform limitations (SSH)\n","status":"in_progress","priority":2,"issue_type":"feature","owner":"Calmcacil@Raion","created_at":"2026-01-12T22:38:54.083153165+01:00","created_by":"Calmcacil","updated_at":"2026-01-12T23:22:39.599383867+01:00"} +{"id":"wg-admin-ee9","title":"Add text selection and copy capability to terminal UI","description":"\n# Add Text Selection and Copy Capability to Terminal UI\n\n## Problem\n\nUsers need to copy text from TUI application, but text selection and copying functionality is limited or non-existent. Users cannot control which text gets selected when dragging over it with mouse.\n\n## Current State\n\n### Terminal Selection Behavior\n- **Mouse selection is terminal-controlled**: The terminal emulator, not the application, controls text selection\n- **No programmatic control**: Applications can't specify which text is selectable\n- **Selection mode varies**: Different terminals have different selection behavior (word, line, block, etc.)\n- **Copy varies**: Copy mechanism depends on terminal/OS combination\n\n### Current Application Support\n- **No clipboard integration**: The app has no clipboard access library\n- **Removed clipboard feature**: We replaced \"Copy Public Key\" with config display modal\n- **Scrollable modals**: Config display and other modals are scrollable but text can still be selected\n\n## Terminal Limitations (Research Results)\n\n### What We CAN'T Control\n\n**Based on Bubble Tea Issue #162** (tracked since Nov 2021):\n1. **Selection boundaries**: Can't specify which text is selectable\n2. **Selection mode**: Can't force word/line/block selection\n3. **Copy action**: Can't programmatically trigger copy\n4. **Selection persistence**: Can't control how long selection persists\n5. **Multi-selection**: Can't control multiple selection regions\n\n### What We CAN Control\n\n1. **Text content**: We control what text is displayed\n2. **Visual highlighting**: We can highlight specific text regions\n3. **Copy buttons**: We can add \"copy\" functionality (requires clipboard API)\n4. **Alternative outputs**: We can export/save content in other ways\n\n### The Mouse Mode Tradeoff\n\nBubble Tea applications have a **binary limitation**:\n\n| Mouse Mode | Native Selection | App Mouse Events |\n|-------------|-------------------|-------------------|\n| OFF (default) | ✓ Works | ✗ None |\n| WithMouseAllMotion | ✗ Disabled | ✓ Full control |\n\n**Evidence**: When using `WithMouseAllMotion()`, native terminal text selection is completely disabled. There is no middle ground.\n\n## Industry Standard Solution: SHIFT Key Workaround\n\n### How Other TUIs Handle This\n\n| Application | Approach | Documentation |\n|-------------|-----------|----------------|\n| **GDB TUI** | Hold SHIFT while dragging | GDB docs: \"Hold SHIFT to access terminal's native mouse copy/paste\" |\n| **tmux** | Hold SHIFT to bypass tmux mouse | tmux docs: Standard practice |\n| **ROCGDB TUI** | Hold SHIFT to access terminal | Same as GDB |\n| **lazygit** | Documents SHIFT requirement | Users request native selection (issue #5034) |\n\n**This is the universal workaround** for TUI applications.\n\n### How It Works\n\n1. User holds **SHIFT key** on keyboard\n2. User drags mouse to select text\n3. Terminal treats this as a **native mouse event** (bypasses TUI)\n4. Terminal emulator's native selection works normally\n5. User copies with terminal-specific shortcut (Ctrl+Shift+C, Cmd+C, etc.)\n\n### Platform-Specific Copy Shortcuts\n\n| Platform | Shortcut | Notes |\n|----------|----------|-------|\n| Linux/WSL | Ctrl+Shift+C | Most terminal emulators |\n| macOS | Cmd+C | Terminal.app |\n| Windows | Click right | Terminal selection context menu |\n| SSH | Depends on client terminal | Not controlled by app |\n\n## Recommended Implementation\n\n### Phase 1: Document SHIFT Workaround (Immediate)\n\n**Add to application help and README:**\n\n```\nText Selection\n--------------\nTo select text for copying from modals or lists:\n• Hold SHIFT key while dragging mouse with left button\n• This bypasses TUI mouse handling and enables terminal's native text selection\n• Then use your terminal's copy shortcut:\n • Linux/WSL: Ctrl+Shift+C (or terminal-specific shortcut)\n • macOS: Cmd+C\n • Windows: Click right (or use terminal copy)\n```\n\n**Benefits:**\n- Works on all terminals (standard behavior)\n- No code changes needed\n- Full native selection control (word, line, block modes)\n- Zero performance impact\n\n### Phase 2: Add Explicit Copy Button (Enhancement)\n\nAdd copy buttons in modals that use clipboard API:\n\n**For Config Display Modal:**\n- Add \"[C] Copy Full Config\" action\n- Copy entire config to system clipboard\n- Works over SSH with X11 forwarding if available\n- Fallback to SHIFT selection if clipboard unavailable\n\n**Implementation approach:**\n```go\n// Add clipboard library\nimport \"github.com/charmbracelet/x/exp/clipboard\"\n\n// In ConfigDisplayModel Update()\ncase \"c\", \"C\":\n // Copy to clipboard with error handling\n if err := clipboard.WriteAll(m.config); err != nil {\n return m, func() tea.Msg {\n return errMsg{err: fmt.Errorf(\"clipboard not available: %w\", err)}\n }\n }\n m.clipboardCopied = true\n return m, nil\n```\n\n**Platform compatibility:**\n- ✓ macOS - Native clipboard access\n- ✓ Linux (native) - X11/Wayland required\n- ✓ WSL - Windows clipboard access\n- ✗ SSH (plain) - X11 forwarding required (ssh -X)\n- ✓ SSH (-X flag) - Uses local clipboard\n\n### Phase 3: Add Export Feature (Optional Enhancement)\n\nAdd ability to export configuration to file:\n\n```go\ncase \"s\", \"S\":\n return m, func() tea.Msg {\n err := os.WriteFile(s.configPath, m.config, 0644)\n if err != nil {\n return errMsg{err: err}\n }\n return ConfigSavedMsg{Path: s.configPath}\n }\n```\n\n## Implementation Details\n\n### Step 1: Document SHIFT Workaround\n\n**Files to update:**\n1. **README.md** - Add text selection section\n2. **Help screen** (internal/tui/screens/help.go) - Add SHIFT key documentation\n3. **Config display modal help** - Add \"Hold SHIFT to select\" note\n\n**Example help text:**\n```\nText Selection \u0026 Copying\n-------------------------\n• Hold SHIFT + drag mouse to select text (native selection)\n• Then use terminal copy shortcut (Ctrl+Shift+C / Cmd+C)\n• Or press [C] to copy to clipboard (when available)\n```\n\n### Step 2: Add Clipboard Library (Optional)\n\n**If implementing explicit copy:**\n\n1. **Add dependency** to go.mod:\n ```\n go get github.com/charmbracelet/x/exp/clipboard\n ```\n\n2. **Update ConfigDisplay component** (internal/tui/components/config-display.go):\n - Import clipboard library\n - Add clipboardCopied field\n - Handle 'C' key to copy\n - Show success/error feedback\n - Add to help text\n\n3. **Handle clipboard errors** - Gracefully degrade when clipboard unavailable\n\n## Search Box Note (Separate Issue)\n\n**Regarding the user's comment about search:**\n\nThe search functionality on the list screen should work independently. It's activated with '/' key and filters the client list. When config modal is open in the detail screen, the search in the list screen is not relevant (different screen).\n\nSearch functionality investigation is covered by issue **wg-admin-v7g** (Fix search box functionality on main client list screen).\n\n## Files to Modify\n\n**Documentation (Required):**\n1. **README.md** - Add text selection instructions\n2. **internal/tui/screens/help.go** - Add SHIFT key to help screen\n\n**Implementation (Optional - if adding explicit copy):**\n3. **internal/tui/components/config-display.go** - Add clipboard copy functionality\n4. **internal/tui/screens/detail.go** - Handle clipboard copied messages\n5. **go.mod** - Add clipboard dependency\n\n## Success Criteria\n\n1. SHIFT key workaround documented in README and help\n2. Users understand how to select text for copying\n3. (Optional) Explicit copy button works when clipboard API available\n4. (Optional) Graceful degradation when clipboard unavailable\n\n## Technical Notes\n\n**Bubble Tea Mouse Mode Tradeoff:**\n- `WithMouseAllMotion()` enables app mouse events but disables native selection\n- There is no partial mouse mode\n- DEC terminal modes are terminal-wide, not per-application\n- This is a fundamental terminal limitation, not Bubble Tea specific\n\n**Industry Standard:**\n- SHIFT key bypass is documented by GDB, tmux, and standard TUI applications\n- Works universally across terminals\n- Zero code changes required for basic functionality\n\n## Dependencies\n\n**For SHIFT workaround:** None (documentation only)\n\n**For explicit copy (optional):**\n- `github.com/charmbracelet/x/exp/clipboard` - Cross-platform clipboard\n\n## Priority\n\n**MEDIUM (P2)** - SHIFT workaround is industry standard and works immediately; explicit copy is enhancement but has platform limitations (SSH)\n","status":"closed","priority":2,"issue_type":"feature","owner":"Calmcacil@Raion","created_at":"2026-01-12T22:38:54.083153165+01:00","created_by":"Calmcacil","updated_at":"2026-01-12T23:23:56.186774506+01:00","closed_at":"2026-01-12T23:23:56.186774506+01:00","close_reason":"Implemented text selection and copy documentation as SHIFT key workaround (industry standard for TUI applications). Added documentation to README.md and help screen explaining how to select and copy text from terminal UI."} {"id":"wg-admin-ej7","title":"Implement color themes","description":"Add support for color themes using lipgloss. Create default theme with primary, success, warning, and error colors. Support theme switching through config file or environment variable.","status":"closed","priority":2,"issue_type":"task","owner":"Calmcacil@Raion","created_at":"2026-01-12T17:03:30.290145203+01:00","created_by":"Calmcacil","updated_at":"2026-01-12T17:48:32.299616088+01:00","closed_at":"2026-01-12T17:48:32.299616088+01:00","close_reason":"Color themes implemented with Theme package. Three built-in themes (default, dark, light) with ColorScheme support. THEME config option and environment variable support added to config.go. Lipgloss styles use theme colors.","dependencies":[{"issue_id":"wg-admin-ej7","depends_on_id":"wg-admin-xum","type":"blocks","created_at":"2026-01-12T17:04:53.269323117+01:00","created_by":"Calmcacil"}]} {"id":"wg-admin-gp4","title":"Create Go TUI epic","description":"Epic: Convert wg-client-manager bash script to a modern, responsive Go TUI application using Bubble Tea framework. Provides better UX with interactive forms, real-time status updates, and intuitive keyboard navigation.","status":"closed","priority":1,"issue_type":"feature","owner":"Calmcacil@Raion","created_at":"2026-01-12T17:03:30.286393088+01:00","created_by":"Calmcacil","updated_at":"2026-01-12T18:06:58.972856627+01:00","closed_at":"2026-01-12T18:06:58.972856627+01:00","close_reason":"All Go TUI tasks completed across 6 phases:\n\nPhase 1 (Foundation): Project init, config system, TUI skeleton\nPhase 2 (Client List): Parsing, table, real-time status \nPhase 3 (Add Client): Form, key generation, config files\nPhase 4 (Detail/Delete): Detail view, delete functionality, QR codes\nPhase 5 (UX): Search, help screen, color themes\nPhase 6 (Backup/Restore): Backup operations, restore functionality\n\nImplementation details:\n- Total packages added: bubbletea, lipgloss, bubbles, huh, qrterminal\n- Files created: 25+ Go source files\n- All features implemented: CRUD clients, status checking, QR codes, themes, search, backup/restore\n- Build successful with ~6MB binary\n- All tasks closed and synced to remote\n\nApplication ready for testing and deployment."} {"id":"wg-admin-gw9","title":"Add search and filter clients","description":"Implement client search functionality with keyboard shortcut (/). Allow filtering by client name, IP address, or status. Highlight matching results in real-time as user types.","status":"closed","priority":2,"issue_type":"task","owner":"Calmcacil@Raion","created_at":"2026-01-12T17:03:30.285733479+01:00","created_by":"Calmcacil","updated_at":"2026-01-12T18:06:07.246176563+01:00","closed_at":"2026-01-12T18:06:07.246176563+01:00","close_reason":"Search component implemented in internal/tui/components/search.go. Real-time filtering by name, IP, or status with '/' activation. Filter types cycle with Tab. Match count display. Integrated with list screen to dynamically update client table.","dependencies":[{"issue_id":"wg-admin-gw9","depends_on_id":"wg-admin-xum","type":"blocks","created_at":"2026-01-12T17:04:36.200521151+01:00","created_by":"Calmcacil"}]}