Commit graph

147 commits

Author SHA1 Message Date
Mario Zechner
302063327e feat: Add unified logging infrastructure with web viewer
- Implement client-side logger that mirrors server interface
- Add /api/logs endpoints for client log submission and retrieval
- Create real-time log viewer component at /logs with filtering
- Update all client files to use new logging system
- Add responsive design for log viewer (mobile/desktop layouts)
- Implement smart auto-scroll that preserves reading position
- Add Mac-style auto-hiding scrollbars
- Configure Express to serve .html files with clean URLs
- Update spec.md with logging infrastructure documentation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-23 00:05:43 +02:00
Mario Zechner
1c007a2181 fix: Track cursor visibility state in terminal renderer
Applications like Claude CLI use ANSI escape sequences to hide the cursor
(\x1b[?25l) and render their own cursor with inverse text. The terminal
component now tracks cursor visibility by parsing these sequences in the
write() method and respects the visibility state when rendering.

- Added cursorVisible state that defaults to true
- Parse \x1b[?25l (hide) and \x1b[?25h (show) sequences in write()
- Only render cursor when both on cursor line AND cursor is visible

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-22 21:23:38 +02:00
Armin Ronacher
dad9e7a248 Standardize on VibeTunnel 2025-06-22 20:38:22 +02:00
Armin Ronacher
36f47c4581 Clauded up some SVG icons 2025-06-22 20:37:49 +02:00
Peter Steinberger
a49ecbc1a7 fix: Fix CI issues - iOS build/test and TypeScript linting
- Fix iOS CI to use correct workspace and scheme names
- Update iOS test script to use workspace instead of project
- Fix all TypeScript 'any' type warnings by adding proper types
- Update build destination format for Xcode 16 compatibility
2025-06-22 17:09:59 +02:00
Armin Ronacher
f1288417b1 Added real icon to web ui 2025-06-22 16:10:27 +02:00
Mario Zechner
e912b65c9e Fix Node.js detection in build-bun-executable.sh for Xcode builds
Add common Node.js installation paths to PATH including Homebrew, NVM, n, and MacPorts locations. This matches the approach used in build-web-frontend.sh and ensures the script can find Node.js when running in Xcode's restricted environment.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-22 04:04:52 +02:00
Mario Zechner
18a28992df Add comprehensive frontend component documentation
- Document all frontend components with JSDoc headers describing their purpose and events
- Add @fires and @listens tags for all component events with detailed parameter descriptions
- Update spec.md with complete Component Event Architecture section
- Add shared terminal-text-formatter.ts for consistent text formatting between client/server
- Implement event-driven activity detection replacing polling-based approach
- Add content-changed event to vibe-terminal-buffer for activity monitoring
- Remove ESC prompt detection in favor of general activity detection
- Add plain text endpoint with optional style formatting (/api/sessions/:id/text?styles)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-21 23:14:30 +02:00
Peter Steinberger
e82c633a9a make file browser work without session 2025-06-21 19:06:19 +02:00
Peter Steinberger
16bc60b379 style and fix file browser 2025-06-21 18:58:42 +02:00
Peter Steinberger
db8f4ffbeb Add first iteration of file browser 2025-06-21 16:11:35 +02:00
Peter Steinberger
3820f98e22 add tutorial 2025-06-21 14:43:00 +02:00
Peter Steinberger
6ce1786c5c port changes from node 2025-06-21 02:49:38 +02:00
Mario Zechner
f86d089226 fix: improve terminal rendering for cursor, inverse video, and overline
- Fixed cursor rendering with inverse video by applying cursor styling
  after inverse processing to ensure it takes precedence
- Added missing overline attribute support (isOverline() → .overline class)
- Improved consistency by applying all persistent styles after inverse
  video processing, which clears and rebuilds the style string

This fixes multiple edge cases in terminal rendering including cursor
visibility in inverted text and proper text decoration support.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 22:56:11 +02:00
Mario Zechner
dc2e72e052 fix: handle inverse video rendering for nano's white bar
Fixed the terminal renderer to properly handle inverse video attributes
when no explicit colors are set. Nano's header bar uses SGR 7 (inverse)
without explicit foreground/background colors, which now correctly swaps
the default terminal colors (#e4e4e4 foreground, #0a0a0a background).

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 22:50:27 +02:00
Mario Zechner
5593ee39ef refactor: modularize server architecture and consolidate codebase
- Restructure server code into modular architecture under src/server/
  - middleware/: Authentication handling
  - pty/: PTY management consolidation
  - routes/: API endpoint handlers
  - services/: Core services (terminal, HQ, streaming)
- Consolidate 20+ scattered files into organized modules
- Replace unit/integration tests with comprehensive E2E testing
- Add spec.md as codebase navigation guide
- Update build paths for new CSS location (styles.css)
- Add chalk dependency for improved terminal output
- Simplify server entry point to use modular loader
- Update CLAUDE.md with spec.md regeneration instructions

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 22:44:40 +02:00
Peter Steinberger
d8dae14bde add view transition for terminal open 2025-06-20 20:15:53 +02:00
Peter Steinberger
6eeabf657e Better frontend error messages 2025-06-20 19:09:21 +02:00
Peter Steinberger
b669b63fc9 redesign new session dialog 2025-06-20 16:54:09 +02:00
Peter Steinberger
d6d3a8f570 design tweaks 2025-06-20 16:34:10 +02:00
Peter Steinberger
ad60da3140 frontend design tweaks 2025-06-20 16:01:50 +02:00
Peter Steinberger
70f5bf2c18 linting and test fixes 2025-06-20 15:43:06 +02:00
Helmut Januschka
9792908fe1
Add terminal max width control and fix WebSocket panic (#29)
* feat: add terminal max width option

- Add terminal preferences manager for persistent settings storage
- Add maxCols property to terminal component with width constraint logic
- Add UI toggle button (∞/80) in session header for easy width control
- Default behavior unchanged: unlimited width (takes full container)
- Optional 80-column max width limit when enabled
- Preferences saved to localStorage and restored on page load
- Real-time updates without page refresh

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: enhance terminal width selector with common presets and custom input

- Add common terminal width presets: ∞, 80, 100, 120, 132, 160
- Add custom width input field (20-500 columns)
- Replace simple toggle with dropdown selector UI
- Include helpful descriptions for each preset
- Support keyboard shortcuts (Enter to submit, Escape to cancel)
- Add click-outside-to-close functionality
- Maintain all existing preferences persistence
- Show current width in button label and tooltip

Common widths:
- 80: Classic terminal
- 100: Modern standard
- 120: Wide terminal
- 132: Mainframe width
- 160: Ultra-wide
- Custom: User-defined (20-500)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: prevent WebSocket send on closed channel panic

Added safeSend helper function with panic recovery to handle race conditions
when multiple goroutines access WebSocket channels. Replaces unsafe channel
sends with graceful error handling.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-06-20 09:21:20 +02:00
Peter Steinberger
b228ffb64c Web design tweaks 2025-06-20 06:59:22 +02:00
Peter Steinberger
d3f80986e3 feat: redesign frontend with modern dark theme and green accents
- Update color scheme to use dark backgrounds (#0a0a0a, #1a1a1a, #242424)
- Add vibrant green accent colors (#00ff88) with glow effects
- Update Tailwind configuration with new theme colors and utilities
- Add reusable CSS component classes (btn-primary, btn-secondary, btn-ghost, card, input-field)
- Replace inline styles across all components with theme classes
- Create new terminal icon component with glow effect
- Update app header with redesigned layout and session stats
- Update session cards with improved visual hierarchy
- Redesign session create form and file browser modals
- Update session view with consistent theme styling
- Apply theme to mobile controls and overlays
- Update all status indicators to use theme colors
- Add smooth transitions and hover effects throughout
2025-06-20 05:47:14 +02:00
Mario Zechner
de8952d34a feat: highlight session cards with orange border when 'esc to interrupt' is detected
- Add checkForEscPrompt() method to scan buffer content on each update
- Emit 'esc-prompt-change' event when prompt presence changes
- Apply orange border to session card when prompt is detected
- Case-insensitive search for 'esc to interrupt' text

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 05:07:56 +02:00
Mario Zechner
3ec549344b fix: improve terminal buffer fitting algorithm
- Properly measure character width at 14px and scale proportionally
- Calculate visible rows based on container height
- Show bottom N lines that fit in the viewport
- Remove overly conservative character width estimates

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 04:54:06 +02:00
Mario Zechner
89982e9bdf feat: implement WebSocket-based real-time buffer updates
- Add /buffers WebSocket endpoint with binary protocol
- Replace polling with push-based updates in vibe-terminal-buffer
- Add buffer change notifications to TerminalManager
- Remove pollInterval property from components
- Optimize network traffic by only sending updates on changes

Binary protocol: [0xBF magic][4 bytes: session ID length][session ID][buffer data]

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 04:36:23 +02:00
Mario Zechner
deb3935172 Implement optimized binary format for terminal buffer transmission
- Switch from JSON to binary format for buffer data transfer
- Optimize encoding with run-length encoding for empty rows
- Reduce data size with efficient cell encoding (1 byte for spaces, variable for complex cells)
- Support both palette and RGB colors with minimal overhead
- Pre-calculate exact buffer sizes to avoid allocations

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 03:56:00 +02:00
Mario Zechner
35755d8376 fix: remove debug logging from vibe-terminal-buffer
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 03:49:02 +02:00
Mario Zechner
faba4b1407 refactor: simplify vibe-terminal-buffer to always fit horizontally
- Remove fontSize and fitHorizontally properties as they're no longer needed
- Always auto-scale font size to fit terminal width in container
- Simplify dimension calculation logic
- Remove unused props from session-card component
- Maintain bottom-aligned terminal view with proper scaling

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 03:48:08 +02:00
Mario Zechner
dbbaaa8442 fix: remove viewportY=0 to show bottom portion of terminal
- Let server decide which portion of buffer to return
- Server defaults to showing bottom portion with prompt
- Only request the number of lines that fit in viewport

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 03:25:50 +02:00
Mario Zechner
fb7d1b2dc0 feat: ensure last non-empty line is always visible in terminal buffer
- Show bottom portion of buffer when content exceeds viewport
- Keep all content visible when it fits within viewport
- Maintain fitHorizontally mode to show all content scaled
- Calculate proper start index to show the most relevant content

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 03:24:25 +02:00
Mario Zechner
6479168ca5 fix: change terminal buffer background to black
- Replace dark gray (#1e1e1e) with pure black background
- Match the expected terminal appearance

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 03:21:47 +02:00
Mario Zechner
3bf543e694 fix: resolve terminal rendering issues in vibe-terminal-buffer
- Move terminal color definitions to shared CSS in input.css
- Use bright color palette for dark backgrounds
- Switch from Lit template rendering to direct innerHTML for terminal content
- Add display: inline-block to terminal-char for proper rendering
- Remove redundant style definitions from terminal.ts
- Fix issue where Lit's template system was interfering with terminal output

The key fix was using innerHTML directly instead of Lit's template system for
the terminal content, matching the approach used in terminal.ts.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 03:21:16 +02:00
Mario Zechner
01df54c63b fix: add terminal styles to vibe-terminal-buffer component
- Add explicit terminal character styles to ensure proper rendering
- Include style definitions for bold, italic, underline, dim, strikethrough
- Ensure CSS variables are properly inherited from parent scope
- Fix text rendering issues where colors appeared gray

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 02:58:44 +02:00
Mario Zechner
4a9ee48427 feat: implement fitHorizontally mode and buffer trimming
- Add fitHorizontally mode to vibe-terminal-buffer component
- Scale font size to fit entire terminal width when enabled
- Trim blank lines from bottom of buffer to reduce data transfer
- Always show content from top down (not centered on cursor)
- Match behavior of terminal.ts fitTerminal implementation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 02:45:13 +02:00
Mario Zechner
aa0658acc7 Fetch at least one full terminal screen in buffer component
The component was only fetching as many lines as could fit in its container,
which could miss important context. Now it fetches at least one full terminal
screen worth of lines (stats.rows) to ensure we capture the complete visible
terminal state.

Also improved rendering to show the bottom portion when we have more lines
than can fit in the display area.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 02:33:23 +02:00
Mario Zechner
b041743287 Add vibe-terminal-buffer component for efficient session previews
Replace terminal.ts in session-card with new buffer-based component that:
- Fetches terminal buffer snapshots via JSON API
- Polls every second only when content changes (checks lastModified)
- Automatically calculates lines needed based on container height
- Reuses terminal rendering styles and logic

Changes:
- Create terminal-renderer.ts with shared rendering logic for both components
- Add vibe-terminal-buffer component that works with buffer API
- Update session-card to use vibe-terminal-buffer instead of vibe-terminal
- Add terminal-line CSS for proper styling
- Fix color handling in terminal-manager (-1 means default color)
- Add debug logging to help diagnose rendering issues

The new approach is more efficient - no cast file parsing, just direct
buffer snapshots from the server.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 02:19:09 +02:00
Mario Zechner
6391605267 Reorder ctrl key dialog buttons for better UX
- Move CANCEL button to the left (renamed from CLOSE)
- Keep CLEAR button in the middle when sequence exists
- Move SEND button to the right when sequence exists
- Follows standard UI convention with cancel actions on left, primary actions on right

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-19 22:55:37 +02:00
Mario Zechner
17f46c84c8 Fix terminal paste functionality and standardize resize endpoint field names
- Made terminal container focusable to receive paste events without clipboard API
- Added tabindex="0" and paste event handling to terminal component
- Terminal now dispatches custom 'terminal-paste' events with clipboard text
- Session view listens for paste events and sends text to terminal session
- Standardized resize endpoint field names across all servers (Rust, Go, Node.js)
- Changed from width/height to cols/rows for consistency
- Removed custom clipboard handling code that required permissions
- Standard Ctrl+V/Cmd+V paste now works without permission prompts
- Maintained PID copying functionality in session cards

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-19 22:28:19 +02:00
Mario Zechner
bbd079c052 Fix terminal keyboard event handling to allow browser shortcuts
The terminal component was aggressively preventing default on ALL keyboard events, blocking important browser shortcuts like F12 (DevTools), Ctrl+C/Ctrl+V (copy/paste), and Ctrl+F (find).

Updated the keyboard handler to:
- Allow F12 and Ctrl+Shift+I/Cmd+Alt+I for DevTools
- Allow common browser shortcuts like Ctrl+A, Ctrl+F, Ctrl+R, etc.
- Allow Alt+Tab and Cmd+Tab for window switching
- Only preventDefault on keys that are actually handled by the terminal

This preserves terminal functionality while restoring essential browser shortcuts.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-19 22:06:23 +02:00
Mario Zechner
5ce76f828f No more artifiial waiting, just start streaming. 2025-06-19 21:26:09 +02:00
Mario Zechner
2040e6e7b4 Removed expand toggle in session-view header. 2025-06-19 21:25:49 +02:00
Mario Zechner
7cb80ec708 Center loading animation in viewport when no session selected
- Change from w-full h-full to fixed inset-0 for proper viewport centering
- Ensures loading spinner is centered relative to entire viewport
- Provides better visual positioning regardless of container constraints

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-19 05:29:31 +02:00
Mario Zechner
85a4811b65 Show loading animation when no session is selected
- Replace static "No session selected" text with animated loading spinner
- Use same loading animation style as session connection state
- Shows "Waiting for session..." message with spinning indicator
- Provides better visual feedback when waiting for session selection

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-19 05:27:19 +02:00
Mario Zechner
b054a57fe3 Add ResizeObserver back in, fix rows/cols calc in terminal. 2025-06-19 05:22:07 +02:00
Mario Zechner
585a593ecc Fix mobile onscreen keyboard scroll position issue
- Add refreshTerminalAfterMobileInput() method to recalculate scroll position
- Call refresh after closing mobile input overlay (cancel, send, send+enter)
- Wait 300ms for viewport to settle before forcing scrollToBottom()
- Fixes issue where terminal scroll position gets confused after keyboard disappears

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-19 04:41:39 +02:00
Mario Zechner
89e2dfe356 Remove mobile browser bar hiding code that was cutting off terminal
- Remove hideAddressBar() method and calls that were interfering with viewport
- Remove adjustTerminalForMobileButtons() method that was causing layout issues
- Terminal should now display properly on mobile without being cut off

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-19 04:23:18 +02:00
Peter Steinberger
83a4bf0f75
fix: apply formatters to pass CI checks (#19) 2025-06-19 01:39:27 +02:00