Files
hermes-agent/web/README.md
T
Austin Pickett b5fb8da7ea refactor(web): dashboard typography & contrast pass
Why
- Whole dashboard was force-uppercased by a single \`uppercase\` on the
  App.tsx root, which inherited into every page and forced ~23
  \`normal-case\` opt-outs across 7 files just to keep dynamic content
  (model names, theme names, etc.) readable.
- Micro-typography (\`text-[0.55rem]\` / \`text-[0.6rem]\` / \`text-[9px]\` /
  \`text-[10px]\` / \`text-[11px]\`) combined with stacked alpha
  (\`text-muted-foreground/60\` over a 55%-alpha base, \`opacity-30\` on
  nav headers) produced text that fails WCAG AA at small sizes.
- Per-theme \`--theme-font-sans\` was being clobbered by a hard-coded
  \`font-mondwest\` on the App.tsx root.

Changes
- Drop global \`uppercase\` + \`font-mondwest\` from the App.tsx root; default
  to \`text-text-primary\` so body content inherits the theme font.
- Map \`--color-muted-foreground\` to \`--color-text-secondary\` so the
  long tail of \`text-muted-foreground\` call sites get a WCAG-AA-targeted
  color instead of 55%-alpha midground.
- Apply the new DS \`text-display\` utility on intentional brand chrome
  (sidebar nav section labels, page titles, mobile header brand,
  segmented filters, badges, ChatSidebar headings).
- Remove the 23 \`normal-case\` opt-outs that only existed to fight the
  global \`uppercase\`. Retain \`normal-case\` on the 4 DS \`Button\`
  instances that legitimately display dynamic content.
- Bump every \`text-[0.55-0.7rem]\` / \`text-[9-11px]\` to \`text-xs\` (12px
  floor) across PluginsPage, ConfigPage, SkillsPage, ModelsPage,
  SessionsPage, AnalyticsPage, LogsPage, EnvPage, ChatPage,
  ChatSidebar, ToolCall, ModelInfoCard, ModelPickerDialog,
  SidebarStatusStrip, SidebarFooter, OAuthProvidersCard, SlashPopover,
  ThemeSwitcher, LanguageSwitcher, BottomPickSheet, AutoField.
- Replace stacked-alpha refs (\`text-muted-foreground/60\`,
  \`text-midground/70\`, \`opacity-30/50/60\` on text) with semantic tokens
  (\`text-text-secondary\`, \`text-text-tertiary\`, \`text-text-disabled\`).
- Bump \`@nous-research/ui\` to 0.16.0 (which adds the \`text-display\`
  utility and semantic text tokens this PR depends on).
- Add a Typography & contrast rules section to \`web/README.md\` codifying
  the 12px text floor, 0.7 opacity floor on text, "uppercase via
  text-display only" rule, and "prefer semantic tokens" guideline so
  the dashboard doesn't drift back.

This pairs with NousResearch/design-language#22 which provides the
\`text-display\` utility and semantic text tokens.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 12:39:09 -04:00

4.5 KiB

Hermes Agent — Web UI

Browser-based dashboard for managing Hermes Agent configuration, API keys, and monitoring active sessions.

Stack

  • Vite + React 19 + TypeScript
  • Tailwind CSS v4 with custom dark theme
  • shadcn/ui-style components (hand-rolled, no CLI dependency)

Development

# Start the backend API server
cd ../
python -m hermes_cli.main web --no-open

# In another terminal, start the Vite dev server (with HMR + API proxy)
cd web/
npm run dev

The Vite dev server proxies /api requests to http://127.0.0.1:9119 (the FastAPI backend).

Build

npm run build

This outputs to ../hermes_cli/web_dist/, which the FastAPI server serves as a static SPA. The built assets are included in the Python package via pyproject.toml package-data.

Structure

src/
├── components/ui/   # Reusable UI primitives (Card, Badge, Button, Input, etc.)
├── lib/
│   ├── api.ts       # API client — typed fetch wrappers for all backend endpoints
│   └── utils.ts     # cn() helper for Tailwind class merging
├── pages/
│   ├── StatusPage   # Agent status, active/recent sessions
│   ├── ConfigPage   # Dynamic config editor (reads schema from backend)
│   └── EnvPage      # API key management with save/clear
├── App.tsx          # Main layout and navigation
├── main.tsx         # React entry point
└── index.css        # Tailwind imports and theme variables

Typography & contrast rules

Read before adding or editing UI styles. These rules keep the dashboard legible across all built-in themes and stop drift back into the patterns the design system was just refactored out of.

Text size floor

  • Minimum body size: text-xs (12px / 0.75rem). Do not use arbitrary text-[0.6rem], text-[0.65rem], text-[9px], text-[10px], or text-[11px] on copy, hints, labels, counts, or badges. Use the standard scale: text-xs, text-sm, text-base.
  • Smaller sizes are only acceptable on decorative overlays (chart stripes, empty-state icons) — never on text the user is meant to read.

Opacity floor on text

  • Never apply opacity below 0.7 to text. No opacity-30, opacity-50, opacity-60 on <span>s, <p>s, labels, etc.
  • Do not stack opacity tokens. Patterns like text-muted-foreground/60, text-midground/70, text-foreground/50 create unpredictable WCAG failures because the parent token already has alpha.
  • Use the semantic text tokens from @nous-research/ui's globals.css:
    • text-text-primary — default body text.
    • text-text-secondary — subtitles, meta, inactive nav.
    • text-text-tertiary — small chrome labels, counts, footnotes.
    • text-text-disabled — disabled states.
    • text-text-on-accent — text on filled accent surfaces.

Brand uppercase via text-display, never uppercase

  • The dashboard preserves the Nous brand uppercase aesthetic, but it is opt-in per element, not global.
  • Apply uppercase via the DS utility text-display on brand chrome only — page titles, nav section headings, badges, brand wordmark. DS components (Button, Badge, Tabs, Segmented, etc.) already self-apply text-display.
  • Do not add uppercase (the literal Tailwind class) anywhere in hermes-agent/web/src.
  • Do not add normal-case to "opt out" of inheritance — the app shell no longer forces uppercase, so opt-outs aren't needed. The only legitimate normal-case overrides are on DS <Button> instances that display dynamic, user-typed content (model slugs, theme names, language names, profile names).

Fonts

  • font-mondwest is the brand display font. Apply it explicitly only on brand chrome (paired with text-display).
  • Body content inherits the active theme's --theme-font-sans. Do not hardcode font-mondwest on body text or pages — it locks out per-theme typography.
  • Code/terminal text uses font-mono / font-mono-ui (both resolve through --theme-font-mono).

Color tokens

  • Prefer semantic tokens (text-text-*, bg-card, border-border, text-foreground, text-destructive, text-success, text-warning) over raw layer references (text-midground, text-foreground).
  • text-muted-foreground is now wired to --color-text-secondary, so existing call sites stay correct, but new code should prefer the semantic name.
  • When you genuinely need a non-token color (icon de-emphasis on a chart, terminal foreground via inline style), keep alpha at ≥ 0.7 for any text.