From 1db86d1766ea21ae04adb097825a492ecbb54566 Mon Sep 17 00:00:00 2001 From: Julian Pawlowski Date: Sat, 11 Apr 2026 11:20:10 +0000 Subject: [PATCH] feat(docs): improve sidebar and navbar UX Disable autoCollapseCategories to prevent unwanted collapsing when clicking an active category header twice. Add hideOnScroll to navbar for more reading space on long pages. Add category link targets in both sidebars so category headers are clickable and navigate to the section overview page. Impact: Sidebar navigation no longer collapses unexpectedly. Category titles are now direct navigation links. Navbar hides while scrolling, giving more screen space for content. --- docs/developer/docusaurus.config.ts | 3 ++- docs/developer/sidebars.ts | 5 +++++ docs/user/docusaurus.config.ts | 3 ++- docs/user/sidebars.ts | 9 +++++++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/docs/developer/docusaurus.config.ts b/docs/developer/docusaurus.config.ts index f7c94b5..d642524 100644 --- a/docs/developer/docusaurus.config.ts +++ b/docs/developer/docusaurus.config.ts @@ -135,10 +135,11 @@ const config: Config = { docs: { sidebar: { hideable: true, - autoCollapseCategories: true, + autoCollapseCategories: false, }, }, navbar: { + hideOnScroll: true, title: 'Tibber Prices HA', logo: { alt: 'Tibber Prices Integration Logo', diff --git a/docs/developer/sidebars.ts b/docs/developer/sidebars.ts index bc4f419..95b1b59 100644 --- a/docs/developer/sidebars.ts +++ b/docs/developer/sidebars.ts @@ -18,6 +18,7 @@ const sidebars: SidebarsConfig = { { type: 'category', label: '🏗️ Architecture', + link: { type: 'doc', id: 'architecture' }, items: ['architecture', 'timer-architecture', 'caching-strategy', 'api-reference'], collapsible: true, collapsed: false, @@ -25,6 +26,7 @@ const sidebars: SidebarsConfig = { { type: 'category', label: '💻 Development', + link: { type: 'doc', id: 'setup' }, items: ['setup', 'coding-guidelines', 'critical-patterns', 'repairs-system', 'debugging'], collapsible: true, collapsed: false, @@ -32,6 +34,7 @@ const sidebars: SidebarsConfig = { { type: 'category', label: '📐 Advanced Topics', + link: { type: 'doc', id: 'period-calculation-theory' }, items: ['period-calculation-theory', 'refactoring-guide', 'performance', 'recorder-optimization'], collapsible: true, collapsed: false, @@ -39,6 +42,7 @@ const sidebars: SidebarsConfig = { { type: 'category', label: '📝 Contributing', + link: { type: 'doc', id: 'contributing' }, items: ['contributing'], collapsible: true, collapsed: false, @@ -46,6 +50,7 @@ const sidebars: SidebarsConfig = { { type: 'category', label: '🚀 Release', + link: { type: 'doc', id: 'release-management' }, items: ['release-management', 'testing'], collapsible: true, collapsed: false, diff --git a/docs/user/docusaurus.config.ts b/docs/user/docusaurus.config.ts index 4388bbb..9dd07f0 100644 --- a/docs/user/docusaurus.config.ts +++ b/docs/user/docusaurus.config.ts @@ -135,10 +135,11 @@ const config: Config = { docs: { sidebar: { hideable: true, - autoCollapseCategories: true, + autoCollapseCategories: false, }, }, navbar: { + hideOnScroll: true, title: 'Tibber Prices HA', logo: { alt: 'Tibber Prices Integration Logo', diff --git a/docs/user/sidebars.ts b/docs/user/sidebars.ts index dbcd3d9..24645ac 100644 --- a/docs/user/sidebars.ts +++ b/docs/user/sidebars.ts @@ -18,6 +18,7 @@ const sidebars: SidebarsConfig = { { type: 'category', label: '🚀 Getting Started', + link: { type: 'doc', id: 'installation' }, items: ['installation', 'configuration'], collapsible: true, collapsed: false, @@ -25,6 +26,7 @@ const sidebars: SidebarsConfig = { { type: 'category', label: '📖 Core Concepts', + link: { type: 'doc', id: 'concepts' }, items: ['concepts', 'glossary'], collapsible: true, collapsed: false, @@ -32,6 +34,7 @@ const sidebars: SidebarsConfig = { { type: 'category', label: '📊 Sensors', + link: { type: 'doc', id: 'sensors-overview' }, items: [ 'sensors-overview', 'sensors-average', @@ -47,6 +50,7 @@ const sidebars: SidebarsConfig = { { type: 'category', label: '⏰ Price Periods', + link: { type: 'doc', id: 'period-calculation' }, items: ['period-calculation', 'period-relaxation'], collapsible: true, collapsed: false, @@ -54,6 +58,7 @@ const sidebars: SidebarsConfig = { { type: 'category', label: '🎨 Dashboards & Charts', + link: { type: 'doc', id: 'dashboard-examples' }, items: ['dynamic-icons', 'icon-colors', 'dashboard-examples', 'chart-examples'], collapsible: true, collapsed: false, @@ -61,6 +66,7 @@ const sidebars: SidebarsConfig = { { type: 'category', label: '🤖 Automations', + link: { type: 'doc', id: 'automation-examples' }, items: ['automation-examples'], collapsible: true, collapsed: false, @@ -68,6 +74,7 @@ const sidebars: SidebarsConfig = { { type: 'category', label: '📖 Reference', + link: { type: 'doc', id: 'sensor-reference' }, items: ['sensor-reference', 'actions'], collapsible: true, collapsed: false, @@ -75,6 +82,7 @@ const sidebars: SidebarsConfig = { { type: 'category', label: '👥 Community', + link: { type: 'doc', id: 'community-examples' }, items: ['community-examples'], collapsible: true, collapsed: false, @@ -82,6 +90,7 @@ const sidebars: SidebarsConfig = { { type: 'category', label: '🔧 Help & Support', + link: { type: 'doc', id: 'faq' }, items: ['faq', 'troubleshooting'], collapsible: true, collapsed: false,