Commit graph

172 commits

Author SHA1 Message Date
Mario Zechner
1e24c19335 Add PTY fallback to tty-fwd with race condition fix
Adds complete PTY fallback functionality when VibeTunnel.app socket is unavailable:
- Implements spawn_via_pty() with full bidirectional I/O
- Creates PTY master/slave, forks child process, and handles stdin/stdout
- Fixes race condition by creating session.json synchronously before API response
- Maintains compatibility with existing session format and API structure
- Enables cross-platform terminal functionality without requiring macOS app

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 12:46:25 +02:00
Mario Zechner
a2d15471d8 Reorder mobile terminal buttons and add symbols
- Change button order to: ESC, ⇥, ABC123, CTRL, ⏎
- Use larger tab symbol (⇥) and enter symbol (⏎)
- Keep CTRL as text, ABC123 in middle position
- Improve visual consistency with symbol sizing

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 10:44:13 +02:00
Mario Zechner
31f1d625b1 Reorganize header button layout for mobile with left and right alignment
- Group related buttons on left: SHOW/HIDE EXITED, CLEAN EXITED, KILL
- Position CREATE button on right side for mobile layout
- Add exited session count to button text for better UX
- Conditionally show SHOW/HIDE EXITED only when exited sessions exist
- Wire up clean exited functionality from header to session list
- Maintain consistent button styling with black backgrounds and colored borders

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 10:37:33 +02:00
Mario Zechner
76ea65839a Replace hide exited checkbox with button and standardize button sizes
- Convert hide exited checkbox to button toggle matching theme style
- Use "SHOW ALL" / "HIDE EXITED" text based on state
- Blue border when active, gray when inactive
- Standardize all header buttons to small size (px-2 py-1 text-xs)
- Consistent button styling across mobile and desktop layouts

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 10:23:55 +02:00
Mario Zechner
7c92eb5bdb Implement black theme, mobile improvements, and fit-to-width toggle
- Apply consistent black theme across all components with colored borders
- Add animated VibeTunnel logo with rainbow scrolling gradient
- Implement comprehensive mobile input controls with Ctrl+Alpha overlay
- Add fit-to-width toggle button in session view header with scroll preservation
- Enhance mobile experience with proper viewport handling and keyboard positioning
- Update button styling to use black backgrounds with colored borders throughout
- Resize scroll-to-bottom button for better mobile accessibility

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 10:16:04 +02:00
Mario Zechner
95cec4c801 Fix touch momentum scrolling jank by eliminating RAF conflicts
Replace requestRenderBuffer() with direct renderBuffer() call during
momentum scrolling to avoid competing requestAnimationFrame systems.

Before: Momentum RAF + render queue RAF = scheduling conflicts & jank
After: Single momentum RAF with synchronous rendering = smooth scrolling

This provides buttery smooth momentum scrolling on mobile while
maintaining < 2ms render times and proper RAF batching for other operations.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 08:53:01 +02:00
Mario Zechner
8089612142 Add terminal debug overlay and scroll-to-bottom indicator
Features added:
- Debug overlay showing render performance metrics (renders, avg time, last time)
- Activates only when ?debug or &debug is in URL query parameters
- Real-time updates during scrolling and terminal operations
- Scroll-to-bottom indicator appears when user scrolls up from bottom
- Instantly scrolls to bottom and re-enables follow cursor when clicked
- Restore smooth fractional pixel scrolling for better UX

Performance improvements:
- Proper render count tracking at start of renderBuffer()
- High-precision timing using performance.now()
- Force component re-render in debug mode for live metrics

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 08:48:50 +02:00
Mario Zechner
e47adc9808 Fix terminal rendering and performance issues
- Add HTML escaping to prevent HTML injection in terminal output
- Implement smart follow cursor with programmatic scroll protection
- Add output batching for SSE streams (~60fps) to improve performance
- Use integer pixel positions for crisp text rendering
- Preserve .vibetunnel folder contents on server restart
- Restrict mobile keyboard to actual mobile devices only

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 08:06:41 +02:00
Mario Zechner
e606f68f45 Optimize session snapshots by scanning for last clear command
- Modified snapshot endpoint to find the last screen clear command
- Only includes content after the last clear for much smaller snapshots
- Preserves the last resize event before clear to maintain terminal dimensions
- Detects common clear sequences: \x1b[2J, \x1b[3J, \x1b[H\x1b[2J, \x1bc
- Logs reduction percentage showing data savings
- Falls back to full content if no clear command found
- Dramatically reduces snapshot size for long-running sessions

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 06:29:50 +02:00
Mario Zechner
b6d45e6c75 Remove unnecessary snapshot refresh from session cards
- Removed 10-second refresh interval that was fetching new snapshots continuously
- Initial snapshot load is sufficient for session card preview
- Reduces server load and unnecessary network requests
- Session cards now load once and display static snapshot content
- Interactive session view still provides real-time updates via streaming

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 06:26:59 +02:00
Mario Zechner
edc2450ab8 Fix XTerm.js buffer overflow by batching writes in dumpToTerminal
- Changed from single large write to batched writes (~1MB per batch)
- Prevents "write data discarded, use flow control" errors
- Flushes batches before resize events to maintain proper sequence
- Balances performance with buffer limits for reliable data transfer
- Handles large session dumps without data loss

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 06:25:48 +02:00
Mario Zechner
8ec8ca47d4 Replace old renderer with new vibe-terminal in session view
- Replaced Renderer class with new vibe-terminal component for interactive sessions
- Integrated CastConverter.connectToStream() for real-time SSE streaming
- Added proper stream connection management with cleanup on disconnect
- Implemented automatic snapshot loading when sessions exit
- Updated copy functionality to work with DOM-based text selection
- Enhanced terminal initialization lifecycle with proper event handling
- Maintained all mobile input controls and keyboard functionality
- Fixed TypeScript type errors for viewport cleanup functionality
- Improved loading states and error handling for network issues

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 05:48:38 +02:00
Mario Zechner
e45371e9ca Add connectToStream method to CastConverter for real-time terminal streaming
- Added connectToStream() method that connects terminal to SSE streams
- Handles header messages with terminal dimensions for initial sizing
- Processes cast events for output ('o') and resize ('r') operations
- Detects session exit events and cleans up connections automatically
- Dispatches custom events for terminal-resize and session-exit
- Returns connection object with EventSource and disconnect method for cleanup
- Uses followCursor=true for live streaming vs false for dumps
- Comprehensive error handling and connection state management

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 05:43:28 +02:00
Mario Zechner
0cef07ccfc Add super-fast dumpToTerminal method to CastConverter
- Added dumpToTerminal() method that builds entire cast content into one string and writes it all at once for maximum performance
- Handles resize ('r') events by tracking final terminal dimensions and applying them before writing content
- Processes output ('o') events into a single concatenated string for the fastest possible loading
- Ignores input ('i') events during dump as they're not needed for display
- Updated session cards to use the new fast dump method instead of manual parsing
- Results in dramatically faster session card loading and refresh

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 05:40:01 +02:00
Mario Zechner
2617ef4199 Replace old renderer with new vibe-terminal in session cards
- Replaced Renderer class with new vibe-terminal component
- Updated session card to use DOM-based terminal instead of XTerm.js directly
- Implemented snapshot loading with cast file parsing
- Added automatic refresh every 10 seconds
- Configured terminal for card display with smaller font and horizontal fitting
- Disabled pointer events to allow click-through to card selection
- Simplified lifecycle management using Lit component patterns

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 05:37:53 +02:00
Mario Zechner
4d6940347f Fix color handling in terminal component
- Removed incomplete RGB color object handling that was causing type errors
- Simplified color handling to support standard palette colors and 24-bit RGB
- Fixed horizontal scrolling container null check

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 05:33:25 +02:00
Mario Zechner
bce7f05f98 Remove excessive logging from terminal component
- Removed console.log statements from viewportY setter, fitTerminal, setupResize, scrollViewportPixels, momentum scrolling, renderBuffer, scrollToBottom, and followCursor methods
- Cleaned up terminal creation logging
- Improved color handling to support 24-bit RGB colors and RGB objects
- Enhanced write method with followCursor parameter for better cursor tracking
- Added followCursor method for automatic cursor visibility during playback
- Updated test page with cast file playback functionality

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 05:31:59 +02:00
Peter Steinberger
e7480c3f59 Spawn new Terminal 2025-06-18 04:52:11 +02:00
Mario Zechner
86123cabbd Add 2D horizontal wheel scrolling support
- Handle both deltaX and deltaY from wheel events
- Convert horizontal wheel deltas to pixels based on deltaMode
- Apply horizontal scrolling using native scrollLeft when not in fit mode
- Support trackpad 2-finger horizontal swipes and mouse horizontal wheels
- Maintain same scaling and deltaMode handling for both axes
- Unify all scrolling inputs (touch, wheel vertical, wheel horizontal)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 04:40:14 +02:00
Mario Zechner
13460ea4d4 Convert wheel scrolling to pixel-based for smooth experience
- Handle all wheel event deltaMode types (pixel, line, page)
- Convert line-based deltas to pixels using fontSize-based lineHeight
- Convert page-based deltas to pixels using viewport height
- Apply consistent scroll scaling across all input devices
- Remove line-based accumulator in favor of direct pixel scrolling
- Unify touch and wheel scrolling to use same pixel-based system

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 04:36:48 +02:00
Mario Zechner
4bb9b8f5ae Add momentum scrolling to touch interactions
- Implement velocity-based momentum scrolling with exponential decay
- Track touch history to calculate instantaneous velocity on touch end
- Apply 0.92 decay factor per frame for natural deceleration feel
- Support both vertical and horizontal momentum scrolling
- Respect scroll boundaries and stop momentum at limits
- Cancel momentum when new touch interaction begins
- Optimize rendering to only update when actually scrolling

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 04:33:25 +02:00
Mario Zechner
113ddabda3 Fix scroll position calculations and horizontal scrolling support
- Implement pixel-based scrolling for smooth sub-line positioning
- Add horizontal scrolling with native scrollLeft when not in fit mode
- Fix scrollToBottom() to wait for XTerm async write completion
- Recalculate viewportY properly when fontSize changes in fit mode
- Add isScrolledToBottom() helper for better scroll state tracking
- Make operation queue handle async XTerm operations correctly
- Fix fit mode switching to maintain scroll position across font changes

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 04:26:57 +02:00
Mario Zechner
4eb45dd2f4 Fix all ESLint warnings and type safety issues
- Replace 'any' types with proper TypeScript types
- Add missing imports for WebSocket and ChildProcess types
- Fix non-null assertion to use nullish coalescing
- Update Map type parameters to use unknown instead of any
- Add proper type guards for DOM element properties
- Remove unused performance measurement variables

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 03:21:26 +02:00
Mario Zechner
1c7894e15d Improve mobile momentum scrolling and layout fixes
- Remove console.log performance logging for cleaner output
- Fix layout spacer positioning with proper flexbox structure
- Improve momentum scrolling responsiveness for rapid flicks
- Cancel existing momentum animations when new touch starts
- Amplify initial velocity and adjust friction curves for better feel

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 03:03:12 +02:00
Mario Zechner
21d0f710f1 Fix linting warnings in terminal and URL highlighter
- Replace non-null assertions with proper null checks in terminal.ts
- Add defensive null checks in all queued operations
- Fix non-null assertion in url-highlighter.ts regex match
- Remove all forbidden non-null assertion warnings for our files

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 02:16:06 +02:00
Mario Zechner
2e599d4679 Refactor URL highlighting into separate utility class
- Extract URL detection and highlighting logic from terminal.ts into UrlHighlighter utility class
- Move all URL processing methods (processLinks, createUrlLinks, getLineText, createClickableInLine, wrapTextInClickable) to new file
- Keep terminal.ts focused on core terminal functionality
- Maintain all existing URL highlighting functionality including multi-line URL support

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 02:12:01 +02:00
Mario Zechner
85b2eadf40 Fix cursor positioning by using XTerm's absolute buffer coordinates
- Fix cursor Y calculation by adding XTerm's viewportY offset to get absolute buffer position
- Simplify cursor line detection logic by removing complex viewport translation
- Write full content in test instead of truncated lines
- Ensure scrollToBottom only runs after terminal is properly fitted

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 02:10:07 +02:00
Mario Zechner
f6f84fb351 Fix viewportY actually being used in DOM terminal rendering
- Replace incorrect Math.min logic with proper viewport bounds checking
- Now properly uses viewportY as the primary scroll position for rendering
- Ensures terminal shows correct viewport content when scrolled up/down

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 01:39:55 +02:00
Mario Zechner
91d454f503 Fix cursor positioning in DOM terminal viewport scrolling
- Add proper cursor coordinate system translation between XTerm logical size and viewport size
- Fix cursor positioning when viewport is scrolled up by adjusting cursor Y offset
- Clean up unused variables and fix linting warnings
- Ensure XTerm write callback timing for performance measurement

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 01:35:57 +02:00
Mario Zechner
992cea9a91 Fix cursor positioning and remove restrictive API safety checks
- Fix cursor viewport positioning by checking if cursor is within current viewport range
- Remove restrictive queue safety checks from immediate query methods
- Update API documentation to clarify when data may be stale and suggest queueCallback() for fresh data
- Simplify test to use proper API flow without unnecessary timeouts
- Cursor now correctly renders only when visible in viewport at proper position

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 01:16:28 +02:00
Mario Zechner
7974dca8b8 Add comprehensive DOM terminal API with cursor rendering and performance tracking
- Implement RAF-based operation queue for optimal batching
- Add cursor position rendering with nice green color and blinking animation
- Add comprehensive public API with documentation:
  - Buffer methods: write(), clear(), setTerminalSize()
  - Scroll methods: scrollToBottom(), scrollTo(), queueCallback()
  - Query methods: getTerminalSize(), getVisibleRows(), getBufferSize(), getScrollPosition(), getMaxScrollPosition()
- Add safety checks to prevent stale data reads when operations are pending
- Add detailed performance measurement for render pipeline
- Update test to use proper encapsulated API instead of accessing internals

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 01:03:02 +02:00
Mario Zechner
06750ed405 Stop URL parsing at empty lines
- Add check for empty lines (after trimming) to stop URL parsing
- URLs now properly end at empty lines, not just whitespace
- More intuitive behavior for multi-line URL detection

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 00:26:38 +02:00
Mario Zechner
97143abc20 Simplify multi-line URL detection with whitespace-based approach
- Detect http(s):// in current line with regex
- Scan subsequent lines until first whitespace character
- Much simpler and more reliable than URL validation
- Use actual <a> tags instead of spans for proper linking
- Remove complex string highlighting (focus on URLs only)
- Cleaner, more maintainable code

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 00:24:17 +02:00
Mario Zechner
98bb30f89f Add multi-line string highlighting to DOM terminal
- Detect quoted strings (single, double, backtick quotes)
- Highlight strings that span multiple lines or are >20 chars
- Style strings with orange color and subtle background
- Handle overlap detection (URLs take precedence over strings)
- Add comprehensive test cases for multi-line strings
- Fix method naming and maintain scrolling functionality

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 00:19:04 +02:00
Mario Zechner
d4902f1d31 Implement clickable links in DOM terminal
- Add multi-line URL detection and linking
- Extract text across all terminal lines for processing
- Handle URLs that span multiple lines correctly
- Style links with hover effects and click handlers
- Add comprehensive link test cases to test HTML
- Process links after each render operation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 00:16:25 +02:00
Mario Zechner
885612f69b Minor fix 2025-06-18 00:10:53 +02:00
Mario Zechner
cc244031ff Add missing session fields and update linting guidance
- Add waiting field to Session interface in session-list.ts
- Include name and waiting fields in app.ts session mapping
- Update CLAUDE.md with linting reminder

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 00:08:57 +02:00
Mario Zechner
12eaa39d73 Fix mobile horizontal fit with Fira Code font consistency
- Remove debug logging after confirming font fix works
- Fira Code provides consistent character width across platforms
- Horizontal fit now works reliably on real devices and emulators
- Minimum font size of 4px enables proper mobile fitting

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 00:04:02 +02:00
Mario Zechner
4dd6d941d8 Add Fira Code font to DOM terminal test
- Add @font-face declarations for Fira Code VF fonts
- Update body and terminal elements to use Fira Code
- Add terminal-line class with proper font styling
- Ensures consistent font rendering between real devices and emulators

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 00:02:02 +02:00
Mario Zechner
3ef137b78d Add back debug logging for real device testing
- Restore detailed horizontal fit logging
- Compare real device vs emulator font rendering
- Identify discrepancies in character width measurement

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-18 00:00:16 +02:00
Mario Zechner
4077977194 Remove debug logging from terminal component
- Clean up console.log statements added for debugging
- Keep the mobile horizontal fit improvements
- Maintain explicit font styling for measurement accuracy

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-17 23:57:12 +02:00
Mario Zechner
d1e98a6f81 Fix horizontal fit on mobile by lowering min font size
- Reduce minimum font size from 8px to 4px for mobile
- Explicitly set fontSize and fontFamily on measurement element
- Add fontSize to measurement logging
- Allows proper fitting for narrow mobile viewports

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-17 23:55:52 +02:00
Mario Zechner
f5694cecbf Add detailed logging for horizontal fit debugging
- Add character width measurement logging
- Show container dimensions and target calculations
- Log scale factor and font size adjustments
- Help debug mobile horizontal fit issues

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-17 23:54:19 +02:00
Mario Zechner
46ce5ffc56 Rename terminal component to vibe-terminal
- Change @customElement from 'terminal' to 'vibe-terminal'
- Update HTML test file to use new element name
- Fixes web component spec compliance (terminal is reserved)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-17 23:51:13 +02:00
Mario Zechner
925bc129c9 Add optional session name support
- Add optional session name field to create form
- Update Session interface to include name property
- Backend now accepts and stores custom session names
- Session cards and views display name when available, fallback to command
- Session names are passed to tty-fwd for better identification

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-17 23:45:55 +02:00
Mario Zechner
689bd1d765 Fix linter issues and limit session grid to 2 columns
- Remove unused css import in mobile-terminal component
- Fix unused location parameter in custom-weblinks-addon
- Limit session list grid to maximum 2 cards per row

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-17 23:40:08 +02:00
Mario Zechner
2650058bb9 Rename dom-terminal to terminal component
Renamed the DOM terminal component for cleaner naming:
- Renamed dom-terminal.ts to terminal.ts
- Renamed DomTerminal class to Terminal
- Renamed XTerm Terminal import to XtermTerminal to avoid conflicts
- Updated custom element from 'dom-terminal' to 'terminal'
- Updated CSS classes from dom-terminal-container to terminal-container
- Updated HTML test file to use new element name and CSS classes
- Updated import in test-terminals-entry.ts
- Fixed linting issues (removed unused variables)

The terminal component now has cleaner, more intuitive naming while
maintaining all existing functionality.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-17 23:32:55 +02:00
Mario Zechner
2179f25025 Add horizontal fitting mode for terminal with toggle button
Implemented responsive terminal sizing that automatically adjusts font size
to fit exactly the specified number of columns in the container width:
- Added fitHorizontally property to toggle horizontal fitting mode
- Character width measurement using representative terminal content
- Automatic font size calculation to fit columns exactly
- Full container utilization by fitting both columns and rows
- Proper font size restoration when toggling off horizontal fitting
- Added toggle button to test page for easy testing

The terminal now supports two modes:
- Normal: Fixed font size, calculate rows that fit vertically
- Horizontal fit: Calculate font size to fit columns, then fit rows

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-17 23:26:14 +02:00
Mario Zechner
322658d9a9 Add smooth macOS-style momentum scrolling for mobile touch
Implemented natural momentum scrolling that feels like native macOS:
- Fixed velocity calculation to use recent movement instead of total
- Added macOS-like deceleration curve with variable friction
- Smooth start with gentle initial deceleration, then gradual slowdown
- Fractional scroll accumulation prevents small movements from being lost
- Removed debug logging for clean production code

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-17 22:57:40 +02:00
Mario Zechner
e464872b15 Fix mobile touch scrolling with pointer events and capture
Replaced touch events with pointer events using setPointerCapture() to solve
the issue where touch scrolling would break when DOM is rebuilt during scroll.
- Use pointer events with setPointerCapture() for touch devices only
- Keep wheel events for desktop trackpad/mouse scrolling
- Add touch-action: none CSS to prevent browser scroll interference
- Include 5px movement threshold to avoid interfering with text selection
- Remove momentum scrolling temporarily for simplicity

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-17 22:49:44 +02:00
Mario Zechner
0e4d202d71 Fix smooth scrolling on Mac trackpads with delta accumulation
- Add scroll accumulator to handle small deltaY values from slow trackpad movements
- Accumulate scroll deltas until they reach at least one line height
- Preserve fractional remainder for next scroll event
- Fixes issue where slow two-finger scrolling would not register movement

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-17 22:13:28 +02:00
Mario Zechner
5ca8acb676 Improve DOM terminal renderer and add rich test content
- Fix DOM terminal rendering with proper innerHTML generation
- Add comprehensive test content including logs, tables, git history, docker status
- Implement proper ANSI color code handling for wide character compatibility
- Add auto-scroll to bottom functionality
- Replace individual line element management with bulk innerHTML updates
- Fix \r\n line ending handling for proper terminal behavior

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-17 22:10:48 +02:00
Mario Zechner
b4d63fc922 New terminal renderer WIP 2025-06-17 22:10:48 +02:00
Mario Zechner
113786a35b Add responsive mobile terminal component with viewport scaling
- Created ResponsiveTerminal Lit component with mobile touch scrolling
- Implements XTerm.js with custom scaling algorithm for different viewport sizes
- Added setViewportSize() method for testing content reflow without regeneration
- Fixed mobile viewport issues using 100dvh for proper height calculation
- Added debounced ResizeObserver to prevent resize loops
- Component uses Tailwind classes and aggressive XTerm CSS constraints
- Test page allows switching viewport dimensions to observe content reflow
- Touch handlers scoped only to terminal content, not affecting external UI

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-17 16:09:09 +02:00
Mario Zechner
c04cb26f4e Fix linter formatting issues
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-17 01:52:52 +02:00
Mario Zechner
7e98e2e735 Fira font, various mobile UI fixes. 2025-06-17 01:38:58 +02:00
Peter Steinberger
10970951d7 linter 2025-06-17 01:31:06 +02:00
Peter Steinberger
df4053282c add mention of linter 2025-06-17 01:12:13 +02:00
Peter Steinberger
52fda3d996 linting 2025-06-17 01:11:10 +02:00
Peter Steinberger
8b3833ee0e Merge remote-tracking branch 'origin/main'
# Conflicts:
#	web/src/client/components/app-header.ts
#	web/src/client/components/session-card.ts
#	web/src/client/components/session-view.ts
2025-06-17 01:06:52 +02:00
Peter Steinberger
bb20c3a833 lint web 2025-06-17 01:03:37 +02:00
Mario Zechner
fb0c3538f2 Mobile fixes. 2025-06-17 00:47:19 +02:00
Peter Steinberger
59ad90fdc7 Move kill to app header 2025-06-17 00:28:39 +02:00
Mario Zechner
b54dc7a17c Fix terminal cursor not showing up 2025-06-17 00:20:48 +02:00
Mario Zechner
16f139ce89 Log websocket error, don't throw. 2025-06-17 00:20:38 +02:00
Mario Zechner
16fe254564 Standard control path 2025-06-17 00:20:38 +02:00
Mario Zechner
ddb342bdec Fix the stupid terminal scaling calculations, we properly measure glyph width/height and apply linear scaling plus conservative row clamping. Good enough. Scroll could be reset to bottom after fit, but might also kill user scroll position so shrug. 2025-06-16 22:56:21 +02:00
Armin Ronacher
71f49142ea Show waiting status 2025-06-16 21:39:37 +02:00
Armin Ronacher
013ba77a04 Fix cursor rendering 2025-06-16 19:19:18 +02:00
Armin Ronacher
510be54304 Implemented copy/paste 2025-06-16 18:28:43 +02:00
Mario Zechner
ab5a34398d Improve mobile UI and add localStorage for session creation
- Add localStorage persistence for last used working directory and command
- Values are saved on successful session creation and loaded on component creation
- Survives page reloads and provides better UX for repeated session creation
- Enhance mobile terminal buttons with larger Unicode symbols (arrows, tab, enter)
- Make arrow keys, tab, and enter buttons more visible and easier to tap

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 17:46:44 +02:00
Mario Zechner
d164db3496 Add Kill All sessions button and fix terminal scaling
- Add Kill All button to session list that appears when running sessions exist
- Button triggers individual session kill animations by clicking each kill button
- Fix terminal scaling issues with proper character width ratio (0.63)
- Constrain terminal containers to viewport width to prevent overflow
- Override XTerm's fixed width CSS to respect container bounds
- Reduce minimum font size to 4px for better scaling flexibility

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 17:37:48 +02:00
Peter Steinberger
67ec9ef118 Add dist/ to web .gitignore
Ignore generated distribution files in the web directory.
2025-06-16 16:30:18 +02:00
Peter Steinberger
d013019b16 cleanup git 2025-06-16 16:20:46 +02:00
Peter Steinberger
95642f4723 Update web/.gitignore to exclude generated JS files in public/
- Add rules to exclude *.js and *.js.map files in web/public/
- Add rules to exclude component JS files in web/public/components/
- These are build artifacts that should not be tracked
2025-06-16 16:16:04 +02:00
Mario Zechner
c5a6e2dd1d Remove unnecessary session polling from session-view
Session-view was polling /api/sessions every 2 seconds unnecessarily.
All session updates come via SSE stream including exit events.
This eliminates redundant API calls and improves performance.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 16:08:28 +02:00
Mario Zechner
ed3927b4a6 Fix session management and terminal scaling
- Fix session killing via DELETE endpoint instead of wrong POST /kill
- Add proper session card kill animation with ASCII spinner
- Fix double key press issue with keyed directive for session-view
- Implement URL-based navigation for consistent component lifecycle
- Fix session card terminal scaling to show all content at smaller sizes
- Modify ScaleFitAddon to only scale font size for previews, not dimensions
- Add session card loading and killing states with visual feedback
- Remove duplicate event listeners and improve component cleanup

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 15:35:11 +02:00
Mario Zechner
90eb324930 Fix session card styling to match original design
- Restore compact header layout with proper spacing (px-3 py-2)
- Use original VS Code theme colors (text-vs-user, text-vs-warning)
- Fix terminal preview with proper aspect ratio (640/480)
- Update kill button styling to match original (bg-vs-warning)
- Add compact footer with session ID and working directory

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 14:59:24 +02:00
Mario Zechner
ae2c986e33 Implement session-card architecture and improve session management
- Create session-card component for individual session rendering
- Add Renderer active count tracking to monitor instance leaks
- Parse session ID from tty-fwd stdout for reliable session creation
- Add 2-second delay for fresh session connections to prevent race conditions
- Simplify session-list to use session-card components
- Restore original layout with controls and proper padding
- Improve SSE exit event handling with direct session ID usage

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 13:50:28 +02:00
Mario Zechner
3ec417c8b1 Implement custom ScaleFitAddon for proper terminal scaling
- Create ScaleFitAddon that scales font size to fit columns to container width
- Calculates optimal rows for container height with scaled font
- Replace CSS transform scaling with proper font size calculation
- Apply to both session view and previews for consistent behavior
- Achieve 95-98% width utilization instead of arbitrary 80% scaling
- Prevent stack overflow with font size change detection

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 12:06:42 +02:00
Mario Zechner
34801bc687 Fix terminal layout and improve mobile UX
- Restructure session-view to use proper flexbox layout (header/xterm/buttons)
- Container now exactly fits viewport height (100vh)
- Header shows command and working directory stacked
- XTerm gets all remaining space with horizontal scrolling
- Mobile buttons integrated into layout instead of overlaying
- Replace setTimeout with requestAnimationFrame for better performance
- Add isPreview parameter to renderer for future preview scaling
- Disable pointer events on preview terminals so clicks pass through

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 11:55:22 +02:00
Mario Zechner
093aff4379 Update XTerm theme to VS Code Dark colors and improve SSE streaming
- Replace Gruvbox color scheme with VS Code Dark theme colors
- Remove inappropriate terminal.clear() calls from live stream connections
- Add debugging logs for SSE events to investigate DOM recreation issue
- Ensure only snapshots clear terminal, streams append new content

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 10:58:21 +02:00
Mario Zechner
e8bee03388 Replace asciinema with XTerm renderer and add key combination support
- Replace AsciinemaPlayer with XTerm.js renderer in session-view and session-list
- Add XTerm CSS for proper terminal styling and hide input textarea
- Implement resize event handling (r-type cast events) in renderer
- Add Ctrl+Enter and Shift+Enter key combination support
- Update tty-fwd to handle ctrl_enter and shift_enter keys
- Set TERM=xterm-256color in tty-fwd for proper Unicode box-drawing
- Add font scaling and preview sizing for session-list terminals
- Remove asciinema dependencies and update CSS accordingly

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 10:38:19 +02:00
Mario Zechner
7b6ebad8be Increase XTerm scrollback buffer to 1M lines by default
- Add configurable scrollback parameter to Renderer constructor
- Default to 1,000,000 lines (up from 1,000) for full session history
- Users can now scroll through entire terminal session history
- Fix renderer-entry.ts import path (remove .js extension)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 10:38:19 +02:00
Mario Zechner
c7c8a605c2 Replace custom renderer with XTerm.js and consolidate tests
- Remove old custom ANSI renderer (src/client/renderer.ts)
- Rename XTermRenderer to Renderer and move to renderer.ts
- Update renderer-entry.ts to export single Renderer class
- Rename and update all test files:
  - test-xterm-renderer.html → test-renderer.html
  - simple-xterm-test.html → simple-test.html
  - debug-xterm.html → debug-renderer.html
- Remove obsolete custom renderer tests
- Update tests/index.html with new test descriptions
- All tests now use single XTerm.js-based Renderer

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 10:38:19 +02:00
Mario Zechner
e4b4a37c86 Fix renderer export name - use TerminalRenderer with Renderer alias 2025-06-16 10:38:19 +02:00
Mario Zechner
9bc6fcc4b1 Replace CDN imports with local bundle in all tests
- Create renderer-entry.ts to bundle both Renderer and XTermRenderer
- Add bundle:renderer script to generate public/bundle/renderer.js
- Update all test files to import from ../bundle/renderer.js
- Remove all unpkg/CDN XTerm.js script imports
- Tests now use bundled dependencies for faster loading

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 10:38:19 +02:00
Mario Zechner
43d406a84c Clean up build system and implement XTerm.js renderer
- Replace TypeScript compilation with esbuild bundling
- Organize all generated files in public/bundle/
- Remove PWA features and simplify index.html
- Add XTerm.js renderer with same API as custom renderer
- Create comprehensive test suite in public/tests/
- Update .gitignore to only track source files

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 09:33:33 +02:00
Mario Zechner
33b1f89f12 Fix Tailwind CSS to use local installation via npx
- Update build:css script to use npx tailwindcss instead of global
- Update watch:css script to use npx tailwindcss instead of global
- Ensures consistent builds using project dependencies

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 07:59:58 +02:00
Mario Zechner
807b32d479 PWA, server needs to serve via HTTPS still 2025-06-16 07:57:48 +02:00
Mario Zechner
fce59c3df6 Add URL routing and enhanced mobile terminal controls
- Implement browser URL routing with session ID parameters
- Add browser back/forward navigation support
- Auto-load session view from URL on page refresh
- Add mobile swipe-back gesture from left edge
- Reorganize mobile controls: arrow keys + special keys in normal view
- Simplify text overlay to show only SEND and SEND+ENTER buttons
- Remove left arrow from BACK button for cleaner look

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 07:47:43 +02:00
Mario Zechner
aae68479ee Improve mobile terminal input with virtual keyboard support
- Move controls above virtual keyboard using Visual Viewport API
- Dynamically adjust textarea height when keyboard appears/disappears
- Add smooth transitions for keyboard show/hide
- Prevent textarea from stretching behind buttons
- Clean up event listeners properly

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 07:36:58 +02:00
Mario Zechner
a77b1dbe26 Implement auto-switch to session view after creation and clean startup
- Add automatic session view switching after creating new sessions
- Poll for session to appear in list and switch immediately when found
- Handle tty-fwd ID mismatch by falling back to newest session
- Add comprehensive debugging for session creation flow
- Clean control directory contents on server startup for fresh state
- Improve session creation UX with seamless transition to interactive view

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 07:19:35 +02:00
Peter Steinberger
79a23c0aa6 Replace PATH hack with proper zsh configuration loading in Xcode build script
- Changed build script shell from /bin/sh to /bin/zsh for better compatibility
- Sources user's .zshrc or .zprofile to get the actual PATH configuration
- Properly handles all Node.js installation methods (nvm, homebrew, fnm, etc.)
- Added PATH debugging output to help troubleshoot issues
- Maintains fallback for systems without zsh configuration files

Also includes:
- Added PATH environment fix for ngrok detection in NgrokService
- Implemented proper update channel support in SparkleUpdaterManager using delegate methods
- Fixed session name placeholder text in web frontend
2025-06-16 07:15:53 +02:00
Mario Zechner
2fa36dd15b Move CREATE SESSION button to header and improve UI layout
- Move CREATE SESSION button from session list to app header for better visibility
- Hide CLEAN EXITED button when "hide exited" is checked (only show when needed)
- Simplify session list controls layout with clean flex design
- Add proper state management for create modal between app and session list
- Maintain hide exited state when navigating between views
- Fix checkbox blocking issue with better event timing

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 07:13:45 +02:00
Peter Steinberger
74373a129d Fix TypeScript error in server.ts
- Handle error type properly in catch block
- Check if error is instanceof Error before accessing message property
- Provide fallback for unknown error types
2025-06-16 06:59:11 +02:00
Mario Zechner
3a6665c13f Fix session status detection and prevent stream restarts for exited sessions
- Add session status polling in session view to detect when sessions end
- Switch from live stream to static snapshot for exited sessions
- Fix session list player creation for toggled visibility states
- Use requestAnimationFrame for better DOM timing instead of setTimeout
- Rename checkbox label from "--filter-exited" to "hide exited"
- Implement smart kill/clean button behavior based on session status
- Remove all focus outlines from session view interface

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 06:43:27 +02:00
Mario Zechner
e27657a9fe WIP: Interactive session view needs refinement
- Basic routing and keyboard handling implemented
- Terminal display and input sending functional
- Still needs polish and bug fixes before fully working

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 05:54:15 +02:00
Mario Zechner
09cc9edb43 Implement interactive session view with keyboard input
- Add session-view.ts component for full-screen terminal interaction
- Implement real-time keyboard input handling for all key types
- Add routing between session list and interactive session view
- Support special keys, Ctrl combinations, and regular text input
- Remove compiled JS files from git tracking (should be build artifacts)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 05:51:27 +02:00
Mario Zechner
ba4a86c5db Improve terminal preview layout for better space utilization
- Change asciinema player fit mode from 'both' to 'width' for horizontal expansion
- Add overflow-hidden to prevent vertical overflow from breaking layout
- Terminal previews now always use full card width

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-16 05:48:50 +02:00