Skip to content

feat(bindings): expose rendering settings and native assertions - #275

Draft
Ayman Bagabas (aymanbagabas) wants to merge 3 commits into
aymanbagabas/recording-pause-resumefrom
aymanbagabas/binding-parity
Draft

Ayman Bagabas (aymanbagabas) wants to merge 3 commits into
aymanbagabas/recording-pause-resumefrom
aymanbagabas/binding-parity

Conversation

@aymanbagabas

Copy link
Copy Markdown
Member

Summary

This draft builds on #274, above #271 and #272.

  • Expose typed rendering settings through JavaScript, Python, and Go.
  • Support constructor defaults and per-call replacement for fonts, colors, padding, window controls, borders, shadows, and cursor animation.
  • Preserve omitted defaults, explicit false and zero, caller settings, and resolved styles after restart.
  • Add native cursor, mode, and color assertions, plus dedicated mode and color getters.
  • Regenerate the shared C header and binding declarations. Advance the native ABI from 6 to 7.
  • Add integration coverage and runnable examples in all three languages.

Cursor settings control permission to blink and the duration of each phase. They do not force a steady application cursor to blink.
Screenshots remain deterministic. Rendering settings do not change terminal colors or locator assertions.

Demonstration

The JavaScript example creates these GIFs through the native renderer.
Both use a 24-pixel font, custom padding, no title bar, and no shadow.
The application requests a blinking bar cursor.

Blink disabled

The constructor style disables animation. The GIF contains one frame and preserves 1.10 seconds of active time.

Custom rendering with cursor animation disabled

Per-call override: 250 ms phases

A per-call style enables animation. The GIF contains five phases over 1.10 seconds.
The first four encoded phases last 270, 240, 260, and 240 ms, within the 30 FPS sampling interval.
The original constructor settings remain unchanged.

Custom rendering with 250 ms cursor phases

Examples:

  • bindings/js/examples/rendering.mjs
  • bindings/python/examples/rendering.py
  • bindings/go/examples/rendering/main.go

Remaining parity gaps

This draft does not claim complete Rust API parity.
The binding locator transport still lacks TextSelector.scope anchors and the whole-match LocatorQuery.style filter.
Intersection with getByStyle() is not equivalent: it can return a styled substring instead of rejecting the full text match.
These gaps remain outside this implementation.

Validation

Local macOS ARM64 checks:

  • 12 generator tests and 17 FFI tests.
  • Generated declaration consistency, Rust formatting, and Clippy.
  • TypeScript build, 70 JavaScript boundary/helper tests, and targeted integration tests.
  • The new integration test under both Node and Bun.
  • All 168 Python tests and all Go packages.
  • Compiler ABI layout checks, Go vet, and all three examples.
  • Decoded example GIFs: one frame with blinking disabled in each language; five phases with the JavaScript override.

The broader JavaScript run passed 102 of 103 tests. The existing echo roundtrip test timed out in waitReady.
The unchanged CLI also reproduced that zsh readiness failure after a command.
No shell integration code changes are included.
Native Windows and Deno validation remain pending.

@cpendery
cpendery (cpendery) force-pushed the aymanbagabas/binding-parity branch 2 times, most recently from 68b28a8 to efad7d4 Compare October 31, 2026 20:50
Expose typed rendering settings through JavaScript, Python, and Go. Preserve native defaults, explicit values, and restart behavior without changing caller settings.

Add native cursor, mode, and color assertions plus state getters. Regenerate the ABI, extend compiler layout checks, and include runnable rendering examples.

Signed-off-by: Ayman Bagabas <ayman.bagabas@gmail.com>
Declare rendering options and native state assertions in the adapter stub. Check public adapter methods and spawn argument counts against the implementation to catch future omissions.

Signed-off-by: Ayman Bagabas <ayman.bagabas@gmail.com>
@cpendery
cpendery (cpendery) force-pushed the aymanbagabas/binding-parity branch from e25122c to 14fb00b Compare October 31, 2026 23:40
…as/parity-raster-review-fixes

Signed-off-by: Ayman Bagabas <ayman.bagabas@gmail.com>

# Conflicts:
#	bindings/js/README.md
#	bindings/python/README.md
#	references/javascript.md
#	references/python.md

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant