Skip to content

feat(viewer): restyle the viewer on one design system, with a light scheme - #352

Merged
DrunkOnJava merged 2 commits into
mainfrom
feat/viewer-design-system
Sep 23, 2026
Merged

DrunkOnJava merged 2 commits into
mainfrom
feat/viewer-design-system

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

The browser viewer is restyled on one design system, and gains a light scheme that follows the system setting.

  • A black 56px header over a white sheet with rounded top corners. One blue accent carries every primary action, link, focus ring and selection.
  • Pill buttons, 8px fields and panels, 12px cards, hairline borders instead of shadows.
  • Every label is sans serif and sentence case. Figures that line up use tabular numerals, not a monospace face.
  • The 3D canvas, grid, lights, axes and selection highlight read their colours from the same tokens and switch with the scheme.
  • The category colours (feat(viewer): colour elements with no material by their category #350) and the plan export's palette now come from the design system's gray, blue, red, green and amber ramps. Blue-6 is left to the selection highlight.

Motivation

The viewer is the first thing most people see of rvt-rs. It was dark only, with an ad hoc palette and a monospace face on data, and the 3D view drew every category darker than its colour.

Changes

  • viewer/src/tokens.css (new): the design system's tokens. The web-font import is left out, so the viewer still makes no network requests, and the two monospace tokens point at the sans face.
  • viewer/src/styles.css (new): every viewer selector restyled on the tokens. It replaces the 1,180-line inline style block in index.html, and the link colours set inline in the markup.
  • viewer/src/main.ts:
    • The scene theme comes from the tokens, rebuilt on a scheme change.
    • Light intensities are set for three.js physical units: a matte face returns its colour times its light over pi, so the old 0.8 and 0.7 drew every face at about half its colour.
    • Status, progress and badge copy is sentence case.
  • viewer/index.html: the wordmark, Export IFC as the one filled primary action, and sentence-case placeholders.
  • viewer/scripts/stage-demos.mjs: demo thumbnails are flat tiles in the tint of their kind, with a building mark that reads at the card's 72 x 40.
  • src/ifc/gltf.rs, src/ifc/sheet.rs: palettes on the ramps. The plan's border and label grays match.
  • The CHANGELOG, including the feat(viewer): colour elements with no material by their category #350 entry's colour list, and the README's plan-export row.

Testing

  • Playwright: all 15 tests pass against Einhoven. The case-sensitive status assertions now expect sentence case.
  • npm run typecheck and npm run build.
  • The wasm network-import audit passes.
  • Light and dark screenshots of the empty state, Einhoven and Core Interior. Each category draws in its token colour.
  • cargo fmt, clippy -D warnings, rustdoc -D warnings, and the full workspace suite.

What this does not do

  • There is no theme toggle in the page. The scheme follows the system; data-theme on the root element forces one.
  • Elements still carry no real materials. The colours are per category.

Audit-honesty checklist

  • No capability claims change.
  • No emojis, private paths or personal data.

Legal and contribution hygiene

  • Apache-2.0
  • No format-RE content.

Note

Low Risk
Mostly UI, styling, and colour constants; no auth, parsing, or export logic changes beyond palette values and viewer lighting.

Overview
Restyles the browser viewer on a shared Sonic Console token set (viewer/src/tokens.css, viewer/src/styles.css), replacing the large inline stylesheet in index.html. The UI follows system light/dark (semantic tokens + prefers-color-scheme / optional data-theme), with a black header, white sheet, pill controls, sentence-case copy, and tabular numerals instead of monospace.

The Three.js scene now reads canvas, grid, lights, axes, and selection colours from those CSS tokens via applySceneTheme(), with brighter hemisphere/directional lighting so category colours read closer to their intended sRGB values.

Export visuals stay in sync: category_colour in gltf.rs and plan SVG strokes/fills in sheet.rs move to the same gray/blue/red/green/amber ramps (e.g. doors amber, windows translucent blue); docs and changelog reflect the new hues. Demo gallery thumbnails become flat tinted tiles with a simple building icon (stage-demos.mjs).

Playwright expectations update for sentence-case status strings (Ready / Loaded).

Reviewed by Cursor Bugbot for commit 70c753d. Configure here.

@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) September 23, 2026 13:44
@cursor

cursor Bot commented Sep 23, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_730acc85-8f3b-43e4-90a9-9f491918a4ed)

@DrunkOnJava
DrunkOnJava merged commit 95567f6 into main Sep 23, 2026
22 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/viewer-design-system branch September 23, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant