Skip to content

Conversation

@birkskyum
Copy link
Member

@birkskyum birkskyum commented Sep 29, 2025

This test was disabled here:

349e407

Summary by CodeRabbit

  • Bug Fixes

    • Restores scroll position reliably after navigation within views using virtualized content.
    • Ensures the correct scrolling container is detected, preventing lost or incorrect scroll positions.
    • Improves consistency of scroll behavior across route transitions.
  • Refactor

    • Simplifies how scroll containers are referenced to better match framework conventions, reducing edge-case failures.
  • Chores

    • Minor internal adjustments to improve stability around scroll handling in examples.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 29, 2025

Walkthrough

Refactors scroll element handling in e2e/solid-router/basic-scroll-restoration/src/main.tsx by replacing a null-based ref placeholder with a mutable HTMLDivElement reference and updating the virtualizer’s getScrollElement to directly return the element or null, aligning with Solid’s element-ref usage.

Changes

Cohort / File(s) Summary
Ref handling for virtualizer scroll element
e2e/solid-router/basic-scroll-restoration/src/main.tsx
Replaces const null ref with mutable HTMLDivElement reference; updates getScrollElement to return the element or null directly instead of accessing .current; aligns ref={virtualizerParentRef} with Solid element-ref semantics.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

package: solid-router

Poem

A rabbit peeks at scroll’s domain,
Ref hops from null to truth, so plain.
The virtualizer finds its tree,
Direct and tidy—let it be.
With gentle paws and element grace,
Smooth restoration takes its place. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "tests(solid-router): Enable e2e scroll restoration test" clearly indicates the main intent of re-enabling a previously disabled end-to-end test. While the actual code changes involve refactoring how the virtualizer parent ref is managed (switching from a constant null-based placeholder to a mutable element reference and updating the ref semantics), these implementation changes appear to be the technical work necessary to fix and re-enable the test. The title accurately captures the developer's primary objective and what a teammate would want to know when scanning the commit history, even though it doesn't detail the specific refactoring work involved.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch enabled-solid-rotuer-e2e-scroll-restoration-test

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f382bd2 and 9d7cc94.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • e2e/solid-router/basic-scroll-restoration/src/main.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript in strict mode with extensive type safety across the codebase

Files:

  • e2e/solid-router/basic-scroll-restoration/src/main.tsx
e2e/**

📄 CodeRabbit inference engine (AGENTS.md)

Store end-to-end tests under the e2e/ directory

Files:

  • e2e/solid-router/basic-scroll-restoration/src/main.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Preview
  • GitHub Check: Test
🔇 Additional comments (2)
e2e/solid-router/basic-scroll-restoration/src/main.tsx (2)

117-117: Excellent type safety improvement!

The change from const virtualizerParentRef: any = null to let virtualizerParentRef: HTMLDivElement | undefined correctly:

  • Uses let to allow Solid's ref assignment mechanism
  • Replaces the unsafe any type with proper HTMLDivElement | undefined typing
  • Aligns with Solid's direct element-ref semantics (unlike React's ref objects)

120-120: Correct fix for Solid ref access!

Removing .current is the proper fix here—Solid refs are direct element references, not ref objects like React. The ?? null fallback appropriately handles the pre-mount undefined state.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🧪 Early access (Sonnet 4.5): enabled

We are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience.

Note:

  • Public repositories are always opted into early access features.
  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link

nx-cloud bot commented Sep 29, 2025

View your CI Pipeline Execution ↗ for commit 9d7cc94

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 6m 11s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1m 38s View ↗

☁️ Nx Cloud last updated this comment at 2025-09-29 20:26:26 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 29, 2025

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@5298

@tanstack/directive-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@5298

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@5298

@tanstack/history

npm i https://pkg.pr.new/TanStack/router/@tanstack/history@5298

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/nitro-v2-vite-plugin@5298

@tanstack/react-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@5298

@tanstack/react-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@5298

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-ssr-query@5298

@tanstack/react-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@5298

@tanstack/react-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@5298

@tanstack/react-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@5298

@tanstack/router-cli

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@5298

@tanstack/router-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@5298

@tanstack/router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@5298

@tanstack/router-devtools-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@5298

@tanstack/router-generator

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@5298

@tanstack/router-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@5298

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-ssr-query-core@5298

@tanstack/router-utils

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@5298

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@5298

@tanstack/server-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@5298

@tanstack/solid-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@5298

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@5298

@tanstack/solid-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@5298

@tanstack/solid-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@5298

@tanstack/solid-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@5298

@tanstack/start-client-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@5298

@tanstack/start-plugin-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@5298

@tanstack/start-server-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@5298

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-static-server-functions@5298

@tanstack/start-storage-context

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@5298

@tanstack/valibot-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@5298

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@5298

@tanstack/zod-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@5298

commit: 9d7cc94

@birkskyum birkskyum merged commit 581941a into main Sep 29, 2025
6 checks passed
@birkskyum birkskyum deleted the enabled-solid-rotuer-e2e-scroll-restoration-test branch September 29, 2025 20:34
@birkskyum birkskyum added this to the catch up solid to react milestone Oct 29, 2025
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.

3 participants