Skip to content

Commit 9b66581

Browse files
committed
fix(web): keep the reader at the top when the pull request chrome reopens
1 parent 2e832b7 commit 9b66581

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,11 +1325,10 @@ export function PullRequestDetailPanel({
13251325
// scrollport actually gains is the difference between the two.
13261326
const chromeDelta = foldHeight - (condensedRowRef.current?.scrollHeight ?? 0);
13271327
if (previous) {
1328-
// The hard top reopens the chrome. The refund puts the reader a fold's height
1329-
// from the top, pinned to the same pixels — the metadata is scrolled up to,
1330-
// not thrown at them.
1328+
// The hard top reopens the chrome with no refund: the reader asked for the top,
1329+
// and moving them a fold's height back down would snatch it away — the fold
1330+
// slides in above while the content stays where they left it.
13311331
if (top < 4 && foldHeight > 0) {
1332-
compensationRef.current = chromeDelta;
13331332
next = false;
13341333
}
13351334
} else if (foldHeight > 0 && top > foldHeight + 32) {

0 commit comments

Comments
 (0)