Skip to content

Fix/dashboard theme layout shift - #17232

Merged
teknium1 merged 2 commits into
NousResearch:mainfrom
AllardQuek:fix/dashboard-theme-layout-shift
May 1, 2026
Merged

Fix/dashboard theme layout shift#17232
teknium1 merged 2 commits into
NousResearch:mainfrom
AllardQuek:fix/dashboard-theme-layout-shift

Conversation

@AllardQuek

@AllardQuek AllardQuek commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

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 #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

Before

before

After

after

All built-in themes now spread DEFAULT_TYPOGRAPHY, removing independent
baseSize overrides and converging on 15px. All themes also use
density: comfortable, removing the compact/spacious divergence that
caused item-count shifts on fixed-height pages (e.g. Skills).

Two additional per-theme overrides are also normalized:

- rose: lineHeight: "1.7" removed — was paired with density: spacious
  for an airy feel; once density was normalised the elevated line-height
  became an orphaned artefact causing nav item height drift.

- cyberpunk: letterSpacing changed from "0.02em" to "0" — extra tracking
  on top of an already-wide monospace font caused text to wrap earlier
  than in other themes.

Switching themes is now a purely cosmetic change — color palette,
font family, border-radius, and typographic style differ; font size,
spacing, line-height, and letter-spacing do not.
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/tui Terminal UI (ui-tui/ + tui_gateway/) labels Apr 29, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Fixes #17229.

Themes previously embedded layout-affecting values (baseSize, lineHeight,
density, letterSpacing) alongside visual identity properties, coupling
user ergonomic preferences to color theme selection.

This change establishes a clear separation of concerns:

- Themes own: palette, font family, border-radius, and font-coupled
  letterSpacing (e.g. Inter's -0.005em tracking)
- Layout scale (baseSize, lineHeight, density) is standardized via
  DEFAULT_TYPOGRAPHY and DEFAULT_LAYOUT — not overridden per theme

All themes now spread DEFAULT_TYPOGRAPHY and DEFAULT_LAYOUT as their
base, removing silent divergence and making future layout settings
(e.g. user-configurable density) trivially applicable across all themes
without per-theme special-casing.
@AllardQuek

AllardQuek commented Apr 30, 2026

Copy link
Copy Markdown
Contributor Author

Referencing the discussion here #17229 (comment), acceptance of this PR would depend on whether our direction is to have separation of concerns between visual identity (e.g. colors, fonts, corner radius) and layout density, versus opinionated themes where each theme sets their own font sizes, densities, etc.

The latest commit supports the former direction, further improving layout consistency across themes with usage of the already existing DEFAULT_LAYOUT (now the skills in the screenshot are aligned horizontally taking similar heights):

image (3)

@teknium1
teknium1 merged commit ebe60ab into NousResearch:main May 1, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tui Terminal UI (ui-tui/ + tui_gateway/) P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Dashboard Theme Changes Cause Layout Shifts

3 participants