Commit graph

405 commits

Author SHA1 Message Date
Peter Steinberger
e3c6a6ea4a fixes startup flicker 2025-06-18 04:48:06 +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
Peter Steinberger
30e8b86f27 Fix permission UI layout jumping and center footer text
- Added fixed height and padding to "Granted" labels to match button sizes
- Prevents layout jumping when transitioning between button and granted state
- Small buttons use height 22px, large buttons use height 38px
- Centered the footer text in DashboardSettingsView permissions section
- Consistent visual appearance across all permission UI elements
2025-06-17 23:03:21 +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
Peter Steinberger
90849a11e2 Fix CLI installation animation issues in welcome dialog
- Added withAnimation wrapper to all state changes in CLIInstaller
- Added small delay before checking installation status to allow view to settle
- Updated permission text to say "AppleScript automation"
- All state transitions now animate smoothly with 0.3s easeInOut
- Fixed the "CLI tool is installed" text popping in without animation
2025-06-17 22:44:03 +02:00
Peter Steinberger
042163d3ab Simplify permissions UI in welcome screen
- Removed white bordered containers
- Simplified explanation text to be more concise
- Removed redundant labels and icons
- Made layout more compact
- Cleaner, more minimal design
2025-06-17 22:17:33 +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
Peter Steinberger
344dee2827 Fix welcome window overlaying everything
- Changed window level from .floating to .normal
- Changed NSApp.activate to not ignore other apps
- Welcome window now behaves like a normal window
2025-06-17 22:12:31 +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
Peter Steinberger
9e0b4b8b3c Fix AppleScript issues and add accessibility permissions UI
- Fixed quote escaping for AppleScript commands (single quotes now properly escaped)
- Added separate escaping for keystroke commands vs regular AppleScript
- Created AccessibilityPermissionManager to handle accessibility permission requests
- Updated WelcomeView to show both Automation and Accessibility permissions
- Updated DashboardSettingsView permissions section with both permission types
- Added proper system dialog triggering using AXIsProcessTrustedWithOptions
- Added NSAppleEventsUsageDescription to Info.plist
- Improved error handling with specific messages for accessibility permission errors
- Clear UI differentiation between which terminals need which permissions
2025-06-17 22:09:22 +02:00
Peter Steinberger
b4f8600ffd Also request accessibility 2025-06-17 22:09:02 +02:00
Peter Steinberger
ee1a48848c Finally fix settings foreground issue 2025-06-17 22:09:02 +02:00
Peter Steinberger
cf4bf494a0 no longer needed 2025-06-17 22:09:02 +02:00
Peter Steinberger
6a0fe1a8af Improve Applescript logic 2025-06-17 22:09:02 +02:00
Peter Steinberger
0e4cacc69d Add note about local signing 2025-06-17 22:09:02 +02:00
Armin Ronacher
9e67150d71 Merge branch 'feature/event-refactor' 2025-06-17 21:18:24 +02:00
Armin Ronacher
4fa8229b6f Add multiplex streaming 2025-06-17 21:18:15 +02:00
Armin Ronacher
f52001d831 Refactored into SSE helper 2025-06-17 20:31:34 +02:00
Armin Ronacher
e8b22949c8 Clean up parser 2025-06-17 20:16:28 +02:00