diff --git a/src/components/dynamicNav.tsx b/src/components/dynamicNav.tsx
index 8c58a61fe1b2e..a7061c75e6daf 100644
--- a/src/components/dynamicNav.tsx
+++ b/src/components/dynamicNav.tsx
@@ -1,5 +1,3 @@
-import {Fragment} from 'react';
-
import {serverContext} from 'sentry-docs/serverContext';
import {sortPages} from 'sentry-docs/utils';
import {getUnversionedPath, VERSION_INDICATOR} from 'sentry-docs/versioning';
@@ -100,8 +98,35 @@ type ChildrenProps = {
showDepth?: number;
};
-export function Children({tree, path, exclude = [], showDepth = 0}: ChildrenProps) {
- return {renderChildren(tree, exclude, path, showDepth)};
+function TopLevelChildren({tree, path, exclude = [], showDepth = 0}: ChildrenProps) {
+ return sortPages(
+ tree.filter(
+ ({name, node}) =>
+ node &&
+ !!node.context.title &&
+ name !== '' &&
+ exclude.indexOf(node.path) === -1 &&
+ !node.context.sidebar_hidden
+ ),
+ ({node}) => node!
+ ).map(({node, children: nodeChildren}) => {
+ // will not be null because of the filter above
+ if (!node) {
+ return null;
+ }
+ return (
+
+ {renderChildren(nodeChildren, exclude, path, showDepth, 1)}
+
+ );
+ });
}
type Props = {
@@ -171,12 +196,12 @@ export function DynamicNav({
activeClassName="active"
data-sidebar-link
>
-
{title}
+ {title}
{withChevron && }
) : (
-
{title}
+ {title}
);
@@ -184,12 +209,12 @@ export function DynamicNav({
{header}
{(!collapse || isActive) && entity.children && (
-
+
{prependLinks &&
prependLinks.map(link => (
))}
-
-
-
Related Guides
-
+ Related Guides
{currentPlatform.guides.map(guide => (
-
diff --git a/src/components/search/index.tsx b/src/components/search/index.tsx
index c18c91004ad60..ee412adaa7826 100644
--- a/src/components/search/index.tsx
+++ b/src/components/search/index.tsx
@@ -345,10 +345,10 @@ export function Search({
>
-
+
Ask Sentry about{' '}
{query.length > 30 ? query.slice(0, 30) + '...' : query}
-
+
Get an AI-powered answer to your question
diff --git a/src/components/search/search.module.scss b/src/components/search/search.module.scss
index 2ebbce1c9d450..94d28ac749037 100644
--- a/src/components/search/search.module.scss
+++ b/src/components/search/search.module.scss
@@ -170,13 +170,6 @@
padding: 0;
}
- h6 {
- margin-top: 0;
- margin-bottom: 0.25rem;
- font-size: 0.875rem;
- color: var(--sgs-color-hit-text);
- }
-
a {
display: block;
text-decoration: none;
@@ -192,6 +185,12 @@
}
}
+.sgs-hit-title {
+ margin-bottom: 0.25rem;
+ font-size: 0.875rem;
+ color: var(--sgs-color-hit-text);
+}
+
.sgs-ai {
color: var(--sgs-color-hit-text);
padding: 0.25rem;
@@ -214,15 +213,17 @@
flex-direction: column;
align-items: flex-start;
flex: 1;
+ }
- h6 {
- font-size: 0.875rem;
- line-height: 1.25rem;
- margin: 0;
+ &-heading {
+ margin-bottom: 0.25rem;
+ font-size: 0.875rem;
+ color: var(--sgs-color-hit-text);
+ line-height: 1.25rem;
+ margin: 0;
- span {
- color: var(--sgs-color-hit-highlight);
- }
+ span {
+ color: var(--sgs-color-hit-highlight);
}
}
}
diff --git a/src/components/search/searchResultItems.tsx b/src/components/search/searchResultItems.tsx
index 06585d682751c..e8ad0870e82ec 100644
--- a/src/components/search/searchResultItems.tsx
+++ b/src/components/search/searchResultItems.tsx
@@ -67,7 +67,7 @@ export function SearchResultItems({
onClick={event => onSearchResultClick({event, hit, position: index})}
>
{hit.title && (
-
+
-
+
)}
{hit.text && (
- {node.frontmatter.sidebar_title || node.frontmatter.title}
+
+ {node.frontmatter.sidebar_title || node.frontmatter.title}
+
{renderChildren(node.children)}
diff --git a/src/components/sidebar/platformSidebar.tsx b/src/components/sidebar/platformSidebar.tsx
index e4e5654a7e6d5..11739674d2cc4 100644
--- a/src/components/sidebar/platformSidebar.tsx
+++ b/src/components/sidebar/platformSidebar.tsx
@@ -53,7 +53,6 @@ export function PlatformSidebar({
title={`Sentry for ${(guide || platform).title}`}
exclude={[`/${pathRoot}/guides/`]}
headerClassName={headerClassName}
- withChevron
/>
);
diff --git a/src/components/sidebar/style.module.scss b/src/components/sidebar/style.module.scss
index 997651ea59739..9eda2e623643b 100644
--- a/src/components/sidebar/style.module.scss
+++ b/src/components/sidebar/style.module.scss
@@ -69,6 +69,10 @@
border-top: 1px solid var(--border-color);
}
+ [data-sidebar-tree-root] > li > [data-sidebar-link] {
+ font-weight: 500;
+ }
+
.toc {
font-size: 0.875rem;
flex: 1;
@@ -89,7 +93,19 @@
padding-left: 0;
}
- :global(.toc-item) :global(.toc-item) {
+ [data-sidebar-tree-root] {
+ margin-bottom: 1rem;
+ }
+
+ [data-sidebar-tree-root] > [data-sidebar-branch-has-subtree='true']:not(:first-child) {
+ margin-top: 1rem;
+ }
+
+ [data-sidebar-tree-root] > [data-sidebar-branch-has-subtree='true']:not(:last-child) {
+ margin-bottom: 1rem;
+ }
+
+ :global(.toc-item) :global(.toc-item) :global(.toc-item) {
padding-left: 0.75rem;
}
@@ -100,23 +116,24 @@
[data-sidebar-link] {
position: relative;
line-height: 1.5;
- border-radius: 4px;
- padding: 0.5rem;
+ border-radius: 0;
+ padding: 0.1rem 0rem;
+ margin: 0.4rem 0;
opacity: 0.8;
text-decoration: none;
transition: var(--transition-time) ease-out;
+ border-left: 3px solid transparent;
&:hover {
opacity: 1;
- text-decoration: none;
- color: var(--sidebar-item-color);
- background-color: var(--sidebar-item-bg-hover);
+ color: var(--accent-purple);
}
&:global(.active) {
opacity: 1;
- color: var(--white);
- background-color: var(--accent-purple);
+ color: var(--accent-purple);
+ border-left-color: var(--accent-purple);
+ padding-left: 0.5rem;
}
}
}
@@ -128,16 +145,18 @@
&.active {
background-color: var(--brandDecoration);
- h6 {
+ strong {
color: #fff;
}
}
- h6 {
+ strong {
+ display: block;
margin-bottom: 0;
font-size: 0.8rem;
text-transform: uppercase;
letter-spacing: 0.2px;
color: inherit;
+ font-weight: inherit;
}
}
diff --git a/src/components/sidebarLink.tsx b/src/components/sidebarLink.tsx
index db38cf81ae8cd..9c92e06bff20b 100644
--- a/src/components/sidebarLink.tsx
+++ b/src/components/sidebarLink.tsx
@@ -27,6 +27,11 @@ interface SidebarLinkProps {
* Indicates that the links are currently hidden. Overriden by isActive
*/
collapsed?: boolean | null;
+
+ /**
+ * Whether to show the chevron, if the page has children
+ */
+ showChevron?: boolean;
}
export function SidebarLink({
@@ -36,6 +41,7 @@ export function SidebarLink({
path,
collapsed = null,
className = '',
+ showChevron = true,
}: SidebarLinkProps) {
const isActive = path?.indexOf(to) === 0;
const enableSubtree = isActive || collapsed === false;
@@ -44,10 +50,16 @@ export function SidebarLink({
const [showSubtree, setShowSubtree] = useState(enableSubtree);
return (
- -
+
-
{
// Allow toggling the sidebar subtree only if the item is selected
@@ -57,9 +69,13 @@ export function SidebarLink({
}}
>
{title || children}
- {hasSubtree && }
+ {hasSubtree && showChevron && (
+
+ )}
- {title && children &&
{showSubtree && children}
}
+ {title && children && hasSubtree && (
+ {showSubtree && children}
+ )}
);
}
diff --git a/src/components/sidebarTableOfContents/index.tsx b/src/components/sidebarTableOfContents/index.tsx
index d1d45269921ec..3a55c069a61c8 100644
--- a/src/components/sidebarTableOfContents/index.tsx
+++ b/src/components/sidebarTableOfContents/index.tsx
@@ -188,11 +188,7 @@ export function SidebarTableOfContents() {
return (
- {!!tocItems.length && (
-
-
On this page
-
- )}
+ {!!tocItems.length &&
On this page
}
{recursiveRender(buildTocTree(tocItems))}
);
diff --git a/src/components/sidebarTableOfContents/style.module.scss b/src/components/sidebarTableOfContents/style.module.scss
index 05613a50da1df..e50a40cd94cd1 100644
--- a/src/components/sidebarTableOfContents/style.module.scss
+++ b/src/components/sidebarTableOfContents/style.module.scss
@@ -83,12 +83,8 @@
.doc-toc-title {
font-weight: 500;
margin-bottom: 0.25rem;
-
- h6 {
- margin-bottom: 0;
- font-size: 0.8rem;
- text-transform: uppercase;
- letter-spacing: 0.2px;
- color: inherit;
- }
+ font-size: 0.8rem;
+ text-transform: uppercase;
+ letter-spacing: 0.2px;
+ color: inherit;
}