-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(develop-docs): Restore old header and fix sidebar collapse on sub-pages #16641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
stephanie-anderson
merged 8 commits into
master
from
fix/develop-docs-header-and-sidebar
Mar 2, 2026
+186
−7
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b74fcb1
fix(develop-docs): Restore old header and fix sidebar collapse on sub…
stephanie-anderson bda9589
[getsentry/action-github-commit] Auto commit
getsantry[bot] 4e6432e
fix(develop-docs): Replace MobileMenu with inline menu showing only e…
stephanie-anderson 0a25c4b
[getsentry/action-github-commit] Auto commit
getsantry[bot] f60f51b
Merge branch 'master' into fix/develop-docs-header-and-sidebar
stephanie-anderson a51a5da
fix(develop-docs): Use md breakpoint for hamburger and mobile menu
stephanie-anderson 0ac3c06
fix(develop-docs): Fix mobile menu breakpoint gap and hamburger acces…
stephanie-anderson 78beb7d
Merge branch 'master' into fix/develop-docs-header-and-sidebar
stephanie-anderson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,173 @@ | ||
| 'use client'; | ||
|
|
||
| import {HamburgerMenuIcon, TriangleRightIcon} from '@radix-ui/react-icons'; | ||
| import * as Popover from '@radix-ui/react-popover'; | ||
| import {Box, Button, Theme} from '@radix-ui/themes'; | ||
| import dynamic from 'next/dynamic'; | ||
| import Image from 'next/image'; | ||
| import Link from 'next/link'; | ||
|
|
||
| import SentryLogoSVG from 'sentry-docs/logos/sentry-logo-dark.svg'; | ||
|
|
||
| import mobileMenuStyles from './mobileMenu/styles.module.scss'; | ||
| import sidebarStyles from './sidebar/style.module.scss'; | ||
|
|
||
| import {NavLink} from './navlink'; | ||
| import {ThemeToggle} from './theme-toggle'; | ||
|
|
||
| // Lazy load Search to reduce initial bundle size. | ||
| const Search = dynamic(() => import('./search').then(mod => ({default: mod.Search})), { | ||
| ssr: false, | ||
| loading: () => ( | ||
| <div className="h-10 w-full max-w-md rounded-lg border border-[var(--gray-a5)] bg-[var(--gray-2)] animate-pulse" /> | ||
| ), | ||
| }); | ||
|
|
||
| export const developerDocsSidebarToggleId = sidebarStyles['navbar-menu-toggle']; | ||
|
|
||
| type Props = { | ||
| pathname: string; | ||
| searchPlatforms: string[]; | ||
| noSearch?: boolean; | ||
| useStoredSearchPlatforms?: boolean; | ||
| }; | ||
|
|
||
| export function DevelopDocsHeader({ | ||
| pathname, | ||
| searchPlatforms, | ||
| noSearch, | ||
| useStoredSearchPlatforms, | ||
| }: Props) { | ||
| return ( | ||
| <header className="bg-[var(--gray-1)] h-[var(--header-height)] w-full z-50 border-b border-[var(--gray-a3)] fixed top-0"> | ||
| {/* define a header-height variable for consumption by other components */} | ||
| <style>{':root { --header-height: 80px; }'}</style> | ||
| <nav className="nav-inner mx-auto px-3 py-2 flex items-center"> | ||
| {pathname !== '/' && ( | ||
| <button className="md:hidden mr-3"> | ||
| <label | ||
| htmlFor={developerDocsSidebarToggleId} | ||
| aria-label="Toggle sidebar navigation" | ||
| className="inline-flex items-center cursor-pointer" | ||
| > | ||
| <HamburgerMenuIcon | ||
| className="inline dark:text-[var(--foreground)] text-[var(--gray-10)]" | ||
| strokeWidth="1.8" | ||
| width="22" | ||
| height="22" | ||
| /> | ||
| </label> | ||
| </button> | ||
cursor[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| )} | ||
| <Link | ||
| href="/" | ||
| title="Sentry error monitoring" | ||
| className="logo-slot flex flex-shrink-0 items-center lg-xl:w-[calc(var(--sidebar-width,300px)-2rem)] text-2xl font-medium text-[var(--foreground)]" | ||
| > | ||
| <div className="h-full pb-[6px]"> | ||
| <Image | ||
| src={SentryLogoSVG} | ||
| alt="Sentry's logo" | ||
| width={40} | ||
| className="h-16 dark:invert" | ||
| /> | ||
| </div> | ||
| Docs | ||
| </Link> | ||
| {!noSearch && ( | ||
| <div className="hidden md:flex justify-center lg-xl:justify-start max-w-md w-full px-6"> | ||
| <Search | ||
| path={pathname} | ||
| searchPlatforms={searchPlatforms} | ||
| showChatBot | ||
| useStoredSearchPlatforms={useStoredSearchPlatforms} | ||
| /> | ||
| </div> | ||
| )} | ||
| <div className="hidden lg-xl:flex justify-end flex-1 gap-6 items-center min-w-fit"> | ||
| <NavLink href="https://sentry.io/changelog/">Changelog</NavLink> | ||
| <NavLink href="https://sandbox.sentry.io/">Sandbox</NavLink> | ||
| <NavLink href="https://sentry.io/">Go to Sentry</NavLink> | ||
| <NavLink | ||
| href="https://sentry.io/signup/" | ||
| className="transition-all duration-300 ease-in-out hover:bg-gradient-to-r hover:from-[#fa7faa] hover:via-[#ff9691] hover:to-[#ffb287]" | ||
| > | ||
| Get Started | ||
| </NavLink> | ||
| <ThemeToggle /> | ||
cursor[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </div> | ||
| <div className="lg-xl:hidden ml-auto"> | ||
| <div className="flex gap-6 items-center"> | ||
| <Popover.Root> | ||
| <Popover.Trigger asChild> | ||
| <Button | ||
| variant="ghost" | ||
| size="4" | ||
| color="gray" | ||
| radius="medium" | ||
| className="font-medium text-[var(--foreground)]" | ||
| > | ||
| Menu | ||
| <TriangleRightIcon /> | ||
| </Button> | ||
| </Popover.Trigger> | ||
| <Popover.Portal> | ||
| <Theme accentColor="iris"> | ||
| <Popover.Content | ||
| className={mobileMenuStyles.PopoverContent} | ||
| sideOffset={5} | ||
| > | ||
| <Box display={{xs: 'block', sm: 'none'}}> | ||
| <li className={mobileMenuStyles.MenuItem}> | ||
| <Search path={pathname} searchPlatforms={searchPlatforms} /> | ||
| </li> | ||
| <div className={mobileMenuStyles.MenuSeparator} /> | ||
| </Box> | ||
| <li className={mobileMenuStyles.MenuItem}> | ||
| <Link href="https://sentry.io/changelog/">Changelog</Link> | ||
| </li> | ||
| <li className={mobileMenuStyles.MenuItem}> | ||
| <Link href="https://sandbox.sentry.io/">Sandbox</Link> | ||
| </li> | ||
| <li className={mobileMenuStyles.MenuItem}> | ||
| <Link href="https://sentry.io/">Go to Sentry</Link> | ||
| </li> | ||
| <li className={mobileMenuStyles.MenuItem}> | ||
| <Link href="https://sentry.io/signup/">Get Started</Link> | ||
| </li> | ||
| </Popover.Content> | ||
| </Theme> | ||
| </Popover.Portal> | ||
| </Popover.Root> | ||
| </div> | ||
| </div> | ||
cursor[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </nav> | ||
| <style>{` | ||
| /* Align header width with content + sidebars at wide screens */ | ||
| @media (min-width: 2057px) { | ||
| header .nav-inner { | ||
| /* total layout width = sidebar + gap + content + gap + toc */ | ||
| max-width: calc( | ||
| var(--sidebar-width, 300px) | ||
| + var(--gap, 24px) | ||
| + var(--doc-content-w, 1200px) | ||
| + var(--gap, 24px) | ||
| + var(--toc-w, 250px) | ||
| ); | ||
| margin-left: auto; | ||
| margin-right: auto; | ||
| /* center, then compensate if sidebar != toc */ | ||
| transform: translateX(calc((var(--toc-w, 250px) - var(--sidebar-width, 300px)) / 2)); | ||
| /* restore small internal padding (≈ Tailwind px-3) */ | ||
| padding-left: 0.75rem; | ||
| padding-right: 0.75rem; | ||
| } | ||
| /* Ensure the left logo area equals sidebar width */ | ||
| header .nav-inner .logo-slot { | ||
| width: var(--sidebar-width, 300px); | ||
| } | ||
| } | ||
| `}</style> | ||
| </header> | ||
| ); | ||
| } | ||
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.