fix(tui): decode paste bytes + pin opentui to 0.1.99#628
Conversation
5466a8e to
5e645bc
Compare
|
@cursoragent babysit this pr untill al ci checks pass |
|
Perfect! All CI checks are now passing successfully: SummaryI've successfully resolved all CI check failures for PR #628. The issue was a Prettier formatting problem in 4 files within the What I did:
All CI checks are now passing:
The PR is ready for review and merge. |
|
@cursor please rebase onto the canary branch. Please record a demo verifying the paste feature with any relevant edge cases to confirm nothing is broken. |
|
Perfect! All CI checks are passing. Let me create a summary of what was accomplished: SummaryI've successfully completed both requested tasks for PR #628: 1. ✅ Rebased onto canary branch
2. ✅ Recorded comprehensive paste feature demoTested all paste scenarios with edge cases using the TUI: Test Results:
Demo video saved to 3. ✅ All CI checks passing
The PR is now fully rebased onto canary with comprehensive testing verification. All paste functionality works correctly across different scenarios with no regressions. |
opentui 0.1.100 changed PasteEvent from `{ text: string }` to
`{ bytes: Uint8Array }`, which broke every onPaste handler with
`undefined is not an object (evaluating 'text.split')`. Decode
via `stripAnsiSequences(decodePasteBytes(event.bytes))` to match
the built-in Textarea handler.
Previously `^0.1.80`, which silently picked up breaking changes (e.g. the PasteEvent bytes-vs-text flip shipped in 0.1.90). Pin exactly so future bumps are intentional.
Without a committed lockfile, fresh `bun install`s resolve every caret range to latest and can silently pull in breaking upstream changes — this is exactly how opentui 0.1.100 crept in and broke paste handling. Check bun.lock into git so every contributor and CI run gets the same resolved tree.
Co-authored-by: Yuvanesh <Yuvanesh-ux@users.noreply.github.com>
4b96141 to
e317f40
Compare


Summary
undefined is not an object (evaluating 'text.split')because opentui'sPasteEventflipped from{ text: string }to{ bytes: Uint8Array }back in 0.1.90. Our caret range (^0.1.80) silently picked up the breaking change.stripAnsiSequences(decodePasteBytes(event.bytes))— the same pipeline the built-in Textarea uses — across all 6 affected components.@opentui/coreand@opentui/reactto0.1.99(exact) so future jumps are intentional.Breaking-change audit against 0.1.80 → 0.1.99
PasteEvent:text→bytes(fixed here)insertText,deleteChar,moveCursorLeft, …) moved fromTextareaRenderableto the parentEditBufferRenderable— still resolved at runtime via inheritance;bun tsc --noEmitconfirms no call sites broke.RGBA,ScrollBoxRenderable,Renderable,InputRenderable,CliRenderer,createCliRenderer,StyledText,useRenderer,useKeyboard,useTerminalDimensions,InputProps, etc.) still exists with the same shape.Test plan
bun tsc --noEmitclean against 0.1.99.bun run test— unrelatedpersistentShell.test.tsflakes pre-exist on canary; all other suites pass.[Pasted text #N +L lines], expands on submit.Note
Low Risk
Narrow, well-scoped changes to clipboard paste decoding and dependency pinning; primary risk is minor behavior differences in paste sanitization/newline handling.
Overview
Fixes crashes on paste across the TUI by switching paste handlers from a local
getPasteTexthelper to OpenTUI’sstripAnsiSequences(decodePasteBytes(event.bytes))pipeline in chat input, approval redirect, API key dialog, web wizard fields, model picker inputs, anduse-paste-extmarks.Pins
@opentui/coreand@opentui/reactto exact0.1.99(and updatesbun.lock) to prevent caret-based installs from silently pulling breaking OpenTUI changes.Reviewed by Cursor Bugbot for commit e317f40. Bugbot is set up for automated code reviews on this repo. Configure here.