Skip to content

Add sidebar group icons and fix homepage sidebar#142

Open
danielclickh wants to merge 2 commits into
ClickHouse:mainfrom
danielclickh:feat/sidebar-icons-homepage
Open

Add sidebar group icons and fix homepage sidebar#142
danielclickh wants to merge 2 commits into
ClickHouse:mainfrom
danielclickh:feat/sidebar-icons-homepage

Conversation

@danielclickh

@danielclickh danielclickh commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Navigation icons

  • Add SVG icons to the "Get started", "Setup", and "Sample datasets" sidebar groups via a new sidebar-icons.js customization script
  • Add a house icon to the homepage navigation entry
  • Add icon frontmatter to install.mdx and sample-datasets/index.mdx so the group root pages surface the correct icon
  • Register sidebar-icons.js in docs.json scripts array

Homepage sidebar fix

  • Mintlify can't match the root URL (/) to the "Get started" nav item, so it falls back to showing the Concepts sidebar on the homepage
  • The homepage is a full custom landing page with its own navigation cards, so hiding the sidebar there is the right UX fix
  • sidebar-icons.js detects the homepage via pathname === '/' (including on SPA navigations via pushState/popState) and toggles a ch-is-homepage class on <html>; CSS uses this to hide #sidebar and expand the content area

Site config

  • Darken page background from #1D1D1D to #151515 in dark mode
  • Add hero card dark-mode CSS (.dark .ch-hero-card)
  • Add Inkeep overlay and scrollbar-gutter CSS overrides

Test plan

  • "Setup" and "Sample datasets" sidebar groups show the correct icons
  • Homepage (/) shows no sidebar — full-width layout with navigation cards
  • Navigating away from / and back restores the sidebar correctly
  • Dark mode background is visually darker (#151515)

🤖 Generated with Claude Code


Note

Low Risk
Docs-site presentation and client-side DOM customization only; no auth, data, or backend behavior changes.

Overview
Adds sidebar navigation icons for Get started: new SVG assets, icon fields on the home entry and Setup / Sample datasets groups in get-started/navigation.json, matching icon frontmatter on the install and sample-datasets landing pages, and a sidebar-icons.js script (registered in docs.json) that injects gear/database SVGs into Mintlify group headers via a MutationObserver.

Visual polish: dark mode page background moves from #1D1D1D to #151515 in docs.json, with related dark styles for hero cards (.ch-hero-card) and a darker Inkeep/Radix dialog overlay (--ikp-color-overlay-dark and direct overlay selectors) in _site/styles.css.

Reviewed by Cursor Bugbot for commit c72c7b0. Bugbot is set up for automated code reviews on this repo. Configure here.

Navigation icons:
- Add SVG icons to "Get started", "Setup", and "Sample datasets" sidebar groups
  via a new sidebar-icons.js customization script
- Add house icon to the homepage entry in the navigation
- Add icon frontmatter to install.mdx and sample-datasets/index.mdx so the
  root pages of those groups show the correct icon
- Register sidebar-icons.js in docs.json scripts

Homepage sidebar fix:
- Mintlify can't match the root URL (/) to the "Get started" nav item, so it
  falls back to showing the Concepts sidebar on the homepage
- The homepage is a full custom landing page with its own navigation cards,
  so hiding the sidebar there is the right fix
- sidebar-icons.js detects the homepage via pathname and toggles a
  `ch-is-homepage` class on <html>; CSS in styles.css uses this to hide
  #sidebar and expand the content area

Site config:
- Darken background color from #1D1D1D to #151515 in dark mode
- Add Inkeep and hero card dark-mode CSS overrides to styles.css

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Comment thread _site/styles.css Outdated
The sidebar should always be visible. Removing the ch-is-homepage
class toggling logic from sidebar-icons.js and the matching CSS
from styles.css.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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 using default effort and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit c72c7b0. Configure here.

var labelDiv = span.parentElement;
li.dataset.chSidebarIcon = '1';
labelDiv.style.cssText = 'display:flex;align-items:center;gap:6px;';
labelDiv.insertBefore(makeSvg(ICON_PATHS[title]), span);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Premature icon-injected flag blocks retry

Low Severity

injectIcons sets li.dataset.chSidebarIcon before insertBefore adds the SVG. If insertion fails or the label structure is incomplete on that pass, later observer runs skip that group because the flag is already set, so Setup or Sample datasets can stay without an icon until a full reload.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c72c7b0. Configure here.

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.

2 participants