-
Notifications
You must be signed in to change notification settings - Fork 0
fix(splash): move handoff to backend app://ready listener (closes #42) #43
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
0e5618a
fix(splash): move handoff to backend `app://ready` listener (closes #42)
InstaZDLL 446a153
fix(splash): allow retry when reveal_main_close_splash fails
InstaZDLL e7da1c4
fix(splash): emit app://ready from useEffect instead of rAF
InstaZDLL 8f29b4f
fix(splash): set native window backgroundColor to avoid white flash o…
InstaZDLL f6d439d
fix(share): use full-res artwork + real blur on Now Playing card
InstaZDLL 6c1f7ac
fix(splash): retry fallback in a loop + don't close splash on main re…
InstaZDLL bb13f03
refactor(splash): extract ReadySignal into its own file
InstaZDLL File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import { useEffect, type ReactNode } from "react"; | ||
| import { emit } from "@tauri-apps/api/event"; | ||
|
|
||
| /** | ||
| * Emits `app://ready` once after the first React commit so the Rust | ||
| * backend can reveal the main window and close the splash from native | ||
| * code (see `reveal_main_close_splash` in src-tauri/src/lib.rs). | ||
| * | ||
| * We rely on a `useEffect` rather than a `requestAnimationFrame` dance | ||
| * because WebKitGTK 2.52 suspends rAF callbacks while a window is | ||
| * `visible: false` — rAF would never fire until the backend reveals | ||
| * the window, deadlocking the handoff until the 15 s safety-net timer | ||
| * trips. `useEffect` runs after React commits, which is the actual | ||
| * guarantee we care about (DOM is populated before reveal); the | ||
| * compositor will paint the first frame as part of the reveal itself, | ||
| * so we don't need to observe a paint to avoid a flash. | ||
| * | ||
| * Lives in its own file rather than in `main.tsx` so it satisfies | ||
| * the React Fast Refresh constraint ("a file must only export | ||
| * components"). Bundle entry points like `main.tsx` have non-component | ||
| * side effects (root.render, i18n init) that prevent HMR from | ||
| * extracting the component cleanly. | ||
| */ | ||
| export function ReadySignal({ children }: { children: ReactNode }) { | ||
| useEffect(() => { | ||
| void emit("app://ready").catch((err) => { | ||
| console.error("[ReadySignal] emit(app://ready) failed", err); | ||
| }); | ||
| }, []); | ||
| return <>{children}</>; | ||
| } |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.