fix(learn): track location.hash reactively instead of freezing it in useState#129
Merged
fix(learn): track location.hash reactively instead of freezing it in useState#129
Conversation
Agent-Logs-Url: https://github.com/ut-code/hitori-mahjong/sessions/f631166b-5d09-4665-944f-8859f3bf899a Co-authored-by: tknkaa <145080781+tknkaa@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix hash tracking logic in learn routes
fix(learn): track location.hash reactively instead of freezing it in useState
Apr 13, 2026
tknkaa
requested changes
Apr 13, 2026
Contributor
tknkaa
left a comment
There was a problem hiding this comment.
最初チュートリアルページに飛んだときは、ハッシュが無い状態であってほしい。
Agent-Logs-Url: https://github.com/ut-code/hitori-mahjong/sessions/d1cd6786-2f4a-4a1f-b011-a72fb1586c0a Co-authored-by: tknkaa <145080781+tknkaa@users.noreply.github.com>
Contributor
Author
6cf131f で |
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.
useState(location.hash)captured the hash once at mount, so navigating between#basicand#localnever updated the sidebar's active highlight. SSR/hydration could also produce a mismatch since the initial server-rendered hash is empty.Changes
app/routes/learn.tsx: Replace frozen state with a live derivation fromuseLocation():useStateimport.#basicor#local.Original prompt
This pull request was created from Copilot chat.