Skip to content

Commit 5a2ffb1

Browse files
authored
feat: customizable heading font via theme settings (#121)
Add a `headingFont` option to ThemeConfig that lets users switch heading typography between Serif (default), Sans, and Mono via the existing Theme Picker UI. - New `--font-heading` CSS custom property (defaults to `--font-serif`) - Theme engine applies the selected font on config change - ThemePicker gets a "Heading Font" toggle section - All 15 component files updated from `font-serif` to `font-heading` - Selection persists in localStorage alongside other theme settings - Backwards-compatible: existing configs without `headingFont` default to serif Closes #120
2 parents 05fd423 + 92a13ea commit 5a2ffb1

21 files changed

Lines changed: 75 additions & 20 deletions

understand-anything-plugin/packages/dashboard/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ function Dashboard({ accessToken }: { accessToken: string }) {
401401
<header className="flex items-center px-3 sm:px-5 py-3 bg-surface border-b border-border-subtle shrink-0 gap-2 sm:gap-4">
402402
{/* Left — fixed */}
403403
<div className="flex items-center gap-3 sm:gap-5 shrink-0 min-w-0">
404-
<h1 className="font-serif text-base sm:text-lg text-text-primary tracking-wide truncate max-w-[160px] sm:max-w-[220px] lg:max-w-none">
404+
<h1 className="font-heading text-base sm:text-lg text-text-primary tracking-wide truncate max-w-[160px] sm:max-w-[220px] lg:max-w-none">
405405
{graph?.project.name ?? "Understand Anything"}
406406
</h1>
407407
<div className="w-px h-5 bg-border-subtle hidden sm:block" />

understand-anything-plugin/packages/dashboard/src/components/CodeViewer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export default function CodeViewer({
155155
</span>
156156
<span className="text-[10px] text-text-muted">{lineInfo}</span>
157157
</div>
158-
<div className="text-sm font-serif text-text-primary truncate" title={node.name}>
158+
<div className="text-sm font-heading text-text-primary truncate" title={node.name}>
159159
{node.name}
160160
</div>
161161
{node.filePath && (

understand-anything-plugin/packages/dashboard/src/components/ContainerNode.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function ContainerNodeComponent({ data, width, height }: NodeProps<ContainerFlow
5959
}}
6060
>
6161
<div
62-
className="flex items-center justify-between font-serif"
62+
className="flex items-center justify-between font-heading"
6363
style={{
6464
padding: "12px 16px",
6565
color: color.label,

understand-anything-plugin/packages/dashboard/src/components/CustomNode.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ function CustomNodeComponent({
156156
</span>
157157
</div>
158158

159-
<div className="text-sm font-serif text-text-primary truncate" title={data.label}>
159+
<div className="text-sm font-heading text-text-primary truncate" title={data.label}>
160160
{truncatedName}
161161
</div>
162162

understand-anything-plugin/packages/dashboard/src/components/DomainClusterNode.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function DomainClusterNode({ data }: NodeProps<DomainClusterFlowNode>) {
3333
<Handle type="target" position={Position.Left} className="!bg-accent/60 !w-2 !h-2" />
3434
<Handle type="source" position={Position.Right} className="!bg-accent/60 !w-2 !h-2" />
3535

36-
<div className="font-serif text-sm text-accent font-semibold mb-1 truncate">
36+
<div className="font-heading text-sm text-accent font-semibold mb-1 truncate">
3737
{data.label}
3838
</div>
3939
<div className="text-[11px] text-text-secondary line-clamp-2 mb-2">

understand-anything-plugin/packages/dashboard/src/components/KeyboardShortcutsHelp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default function KeyboardShortcutsHelp({
3131
{/* Header */}
3232
<div className="sticky top-0 glass-heavy border-b border-border-subtle px-6 py-4 flex items-center justify-between">
3333
<div>
34-
<h2 className="text-xl font-serif text-text-primary">
34+
<h2 className="text-xl font-heading text-text-primary">
3535
Keyboard Shortcuts
3636
</h2>
3737
<p className="text-xs text-text-muted mt-1">

understand-anything-plugin/packages/dashboard/src/components/LayerClusterNode.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function LayerClusterNode({
7272
</div>
7373

7474
{/* Layer name */}
75-
<div className="text-lg font-serif text-text-primary mb-1">
75+
<div className="text-lg font-heading text-text-primary mb-1">
7676
{data.layerName}
7777
</div>
7878

understand-anything-plugin/packages/dashboard/src/components/LearnPanel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default function LearnPanel() {
3939
return (
4040
<div className="h-full w-full overflow-auto p-5">
4141
<div className="mb-4">
42-
<h2 className="text-lg font-serif text-text-primary mb-1">Project Tour</h2>
42+
<h2 className="text-lg font-heading text-text-primary mb-1">Project Tour</h2>
4343
<p className="text-xs text-text-muted">
4444
{tourSteps.length} steps &middot; Guided walkthrough of the codebase
4545
</p>
@@ -112,7 +112,7 @@ export default function LearnPanel() {
112112
{/* Scrollable content */}
113113
<div className="flex-1 overflow-y-auto p-4 min-h-0">
114114
{/* Step title */}
115-
<h2 className="text-lg font-serif text-text-primary mb-3">{step.title}</h2>
115+
<h2 className="text-lg font-heading text-text-primary mb-3">{step.title}</h2>
116116

117117
{/* Description via ReactMarkdown */}
118118
<div className="text-sm text-text-secondary leading-relaxed mb-4 tour-markdown">

understand-anything-plugin/packages/dashboard/src/components/MobileDrawer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export default function MobileDrawer({
107107
<span className="text-[10px] font-semibold uppercase tracking-[0.2em] text-accent">
108108
Controls
109109
</span>
110-
<h2 className="font-serif text-lg text-text-primary mt-0.5 leading-none">
110+
<h2 className="font-heading text-lg text-text-primary mt-0.5 leading-none">
111111
{graph?.project.name ?? "Dashboard"}
112112
</h2>
113113
</div>

understand-anything-plugin/packages/dashboard/src/components/MobileLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export default function MobileLayout({
9595
</svg>
9696
</button>
9797

98-
<h1 className="font-serif text-base flex-1 min-w-0 truncate text-center text-text-primary tracking-wide">
98+
<h1 className="font-heading text-base flex-1 min-w-0 truncate text-center text-text-primary tracking-wide">
9999
{graph?.project.name ?? "Understand Anything"}
100100
</h1>
101101

0 commit comments

Comments
 (0)