Repository navigation
Conversation
Contributor
Code Metrics Report
Details | | main (d8d4ec3) | #602 (4194321) | +/- |
|---------------------|----------------|----------------|-------|
+ | Coverage | 88.6% | 88.6% | +0.0% |
| Files | 208 | 208 | 0 |
| Lines | 6263 | 6260 | -3 |
- | Covered | 5552 | 5551 | -1 |
+ | Test Execution Time | 1m53s | 1m31s | -22s |Code coverage of files in pull request scope (90.4% → 100.0%, patch 100.0%)
Reported by octocov |
IzumiSy
marked this pull request as ready for review
October 13, 2026 04:37
Contributor
Author
|
/review |
Contributor
|
✅ Code Review completed successfully! Code review complete for PR #602 package changes. No actionable High/Medium issues found in the packages/** diff, so no inline review comment was needed.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The sidebar's mobile and tablet hooks currently subscribe to
matchMediaand copy the viewport into React state through effects. Both initially returnfalse, so client-only rendering starts with desktop assumptions even when the actual viewport is mobile or tablet.The effects synchronously update the viewport state after the first commit, triggering an additional render solely to copy a browser-owned value into React state.
This extracts the responsive-hook changes from #525 into an independent PR based on
main, without the lint upgrade or the other state-ownership changes.Design Decision
Subscribe directly to the browser-owned viewport
Use
useSyncExternalStorein the two existing hooks, retaining their currentinnerWidthpredicates and media-query subscriptions. Module-level subscription functions remain stable across rerenders and remove the same listeners on unmount. No shared hook abstraction or public API is added.Preserve server rendering and hydration
Both server snapshots remain
false. Server rendering and the first hydration render therefore retain the existing desktop fallback; client-only rendering reads the actual viewport immediately.The desktop Sidebar test fixture moves from 1024px, which lies in the tablet range, to 1200px. A separate 1024px assertion retains coverage of the tablet icon rail rather than relying on the temporary desktop fallback.
Summary