Skip to content

fix: route LEPUS global events to GlobalEventEmitter#193

Merged
Huxpro merged 4 commits into
Huxpro:mainfrom
KealanAU:fix/global-events-from-lepus
Jul 15, 2026
Merged

fix: route LEPUS global events to GlobalEventEmitter#193
Huxpro merged 4 commits into
Huxpro:mainfrom
KealanAU:fix/global-events-from-lepus

Conversation

@KealanAU

@KealanAU KealanAU commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

globalEventFromLepus lifecycle events (e.g. keyboardstatuschanged) never reached the background thread. This routes them into GlobalEventEmitter.

  • Wraps tt.OnLifecycleEvent to forward LEPUS lifecycle events to GlobalEventEmitter, preserving any existing handler.
  • Adds useGlobalEvent() composable with automatic scope cleanup (onScopeDispose).
  • Exports useGlobalEvent from the runtime entry; adds a regression test + patch changeset.

Verification

  • pnpm test; biome clean on touched files.
  • Confirmed native keyboardstatuschanged reaches useGlobalEvent('keyboardstatuschanged', ...).

Note: pnpm --filter vue-lynx run build stops at the pre-existing types package error (elements/index.ts can't resolve vue) — unrelated to this change.

@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown

@KealanAU is attempting to deploy a commit to the huxpro's projects Team on Vercel.

A member of the Team first needs to authorize it.

@KealanAU KealanAU force-pushed the fix/global-events-from-lepus branch 2 times, most recently from 53dfb79 to 2fb80c6 Compare June 17, 2026 09:30
@KealanAU KealanAU force-pushed the fix/global-events-from-lepus branch from 2fb80c6 to e8b1daf Compare June 17, 2026 09:35
@KealanAU

Copy link
Copy Markdown
Contributor Author
CleanShot.2026-06-17.at.21.29.21.mp4

@KealanAU KealanAU marked this pull request as ready for review June 17, 2026 19:35

@Huxpro Huxpro left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

One follow-up I'd still like to see is a regression test that explicitly proves the previous tt.OnLifecycleEvent handler is preserved when vue-lynx installs its wrapper, since keeping that compatibility path intact is part of the behavior change here.

@KealanAU

Copy link
Copy Markdown
Contributor Author

Added a regression test: it installs the wrapper over an existing tt.OnLifecycleEvent and asserts both our routing fires and the prior handler is still invoked. (4468f0a)

@Huxpro Huxpro merged commit 39ccc7c into Huxpro:main Jul 15, 2026
6 of 7 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 15, 2026
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.

2 participants