Fix desktop launch motion and reaction spacing (#1717)

Co-authored-by: Fizz <8a675edd33677aa0389f6650d467b2041fb0df4ca820eacb009babb95e3715d4@sprout-oss.stage.blox.sqprod.co>
This commit is contained in:
klopez4212
2026-07-12 16:42:31 +01:00
committed by GitHub
parent 53c177e341
commit 89e2e2e4ad
6 changed files with 159 additions and 24 deletions

View File

@@ -1,4 +1,5 @@
import { getCurrentWindow } from "@tauri-apps/api/window";
import { isTauri } from "@tauri-apps/api/core";
import { emit } from "@tauri-apps/api/event";
import { QueryClientProvider } from "@tanstack/react-query";
import { RouterProvider } from "@tanstack/react-router";
import { Hexagon } from "lucide-react";
@@ -39,16 +40,26 @@ import { StepProgress } from "@/shared/ui/step-progress";
const LOADING_TEXT = "Setting up your workspace...";
// Minimum time the cold-boot splash stays on screen. A real boot resolves the
// workspace in well under 100ms, and the hidden Tauri window (visible:false
// until getCurrentWindow().show()) takes longer than that to put its first
// frame on screen — without a hold, the bee is unmounted before it is ever
// visible. The hold runs as an overlay above the already-mounted app, so
// workspace in well under 100ms, and the native window setup plus first paint
// can take longer than that — without a hold, the bee is unmounted before it is
// ever visible. The hold runs as an overlay above the already-mounted app, so
// time-to-interactive is unchanged; only the reveal waits.
const BOOT_SPLASH_MIN_VISIBLE_MS = 1_200;
const BOOT_SPLASH_FADE_MS = 200;
const INITIAL_RENDER_READY_EVENT = "initial-render-ready";
type BootSplashPhase = "holding" | "fading" | "done";
function useInitialRenderReady() {
useLayoutEffect(() => {
if (!isTauri()) {
return;
}
void emit(INITIAL_RENDER_READY_EVENT);
}, []);
}
// E2E runs skip the hold (it would slow every spec's boot and block pointer
// actionability); a spec can opt back in via __BUZZ_E2E__.bootSplashHoldMs.
function bootSplashHoldMs(): number {
@@ -323,10 +334,7 @@ export function App() {
// Mounted at the root so Cmd/Ctrl+R reloads in every app state,
// including the loading and first-run setup screens below.
useReloadShortcut();
useLayoutEffect(() => {
void getCurrentWindow().show();
}, []);
useInitialRenderReady();
const [sharedIdentity, setSharedIdentity] = useState<boolean | null>(null);
useEffect(() => {

View File

@@ -65,11 +65,11 @@ export function AppTopChrome({
}: AppTopChromeProps) {
const topChromeRef = React.useRef<HTMLDivElement>(null);
const isFullscreen = useIsFullscreen();
// On macOS the traffic-light buttons overlay the chrome (see
// `trafficLightPosition` in `tauri.conf.json`), so the nav row clears their
// x-position. When the workspace rail is present it already occupies the far
// left, so the nav row only needs to clear the lights past the rail edge
// rather than the full offset. In fullscreen those buttons hide.
// On macOS the native traffic-light buttons overlay the chrome, so the nav
// row clears their x-position. When the workspace rail is present it already
// occupies the far left, so the nav row only needs to clear the lights past
// the rail edge rather than the full offset. In fullscreen those buttons
// hide.
//
// Fixed px on purpose: the native traffic lights do not scale with the app's
// Cmd +/- text zoom (rem), so rem-based clearance shrinks under them when
@@ -80,7 +80,7 @@ export function AppTopChrome({
? "pl-[32px]"
: "pl-[80px]"
: "pl-3";
const navRowAlignmentClass = macChrome ? "translate-y-[3px]" : null;
const navRowAlignmentClass = macChrome ? "-translate-y-[4px]" : null;
React.useEffect(() => {
const topChrome = topChromeRef.current;

View File

@@ -246,7 +246,7 @@ export function MessageReactions({
return (
<div
className={cn(
"group/reactions mt-1.5 flex flex-wrap items-center gap-1.5 pt-1",
"group/reactions mt-1.5 flex flex-wrap items-center gap-1.5",
className,
)}
data-testid="message-reactions"