Skip to content

Tokibean 码豆 0.4.6

Choose a tag to compare

@github-actions github-actions released this 13 Jul 02:24

Release v0.4.6: fix pet jumping when the panel opens (macOS)

Clicking the pet made it flash ~197px up and snap back before the panel
appeared, and the panel's top rows (billing badge + mode select) were clipped.

Cause: macOS resized the window on open, and any resize that moves the window's
TOP edge shows one stale webview frame — the window geometry lands immediately
but WKWebView keeps painting the old layout for a frame, so the pet is drawn at
its old offset-from-top, i.e. (fullH - collapsedH) px too high. Making the
move+resize atomic (set_window_rect) does not help: the stale frame is the
webview's, not the window's. Windows had already solved this by pre-allocating
the full height and never resizing; macOS now does the same.

  • main.rs: pre-allocate FULL_H on macOS too, restore from the layout-independent
    pet anchor (pet_anchor_y, migrated from the old window top-left), keep the
    anchor correct in the Moved backstop, and use the pet-strip click-through rule.
  • main.js: split IS_WIN_DRAG into PREALLOC (Win+mac layout) and IS_WIN_DRAG
    (Windows manual drag only).
  • style.css: #panel gets flex: none — the flex column shrank it inside the still
    collapsed window, so the measured height was too small and the panel's top rows
    were clipped.

Verified frame-by-frame with a 60fps screen recording driven by a real OS click:
pet's on-screen position is now constant across open and close (was 197px up for
one frame).