Skip to content

Fix #r- links opened by a hash change on a loaded page - #21

Open
radroid wants to merge 1 commit into
mainfrom
fix/hash-jump
Open

radroid wants to merge 1 commit into
mainfrom
fix/hash-jump

Conversation

@radroid

@radroid radroid commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Found while checking production after #20.

Bug. With the page already open, changing the hash to a resume line did nothing when smooth motion is on. That covers pasting curlycloud.dev/#r-… into the address bar and going back or forward between hashes. The line's role opened, but the page stayed where it was. Fresh loads, citations, stars and "source:" links go through focusAnchor directly and weren't affected. Reduced motion and Saver weren't affected either.

Cause. For a hash inside a closed <details>, Chrome opens it before hashchange fires and runs the open animation. reveal() saw the <details> as already open, so it skipped turning transitions off. The content was still content-visibility: hidden mid-animation, so scrollIntoView had nothing to scroll to.

Fix. reveal() now always sets data-jump for the enclosing disclosures. That also finishes an open that is already running.

Checked on bun run preview, motion High:

  • A hash change to each of the 44 #r-… lines lands the line on screen. On production today it doesn't.
  • A fresh deep link and a numbers "source:" click still work.
  • bun run typecheck is clean; bun run test has 748 passing.

🤖 Generated with Claude Code

When the URL's hash points inside a closed <details>, Chrome opens it
before hashchange fires and animates the open. reveal() saw it as
already open and skipped the no-transition switch, so the line was
still hidden (content-visibility) when the smooth scroll started, and
the page didn't move. reveal() now always turns transitions off for the
enclosing disclosures, which also finishes an open in progress.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 28, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 86a80410-b5d9-416d-aa8c-a65b379853ee

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

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

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
raj-portfolio 5e66902 Sep 28 2026, 01:07 AM

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