diff --git a/.gitignore b/.gitignore index 0d51833f09..5e3ca974d8 100644 --- a/.gitignore +++ b/.gitignore @@ -114,3 +114,5 @@ src/scaffolding.config .claude/skills/impeccable/ .claude/agents/impeccable-*.md .claude/settings.local.json +# Impeccable: regenerable cache of docs/DESIGN.md; docs/DESIGN.md is the source +.impeccable/design.json diff --git a/docs/DESIGN.md b/docs/DESIGN.md new file mode 100644 index 0000000000..64dbbab223 --- /dev/null +++ b/docs/DESIGN.md @@ -0,0 +1,204 @@ +--- +name: ServicePulse +description: Operations console for NServiceBus systems. Problems first, calm otherwise. +colors: + brand: "#00a3c4" + canvas: "#f2f6f7" + surface: "#ffffff" + danger: "#ce4844" + trial: "#b22222" + chrome: "#1a1a1a" + chrome-ink: "#b4bcbd" + chrome-ink-muted: "#8a9496" + chrome-ink-active: "#ffffff" + chrome-hover: "#262a2b" + chrome-active: "#2f3537" + chrome-divider: "#2c3132" +typography: + body: + fontFamily: "Helvetica Neue, Helvetica, Arial, sans-serif" + fontSize: "14px" + fontWeight: 400 + lineHeight: 1.43 + nav-item: + fontFamily: "Helvetica Neue, Helvetica, Arial, sans-serif" + fontSize: "15px" + fontWeight: 400 + lineHeight: 1.3 + nav-item-active: + fontFamily: "Helvetica Neue, Helvetica, Arial, sans-serif" + fontSize: "15px" + fontWeight: 600 + lineHeight: 1.3 + nav-group-label: + fontFamily: "Helvetica Neue, Helvetica, Arial, sans-serif" + fontSize: "12px" + fontWeight: 700 + lineHeight: 1.4 + letterSpacing: "0.08em" + page-title: + fontFamily: "Helvetica Neue, Helvetica, Arial, sans-serif" + fontSize: "30px" + fontWeight: 700 + lineHeight: 1.2 +rounded: + sm: "6px" +spacing: + xs: "4px" + sm: "8px" + md: "12px" + lg: "20px" + sidebar: "248px" + sidebar-collapsed: "64px" +components: + sidebar: + backgroundColor: "{colors.chrome}" + textColor: "{colors.chrome-ink}" + width: "{spacing.sidebar}" + sidebar-item: + textColor: "{colors.chrome-ink}" + typography: "{typography.nav-item}" + rounded: "{rounded.sm}" + padding: "8px 12px" + height: "40px" + sidebar-item-hover: + backgroundColor: "{colors.chrome-hover}" + textColor: "{colors.chrome-ink-active}" + sidebar-item-active: + backgroundColor: "{colors.chrome-active}" + textColor: "{colors.chrome-ink-active}" + typography: "{typography.nav-item-active}" + sidebar-group-label: + textColor: "{colors.chrome-ink-muted}" + typography: "{typography.nav-group-label}" + padding: "0 12px" + count-badge: + backgroundColor: "{colors.danger}" + textColor: "{colors.surface}" + trial-license-bar: + backgroundColor: "{colors.trial}" + textColor: "{colors.surface}" + padding: "6px 16px" +--- + +# Design System: ServicePulse + +This document describes the ServicePulse design system. The values above are mirrored as CSS custom properties in `src/Frontend/src/assets/tokens.css` (`colors.chrome` is `--sp-chrome`, and so on); change both in the same pull request. It is written to be read by people and by any tool, and does not depend on a particular one. + +## Overview + +ServicePulse is an operations console. People open it mostly when something is wrong in production, or while developing to understand how their system behaves ([product](PRODUCT.md)). The design follows from that: + +- **Problems first.** What is broken and needs action is visible before anything else: counts and warnings sit next to the area they belong to, in the navigation itself. +- **Calm when healthy.** A healthy system shows no decoration: no "all good" banners, no colour without meaning. +- **The existing look is kept.** Dark application chrome, a light canvas for content, the teal brand mark. Changes improve structure, legibility and accessibility rather than restyle. + +**Key characteristics:** + +- Dark left sidebar holds all navigation; content sits on a light canvas. +- Colour carries state (danger, warning, trial), never decoration. +- One typeface family, sized for dense, scannable lists. + +## Colors + +A restrained palette: neutral chrome and canvas, the brand teal, and state colours. + +### Primary + +- **Brand teal** (`#00a3c4`): the ServicePulse mark, the icon of the active navigation item, and the "Updates available" link in the sidebar. On the dark chrome it reaches 5.8:1. + +### Neutral + +- **Chrome** (`#1a1a1a`): sidebar background. +- **Chrome ink** (`#b4bcbd`): sidebar item text, 9.0:1 on chrome. +- **Chrome ink, muted** (`#8a9496`): sidebar group labels, 5.6:1 on chrome. +- **Chrome hover** (`#262a2b`) and **chrome active** (`#2f3537`): item backgrounds for hover and for the current area; active text is white (12.5:1). +- **Chrome divider** (`#2c3132`): separates the sidebar's bottom items. +- **Canvas** (`#f2f6f7`): page background behind content. **Surface** (`#ffffff`): panels and lists. + +### State + +- **Danger** (`#ce4844`): count badges for things that need action (failed messages, failing custom checks, unhealthy heartbeats). +- **Trial** (`#b22222`): the trial-license bar, white text at 6.7:1. + +### Named rules + +**The Meaning Rule.** A colour other than the neutrals always means a state or the current location. Status is never shown by colour alone: a count, a word or an icon carries it too. + +**The Contrast Rule.** Text meets WCAG 2.2 AA: 4.5:1 for normal text, 3:1 for large text and for icons that carry meaning. + +## Typography + +**Body font:** Helvetica Neue (with Helvetica, Arial, sans-serif). + +**Character:** neutral and compact; the content (endpoint names, exception types, counts) is the voice. + +- **Body:** 14px, line height 1.43. +- **Navigation items:** 15px regular; the current area is 600 weight. +- **Navigation group labels:** 12px bold uppercase, tracked 0.08em. +- **Page title:** 30px bold. + +## Layout + +**Desktop-first, landscape.** Desktop is the main target ([product](PRODUCT.md)) and desktop viewports are wider than they are tall, so horizontal space is cheap and vertical space is scarce. Navigation therefore lives in a left sidebar and there is no top navigation bar, so the height goes to content. A footer appears only when there is license information to show, and then only under the content column, never under the sidebar. + +- **Sidebar:** 248px wide. Collapsible to a 64px icon rail; the choice is remembered per browser. +- **Content:** fills the remaining width and scrolls on its own; the sidebar stays in place. +- **Small screens (below 768px):** a slim top bar with a menu button and the logo; the sidebar opens as a drawer over the content, moves focus into itself and closes on Escape, on the close button, on the backdrop or after navigating. +- Every task stays usable on tablets and phones; the page itself must not force a minimum width. + +## Elevation & Depth + +Flat. Regions are separated by colour (dark chrome against a light canvas) and by 1px dividers, not by shadows. + +## Shapes + +Small, consistent rounding: 6px on navigation items and controls. Count badges are pills. + +## Components + +### Sidebar + +The single place for navigation. Top to bottom: + +1. The ServicePulse logo, linking to the dashboard, and the collapse control. +2. **Dashboard.** +3. Groups, each with a label: **Recoverability** (Failed Messages, Heartbeats, Custom Checks), **Monitoring** (Monitoring), **Auditing** (All Messages), **Platform** (Platform health, Events). +4. A bottom block, separated by a divider: platform update status ("Updates available", linking to Platform health, shown only when an update exists; "Integrated ServicePulse" in integrated mode), then **Usage**, **Configuration**, **Feedback** and the signed-in user. + +Items the user is not permitted to use, or capabilities that are not configured, are not shown; a group with no items is not shown either. + +### Sidebar item + +Icon (18px) and label in one row, 40px high, 6px rounding. States: default (chrome ink), hover (chrome hover background, white text), current area (chrome active background, white 600-weight text, teal icon), keyboard focus (2px teal outline). Labels are always present for assistive technology; in the collapsed rail they are visually hidden, not removed. + +### Count badge and warning mark + +A danger-coloured pill with a number sits at the end of an item when that area has something needing action. A warning triangle marks degraded or misconfigured areas (Platform health, Configuration, Usage). In the collapsed rail both move to the icon's top-right corner. + +### Footer + +Carries license information only: for a trial license, a trial-colour bar " license, non-production use only" linking to the license page. With any other license there is no footer. It sits below the current view in the content column and never spans the sidebar. + +## Do's and Don'ts + +**Do:** + +- Put a count or warning next to the navigation item it belongs to. +- Keep text labels on every navigation item, also for screen readers when visually collapsed. +- Use the shared tokens (`tokens.css`) for colours, sizes and rounding in new styles. +- Name components by role ("sidebar item", "count badge"), not by a library's class names. +- Build views from the shared components in `src/Frontend/src/components`; do not add Bootstrap component classes or `data-bs-*` attributes (see the [UI guideline](guidelines/ui.md)). + +**Don't:** + +- Add a top navigation bar or a permanent footer; they take vertical space from content. +- Use brand teal for text on the light canvas or on white: it reaches only 2.7–3.0:1 there. +- Show healthy status as decoration. + +### Known gaps + +- **Brand teal on light backgrounds.** Links, tabs and primary buttons inside pages still use `#00a3c4` on white or canvas, which fails AA for text (2.7–3.0:1). Outside the scope of the shell change; needs a darker interactive teal. +- **Page-level tabs** (e.g. Failed Messages' five tabs) still sit inside pages. Moving them into the sidebar as sub-items is a follow-up. +- **Page content on small screens** is usable but not yet designed for narrow widths. +- **User menu** still relies on Bootstrap's dropdown until Bootstrap is removed. diff --git a/docs/README.md b/docs/README.md index 1e0b510f8f..f7275efe61 100644 --- a/docs/README.md +++ b/docs/README.md @@ -23,6 +23,7 @@ ServicePulse is the web operations console of the Particular Service Platform. I ## Architecture and design - [Product](PRODUCT.md) — who ServicePulse is for, the situations it is used in, and what it must do +- [Design system](DESIGN.md) — how the UI looks and behaves, the layout rules, and the tokens mirrored in `src/Frontend/src/assets/tokens.css` - [Platform topology](platform-topology.md) — how ServicePulse models ServiceControl instances and which ones it calls directly - [Platform health page](frontend/platform-health-page.md) — how Platform health derives its rows and severity - [Custom checks page](frontend/custom-checks-page.md) — how internal platform custom checks relate to other views diff --git a/docs/frontend/platform-health-page.md b/docs/frontend/platform-health-page.md index 3a3cfba6cc..16d34cfd2e 100644 --- a/docs/frontend/platform-health-page.md +++ b/docs/frontend/platform-health-page.md @@ -213,7 +213,7 @@ npx vitest run test/mocks/platform-health-state.spec.ts | `src/Frontend/src/resources/PlatformHealth.ts` | Page-specific response/row types | | `src/Frontend/test/mocks/platform-health-state.ts` | Runtime mock topology and custom-check controls | | `src/Frontend/src/components/platformhealth/PlatformHealthMenuItem.vue` | Navigation severity and tooltip behavior | -| `src/Frontend/src/components/PageFooter.vue` | Aggregate platform update status in the footer | +| `src/Frontend/src/components/platformhealth/PlatformUpdatesMenuItem.vue` | Aggregate platform update status in the sidebar | ## Troubleshooting diff --git a/docs/frontend/testing-basics.md b/docs/frontend/testing-basics.md index 332ac00d52..09fb8bccb8 100644 --- a/docs/frontend/testing-basics.md +++ b/docs/frontend/testing-basics.md @@ -75,7 +75,7 @@ export const setupComplete = (async () => { Run focused Vitest specs from `src/Frontend`: ```bash -npx vitest run src/components/PageFooter.spec.ts +npx vitest run src/components/platformhealth/PlatformUpdatesMenuItem.spec.ts npx vitest run test/specs/platformcapabilities/monitoring-capability-card.spec.ts npx vitest run test/specs/platformcapabilities/recoverability-capability-card.spec.ts npx vitest run src/views/PlatformHealthView.spec.ts diff --git a/src/Frontend/src/App.vue b/src/Frontend/src/App.vue index 068f83fe7d..fc7428c200 100644 --- a/src/Frontend/src/App.vue +++ b/src/Frontend/src/App.vue @@ -1,8 +1,8 @@ + + + + diff --git a/src/Frontend/src/components/FeedbackButton.vue b/src/Frontend/src/components/FeedbackButton.vue index e01ac18ce3..c2612d4e7a 100644 --- a/src/Frontend/src/components/FeedbackButton.vue +++ b/src/Frontend/src/components/FeedbackButton.vue @@ -5,35 +5,11 @@ import ExternalLink from "@/components/ExternalLink.vue"; diff --git a/src/Frontend/src/components/PageFooter.spec.ts b/src/Frontend/src/components/PageFooter.spec.ts index 16db358a20..2fd30f77ba 100644 --- a/src/Frontend/src/components/PageFooter.spec.ts +++ b/src/Frontend/src/components/PageFooter.spec.ts @@ -1,6 +1,6 @@ import { render, screen } from "@component-test-utils"; import { createTestingPinia } from "@pinia/testing"; -import { describe, expect, test, vi } from "vitest"; +import { describe, expect, test } from "vitest"; import PageFooter from "@/components/PageFooter.vue"; import { useLicenseStore } from "@/stores/LicenseStore"; @@ -9,44 +9,26 @@ const RouterLinkStub = { template: '', }; -const platformHealthStore = vi.hoisted(() => ({ - outdatedOnly: false, - rows: [] as Array<{ upgradeAvailable: boolean }>, -})); - -vi.mock("@/composables/usePlatformHealthStoreAutoRefresh", () => ({ - default: () => ({ - store: platformHealthStore, - }), -})); - describe("PageFooter", () => { - test("shows updates available and links to platform health when any row is outdated", () => { - platformHealthStore.outdatedOnly = false; - platformHealthStore.rows = [{ upgradeAvailable: false }, { upgradeAvailable: true }]; + test("shows the trial license bar for a trial license", () => { + renderFooter(true); - renderFooter(); - - const updatesLink = screen.getByRole("link", { name: /Updates available/i }); - expect(updatesLink).toBeInTheDocument(); - expect(updatesLink).toHaveAttribute("href", "/platform-health"); + expect(screen.getByRole("status", { name: /trial license bar information/i })).toBeInTheDocument(); }); - test("shows platform up to date when no rows are outdated", () => { - platformHealthStore.outdatedOnly = false; - platformHealthStore.rows = [{ upgradeAvailable: false }]; - - renderFooter(); + test("shows nothing for a non-trial license", () => { + renderFooter(false); - expect(screen.getByText("Platform up to date")).toBeInTheDocument(); + expect(screen.queryByRole("status", { name: /trial license bar information/i })).not.toBeInTheDocument(); + expect(screen.queryByRole("contentinfo")).not.toBeInTheDocument(); }); }); -function renderFooter() { +function renderFooter(isTrialLicense: boolean) { const pinia = createTestingPinia({ stubActions: false }); const licenseStore = useLicenseStore(pinia); licenseStore.license.license_status = "valid" as never; - licenseStore.licenseStatus.isTrialLicense = false; + licenseStore.licenseStatus.isTrialLicense = isTrialLicense; return render(PageFooter, { global: { diff --git a/src/Frontend/src/components/PageFooter.vue b/src/Frontend/src/components/PageFooter.vue index 649b1b9cfa..889f5e8ed2 100644 --- a/src/Frontend/src/components/PageFooter.vue +++ b/src/Frontend/src/components/PageFooter.vue @@ -1,56 +1,24 @@ - - diff --git a/src/Frontend/src/components/PageHeader.vue b/src/Frontend/src/components/PageHeader.vue deleted file mode 100644 index faec383e79..0000000000 --- a/src/Frontend/src/components/PageHeader.vue +++ /dev/null @@ -1,78 +0,0 @@ - - - - - diff --git a/src/Frontend/src/components/UserProfileMenuItem.vue b/src/Frontend/src/components/UserProfileMenuItem.vue index 2f701aa784..26d5edac25 100644 --- a/src/Frontend/src/components/UserProfileMenuItem.vue +++ b/src/Frontend/src/components/UserProfileMenuItem.vue @@ -18,12 +18,12 @@ async function handleLogout() { diff --git a/src/Frontend/src/components/configuration/ConfigurationMenuItem.vue b/src/Frontend/src/components/configuration/ConfigurationMenuItem.vue index fedab35c36..0970a4ddd8 100644 --- a/src/Frontend/src/components/configuration/ConfigurationMenuItem.vue +++ b/src/Frontend/src/components/configuration/ConfigurationMenuItem.vue @@ -37,6 +37,5 @@ const displayDanger = computed(() => { diff --git a/src/Frontend/src/components/customchecks/CustomChecksMenuItem.vue b/src/Frontend/src/components/customchecks/CustomChecksMenuItem.vue index b3c4542f68..4bcbcf8b43 100644 --- a/src/Frontend/src/components/customchecks/CustomChecksMenuItem.vue +++ b/src/Frontend/src/components/customchecks/CustomChecksMenuItem.vue @@ -19,6 +19,5 @@ const { failingCount } = storeToRefs(store); diff --git a/src/Frontend/src/components/dashboard/DashboardMenuItem.vue b/src/Frontend/src/components/dashboard/DashboardMenuItem.vue index fe5b21cc5a..fc93c4ff67 100644 --- a/src/Frontend/src/components/dashboard/DashboardMenuItem.vue +++ b/src/Frontend/src/components/dashboard/DashboardMenuItem.vue @@ -13,8 +13,7 @@ import FAIcon from "@/components/FAIcon.vue"; diff --git a/src/Frontend/src/components/failedmessages/FailedMessagesMenuItem.vue b/src/Frontend/src/components/failedmessages/FailedMessagesMenuItem.vue index 92cd5da021..72cf25facb 100644 --- a/src/Frontend/src/components/failedmessages/FailedMessagesMenuItem.vue +++ b/src/Frontend/src/components/failedmessages/FailedMessagesMenuItem.vue @@ -19,6 +19,5 @@ const { failedMessageCount } = storeToRefs(store); diff --git a/src/Frontend/src/components/heartbeats/HeartbeatsMenuItem.vue b/src/Frontend/src/components/heartbeats/HeartbeatsMenuItem.vue index abf27da5a9..63f05b8575 100644 --- a/src/Frontend/src/components/heartbeats/HeartbeatsMenuItem.vue +++ b/src/Frontend/src/components/heartbeats/HeartbeatsMenuItem.vue @@ -19,6 +19,5 @@ const { failedHeartbeatsCount } = storeToRefs(store); diff --git a/src/Frontend/src/components/monitoring/MonitoringMenuItem.vue b/src/Frontend/src/components/monitoring/MonitoringMenuItem.vue index bf6aa8863b..756d5f456f 100644 --- a/src/Frontend/src/components/monitoring/MonitoringMenuItem.vue +++ b/src/Frontend/src/components/monitoring/MonitoringMenuItem.vue @@ -19,6 +19,5 @@ const { disconnectedEndpointsCount } = storeToRefs(statsStore); diff --git a/src/Frontend/src/components/platformhealth/PlatformHealthMenuItem.vue b/src/Frontend/src/components/platformhealth/PlatformHealthMenuItem.vue index b86337a3dc..6c8935fecb 100644 --- a/src/Frontend/src/components/platformhealth/PlatformHealthMenuItem.vue +++ b/src/Frontend/src/components/platformhealth/PlatformHealthMenuItem.vue @@ -54,8 +54,7 @@ const tooltip = computed(() => { diff --git a/src/Frontend/src/views/throughputreport/ThroughputMenuItem.vue b/src/Frontend/src/views/throughputreport/ThroughputMenuItem.vue index 3004496387..d0f476368d 100644 --- a/src/Frontend/src/views/throughputreport/ThroughputMenuItem.vue +++ b/src/Frontend/src/views/throughputreport/ThroughputMenuItem.vue @@ -22,6 +22,5 @@ const { endpoints, validId, error: licenseDetailsError } = storeToRefs(licenseDe diff --git a/src/Frontend/test/mocks/scenarios/index.ts b/src/Frontend/test/mocks/scenarios/index.ts index 2e41959897..a73fa11864 100644 --- a/src/Frontend/test/mocks/scenarios/index.ts +++ b/src/Frontend/test/mocks/scenarios/index.ts @@ -38,6 +38,9 @@ const scenarios: Record Promise> = { "monitoring-no-endpoints": () => import("./monitoring/monitoring-no-endpoints"), // Platform health scenarios "platform-health": () => import("./platform-health/platform-health"), + // Licensing scenarios + "license-trial": () => import("./licensing/license-trial"), + "license-trial-expired": () => import("./licensing/license-trial-expired"), // Recoverability scenarios "recoverability-available": () => import("./recoverability/recoverability-available"), "recoverability-unavailable": () => import("./recoverability/recoverability-unavailable"), diff --git a/src/Frontend/test/mocks/scenarios/licensing/license-shared.ts b/src/Frontend/test/mocks/scenarios/licensing/license-shared.ts new file mode 100644 index 0000000000..743e74e3a0 --- /dev/null +++ b/src/Frontend/test/mocks/scenarios/licensing/license-shared.ts @@ -0,0 +1,25 @@ +/** + * Shared setup for licensing scenarios: the default dev-mocks data + * (failed messages, custom checks, monitored endpoints) with a given license. + */ +import type { SetupFactoryOptions } from "../../../driver"; +import * as precondition from "../../../preconditions"; + +type SetupFactory = (options: SetupFactoryOptions) => unknown; + +export const withDefaultDataAndLicense = + (license: SetupFactory) => + async ({ driver }: SetupFactoryOptions) => { + await driver.setUp(precondition.serviceControlWithMonitoring); + await driver.setUp(precondition.hasCustomChecks(3, 2)); + await driver.setUp(precondition.monitoredEndpointsNamed(["Universe.Solarsystem.Mercury.Endpoint1", "Universe.Solarsystem.Venus.Endpoint3", "Universe.Solarsystem.Earth.Endpoint5"])); + await driver.setUp( + precondition.hasFailedMessage({ + withGroupId: "81dca64e-76fc-e1c3-11a2-3069f51c58c8", + withMessageId: "40134401-bab9-41aa-9acb-b19c0066f22d", + withContentType: "application/json", + withBody: { Index: 0, Data: "" }, + }) + ); + await driver.setUp(license); + }; diff --git a/src/Frontend/test/mocks/scenarios/licensing/license-trial-expired.ts b/src/Frontend/test/mocks/scenarios/licensing/license-trial-expired.ts new file mode 100644 index 0000000000..6976c62841 --- /dev/null +++ b/src/Frontend/test/mocks/scenarios/licensing/license-trial-expired.ts @@ -0,0 +1,18 @@ +/** + * Scenario: Expired trial license + * + * A trial license that expired 10 days ago, with the default dev-mocks data. + * License warnings appear on Configuration and in the license notifications. + * + * Usage: + * VITE_MOCK_SCENARIO=license-trial-expired npm run dev:mocks + */ +import { createScenario } from "../scenario-helper"; +import * as precondition from "../../../preconditions"; +import { LicenseType } from "@/resources/LicenseInfo"; +import { withDefaultDataAndLicense } from "./license-shared"; + +const { worker, runScenario } = createScenario(); + +export { worker }; +export const setupComplete = runScenario(withDefaultDataAndLicense(precondition.hasExpiredLicense(LicenseType.Trial))); diff --git a/src/Frontend/test/mocks/scenarios/licensing/license-trial.ts b/src/Frontend/test/mocks/scenarios/licensing/license-trial.ts new file mode 100644 index 0000000000..870ce65eb6 --- /dev/null +++ b/src/Frontend/test/mocks/scenarios/licensing/license-trial.ts @@ -0,0 +1,18 @@ +/** + * Scenario: Trial license + * + * A valid trial license that expires in 10 days, with the default dev-mocks data. + * The sidebar shows the trial-license notice. + * + * Usage: + * VITE_MOCK_SCENARIO=license-trial npm run dev:mocks + */ +import { createScenario } from "../scenario-helper"; +import * as precondition from "../../../preconditions"; +import { LicenseType } from "@/resources/LicenseInfo"; +import { withDefaultDataAndLicense } from "./license-shared"; + +const { worker, runScenario } = createScenario(); + +export { worker }; +export const setupComplete = runScenario(withDefaultDataAndLicense(precondition.hasExpiringLicense(LicenseType.Trial)));