Skip to content

feat(layout): Map-Canvas+ tokens, Layout::Canvas and shell test helpers - #193

Closed
roncodes wants to merge 1 commit into
mainfrom
feature/upbeat-wu-16d81b
Closed

roncodes wants to merge 1 commit into
mainfrom
feature/upbeat-wu-16d81b

Conversation

@roncodes

Copy link
Copy Markdown
Member

Shell phase 1 (foundations) of the Map-Canvas+ console redesign. This change only adds things and is opt-in: no existing component or style changes, and nothing in the classic layout reads the new tokens.

What's added

Design tokens: addon/styles/tokens.css

  • --fb-* CSS variables under [data-theme='light'] (also on :root) and [data-theme='dark']: surface, subtle, border, text, muted, accent, accent-fg, focus, chrome glass and its border, info/warn/ok/critical (each with a -subtle background), map land/water/road/route, the dot-grid canvas (light #EEF1F5/#B8C3D1, dark #0B1220/#26344F, 22px), and chrome and sheet shadows.
  • Geometry that doesn't depend on the theme: radius (control 8, card 12, chrome 14, dock 18) and content insets (left 82, top 64, bottom 80, right 12).
  • Imported first in addon.css. Mapped in tailwind.config.js to bg-surface, text-muted, border-border, text-text, bg-accent, ring-focus, bg-chrome, text-info / bg-info-subtle (and the same for warn, ok and critical), bg-map-*, bg-canvas, rounded-control|card|chrome|dock, shadow-chrome|sheet, and spacing canvas-left|top|bottom|right. No existing class names clash.

<Layout::Canvas @theme?>: the shell root, with three layers stacked lowest first:

  • <:backdrop>: defaults to the dot grid.
  • default block: content, a <main> placed by the inset variables.
  • <:chrome>: the layer has pointer-events: none and its direct children have auto. It renders only when the block is passed.
  • @theme scopes a theme to the canvas alone.

<Layout::Canvas::Backdrop::DotGrid />: decorative (hidden from screen readers). Change the grid size with style="--fb-canvas-grid: …".

Shell test helpers: @fleetbase/ember-ui/test-support (new addon-test-support/)
SHELL_THEMES, setShellTheme, snapshotShellTheme, setupShellTheme(hooks), eachShellTheme(cb), renderShell(template, { theme }), which returns .fb-canvas or null, and shellToken(name, el).

Tests

  • Rendering tests for every block state in light and dark, plus pointer pass-through, layer order, inset geometry and inset overrides.
  • Every token's value in both themes, and in neither theme.
  • The test-support helpers themselves.
  • tests/node/tokens-tailwind-test.cjs checks that the utilities compile to the variables and that every variable the config references is defined (run it with node --test tests/node).

The coverage gate passes: every addon file, addon-test-support/index.js included, is at 100% for statements, branches, functions and lines.

Local run note: the run used a node_modules with ember-core from the workspace (0.3.27) because 0.3.25 is missing from the local store. With that setup, 4 existing tests fail: filter/model name path, the navigator search-result style, and the driver/pill resource-component tests. 3 of them also fail on the untouched base commit ae839f8 in the same environment, and the 4th checks the same driver/pill lookup. CI with a clean install is the real check.

Out of scope

The dock, context bar, taskbar, ember-core services, console wiring (layout flag, ?layout=canvas) and engines come in later phases.

Shell phase 1 (foundations), additive and opt-in; the classic layout is unchanged.

- styles/tokens.css: --fb-* CSS variables under [data-theme=light|dark]
  (light also on :root) for surface, text, accent, chrome, status, map,
  dot-grid canvas, radius, shadow and content insets; mapped into
  tailwind.config.js (bg-surface, text-muted, rounded-chrome, ...).
- Layout::Canvas: backdrop (named block, defaults to the dot grid),
  content (<main>, positioned by the inset variables) and chrome
  (named block; pointer-events none on the layer, auto on children).
  Optional @theme scopes a theme to the canvas.
- Layout::Canvas::Backdrop::DotGrid.
- @fleetbase/ember-ui/test-support: setupShellTheme, setShellTheme,
  snapshotShellTheme, eachShellTheme, renderShell, shellToken.
- Rendering tests for every component and state in both themes, token
  value tests, and a node test for the Tailwind mapping.
@roncodes

Copy link
Copy Markdown
Member Author

Superseded by #194 (same change, moved to the feat/canvas-layout branch).

@roncodes roncodes closed this Nov 27, 2026
@roncodes
roncodes deleted the feature/upbeat-wu-16d81b branch November 27, 2026 03:06
@codecov

codecov Bot commented Nov 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (ae839f8) to head (e1fdc9a).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #193   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          338       338           
  Lines         9369      9369           
=========================================
  Hits          9369      9369           
Flag Coverage Δ
ember-ui 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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