Skip to content

Commit 6b3760c

Browse files
sebbycorpclaude
andcommitted
Make Install and Channels sidebar sections always expanded
Remove chevron toggles and force sub-sections open for Install (Installing kagent, Tools & Plugins, Concepts) and Channels (Messaging) docs sections. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Sebastian Maniak <sebastian@maniak.io>
1 parent 160f1b4 commit 6b3760c

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/app/docs/DocsLayoutClient.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ interface DocsLayoutClientProps {
2323
export default function DocsLayoutClient({ navigation, children }: DocsLayoutClientProps) {
2424
const pathname = usePathname();
2525

26+
const alwaysExpandedSections = new Set(['Install', 'Channels']);
27+
2628
function initExpandedSections(nav: NavItem[], path: string): Record<string, boolean> {
2729
const result: Record<string, boolean> = {};
2830
const match = (href: string) => path === href || path.startsWith(href + '/');
@@ -31,10 +33,11 @@ export default function DocsLayoutClient({ navigation, children }: DocsLayoutCli
3133
return items.some(item => match(item.href) || hasActive(item.items));
3234
};
3335
nav.forEach(section => {
34-
result[section.title] = match(section.href) || hasActive(section.items);
36+
const forceOpen = alwaysExpandedSections.has(section.title);
37+
result[section.title] = forceOpen || match(section.href) || hasActive(section.items);
3538
section.items?.forEach(item => {
3639
if (item.items?.length) {
37-
result[item.title] = match(item.href) || hasActive(item.items);
40+
result[item.title] = forceOpen || match(item.href) || hasActive(item.items);
3841
}
3942
});
4043
});
@@ -117,13 +120,13 @@ export default function DocsLayoutClient({ navigation, children }: DocsLayoutCli
117120
: 'text-secondary-foreground/70 hover:text-secondary-foreground hover:bg-white/5'
118121
}`}
119122
onClick={() => {
120-
if (item.items?.length) toggleSection(item.title);
123+
if (item.items?.length && !alwaysExpandedSections.has(activeSection.title)) toggleSection(item.title);
121124
}}
122125
>
123126
{item.title}
124127
</Link>
125128
)}
126-
{item.items && item.items.length > 0 && (
129+
{item.items && item.items.length > 0 && !alwaysExpandedSections.has(activeSection.title) && (
127130
<button
128131
onClick={() => toggleSection(item.title)}
129132
className="ml-1 p-1 hover:bg-white/10 rounded transition-colors"

0 commit comments

Comments
 (0)