Skip to content

fix: open a reply's page on the reply instead of the top of its thread - #1606

Open
kachelle wants to merge 2 commits into
dev-null-sh:productionfrom
kachelle:fix/scroll-to-linked-commit
Open

kachelle wants to merge 2 commits into
dev-null-sh:productionfrom
kachelle:fix/scroll-to-linked-commit

Conversation

@kachelle

@kachelle kachelle commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Opening a reply deep in a thread now scrolls the reply itself on screen, with the end of its parent just above it. Back, Forward, reloads, #anchors and opening a photo keep their position.

Visual evidence

Before: live dev-null.sh, the reply from the linked thread, as a guest. After: local, a 10-commit test thread, opening step 10. Headless Chromium at 2x.

Before After
Desktop (dark) before desktop after desktop
Phone (light) before phone after phone

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Opening a commit page scrolls to the focused commit, with its parent positioned just above it when available.
    • Back and Forward navigation preserve your reading position. The page also avoids changing your position when an anchor or photo is open.
  • Documentation
    • Updated the guidance for navigating replies and threads to describe commit-page scrolling and position preservation.

A commit's page lists its ancestors above it, so a reply deep in a thread opened off screen. A fresh visit now scrolls the opened commit under the header with the end of its parent above it. Back, Forward, reloads, anchors and opening a photo keep their position.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Eligible navigation events on commit pages now scroll the focused commit to the top. The helper skips scrolling for specified page states and navigation types. Unit tests cover these conditions, and the knowledge base describes the behavior.

Changes: Focused commit positioning

Layer / File(s) Summary
Navigation-triggered commit scrolling
resources/js/lib/focused-commit-scroll.ts, resources/js/app.tsx, tests/Unit/FocusedCommitScroll.test.ts, KNOWLEDGE_BASE.md
The helper scrolls the matching commit to the top for eligible visit and initial navigation events. It skips scrolling when ancestors are absent, a photo or URL hash is present, the page is not commit/show, or navigation is a reload or back/forward event. The app passes Inertia navigation events to the helper. Tests cover these conditions, and the knowledge base documents commit positioning and history navigation.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant Inertia
  participant scrollToFocusedCommit
  participant CommitDOM
  Inertia->>scrollToFocusedCommit: navigate event details
  scrollToFocusedCommit->>CommitDOM: scroll matching commit to top when eligible
Loading

Possibly related issues

  • Issue 979 reports that opening a reply in a long thread places the target commit at the bottom of the page. This change addresses the same commit-positioning behavior.

Suggested reviewers: mnapoli, xheaven

Merge Risk: Minimal · up to dba47

Opening a commit page from a reply now scrolls to that reply, and Back, Forward, reload, anchors, and photo views keep their position. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix: open a reply's page on the reply instead of the top of its thread" matches the main change. The summaries add scrollToFocusedCommit for commit/show pages, which scrolls the focused com…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix: open a reply's page on the reply instead of the top of its thread" matches the main change. The summaries add scrollToFocusedCommit for commit/show pages, which scrolls the focused commit into view with its parent just above it, and the PR objectives describe the same behavior. The title is short, specific, and uses a conventional fix: prefix. It does not cover the tests or documentation update, which is acceptable.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f60eddfd-25bf-4f8b-a9ff-7f946f932099
Commits

Reviewing files that changed from the base of the PR and between cb05ffd and dba473a.

Files selected for processing: 1

  • KNOWLEDGE_BASE.md
Files skipped from review as they are similar to previous changes: 1

  • KNOWLEDGE_BASE.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@kachelle
kachelle marked this pull request as ready for review November 17, 2026 22:45
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