Skip to content

feat(ui): add page enter transition and instant sidebar feedback - #207

Open
simciudev wants to merge 1 commit into
coollabsio:mainfrom
simciudev:main
Open

simciudev wants to merge 1 commit into
coollabsio:mainfrom
simciudev:main

Conversation

@simciudev

Copy link
Copy Markdown

What

Navigating between dashboard pages swapped content with no motion, and the sidebar only highlighted the destination after the server responded, so clicks felt unacknowledged.

Accounts.-.Shoutrrr.-.Aside.Window.2026-11-28.08.14.PM.mp4

Changes

  • Page enter transition (PageTransition): on a page change the content fades in and settles 8px from above (260ms, cubic-bezier(0.23, 1, 0.32, 1)). It uses WAAPI on the existing element instead of a keyed remount, so component state and focus are kept.
    • Skipped on first load, same-page visits (filters, polling), keyboard-driven navigation and under prefers-reduced-motion (fade only, no movement).
    • Between pages of one settings layout only the inner content pane animates, so the settings nav and heading stay still.
  • Instant sidebar feedback: useCurrentUrl tracks the in-flight GET visit, so the sidebar and settings navs highlight the destination as soon as it is clicked. Partial reloads and non-GET visits are ignored; the real page URL takes over when the visit finishes.
  • Sidebar menu buttons now transition background-color and color.
  • The Inertia progress bar is disabled (progress: false).

Notes for review

  • The enter offset is deliberately negative. main is overflow-x-hidden, which makes it a scroll container on both axes, so a downward translateY (even 4px) overflows it and flashes a scrollbar that shifts the layout by ~15px. There is a one-line comment at PAGE_ENTER_OFFSET_PX.
  • Frontend only, no PHP or dependency changes.

Testing

  • tsc --noEmit, oxlint and oxfmt --check: clean.
  • New unit tests for the animation decision logic (lib/navigation/__tests__/page-transition.test.ts): 15 tests in lib/navigation pass.
  • Checked in a browser on a production build: during navigation the header and sidebar do not move, the content wrapper starts at opacity: 0 and translateY(-8px), and main has no vertical overflow (no scrollbar flash).
  • Full vitest run: 967 of 969 pass. The 2 failures are unrelated to this change: inertia-cache-policy hit its 5s timeout on a slow bind mount (no offending code found), and build-feedback-payload expects application/json but gets application/json;charset=utf-8.

- Fade and settle page content on navigation (PageTransition), skipped for
  first load, same-page visits, keyboard-driven navigation and sibling
  settings pages.
- Highlight the destination in sidebar and settings navs as soon as a GET
  visit starts.
- Transition sidebar button background and text color.
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