forked from anomalyco/opentui
-
Notifications
You must be signed in to change notification settings - Fork 0
Add @opentui/web package for browser rendering #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
remorses
wants to merge
72
commits into
main
Choose a base branch
from
vterm-spans
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- fix useKeyboard callback signature (single KeyEvent param, not two) - add renderer.start() for keyboard input to work - map browser key names to KeyCodes format (ArrowUp -> ARROW_UP) - add white-space: pre to preserve spaces in terminal output - remove createWebRenderer abstraction, use createTestRenderer directly - simplify demo UI to clean terminal-style design - fix code point validation in buffer.ts to prevent RangeError
- remove renderer.start() to avoid conflicting with our render loop - add rendering/pendingRender flags to prevent overlapping renders - trigger immediate render after mouse/resize events - remove debug logging that added latency
- add 4 tabs: Overview, Diff, Scroll, Colors - use real <input> component instead of fake styled text - show system stats, status boxes, color palette, border styles - fix keyboard handler to not interfere with input
- add cursorVisible to VTermData type - include cursor visibility in captureSpans - send cursor updates when position or visibility changes - use actual cursor visibility instead of hardcoded true
Tests use inline snapshots with visual grid showing cursor position (█). Covers: typing, arrow keys, Home/End, backspace, typing in middle.
- add tunnel package with connectTunnel() API for exposing local apps via public URLs
- add cloudflare worker to serve HTML client at opentui.net/s/{tunnelId}
- refactor session logic into shared SessionCore for reuse between server and tunnel
- add WebSocketLike abstraction for server/client compatibility
- bundle client with bun build and serve via cloudflare assets
Remove Math.ceil() from charWidth calculation so canvas uses same fractional character widths as HTML text layer. Add matching CSS properties (font-weight, letter-spacing, kerning) to text layer. Reduces text selection drift from ~30px to <1px over 100 characters.
…terminal - Remove handleClick and let consumers manage focus via setFocused() - Update handleBlur to use requestAnimationFrame and check if another opentui textarea has focus, preventing focus fights between terminals
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a new
@opentui/webpackage that enables rendering opentui apps in the browser via WebSocket.Changes:
@opentui/corespan capture API (getSpanLines,captureSpans)Usage: