Skip to content

🐛 Reset note detail scroll on route changes#247

Merged
baealex merged 1 commit into
mainfrom
fix/note-detail-scroll-reset
Jul 11, 2026
Merged

🐛 Reset note detail scroll on route changes#247
baealex merged 1 commit into
mainfrom
fix/note-detail-scroll-reset

Conversation

@baealex

@baealex baealex commented Jul 6, 2026

Copy link
Copy Markdown
Owner

🎯 Goal

  • Prevent detail pages from inheriting the previous list scroll position when navigating from a scrolled note list.
  • Keep route-specific scroll restoration for paths that already have a saved position.

🛠️ Core Changes

  • Reset the parent scroll container to the top when the next route has no saved scroll position.
  • Added coverage for resetting new routes and restoring previously saved routes.

🧠 Key Decisions

  • Kept the existing path-based scroll memory behavior.
  • Changed only the missing fallback behavior so new routes start at the top instead of reusing the current container position.

🧪 Verification Guide

How to verify

  1. Run pnpm --filter @ocean-brain/client lint.
  2. Run pnpm --filter @ocean-brain/client type-check.
  3. Run pnpm --filter @ocean-brain/client test -- RestoreParentScroll.spec.tsx --run.

Expected result

  • Lint passes.
  • Type-check passes.
  • Scroll restoration tests pass.

✅ Checklist

  • Lint completed
  • Type-check completed
  • Tests completed
  • Documentation updated (if needed)

@baealex baealex merged commit 19ba2ab into main Jul 11, 2026
6 checks passed
@baealex baealex deleted the fix/note-detail-scroll-reset branch July 11, 2026 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant