Skip to content

Self-hosted homelab infrastructure visualizer — interactive network diagram with live status monitoring

fix(ui): use official Homelable logo on login page

Pouzor34758c985071
diff --git a/frontend/src/components/LoginPage.tsx b/frontend/src/components/LoginPage.tsx
index bdea9f5..dddcb8e 100644
--- a/frontend/src/components/LoginPage.tsx
+++ b/frontend/src/components/LoginPage.tsx
@@ -1,8 +1,9 @@
import { useState } from 'react'
-import { Network, Loader2 } from 'lucide-react'
+import { Loader2 } from 'lucide-react'
import { Button, buttonVariants } from '@/components/ui/button'
import { Input } from '@/components/ui/input'
import { Label } from '@/components/ui/label'
+import { Logo } from '@/components/ui/Logo'
import { authApi } from '@/api/client'
import { useAuthStore } from '@/stores/authStore'
import { cn } from '@/lib/utils'
@@ -43,11 +44,12 @@ export function LoginPage() {
<div className="relative w-full max-w-sm px-4">
{/* Logo */}
<div className="flex flex-col items-center gap-3 mb-8">
- <div className="flex items-center justify-center w-14 h-14 rounded-xl bg-[#00d4ff]/10 border border-[#00d4ff]/20">
- <Network size={28} className="text-[#00d4ff]" />
- </div>
+ <Logo size={64} showText={false} />
<div className="text-center">
- <h1 className="text-xl font-semibold text-foreground tracking-wide">Homelable</h1>
+ <h1 className="text-xl font-semibold tracking-tight">
+ <span className="text-[#e6edf3]">Home</span>
+ <span className="text-[#00d4ff]">lable</span>
+ </h1>
<p className="text-xs text-muted-foreground mt-0.5">HomeLab Visualizer</p>
</div>
</div>
diff --git a/frontend/src/components/__tests__/LoginPage.test.tsx b/frontend/src/components/__tests__/LoginPage.test.tsx
index 7df6e52..72b7f20 100644
--- a/frontend/src/components/__tests__/LoginPage.test.tsx
+++ b/frontend/src/components/__tests__/LoginPage.test.tsx
@@ -35,6 +35,17 @@ describe('LoginPage', () => {
expect(screen.getByRole('button', { name: /sign in/i })).toBeDefined()
})
+ it('renders the official Homelable logo mark — not a generic lucide icon', () => {
+ render(<LoginPage />)
+ const svg = screen.getByTestId('logo-mark')
+ // The official mark from docs/logo/icon.svg, not lucide's Network glyph
+ expect(svg.querySelector('path')?.getAttribute('d'))
+ .toBe('M32 11 L53 30 L48 30 L48 53 L16 53 L16 30 L11 30 Z')
+ expect(svg.classList.contains('lucide')).toBe(false)
+ expect(screen.getByRole('heading', { level: 1 })).toHaveTextContent('Homelable')
+ expect(screen.getByText('HomeLab Visualizer')).toBeDefined()
+ })
+
it('renders only the provider redirect in OIDC mode', () => {
useAuthStore.setState({
authMode: 'oidc',
diff --git a/frontend/src/components/ui/Logo.tsx b/frontend/src/components/ui/Logo.tsx
index 85a227b..66320bd 100644
--- a/frontend/src/components/ui/Logo.tsx
+++ b/frontend/src/components/ui/Logo.tsx
@@ -1,10 +1,21 @@
+import { useId } from 'react';
+
interface LogoProps {
size?: number;
showText?: boolean;
className?: string;
}
+/**
+ * Official Homelable mark — kept in sync with `docs/logo/icon.svg`.
+ * Wordmark colors follow `docs/logo/logo-md.svg` (Home = #e6edf3, lable = #00d4ff).
+ */
export function Logo({ size = 32, showText = true, className = '' }: LogoProps) {
+ // Colons are legal in a URL fragment but confuse some tooling — strip them.
+ const uid = useId().replace(/:/g, '');
+ const bgGlow = `homelable-bg-glow-${uid}`;
+ const nodeGlow = `homelable-node-glow-${uid}`;
+
return (
<div className={`flex items-center gap-2 ${className}`}>
<svg
@@ -13,32 +24,73 @@ export function Logo({ size = 32, showText = true, className = '' }: LogoProps)
viewBox="0 0 64 64"
fill="none"
xmlns="http://www.w3.org/2000/svg"
+ aria-hidden="true"
+ data-testid="logo-mark"
>
+ <defs>
+ <radialGradient id={bgGlow} cx="50%" cy="35%" r="55%">
+ <stop offset="0%" stopColor="#00d4ff" stopOpacity="0.08" />
+ <stop offset="100%" stopColor="#0d1117" stopOpacity="0" />
+ </radialGradient>
+ <filter id={nodeGlow}>
+ <feGaussianBlur stdDeviation="1.5" result="blur" />
+ <feMerge>
+ <feMergeNode in="blur" />
+ <feMergeNode in="SourceGraphic" />
+ </feMerge>
+ </filter>
+ </defs>
+
+ {/* Background */}
<circle cx="32" cy="32" r="32" fill="#0d1117" />
+ <circle cx="32" cy="32" r="32" fill={`url(#${bgGlow})`} />
+
+ {/* House body */}
<path
- d="M32 12 L52 30 L48 30 L48 52 L16 52 L16 30 L12 30 Z"
+ d="M32 11 L53 30 L48 30 L48 53 L16 53 L16 30 L11 30 Z"
fill="#161b22"
stroke="#00d4ff"
strokeWidth="1.5"
strokeLinejoin="round"
/>
- <rect x="27" y="40" width="10" height="12" rx="1" fill="#0d1117" stroke="#00d4ff" strokeWidth="1" />
- <circle cx="32" cy="33" r="3" fill="#00d4ff" />
- <circle cx="22" cy="38" r="2" fill="#39d353" />
- <line x1="22" y1="38" x2="29" y2="33" stroke="#39d353" strokeWidth="1" opacity="0.7" />
- <circle cx="42" cy="38" r="2" fill="#39d353" />
- <line x1="42" y1="38" x2="35" y2="33" stroke="#39d353" strokeWidth="1" opacity="0.7" />
- <circle cx="32" cy="24" r="2" fill="#a855f7" />
- <line x1="32" y1="24" x2="32" y2="30" stroke="#a855f7" strokeWidth="1" opacity="0.7" />
- <circle cx="32" cy="33" r="3" fill="none" stroke="#00d4ff" strokeWidth="1.5" opacity="0.4" />
+
+ {/* Floor line (subtle) */}
+ <line x1="16" y1="30" x2="48" y2="30" stroke="#00d4ff" strokeWidth="0.5" opacity="0.25" />
+
+ {/* Door */}
+ <rect
+ x="27"
+ y="40"
+ width="10"
+ height="13"
+ rx="1.5"
+ fill="#0d1117"
+ stroke="#00d4ff"
+ strokeWidth="1"
+ opacity="0.9"
+ />
+
+ {/* Network lines (drawn under nodes) */}
+ <line x1="32" y1="23" x2="32" y2="30" stroke="#a855f7" strokeWidth="1.2" opacity="0.7" strokeLinecap="round" />
+ <line x1="21" y1="38" x2="29" y2="33" stroke="#39d353" strokeWidth="1.2" opacity="0.7" strokeLinecap="round" />
+ <line x1="43" y1="38" x2="35" y2="33" stroke="#39d353" strokeWidth="1.2" opacity="0.7" strokeLinecap="round" />
+
+ {/* Center hub */}
+ <circle cx="32" cy="33" r="5" fill="#00d4ff" opacity="0.12" />
+ <circle cx="32" cy="33" r="3" fill="#00d4ff" filter={`url(#${nodeGlow})`} />
+
+ {/* Peripheral nodes */}
+ <circle cx="21" cy="38" r="2.5" fill="#39d353" filter={`url(#${nodeGlow})`} />
+ <circle cx="43" cy="38" r="2.5" fill="#39d353" filter={`url(#${nodeGlow})`} />
+ <circle cx="32" cy="23" r="2" fill="#a855f7" filter={`url(#${nodeGlow})`} />
</svg>
{showText && (
<span
className="font-bold tracking-tight"
style={{ fontSize: size * 0.55, fontFamily: 'Inter, sans-serif' }}
>
- <span style={{ color: '#00d4ff' }}>Home</span>
- <span style={{ color: '#ffffff' }}>lable</span>
+ <span style={{ color: '#e6edf3' }}>Home</span>
+ <span style={{ color: '#00d4ff' }}>lable</span>
</span>
)}
</div>
diff --git a/frontend/src/components/ui/__tests__/Logo.test.tsx b/frontend/src/components/ui/__tests__/Logo.test.tsx
new file mode 100644
index 0000000..17b2863
--- /dev/null
+++ b/frontend/src/components/ui/__tests__/Logo.test.tsx
@@ -0,0 +1,59 @@
+import { describe, it, expect } from 'vitest'
+import { render, screen } from '@testing-library/react'
+import { Logo } from '../Logo'
+
+describe('Logo', () => {
+ it('renders the official mark (house + network nodes), not a placeholder icon', () => {
+ render(<Logo />)
+ const svg = screen.getByTestId('logo-mark')
+ // Canonical house outline from docs/logo/icon.svg
+ expect(svg.querySelector('path')?.getAttribute('d'))
+ .toBe('M32 11 L53 30 L48 30 L48 53 L16 53 L16 30 L11 30 Z')
+ // Center hub + 3 peripheral nodes + hub glow + 2 background circles
+ expect(svg.querySelectorAll('circle').length).toBe(7)
+ })
+
+ it('uses the canonical wordmark colors (Home #e6edf3 / lable #00d4ff)', () => {
+ render(<Logo showText />)
+ expect(screen.getByText('Home')).toHaveStyle({ color: '#e6edf3' })
+ expect(screen.getByText('lable')).toHaveStyle({ color: '#00d4ff' })
+ })
+
+ it('hides the wordmark when showText is false', () => {
+ render(<Logo showText={false} />)
+ expect(screen.queryByText('Home')).toBeNull()
+ expect(screen.getByTestId('logo-mark')).toBeInTheDocument()
+ })
+
+ it('scales the svg to the requested size', () => {
+ render(<Logo size={64} />)
+ const svg = screen.getByTestId('logo-mark')
+ expect(svg.getAttribute('width')).toBe('64')
+ expect(svg.getAttribute('height')).toBe('64')
+ })
+
+ it('generates unique gradient/filter ids per instance — two logos can coexist', () => {
+ // Sidebar and Toolbar both render a Logo at the same time; duplicate SVG
+ // defs ids would make one instance reference the other's gradient.
+ render(<><Logo /><Logo /></>)
+ const [first, second] = screen.getAllByTestId('logo-mark')
+ const idOf = (svg: HTMLElement) => svg.querySelector('radialGradient')!.getAttribute('id')
+ expect(idOf(first)).not.toBe(idOf(second))
+
+ // Each instance must point at its own gradient
+ const gradientRef = (svg: HTMLElement) =>
+ svg.querySelectorAll('circle')[1].getAttribute('fill')
+ expect(gradientRef(first)).toBe(`url(#${idOf(first)!})`)
+ expect(gradientRef(second)).toBe(`url(#${idOf(second)!})`)
+ })
+
+ it('marks the svg aria-hidden — the adjacent wordmark carries the name', () => {
+ render(<Logo />)
+ expect(screen.getByTestId('logo-mark')).toHaveAttribute('aria-hidden', 'true')
+ })
+
+ it('forwards className to the wrapper', () => {
+ const { container } = render(<Logo className="my-class" />)
+ expect(container.firstElementChild).toHaveClass('my-class')
+ })
+})