Skip to content

Commit da5bbfd

Browse files
colebemisclaude
andcommitted
feat: make help sections collapsible and improve spacing
- Make help sections collapsible using Details component - Adjust item height to 40px when help panel is medium size - Add question mark icon to help header - Refine spacing: 32px item height, section headers as bold text - Only show gap between summary and content when section is open - Add content-start to help container for proper alignment Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent a61f443 commit da5bbfd

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

src/components/details.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function Root({
1414
return (
1515
<details
1616
open={defaultOpen}
17-
className={cx("group/details flex flex-col gap-3 coarse:gap-4", className)}
17+
className={cx("group/details flex flex-col open:gap-3 open:coarse:gap-4", className)}
1818
>
1919
{children}
2020
</details>

src/components/help-panel.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,25 @@ import { useAtom } from "jotai"
22
import { Drawer } from "vaul"
33
import { isHelpPanelOpenAtom } from "../global-state"
44
import { IconButton } from "./icon-button"
5-
import { XIcon16 } from "./icons"
5+
import { CircleQuestionMarkIcon16, XIcon16 } from "./icons"
66
import { Markdown } from "./markdown"
7+
import { Details } from "./details"
78
import { HoverCard } from "./hover-card"
89

910
function HelpSection({ title, children }: { title: string; children: React.ReactNode }) {
1011
return (
11-
<div className="flex flex-col gap-2 min-w-0 p-4">
12-
<div className="text-sm text-text-secondary h-4 flex items-center">{title}</div>
13-
<ul className="flex flex-col">{children}</ul>
12+
<div className="min-w-0 p-4">
13+
<Details>
14+
<Details.Summary>{title}</Details.Summary>
15+
<ul className="flex flex-col gap-1">{children}</ul>
16+
</Details>
1417
</div>
1518
)
1619
}
1720

1821
function HelpItem({ children }: { children: React.ReactNode }) {
1922
return (
20-
<li className="flex items-center justify-between h-9 gap-3 *:first:min-w-0 *:first:truncate *:last:shrink-0">
23+
<li className="flex items-center justify-between h-8 group-data-[size=medium]/help:h-10 gap-3 *:first:min-w-0 *:first:truncate *:last:shrink-0">
2124
{children}
2225
</li>
2326
)
@@ -66,17 +69,18 @@ function HelpContent({
6669
}) {
6770
return (
6871
<HoverCard.Provider container={null}>
69-
<div className="grid grid-rows-[auto_1fr] overflow-hidden h-full">
72+
<div className="grid grid-rows-[auto_1fr] overflow-hidden h-full group/help" data-size={size}>
7073
<header className="flex items-center gap-2 px-2 py-2">
7174
<div className="flex w-0 grow items-center gap-3 px-2">
75+
<CircleQuestionMarkIcon16 className="shrink-0 text-text-secondary" />
7276
<div className="truncate">Help</div>
7377
</div>
7478
<IconButton aria-label="Close" shortcut={["⌘", "/"]} size={size} onClick={onClose}>
7579
<XIcon16 />
7680
</IconButton>
7781
</header>
7882

79-
<div className="overflow-auto scroll-mask grid divide-y divide-border-secondary">
83+
<div className="overflow-auto scroll-mask grid content-start divide-y divide-border-secondary">
8084
<HelpSection title="Links">
8185
<HelpLink href="https://github.com/lumen-notes/lumen/issues/new">
8286
Send feedback

0 commit comments

Comments
 (0)