hermes - ✅(Solved) Fix [Bug]: Dashboard Theme Changes Cause Layout Shifts [1 pull requests, 2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#17229Fetched 2026-04-30 06:49:00
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×3commented ×2cross-referenced ×1

Error Message

Additional Logs / Traceback (optional)

Root Cause

Root Cause Analysis (optional)

Fix Action

Fixed

PR fix notes

PR #17232: Fix/dashboard theme layout shift

Description (problem / solution / changelog)

What does this PR do?

Switching between dashboard themes caused visible layout shifts across four axes: font sizes varied by up to 3px, spacing scaled by up to 40% (compact/spacious density), the rose navbar was taller due to an orphaned lineHeight: 1.7, and the cyberpunk theme caused text to wrap earlier than other themes due to extra letterSpacing: 0.02em on top of an already-wide monospace font.

The root cause was that each built-in theme independently hardcoded typography and layout values rather than inheriting from DEFAULT_TYPOGRAPHY. Divergence was silent — no single author made a wrong decision, but the values accumulated without a shared constraint.

The fix spreads DEFAULT_TYPOGRAPHY into every per-theme typography object, removing explicit overrides for baseSize, density, lineHeight (rose), and letterSpacing (cyberpunk). Layout-affecting values now default to a shared baseline; themes retain their distinct identity through palette, font family, border-radius, and stylistic typographic choices.

Related Issue

Fixes https://github.com/NousResearch/hermes-agent/issues/17229

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • web/src/themes/presets.ts:
    • All five non-default themes now spread ...DEFAULT_TYPOGRAPHY, removing independent baseSize values and converging on 15px
    • mono, cyberpunk, rose: density changed to "comfortable" (was compact, compact, spacious)
    • rose: lineHeight: "1.7" removed — now inherits 1.55 via spread (was orphaned after density normalization, causing nav item height drift)
    • cyberpunk: letterSpacing changed from "0.02em" to "0" — extra tracking on a monospace font caused text to wrap earlier than other themes

How to Test

  1. Run hermes dashboard and navigate to the Skills page — note how many skill rows are visible.
  2. Open Settings → Theme and cycle through all six themes (default, midnight, ember, mono, cyberpunk, rose).
  3. After each switch, confirm:
    • The number of visible skill rows does not change
    • The font size does not visibly change
    • The sidebar nav item height is consistent
    • The badge label "Dark-themed SVG architecture/cloud/infra diagrams as HTML." does not wrap in cyberpunk when it doesn't wrap in other themes
  4. Confirm each theme still looks visually distinct (colors, font family, border-radius differ as expected).

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS 15

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Screenshots / Logs

<!-- If applicable, add screenshots or log output showing the fix/feature in action. -->

Before

<img width="3020" height="1734" alt="before" src="https://github.com/user-attachments/assets/e2d736d3-36d7-4778-8cb4-837ff60a4998" />

After

<img width="3020" height="1734" alt="after" src="https://github.com/user-attachments/assets/137956cf-f36b-419c-a897-769a4c01fd57" />

Changed files

  • web/src/themes/presets.ts (modified, +10/-19)

Code Example

N.A.

---



---

// Before — each theme hardcodes its own baseSize, divergence inevitable
typography: {
  fontSans: `"Inter", ${SYSTEM_SANS}`,
  baseSize: "14px",   // ← diverges from DEFAULT_TYPOGRAPHY silently
  lineHeight: "1.6",
  letterSpacing: "-0.005em",
},

// After — spread the shared base, override only what the theme actually needs
typography: {
  ...DEFAULT_TYPOGRAPHY,
  fontSans: `"Inter", ${SYSTEM_SANS}`,
  lineHeight: "1.6",
  letterSpacing: "-0.005em",
  // baseSize intentionally absent — inherits DEFAULT_TYPOGRAPHY.baseSize (15px)
},
RAW_BUFFERClick to expand / collapse

Bug Description

Switching between dashboard themes causes noticeable changes in font size and overall layout density. Content reflows, the number of items visible in a fixed viewport changes, and the reading experience shifts — making theme switching feel unstable rather than cosmetic. This appears to have been introduced by PR #14725 which added per-theme font/layout/density controls.

User impact: A user switching themes expects a color/font-family change, not a layout reflow. Having the number of visible items on a page change when switching themes is disorienting and suggests the app is not in control of its own layout.

Steps to Reproduce

  1. Open the Hermes dashboard (hermes dashboard).
  2. Go to Skills page and note how many skill rows are visible.
  3. Go to Settings → Theme and switch between themes (default, midnight, ember, mono, cyberpunk, rose).
  4. Return to Skills — the number of visible rows changes across themes, particularly noticeable between mono/cyberpunk (compact) and rose (spacious).
  5. Font sizes also shift — largest gap is between mono (13px) and rose (16px).

Expected Behavior

Switching themes should be a purely cosmetic change. Font size, spacing, and the number of items visible in a fixed viewport should remain constant across all themes. Visual differentiation should come from color palette, font family, border-radius, and typographic style — not from size or density.

Actual Behavior

Four independent properties diverge across themes:

1. baseSize — 3px spread

Each theme defines its own root font size independently in web/src/themes/presets.ts:

ThemebaseSizedensitylineHeightletterSpacing
default15pxcomfortable1.550
midnight14pxcomfortable1.6-0.005em
ember15pxcomfortable1.60
mono13pxcompact1.50
cyberpunk14pxcompact1.50.02em
rose16pxspacious1.70

2. density — spacing multiplier diverges

density maps to a --theme-spacing-mul CSS variable (compact = 0.85×, comfortable = 1.0×, spacious = 1.2×). In Tailwind v4, this scales the entire spacing scale — --spacing: calc(0.25rem * var(--theme-spacing-mul)). Every p-N, gap-N, w-56 (sidebar), and py-3/px-4 (card padding) changes, directly affecting how much viewport height the chrome consumes and how many items fit on screen.

3. lineHeight: "1.7" on rose — taller nav items

The sidebar nav links have no fixed height; their rendered height is fontSize × lineHeight + padding. Rose's 1.7 vs the default 1.55 adds ~2px per nav item, making the sidebar header container visibly taller and causing pixel-level layout differences on every page.

This was originally paired with density: spacious to create an "airy" feel — once density was normalized, the elevated lineHeight became an orphaned artefact that just creates height drift.

4. letterSpacing: "0.02em" on cyberpunk — text wraps earlier

Cyberpunk uses a monospace font (Share Tech Mono) for body text (fontSans). Monospace glyphs are inherently wider than proportional glyphs at the same baseSize. The additional 0.02em tracking compounds this: badge labels and skill descriptions that fit on one line in other themes wrap to a second line in cyberpunk.

Affected Component

Configuration (config.yaml, .env, hermes setup)

Messaging Platform (if gateway-related)

No response

Debug Report

N.A.

Operating System

MacOS 26.4

Python Version

No response

Hermes Version

No response

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

PR #14725 introduced baseSize, density, lineHeight, and letterSpacing as per-theme properties to give themes full typographic and layout control. No design constraint was enforced to keep layout-affecting values consistent, so each theme author set their own values independently — the intent was customisation, but the effect is layout instability.

density is the most impactful: even a 0.15× spacing change is enough to change the visible item count on any fixed-height page. lineHeight and letterSpacing are subtler but cause real element-height and text-wrapping differences that a user notices when switching themes.

Proposed Fix (optional)

Four coordinated data-only changes in web/src/themes/presets.ts. No logic changes, no CSS changes.

1. Normalize baseSize — spread DEFAULT_TYPOGRAPHY

Have all per-theme typography objects spread DEFAULT_TYPOGRAPHY and omit baseSize. The shared 15px default is inherited automatically; a future theme author must make an explicit, visible decision to deviate.

// Before — each theme hardcodes its own baseSize, divergence inevitable
typography: {
  fontSans: `"Inter", ${SYSTEM_SANS}`,
  baseSize: "14px",   // ← diverges from DEFAULT_TYPOGRAPHY silently
  lineHeight: "1.6",
  letterSpacing: "-0.005em",
},

// After — spread the shared base, override only what the theme actually needs
typography: {
  ...DEFAULT_TYPOGRAPHY,
  fontSans: `"Inter", ${SYSTEM_SANS}`,
  lineHeight: "1.6",
  letterSpacing: "-0.005em",
  // baseSize intentionally absent — inherits DEFAULT_TYPOGRAPHY.baseSize (15px)
},

Note: index.css is unchanged. rem is already anchored to html { font-size: var(--theme-base-size) }, so small and code scale proportionally. A rem → em change would be incorrect.

2. Normalize density — set all built-in themes to "comfortable"

Remove compact and spacious from all built-in theme layout objects. density remains a valid property for user-created custom themes that explicitly want the spacing shift; built-in themes should not impose it.

3. Normalize lineHeight on rose — remove the 1.7 override

Rose's explicit lineHeight: "1.7" was paired with density: spacious for an "airy" feel. Now that density is normalized, the elevated line-height is an orphaned artefact causing nav item height drift. Removing it lets it fall back to DEFAULT_TYPOGRAPHY's 1.55 via the spread.

4. Normalize letterSpacing on cyberpunk — change 0.02em to "0"

Cyberpunk already uses a monospace font (Share Tech Mono) for body text, which is inherently wider than proportional fonts. The additional 0.02em tracking compounds the width increase and causes text to wrap earlier than in other themes. Setting it to "0" brings text wrapping in line with the other themes while preserving the monospace aesthetic.

Result

ThemebaseSizedensitylineHeightletterSpacing
default15px (–)comfortable (–)1.55 (–)0 (–)
midnight15pxcomfortable (–)1.6 (–)-0.005em (–)
ember15px (–)comfortable (–)1.6 (–)0 (–)
mono15pxcomfortable1.5 (–)0 (–)
cyberpunk15pxcomfortable1.5 (–)0
rose15pxcomfortable1.550 (–)

Why this is the right approach

  • Fixes all four symptoms: font-size, item-count shift, nav height drift, and text-wrapping all resolved.
  • Right mental model: palette, font family, radius, and stylistic letter-spacing are the axes of theme identity. Base size, spacing density, and line-height are not — they are accessibility/preference controls and should not vary silently between themes.
  • Prevents recurrence: spreads and shared defaults mean future theme authors can't accidentally diverge on these axes without a visible, intentional override.
  • Self-documenting: ...DEFAULT_TYPOGRAPHY makes the inheritance relationship explicit. A reviewer immediately understands the contract.
  • No new abstraction: no enforcement logic, no runtime guard, no TypeScript trickery.

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

extent analysis

TL;DR

Normalize baseSize, density, lineHeight, and letterSpacing across all themes to prevent layout instability when switching themes.

Guidance

  • Review the web/src/themes/presets.ts file and update the typography objects for each theme to spread the DEFAULT_TYPOGRAPHY and omit baseSize.
  • Set all built-in themes to use "comfortable" density and remove any overrides.
  • Remove the lineHeight override for the rose theme to fall back to the default value.
  • Update the cyberpunk theme to use "0" for letterSpacing to prevent early text wrapping.

Example

typography: {
  ...DEFAULT_TYPOGRAPHY,
  fontSans: `"Inter", ${SYSTEM_SANS}`,
  lineHeight: "1.6",
  letterSpacing: "-0.005em",
}

Notes

This fix assumes that the DEFAULT_TYPOGRAPHY object is defined and exports the desired default values for baseSize, density, lineHeight, and letterSpacing.

Recommendation

Apply the proposed workaround by normalizing the typography properties across all themes to ensure a consistent layout and prevent instability when switching themes. This approach fixes all four symptoms, uses the right mental model, and prevents recurrence by making the inheritance relationship explicit.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - ✅(Solved) Fix [Bug]: Dashboard Theme Changes Cause Layout Shifts [1 pull requests, 2 comments, 2 participants]