Skip to content

fix(issue-details): Keep sticky event nav below page frame#113401

Merged
priscilawebdev merged 5 commits into
masterfrom
priscilawebdev/fix/page-frame-issue-details-sticky-nav
Apr 21, 2026
Merged

fix(issue-details): Keep sticky event nav below page frame#113401
priscilawebdev merged 5 commits into
masterfrom
priscilawebdev/fix/page-frame-issue-details-sticky-nav

Conversation

@priscilawebdev

@priscilawebdev priscilawebdev commented Apr 20, 2026

Copy link
Copy Markdown
Member

Keep the issue details sticky event nav below the new page frame top bar.

This PR is stacked on nm/nav/topbar-offset and reuses the shared useTopOffset() logic from that branch instead of duplicating the page-frame offset math in issue details.

For issue details specifically, this updates the sticky event nav to:

  • use contentTop for the page-frame top offset
  • keep section scroll margins aligned with the visible sticky chrome
  • keep the legacy mobile top bar fallback when page frame is disabled

Before

Screen.Recording.2026-04-20.at.11.27.43.mov

After

Screen.Recording.2026-04-20.at.11.28.44.mov

Closes DE-1160

Use a local issue-details offset helper so the sticky event nav sits below the page frame top bar and keeps section scroll margins aligned.

This issue only affects issue details today, so keep the offset logic local instead of introducing a broader navigation abstraction before another page needs it.

Refs DE-1160
Co-Authored-By: Codex GPT-5 <noreply@openai.com>
@linear-code

linear-code Bot commented Apr 20, 2026

Copy link
Copy Markdown

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 20, 2026
Drop the focused hook spec added during the sticky nav fix follow-up.

Keep the production change only and leave the PR scoped to the issue-details offset behavior update itself.

Refs DE-1160
Co-Authored-By: Codex GPT-5 <noreply@openai.com>

@TkDodo TkDodo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just an FYI, @natemoo-re has a PR that does something similar to useTopOffset:

@priscilawebdev
priscilawebdev changed the base branch from master to nm/nav/topbar-offset April 20, 2026 08:58
@priscilawebdev
priscilawebdev force-pushed the priscilawebdev/fix/page-frame-issue-details-sticky-nav branch from e024de8 to 903ee46 Compare April 20, 2026 09:05
@priscilawebdev
priscilawebdev force-pushed the priscilawebdev/fix/page-frame-issue-details-sticky-nav branch from 903ee46 to 6f6239f Compare April 20, 2026 09:11
@priscilawebdev

Copy link
Copy Markdown
Member Author

Just an FYI, @natemoo-re has a PR that does something similar to useTopOffset:

Thank you! I could reuse his changes 🙌

@priscilawebdev
priscilawebdev requested review from a team and TkDodo April 20, 2026 09:29
@priscilawebdev
priscilawebdev marked this pull request as ready for review April 20, 2026 09:29
@priscilawebdev
priscilawebdev requested a review from a team as a code owner April 20, 2026 09:29
Comment thread static/app/views/issueDetails/streamline/eventDetails.tsx Outdated
@natemoo-re
natemoo-re force-pushed the nm/nav/topbar-offset branch from 5b7f9cc to 18a3487 Compare April 20, 2026 15:06

@natemoo-re natemoo-re left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Could be nice to refactor out some of the logic and use the existing Sticky component, but not a blocker. I'm going to merge #113298 so you should be able to rebase against master.

});
}, [nav, isScreenMedium, dispatch, sidebarHeight]);
}, [nav, dispatch, stickyTopOffset]);

return (
<FloatingEventNavigation

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance we could refactor this to wrap it in static/app/components/sticky.tsx? That already encapsulates the pinning logic.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can address that in a follow-up PR 😉

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Base automatically changed from nm/nav/topbar-offset to master April 20, 2026 15:32
Reuse the shared top-offset logic introduced by the page frame navigation work so issue details consumes the same source of truth for sticky positioning.

This removes the local sticky offset helper, makes contentTop carry the legacy mobile fallback when page frame is disabled, and lets issue details consume the shared value directly for both sticky position and scroll margin math.
…page-frame-issue-details-sticky-nav

# Conflicts:
#	static/app/views/navigation/useTopOffset.tsx
@priscilawebdev
priscilawebdev force-pushed the priscilawebdev/fix/page-frame-issue-details-sticky-nav branch from 2fd8380 to 64a8923 Compare April 21, 2026 06:03
Comment thread static/app/views/navigation/useTopOffset.tsx
Comment thread static/app/views/issueDetails/streamline/eventDetails.tsx Outdated
@priscilawebdev
priscilawebdev force-pushed the priscilawebdev/fix/page-frame-issue-details-sticky-nav branch from 62c6043 to 64a8923 Compare April 21, 2026 07:00
@priscilawebdev
priscilawebdev enabled auto-merge (squash) April 21, 2026 07:02
@priscilawebdev
priscilawebdev merged commit 1839405 into master Apr 21, 2026
65 checks passed
@priscilawebdev
priscilawebdev deleted the priscilawebdev/fix/page-frame-issue-details-sticky-nav branch April 21, 2026 07:12

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit def3b4f. Configure here.

}

function StickyEventNav({event, group}: {event: Event; group: Group}) {
const theme = useTheme();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stuck detection broken with non-zero sticky top offset

Medium Severity

useIsStuck(nav) is called without an offset option, but the element now sticks at a non-zero top value (stickyTopOffset, e.g. 53px on desktop with page frame). The useIsStuck hook uses an IntersectionObserver with rootMargin: '-1px 0px 0px 0px' (offset defaults to 0), which only detects sticking when the element's top edge crosses 1px from the viewport top. Since the element now sticks at 53px, it never crosses that boundary, so isStuck is always false and data-stuck is never "true". The &[data-stuck='true'] border-radius removal never triggers. The sticky.tsx component correctly passes the offset to useIsStuck — this call needs the same treatment.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit def3b4f. Configure here.

priscilawebdev added a commit that referenced this pull request Apr 22, 2026
Follow-up to [this review
comment](#113401 (comment))
on #113401: wrap the sticky event nav in the shared `Sticky` component
from `sentry/components/sticky` instead of hand-rolling the pinning
logic with `position: sticky` + `useIsStuck`.

To make `Sticky` a true self-contained primitive, this also makes
`--top-bar-height` unconditional in `TopBar`: the CSS variable is now
set from `useTopOffset`'s `contentTop` regardless of the page frame
feature, so `Sticky`'s `top: var(--top-bar-height, 0px)` works as a
single source of truth across desktop/mobile and page-frame-on/off
(including the legacy mobile top bar fallback). Consumers no longer need
to pass an inline `top` style, and the inline style here is dropped.
`useTopOffset` is still consumed in `StickyEventNav` for the
scroll-margin math.

Refs DE-1160
@github-actions github-actions Bot locked and limited conversation to collaborators May 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants