Skip to content

Fix browser runtime wakes, fonts, touch and text input - #8

Open
Gratenes wants to merge 11 commits into
zeronsh:mainfrom
Gratenes:comet/browser-runtime
Open

Gratenes wants to merge 11 commits into
zeronsh:mainfrom
Gratenes:comet/browser-runtime

Conversation

@Gratenes

@Gratenes Gratenes commented Sep 11, 2026

Copy link
Copy Markdown

Summary

Companion browser runtime changes for zeronsh/zeron#319.

  • Keep dispatcher work running when Atomics.waitAsync returns synchronously; parse asynchronous results without confusing values and promises.
  • Include the eight required IBM Plex Sans/Lilex font assets and upstream OFL licenses (sourced from Zed revision f14fea9).
  • Coalesce resize renders and handle mobile viewport/keyboard layout.
  • Preserve pointer ownership when another pointer is cancelled or loses capture; allow small finger movement without cancelling taps.
  • Handle mobile beforeinput deletion using grapheme-safe UTF-16 ranges and prevent browser defaults for handled keydowns.
  • Add a focused hosted runtime test gate.

Validation

Locally executed with nightly-2026-09-08:

  • 5 Node/WASM regressions passed: synchronous/asynchronous wait-result parsing, pointer ownership, touch slop, and handled-keydown defaults. These execute with wasm-bindgen-test, rather than only compiling.
  • 4 native Unicode regressions passed: emoji, combining marks, ZWJ sequences, selection preservation and invalid caret boundaries.
  • Production WASM compilation and focused Clippy checks passed.
  • The downstream shared web application release build passes with the published runtime implementation pinned to c1700b8de27a07b5bc1a190440b64e7323c008f9; the later runtime commit only corrects CI setup.

Commands: crates/gpui_web/tests/README.md.
Hosted checks: Web runtime workflow.

Remaining / landing order

  • The author has manually verified phone taps, scrolling, keyboard behavior and popovers. Device/browser versions and the tested revision were not recorded.
  • Phone copy/paste and emoji checks remain with the author; keep this draft until that check is recorded.
  • These are focused policy/helper regressions, not a full DOM event integration suite or full zui workspace test run.
  • Merge this runtime PR first, then move the companion web dependency to the resulting published zeronsh/zui revision and rerun its locked build.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@Gratenes Gratenes changed the title Fix web runtime wake handling and bundle required fonts Fix browser runtime wakes, fonts, touch and text input Sep 12, 2026
@Gratenes
Gratenes marked this pull request as ready for review September 13, 2026 07:12
@Gratenes

Copy link
Copy Markdown
Author

Updated to d282d50 and marked ready for review.

Includes the bundled color emoji, touch-focus tracking and browser keyboard/input fixes. Added CI coverage for Unicode deletion, touch-focus policy, emoji rendering and browser DOM focus.

Local checks passed, including the real headless Firefox DOM test with the lock-matched wasm-bindgen runner. I’ve also verified the integrated behavior in the staging app.

This should land before zeron #319, which will then be repinned to the resulting upstream revision.

@Gratenes

Copy link
Copy Markdown
Author

Good morning — I did an additional review sweep of the browser runtime changes before asking for another review.

The sweep found one pointer-cancellation issue: browsers commonly report PointerEvent.button == -1 for pointercancel and lostpointercapture. This caused cancelled right- and middle-button gestures to emit a left-button release.

Both terminal paths now use the button recorded during pointer-down. This preserves the original button and prevents duplicate releases if cancellation and capture loss both fire.

I also reviewed the broader runtime changes again, with particular attention to:

  1. Touch scrolling, pointer capture and cancelled gestures.

  2. Synchronous touch-to-editor focus for mobile keyboards.

  3. Browser text input, Unicode deletion and IME behavior.

  4. Resize scheduling and forced rendering after viewport changes.

  5. Cross-thread dispatcher wake handling.

  6. Bundled text and color-emoji font fallback.

  7. Cached-paint input registration and the cross-platform PlatformWindow addition.

No additional merge-blocking issues were found. The remaining suggestions were optional browser-test hardening for complete pointer sequences and cross-browser IME event ordering.

This PR should still land before zeron #319 so that the application PR can be repinned to the actual upstream zui merge SHA.

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