@atelic-action/ui 8.0.0 → 8.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +187 -22
- package/bin/atelic-check-sentry.ts +5 -0
- package/dist/gate/middleware.js +15 -1
- package/dist/monitoring/server.d.ts +122 -0
- package/dist/monitoring/server.js +302 -0
- package/dist/vite/index.d.ts +1 -1
- package/dist/vite/index.js +1 -1
- package/dist/vite/marketing-config.d.ts +28 -1
- package/dist/vite/marketing-config.js +62 -0
- package/package.json +10 -2
- package/src/app/layout/DesktopRail.tsx +6 -4
- package/src/app/layout/MobileMenu.tsx +10 -5
- package/src/app/layout/MobileTabBar.tsx +3 -2
- package/src/app/layout/PageError.tsx +2 -2
- package/src/app/layout/SectionCards.tsx +7 -2
- package/src/app/layout/UserMenu.tsx +1 -1
- package/src/app/ui/alert.tsx +1 -1
- package/src/app/ui/form.tsx +2 -2
- package/src/artifact/AppErrorBoundary.tsx +12 -7
- package/src/chrome/BrandLockup.tsx +46 -7
- package/src/chrome/ContactDock.tsx +59 -13
- package/src/chrome/Footer.tsx +97 -28
- package/src/chrome/NavMegaPanel.tsx +11 -6
- package/src/chrome/SiteHeader.tsx +68 -18
- package/src/chrome/SiteMenu.tsx +207 -72
- package/src/chrome/SiteShell.tsx +25 -3
- package/src/chrome/StickyCTABar.tsx +24 -8
- package/src/chrome/index.ts +2 -0
- package/src/components/NotFound.tsx +3 -2
- package/src/gate/middleware.ts +15 -1
- package/src/lib/emailText.tsx +26 -0
- package/src/lib/phoneText.tsx +49 -0
- package/src/monitoring/ErrorCatcherScript.tsx +26 -0
- package/src/monitoring/catcher.ts +118 -0
- package/src/monitoring/index.ts +25 -0
- package/src/monitoring/sdk.ts +112 -0
- package/src/monitoring/server.ts +368 -0
- package/src/monitoring/start.ts +118 -0
- package/src/primitives/Button.tsx +3 -1
- package/src/primitives/Eyebrow.tsx +6 -2
- package/src/routing/index.ts +11 -32
- package/src/routing/miss.ts +32 -0
- package/src/routing/routerErrors.tsx +57 -0
- package/src/routing/staticNotFound.tsx +64 -0
- package/src/scripts/check-sentry.ts +98 -0
- package/src/sections/CalloutPanel.tsx +4 -1
- package/src/sections/ContactInfoCard.tsx +1 -1
- package/src/sections/FullBleedVideo.tsx +13 -4
- package/src/sections/Hero.tsx +10 -3
- package/src/sections/LinkColumns.tsx +30 -14
- package/src/sections/Locations.tsx +1 -1
- package/src/sections/LogoMarquee.tsx +1 -1
- package/src/sections/PricingBand.tsx +1 -1
- package/src/sections/ProcessSteps.tsx +1 -1
- package/src/sections/siteConfig.ts +67 -5
- package/src/styles/app.css +9 -0
- package/src/styles/base.css +34 -2
- package/src/styles/chrome.css +449 -41
- package/src/styles/defaults.css +61 -2
- package/src/styles/primitives.css +20 -7
- package/src/styles/sections.css +52 -9
- package/src/types.ts +40 -2
- package/src/vite/index.ts +4 -0
- package/src/vite/marketing-config.ts +81 -1
package/README.md
CHANGED
|
@@ -11,14 +11,14 @@ Every export, grouped by the entry it is imported from. The Storybook column lin
|
|
|
11
11
|
| Export | Entry | What it is | Storybook |
|
|
12
12
|
|---|---|---|---|
|
|
13
13
|
| `SiteHeader` | `@atelic-action/ui/chrome` | The fixed bar: the lockup, the nav or a page's own stops, the call to action, the burger; transparent, solid, or dark. A nav entry with `columns` is a group that opens a mega menu panel of link columns (nested links, badges), a picture, icon rows, and cards beside a ticked feature card, and `phones` puts up to two tel links in the bar (8.0.0) | [Chrome/SiteHeader](https://ui.atelic.me/?path=/docs/chrome-siteheader--docs) |
|
|
14
|
-
| `SiteMenu` | `@atelic-action/ui/chrome` | The phone's full screen menu, on a native modal dialog; a group is an accordion that opens one at a time, every group closed when the menu opens (8.0.0) | [Chrome/SiteMenu](https://ui.atelic.me/?path=/docs/chrome-sitemenu--docs) |
|
|
14
|
+
| `SiteMenu` | `@atelic-action/ui/chrome` | The phone's full screen menu, on a native modal dialog; a group is an accordion that opens one at a time, every group closed when the menu opens (8.0.0); a dark sheet or a light one (`surface`, with `brand` for its top row), the current page underlined on both (8.2.0) | [Chrome/SiteMenu](https://ui.atelic.me/?path=/docs/chrome-sitemenu--docs) |
|
|
15
15
|
| `ContactDock` | `@atelic-action/ui/chrome` | The floating Get in Touch launcher and its panel of ways to reach the business, inset alike from the right and the bottom, lifting over the phone's sticky bar and riding above the footer; `SiteShell` mounts it from `site.contactDock` (8.0.0) | [Chrome/ContactDock](https://ui.atelic.me/?path=/docs/chrome-contactdock--docs) |
|
|
16
|
-
| `Footer` | `@atelic-action/ui/chrome` | The default footer: the brand column (
|
|
16
|
+
| `Footer` | `@atelic-action/ui/chrome` | The default footer: the brand column (the header's lockup, the Google rating linked to the profile, linked address, phone, email), the hours, the link columns, and the closing bar | [Chrome/Footer](https://ui.atelic.me/?path=/docs/chrome-footer--docs) |
|
|
17
17
|
| `ClosingBar`, `Copyright`, `Credit` | `@atelic-action/ui/chrome` | The line that closes every page, in two sides that each take anything: by default `Copyright` with the business's name on the left and `Credit`, the practice's made with line, on the right | [Chrome/ClosingBar](https://ui.atelic.me/?path=/docs/chrome-closingbar--docs) |
|
|
18
18
|
| `StickyCTABar` | `@atelic-action/ui/chrome` | The phone's bottom bar: the call to action and a call shortcut, there from the top on an interior page (`fromTop`) and sliding in after a scroll on a hero page | [Chrome/StickyCTABar](https://ui.atelic.me/?path=/docs/chrome-stickyctabar--docs) |
|
|
19
|
-
| `BrandLockup` | `@atelic-action/ui/chrome` | The header's identity as one link, with the recipient's mark on a sent document; the brand's own mark per surface (`onLight`, `onDark`), never recolored, at `--brand-mark-height` (8.0.0) | [Chrome/BrandLockup](https://ui.atelic.me/?path=/docs/chrome-brandlockup--docs) |
|
|
19
|
+
| `BrandLockup` | `@atelic-action/ui/chrome` | The header's identity as one link, with the recipient's mark on a sent document; the brand's own mark per surface (`onLight`, `onDark`), never recolored, at `--brand-mark-height` (8.0.0); `surface` draws one ground's mark alone, and `onClick` hears the link followed (8.2.0) | [Chrome/BrandLockup](https://ui.atelic.me/?path=/docs/chrome-brandlockup--docs) |
|
|
20
20
|
| `SkipLink` | `@atelic-action/ui/chrome` | The keyboard user's jump past the chrome | [Chrome/SkipLink](https://ui.atelic.me/?path=/docs/chrome-skiplink--docs) |
|
|
21
|
-
| `Brand`, `BrandLogo`, `CallToAction`, `HoursRow`, `MenuContact`, `NavLink`, `NavPanelSection`, `NavGroupColumn`, `NavGroupLink`, `NavGroupChildLink`, `NavPictureSection`, `NavIconRowsSection`, `NavIconRow`, `NavIcon`, `NavCardsSection`, `NavCard`, `NavFeature`, `HeaderPhone`, `ContactDockConfig`, `ContactDockItem`, `ContactDockIcon`, `Phone`, `PostalAddress`, `SiteLink`, `SocialLink`, `PageStop`, `FooterColumn`, `FooterColumnLink`, `FooterIcon` | `@atelic-action/ui/chrome` | The shapes the chrome renders from (types) | none |
|
|
21
|
+
| `Brand`, `BrandLogo`, `CallToAction`, `HoursRow`, `MenuContact`, `NavLink`, `NavPanelSection`, `NavGroupColumn`, `NavGroupLink`, `NavGroupChildLink`, `NavPictureSection`, `NavIconRowsSection`, `NavIconRow`, `NavIcon`, `NavCardsSection`, `NavCard`, `NavFeature`, `HeaderPhone`, `SiteMenuSurface`, `MenuBurgerStyle`, `ContactDockConfig`, `ContactDockItem`, `ContactDockIcon`, `Phone`, `PostalAddress`, `SiteLink`, `SocialLink`, `PageStop`, `FooterColumn`, `FooterColumnLink`, `FooterIcon` | `@atelic-action/ui/chrome` | The shapes the chrome renders from (types) | none |
|
|
22
22
|
| `NotFound` | `@atelic-action/ui/components` | The body of the page an unknown path renders | [Components/NotFound](https://ui.atelic.me/?path=/docs/components-notfound--docs) |
|
|
23
23
|
| `Checklist` | `@atelic-action/ui/components` | A short list of checks, each passed or failed | [Components/Checklist](https://ui.atelic.me/?path=/docs/components-checklist--docs) |
|
|
24
24
|
| `IconList` | `@atelic-action/ui/components` | A list whose bullets are icons, one for the list or one per item, each in a tone | [Components/IconList](https://ui.atelic.me/?path=/docs/components-iconlist--docs) |
|
|
@@ -56,7 +56,7 @@ Every export, grouped by the entry it is imported from. The Storybook column lin
|
|
|
56
56
|
| `renderEmail`, `renderFailureEmail` | `@atelic-action/ui/email/render` | The whole email document, and the failure page's | [Email/WeeklyReport](https://ui.atelic.me/?path=/docs/email-weeklyreport--docs) |
|
|
57
57
|
| `atelicPalette`, `atelicFonts`, `toThemeCSS`, `themeTokenMap`, `Palette`, `Fonts` | `@atelic-action/ui/tokens` | The palette and font stacks, with no React | none |
|
|
58
58
|
| `useScrollSpy` | `@atelic-action/ui/hooks` | Which section is in the reading band; the header's stops use it | [Chrome/SiteHeader](https://ui.atelic.me/?path=/docs/chrome-siteheader--docs) (the dark bar's stops) |
|
|
59
|
-
| `staticNotFoundRouting` | `@atelic-action/ui/routing` | The router options that keep a prerendered not found page alive | none |
|
|
59
|
+
| `staticNotFoundRouting`, `StaticNotFoundOptions` | `@atelic-action/ui/routing` | The router options that keep a prerendered not found page alive; given the router's `useMatches`, its pending view draws the page on a miss alone (8.2.0) | none |
|
|
60
60
|
| `signToken`, `verifyToken`, `safeNext`, `needsSession` | `@atelic-action/ui/gate` | The access gate's tokens, the safe post sign in path, and the wall's test | none |
|
|
61
61
|
| `POST`, `createRequestLink` | `@atelic-action/ui/gate/request-link` | The function that emails a sign in link | none |
|
|
62
62
|
| `GET` | `@atelic-action/ui/gate/verify` | The function that turns a link into a session | none |
|
|
@@ -102,14 +102,19 @@ Every export, grouped by the entry it is imported from. The Storybook column lin
|
|
|
102
102
|
| `SiteShell` | `@atelic-action/ui/chrome` | A marketing page's whole chrome: skip link, header, main, footer, sticky bar, the contact dock when configured, mounting the base path provider and setting the section density | [Chrome/SiteShell](https://ui.atelic.me/?path=/docs/chrome-siteshell--docs) |
|
|
103
103
|
| `BasePathProvider`, `useBasePath`, `useWithBase`, `joinBase`, `stripBase`, `hasBase`, `normalizeBasePath` | `@atelic-action/ui/routing` | The base path a site is served under, read by Button, Chip, and every section that builds a link | none |
|
|
104
104
|
| `joinBase`, `stripBase`, `hasBase`, `normalizeBasePath` | `@atelic-action/ui/routing/base-path` | The same four pure helpers, built, for what Node runs (a Playwright spec, a script) | none |
|
|
105
|
-
| `marketingConfig` | `@atelic-action/ui/vite` | A marketing site's whole Vite configuration as one call | none |
|
|
105
|
+
| `marketingConfig` | `@atelic-action/ui/vite` | A marketing site's whole Vite configuration as one call; with the three Sentry variables it uploads hidden source maps under the commit (8.1.0) | none |
|
|
106
|
+
| `buildRelease`, `sentryUpload`, `SentryUpload`, `environmentPlugin` | `@atelic-action/ui/vite` | The commit a build is filed under, the source map upload's settings (on only with its three variables), and the plugin that names the build's environment for the browser (8.1.0) | none |
|
|
107
|
+
| `isMiss`, `MissMatch`, `CATCH_ALL_ROUTE_ID` | `@atelic-action/ui/routing` | Whether a router's matches are a miss (the catch all route, or a route whose params name no page), router free, for a site's root route (8.1.0) | none |
|
|
108
|
+
| `routerErrorOptions`, `RouteErrorFallback`, `RouteErrorProps`, `reportRouteError` | `@atelic-action/ui/routing` | The router options that report a route's render crash and draw the package's error page in its place, router free (8.2.0; see [Error Reporting](#error-reporting)) | none |
|
|
109
|
+
| `startErrorReporting`, `ErrorCatcherScript` (`enabled`, 8.2.0), `ErrorCatcherScriptProps`, `errorCatcherScript`, `reportError`, `installCatcher`, `readCatcher`, `afterFirstPaint`, `throwLaunchCheck`, `LAUNCH_CHECK_MESSAGE` | `@atelic-action/ui/monitoring` | Error reporting in the browser: the inline early catcher, and the start function that loads the Sentry SDK after first paint, errors only (8.1.0; see [Error Reporting](#error-reporting)) | none |
|
|
110
|
+
| `reportServerError`, `reportServerErrorLater`, `WaitUntilContext`, `refusalError`, `reportRefusedResponse`, `withErrorReporting`, `parseDSN`, `parseStack`, `buildEnvelope` | `@atelic-action/ui/monitoring/server` | Error reporting from a function or the middleware, dependency free and built, for what Vercel runs uncompiled (8.1.0); the later one sends without holding the answer, on the platform's `waitUntil` (8.2.0) | none |
|
|
106
111
|
| `sections.css` | `@atelic-action/ui/styles/sections.css` | Styles for everything under `sections`, imported after `primitives.css` | none |
|
|
107
112
|
| `AppProvider`, `AppConfigProvider`, `useAppConfig`, `useNav`, `useUser`, `configureApp`, `getAppConfig`, `AppConfig`, `NavItem`, `AppUser`, `Register` | `@atelic-action/ui/app` | The app shell's seam: the app hands in its config and nav, registers its user type, and reads them back | [App/AppProvider](https://ui.atelic.me/?path=/docs/app-appprovider--docs) |
|
|
108
113
|
| `AppLayout`, `AppPage`, `AppPageToolbar`, `Breadcrumbs`, `SectionCards`, `DesktopRail`, `MobileTabBar`, `MobileMenu`, `UserMenu`, `PageSkeleton`, `PageError`, `ActionButton`, `FormActionButtons`, `activeSection` | `@atelic-action/ui/app` | The app frame: the rails, the tab bar, the page scaffold with its toolbar and right rail | [App/AppLayout](https://ui.atelic.me/?path=/docs/app-applayout--docs) |
|
|
109
114
|
| `AuthGuard`, `ErrorFallback`, `GoogleGlyph`, `useAuthStore`, `useUnitsStore`, `apiFetch`, `publicFetch`, `session`, the hooks and the wire types | `@atelic-action/ui/app` | Auth, transport, the two shell stores, and the helpers the shell runs on | [App/AuthGuard](https://ui.atelic.me/?path=/docs/app-authguard--docs) |
|
|
110
115
|
| The shadcn kit (`Button`, `Dialog`, `Select`, `OptionSelect`, `SearchInput`, `BadgeList`, `Callout`, and the rest) | `@atelic-action/ui/app/ui` | The kit the shell is set in; a new kit component lands here, never in an app | [App/UI/Button](https://ui.atelic.me/?path=/docs/app-ui-button--docs) |
|
|
111
116
|
| `app.css` | `@atelic-action/ui/styles/app.css` | The shell's Tailwind sheet: the token mapping, the default tokens, the base layer, the `ap-*` scaffold, and the `@source` that points Tailwind at the shell | none |
|
|
112
|
-
| The
|
|
117
|
+
| The `atelic-*` commands | the `bin` map | The build guard, health stamp, link and wall checks, reader link, static server, print, sealing, and the marketing site's sitemap clean, base path check, contact canary, and Sentry check (8.1.0) | none |
|
|
113
118
|
|
|
114
119
|
|
|
115
120
|
## Install
|
|
@@ -230,7 +235,7 @@ The menu is a native `<dialog>` opened with `showModal()`, so Escape, focus cont
|
|
|
230
235
|
On a statically prerendered TanStack Start site the markup is the easy part. The host serves the `/404` prerender for every miss, and the page survives hydration only with three pieces in the site:
|
|
231
236
|
|
|
232
237
|
1. **A catch all route**, `src/routes/$.tsx`, rendering the site's page (noindexed). Never a dedicated `/404` route: an unknown path then matches only the root, TanStack's hydrate throws, and the page goes blank.
|
|
233
|
-
2. **The router options:** `createRouter({ routeTree, ...staticNotFoundRouting(NotFoundPage) })
|
|
238
|
+
2. **The router options:** `createRouter({ routeTree, ...staticNotFoundRouting(NotFoundPage, { useMatches }) })`, with `useMatches` imported from `@tanstack/react-router` and handed in, so the package imports no router. A miss hydrates through its pending state first, so pending has to render the same page or React reports a mismatch (a pending view of plain `null` is React error 418 and a blank body on every miss). Given `useMatches` (8.2.0), the pending view draws the page on a miss alone (`isMiss`) and nothing on any other route's pending state, so a slow client navigation never shows a bare 404 body with no header; without it, the pending view is the page itself, as before. `catchAllId` names a catch all route other than `/$`.
|
|
234
239
|
3. **The build:** a `{ path: "/404", prerender: { enabled: true }, sitemap: { exclude: true } }` entry in the Vite `pages` list, and a copy of `dist/client/404/index.html` to `dist/client/404.html`.
|
|
235
240
|
|
|
236
241
|
```tsx
|
|
@@ -252,6 +257,18 @@ export function NotFoundPage() {
|
|
|
252
257
|
}
|
|
253
258
|
```
|
|
254
259
|
|
|
260
|
+
A site's root route asks whether the matches are a miss twice: to emit the 404's head tags from the root (tags on the still pending catch all route would land twice), and to draw a miss inside the site's shell from the root layout, so the shell stays mounted while the not found body swaps from its pending render to its own and a menu opened in the first moments stays open. `isMiss(matches)` from `@atelic-action/ui/routing` answers it with no router import: the catch all route (`/$`) took the path, or a route's `staticData.missing(params)` says its params name no page.
|
|
261
|
+
|
|
262
|
+
```tsx
|
|
263
|
+
// src/routes/__root.tsx
|
|
264
|
+
import { isMiss } from "@atelic-action/ui/routing";
|
|
265
|
+
|
|
266
|
+
head: ({ matches }) => ({ ...(isMiss(matches) ? buildPageHead(site, notFound.meta) : {}) }),
|
|
267
|
+
// RootLayout
|
|
268
|
+
const miss = useMatches({ select: isMiss });
|
|
269
|
+
return miss ? <SiteShell site={site}><Outlet /></SiteShell> : <Outlet />;
|
|
270
|
+
```
|
|
271
|
+
|
|
255
272
|
`staticNotFoundRouting` is for prerendered sites only. On a live app the pending state is a real loading moment and the page would flash through every slow load, so an app sets `defaultNotFoundComponent` alone. A browser test is the only proof any of this works; template-marketing's `e2e/not-found.spec.ts` is the one to copy.
|
|
256
273
|
|
|
257
274
|
## Primitives
|
|
@@ -372,6 +389,87 @@ The two pieces a reader sees are ordinary components, in `@atelic-action/ui/comp
|
|
|
372
389
|
|
|
373
390
|
`GateLogin` posts to `/api/auth/request-link`; a site served under a base path passes its own `endpoint`. Its button wears the site's `.btn` classes, as the chrome's do. `Watermark` reads the `gate_email` cookie and draws nothing without one. `readCookie`, exported beside them, is the reader `Watermark` uses and a site's own code can: empty during prerender, for a missing cookie, and for one that will not decode. `GateLogin` says so when an address is not an email, holds a second submit while the first is in flight, and announces each outcome to a screen reader.
|
|
374
391
|
|
|
392
|
+
## Error Reporting
|
|
393
|
+
|
|
394
|
+
Every site reports its errors to Sentry, errors only and never performance tracing, through three pieces the package owns (8.1.0). A site cannot launch without it: `atelic-check-sentry` stops a production build with no DSN.
|
|
395
|
+
|
|
396
|
+
1. **The early catcher.** `ErrorCatcherScript`, placed first among the root route's `<head>` scripts, is a 443 byte inline script (281 gzipped, ES5, no dependencies) that listens for `error` and `unhandledrejection` from the first moment and holds up to twenty (`CATCHER_CAP`) in a buffer on `window.__atelicErrors` (`CATCHER_GLOBAL`), counting the rest as dropped; the count rides on each replayed error as `earlyDropped`. It is the page's first script and runs before any other script on the page; it is not the first element in `<head>`, since React 19 hoists the title, the meta tags, the preloads, and the stylesheets ahead of it, and nothing it does depends on that. An error thrown before the app's own JavaScript runs is held, not lost.
|
|
397
|
+
2. **The start function.** `startErrorReporting({ dsn, release, environment })` from `@atelic-action/ui/monitoring` (with `environment` defaulting to the build's `import.meta.env.VITE_ENVIRONMENT`) makes sure the catcher is listening (installing it when the page has none), then after first paint (falling back to the load event where the browser cannot report paints, and to ten seconds whatever happens) loads the Sentry browser SDK, replays what the catcher held, each tagged `early`, and takes the catcher's listeners off so nothing is reported twice. With no `dsn` it does nothing and loads nothing. The SDK chunk is the client set up by hand with six integrations (event filters, function to string, the global handlers, linked errors, dedupe, the page's URL and user agent): no tracing, no replay, no breadcrumbs. Measured alone with esbuild, the chunk weighs 69.9 KB raw, 24.6 KB gzipped, and 22.3 KB in brotli, where the old `@sentry/react` chunk with browser tracing, measured the same way, weighed 136.2 KB, 47.0 KB, and 41.5 KB; a site's own build bundles them with what it shares, so its figures differ (a real site's new chunk measured 81 KB raw and 28 KB gzipped, replacing one of 425 KB raw and 141 KB gzipped). `AppErrorBoundary` hands a render crash to the same buffer (`reportError`), since React keeps a caught crash from the window's handlers; on a page where reporting never started and no inline catcher runs, the crash is let go quietly rather than held by a catcher nobody reads. A route's render crash reaches that boundary too on TanStack Router 1.170, where a route has a catch boundary of its own only when an `errorComponent` applies to it, so on a site that sets none the crash rises to `AppErrorBoundary` and is reported once. A route or a site that sets its own `errorComponent` with no `onCatch` puts a boundary in the way that catches the crash and reports it to nobody. `routerErrorOptions()` (8.2.0, below) closes that: spread into `createRouter`, it gives every route the boundary, its `defaultOnCatch` hands what any of them catches to `reportError` once, and its `defaultErrorComponent` draws the same `ErrorFallback` page, so the report no longer depends on which boundary is nearest. The package carries `@sentry/browser`, so a site needs no Sentry dependency of its own.
|
|
398
|
+
3. **The server reporter.** `@atelic-action/ui/monitoring/server`, built like the gate so a Vercel function imports it uncompiled: `reportServerError(error, { dsn?, request?, tags?, release?, environment? })` posts a Sentry envelope to the ingest the DSN names (`SENTRY_DSN`, then `VITE_SENTRY_DSN`), with the stack's frames, the runtime as a tag, and the release from `VERCEL_GIT_COMMIT_SHA`. It waits two seconds at most, never throws, and resolves whether or not the send worked. `withErrorReporting(handler)` reports a handler's throw and throws it again. `reportServerErrorLater(error, { context?, ...options })` (8.2.0) starts the same send and returns at once: it hands the send to the platform's `waitUntil`, the `context` a handler was given (an edge middleware's or a function's second argument) or else the request context Vercel keeps for a function, so the function stays alive until the send finishes after the answer has gone; with neither, the send runs without blocking the answer and may be cut short when the runtime freezes. Await `reportServerError` where the report must land before the handler goes on (before a throw, or in a handler that waits anyway); call `reportServerErrorLater` where the person is waiting on the answer (a refused send the form should say at once). The gate's middleware reports anything it throws, and passes and blocks exactly as before. `refusalError(response, service?)` (8.2.0) turns a refused upstream answer (a send the mail service would not take) into an error a report may carry: the service's name, the status, and the error body's `name` and `message` alone, each with anything shaped like an email address replaced by `[address]` and cut to 300 characters, nothing else of the body read; `reportRefusedResponse(response, { service, request, tags, context })` builds it and sends it with `reportServerErrorLater`, resolving once the body is read and never waiting on the send.
|
|
399
|
+
|
|
400
|
+
**The launch check.** Once reporting has started, `window.__atelicErrors.test()` in the browser's console throws an error from the package's own code on the next turn, uncaught, named "Atelic error reporting launch check: thrown on purpose from @atelic-action/ui" (`LAUNCH_CHECK_MESSAGE`). Run it on a site's first production deploy: the error should reach Sentry under the deploy's release and environment with a readable, source mapped stack. A stack of minified names means the upload did not run.
|
|
401
|
+
|
|
402
|
+
Two noises are left out, the list kept short: an error whose top frame is a browser extension's (`chrome-extension://`, `moz-extension://`, `safari-extension://`, `safari-web-extension://`), and the in app webview bridges failing ("Java object is gone", "Error invoking postMessage").
|
|
403
|
+
|
|
404
|
+
**What is captured:** uncaught errors and unhandled rejections in the browser, from before first paint on; render crashes `AppErrorBoundary` catches, and with `routerErrorOptions()` any a route's own boundary catches; a function's or the middleware's throw, and whatever a function reports by hand. **What is not:** performance, sessions, replays, breadcrumbs, console output, and the expected misses (a contact form's validation answer, a malformed or expired gate cookie). **Privacy:** a server report carries the request's method, its path with no query string, and its user agent, and nothing else from the request: never a body, never another header. A browser report is cut the same way before it leaves the page: the page's URL and each stack frame's file lose their query string and fragment, the referrer goes, and the user agent is the one header kept. A contact form's request holds a person's name, address, and message.
|
|
405
|
+
|
|
406
|
+
| Variable | Where | What it does |
|
|
407
|
+
|---|---|---|
|
|
408
|
+
| `VITE_SENTRY_DSN` | the Vercel project, every environment | The browser's DSN, read by the start function; the server reporter falls back to it. Required for a production build |
|
|
409
|
+
| `SENTRY_DSN` | the Vercel project, optional | The server's DSN when it should differ from the browser's |
|
|
410
|
+
| `SENTRY_AUTH_TOKEN`, `SENTRY_ORG`, `SENTRY_PROJECT` | the Vercel project, production | With all three, `marketingConfig` adds the Sentry Vite plugin: it creates a release named by the commit, uploads hidden source maps (`build.sourcemap: "hidden"`, only then), and deletes every map from `dist/` once uploaded. With any missing, the build is unchanged |
|
|
411
|
+
|
|
412
|
+
`marketingConfig` hands the browser the commit (`VERCEL_GIT_COMMIT_SHA`, else `GITHUB_SHA`) as `import.meta.env.VITE_RELEASE`, the same name the upload's release takes, so a stack trace meets its source maps, and the environment as `import.meta.env.VITE_ENVIRONMENT`: `VERCEL_ENV` (production, preview, development) on Vercel, else the build's mode, since a production build's mode is production on every deploy, a preview's included. `atelic-check-sentry` also fails any build whose DSN is set but is not one, and any whose DSN carries a space or a line break around it, since the build ships the value as it is set (8.2.0).
|
|
413
|
+
|
|
414
|
+
What a site changes. `src/router.tsx` drops its own Sentry import and its `afterFirstPaint`, and starts reporting where the lazy init was:
|
|
415
|
+
|
|
416
|
+
```ts
|
|
417
|
+
import { startErrorReporting } from "@atelic-action/ui/monitoring";
|
|
418
|
+
|
|
419
|
+
if (typeof window !== "undefined") {
|
|
420
|
+
startErrorReporting({
|
|
421
|
+
dsn: env.VITE_SENTRY_DSN,
|
|
422
|
+
release: import.meta.env.VITE_RELEASE,
|
|
423
|
+
environment: import.meta.env.VITE_ENVIRONMENT,
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
The same file hands the router's boundaries to error reporting, two lines (8.2.0). Without them a route crash is still reported by `AppErrorBoundary` unless a route or the site sets its own `errorComponent` with no `onCatch`; with them every route's crash is reported once by its own boundary, whatever error page a route sets:
|
|
429
|
+
|
|
430
|
+
```ts
|
|
431
|
+
import { routerErrorOptions } from "@atelic-action/ui/routing";
|
|
432
|
+
|
|
433
|
+
const router = createRouter({ routeTree, ...routerErrorOptions() });
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
`src/routes/__root.tsx` puts the catcher first among the scripts in `<head>`, and imports the boundary from the package in place of its own copy, so a render crash outside a route is reported too (the site deletes its `src/shared/components/AppErrorBoundary.tsx` and `ErrorFallback.tsx`, whose package twins are the same page with a long message that wraps). The catcher renders only when the build has a DSN (`enabled`, 8.2.0, default true), so a build with none ships no catcher holding errors nobody reads:
|
|
437
|
+
|
|
438
|
+
```tsx
|
|
439
|
+
import { AppErrorBoundary } from "@atelic-action/ui/artifact";
|
|
440
|
+
import { ErrorCatcherScript } from "@atelic-action/ui/monitoring";
|
|
441
|
+
|
|
442
|
+
<head>
|
|
443
|
+
<ErrorCatcherScript enabled={Boolean(env.VITE_SENTRY_DSN)} />
|
|
444
|
+
<HeadContent />
|
|
445
|
+
</head>
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
`api/contact.ts` wraps its handler, and reports a refused send by hand, since that path answers rather than throws:
|
|
449
|
+
|
|
450
|
+
```ts
|
|
451
|
+
import { reportRefusedResponse, withErrorReporting } from "@atelic-action/ui/monitoring/server";
|
|
452
|
+
|
|
453
|
+
export const POST = withErrorReporting(
|
|
454
|
+
async (request: Request): Promise<Response> => {
|
|
455
|
+
// ...the handler as it was, and where Resend refuses:
|
|
456
|
+
if (!response.ok) {
|
|
457
|
+
await reportRefusedResponse(response, { service: "Resend", request, tags: { route: "contact" } });
|
|
458
|
+
return json(502, { ok: false, error: "Sending failed. Please try again in a moment." });
|
|
459
|
+
}
|
|
460
|
+
},
|
|
461
|
+
{ tags: { route: "contact" } },
|
|
462
|
+
);
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
`package.json` runs the check first in `build` and drops its own `@sentry/react` dependency:
|
|
466
|
+
|
|
467
|
+
```json
|
|
468
|
+
"build": "atelic-check-sentry && atelic-check-images && tsc -b && vite build && ..."
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
A site with a real reason to launch without Sentry runs `atelic-check-sentry --allow-missing`, which lets the build through under a loud warning. `middleware.ts` changes nothing: the gate's middleware reports on its own.
|
|
472
|
+
|
|
375
473
|
## The Artifact Documents
|
|
376
474
|
|
|
377
475
|
`@atelic-action/ui/artifact` is the pieces an artifact document is built from and the site around it, so a fix to a piece reaches every business's documents with one version bump. The composed documents themselves (`Writeup`, `Read`, `Report`, `Note`, and the sealed `Gate`, with their content types and their stylesheet) live in [`@atelic-action/artifact`](https://github.com/atelic-action/artifact) since 2.0.0, which depends on this package for everything below:
|
|
@@ -513,20 +611,23 @@ export function SiteShell(props: Omit<SiteShellProps, "currentPath" | "basePath"
|
|
|
513
611
|
|
|
514
612
|
Every site's footer has one shape, and `Footer` draws it (7.0.0):
|
|
515
613
|
|
|
516
|
-
- **The brand column:** the logo, then the Google rating
|
|
517
|
-
- **
|
|
614
|
+
- **The brand column:** the header's lockup (the mark with the wordmark beside it, or the mark alone when `logo.wordmark` is false), then the Google rating beside five stars, the whole line one link to the business's Google profile when it has one, then the one address, the headquarters, linked to the same profile, then the phone and the email, each a link.
|
|
615
|
+
- **The hours,** when the site gives them: a column of their own headed Hours (`hoursHeading`), each row's days beside or over its range, as the column's width allows (8.1.0).
|
|
616
|
+
- **Four link columns:** Company, Resources, Social, and Legal, in that order. From 760px the columns share one row at their shares but never narrower than their longest word, wrapping a column to a second row before a label breaks inside itself (8.1.0). A Social link carries its icon in front of its words. A column with no links is left out, and the grid sizes itself to the columns shown.
|
|
518
617
|
- **The closing bar:** `ClosingBar` under it all, `Copyright` with the business's name on the left and `Credit` on the right.
|
|
519
618
|
|
|
520
|
-
The rating's five stars read `--star-fill`, the same token `StarRating`'s filled star reads, and fall back to `--review-gold` (`#f5b301`) when a theme sets none, so one line in `theme.css` recolors every star on a site (8.0.0). The logo is the mark the dark surface resolves to, by the header's own order (see the table under [Rendering From Props](#rendering-from-props)). The column headings are level 2 by default (`headingLevel` takes 2 to 6): the footer is a landmark beside the page's main content, so its sections sit one level under the page's `h1` whatever the page's own outline ends on, which satisfies axe's `heading-order` on every page and keeps the columns in a screen reader's heading list. Each is a `div` with `role="heading"` and `aria-level`, wearing `.footer-heading`, rather than an `h2`: a site's own bare `h2` rule is unlayered, so it beats every rule in the package's layer whatever its weight, and it is written for a page's section titles, not these small labels. A heading by role keeps the outline and matches no element rule, with no `!important` and no specificity raised.
|
|
619
|
+
The rating's stars are hidden from assistive technology, so the line, linked or not, is named by its words ("4.8 on Google"); `ratingLabel` gives the link a fuller name when a site wants one ("4.8 on Google, opens the Google profile"). Linked, it opens in a new tab as the address does. With the hours the footer holds six columns, so from 760px to 1100px the brand column keeps a row of its own above the other five, and from 1100px all six share one row with the brand column a little wider; a phone sets the brand column over two across, as without them. The rating's five stars read `--star-fill`, the same token `StarRating`'s filled star reads, and fall back to `--review-gold` (`#f5b301`) when a theme sets none, so one line in `theme.css` recolors every star on a site (8.0.0). The logo is the header's lockup drawn on the dark band (8.1.0): the mark the dark surface resolves to, by the header's own order (see the table under [Rendering From Props](#rendering-from-props)), with the wordmark beside it, composed by the same parts the header's `BrandLockup` draws. Its picture is silent there, since the words name it. `logo.wordmark: false` draws the mark alone, named by `logo.alt`; a glyph tile keeps the name beside it, and a logo with no picture is the words alone. The column headings are level 2 by default (`headingLevel` takes 2 to 6): the footer is a landmark beside the page's main content, so its sections sit one level under the page's `h1` whatever the page's own outline ends on, which satisfies axe's `heading-order` on every page and keeps the columns in a screen reader's heading list. Each is a `div` with `role="heading"` and `aria-level`, wearing `.footer-heading`, rather than an `h2`: a site's own bare `h2` rule is unlayered, so it beats every rule in the package's layer whatever its weight, and it is written for a page's section titles, not these small labels. A heading by role keeps the outline and matches no element rule, with no `!important` and no specificity raised.
|
|
521
620
|
|
|
522
|
-
The header carries the services and the service areas, so the footer does not repeat them. It holds no blurb, no
|
|
621
|
+
The header carries the services and the service areas, so the footer does not repeat them. It holds no blurb, no call to action, and no credential badges; a site that needs one of those puts it on a page.
|
|
523
622
|
|
|
524
623
|
`SiteShell` fills the footer from the `SiteConfig`, so a site names nothing twice:
|
|
525
624
|
|
|
526
625
|
| The footer shows | From the config |
|
|
527
626
|
|---|---|
|
|
528
627
|
| The rating | `footer.rating`, as printed (`"4.8 on Google"`) |
|
|
628
|
+
| The rating's link | `footer.ratingHref`, else `mapLinkURL`, the Google profile, whenever a rating is set; `footer.ratingLabel` names it |
|
|
529
629
|
| The address and its link | `address` and `mapLinkURL`; `footer.showAddress: false` drops the address |
|
|
630
|
+
| The hours | `hours`, each row's `labelShort` and its range on `clock`; `footer.showHours: false` keeps them out of the footer and in the structured data |
|
|
530
631
|
| The phone and the email | `phone`, `email` |
|
|
531
632
|
| Company | `nav` |
|
|
532
633
|
| Resources | `footerLinks` |
|
|
@@ -536,7 +637,7 @@ The header carries the services and the service areas, so the footer does not re
|
|
|
536
637
|
|
|
537
638
|
A site whose footer genuinely needs other columns names them outright in `footer.columns`, which replaces the derived four. Rendering `Footer` directly, a site passes `columns` itself.
|
|
538
639
|
|
|
539
|
-
Moving to 7.0.0: `footerBlurb` and `footer.contactHeading` are gone from the config, and `Footer` no longer takes `blurb`, `socialLinks`, `links`, `extraLinks`, `contactHeading`, `hours`, or `legalLinks`. Delete `footerBlurb` from the site config; the rest carries over through the mapping above. The hours stay in the config for the structured data and the page sections that print them.
|
|
640
|
+
Moving to 7.0.0: `footerBlurb` and `footer.contactHeading` are gone from the config, and `Footer` no longer takes `blurb`, `socialLinks`, `links`, `extraLinks`, `contactHeading`, `hours`, or `legalLinks`. Delete `footerBlurb` from the site config; the rest carries over through the mapping above. The hours stay in the config for the structured data and the page sections that print them, and since 8.1.0 the footer draws them again (see [Moving to 8.1.0](#moving-to-810)).
|
|
540
641
|
|
|
541
642
|
### The Mega Menu
|
|
542
643
|
|
|
@@ -546,16 +647,22 @@ A section is one of four kinds, named by `kind`; a section without one is a link
|
|
|
546
647
|
|
|
547
648
|
| Kind | What it draws | Its data |
|
|
548
649
|
|---|---|---|
|
|
549
|
-
| link column (`kind` left out, or `"links"`) | A mono heading over its links. The heading is itself a link when it has an `href`. A link may carry a `description` under it, a `badge` ("Popular") in a pill after its label, and `children`, drawn indented under it with an elbow, each with its own `badge` | `{ heading, href?, links: [{ label, href, description?, badge?, external?, children? }] }` |
|
|
650
|
+
| link column (`kind` left out, or `"links"`) | A mono heading over its links. The heading is itself a link when it has an `href`. A link may carry a `description` under it, a `badge` ("Popular") in a pill after its label, and `children`, drawn indented under it with an elbow, each with its own `badge`; `quiet` sets a link in the softer words and the regular weight, for a long list such as the towns under a region (8.1.0) | `{ heading, href?, links: [{ label, href, description?, badge?, external?, quiet?, children? }] }` |
|
|
550
651
|
| `"picture"` | One photo filling the section, its caption over a wash at the foot, the whole of it a link named by the caption | `{ kind: "picture", image: { src, alt? }, caption, href }` |
|
|
551
652
|
| `"rows"` | Icon rows two across under an optional heading: a lucide icon by name, a label, and a short line, one row (`highlight`) set on the primary | `{ kind: "rows", heading?, rows: [{ label, description?, icon, href, highlight? }] }` |
|
|
552
653
|
| `"cards"` | Small cards under an optional heading, set off by a rule: a kicker, a title, and a meta line beside a square picture, or a quiet tile without one | `{ kind: "cards", heading?, cards: [{ kicker?, title, meta?, image?, href }] }` |
|
|
553
654
|
|
|
554
655
|
A row's `icon` is one of `calculator`, `calendar`, `card`, `chat`, `document`, `help`, `home`, `mail`, `map`, `phone`, `pin`, `play`, `shield`, `star`, `tool`, `truck`, and `users` (the `NavIcon` type), each a lucide icon. `feature` is the card at the panel's right, 340px wide on `--primary-deep`: a picture taking the height the words leave, an eyebrow, a headline, a line (`text`), ticked `points` (`TickList`), and its action as a `Button` with the arrow, which turns light on the card (`.on-primary`). `allLabel` is off unless given; given, it links the group's own page first in the panel at a column link's weight.
|
|
555
656
|
|
|
556
|
-
Every link in a panel that leads to the page being read carries `aria-current="page"`, the picture, the cards, a column heading, and the group's own link included, and a flat bar link on the current page is marked as a group holding it is. The sections share one row and wrap to a second when their least widths outrun it (a picture, icon rows, and cards beside the feature card at a narrow desktop), so none is squeezed past reading or pushed out of the card.
|
|
657
|
+
Every link in a panel that leads to the page being read carries `aria-current="page"`, the picture, the cards, a column heading, and the group's own link included, and a flat bar link on the current page is marked as a group holding it is. On the solid bar the current entry reads `--primary-ink`; over a hero the transparent bar keeps it in `--on-dark` with its siblings and marks it with an underline, so it reads on a dark photograph whatever the theme's primary (8.1.0). The sections share one row and wrap to a second when their least widths outrun it (a picture, icon rows, and cards beside the feature card at a narrow desktop, or two link columns, icon rows, and cards on a wide wrap), so none is squeezed past reading or pushed out of the card. A section's least width is the larger of its floor (a link column's list 120px, the icon rows 320px, the cards 240px, the picture 220px) and its longest word, and words in a panel break only as a last resort, so no label breaks inside a word to make a row fit (8.1.0).
|
|
658
|
+
|
|
659
|
+
On a phone and a tablet the menu opens each group as an accordion, one at a time, and every group starts closed whenever the menu opens, the one holding the current page included. It draws the same data: each section's heading, a link's children indented under it with the same elbow, the badges kept, icon rows and cards as plain links of their labels and titles, and a picture as a plain link of its caption. A plain entry wears a number, and the numbers count plain entries alone, so a group between them leaves no gap. The link to the page being read carries `aria-current="page"` and, for the eye, the 2px underline the bar marks its current entry with, under its words alone (8.2.0).
|
|
660
|
+
|
|
661
|
+
The menu has two sheets, chosen by `menu.surface` in the config (`SiteHeader`'s `menuSurface`, `SiteMenu`'s `surface`), with one behavior: the native modal dialog traps focus, Escape closes it, focus returns to the burger, and the page behind holds still. `dark`, the default, is the sheet every site had: the dark surface, large light entries with their numbers, the call to action mid sheet, and the contact block at the foot. `light` (8.2.0) sets the page's ground and ink: a top row with the header's lockup, drawn for the light ground and linking home, and a round outlined close button, where focus starts; the entries as rows under hairlines, a group's label bold in ink at a moderate size with a chevron at the right, turning the primary's words while it is open, its sections' headings small quiet caps labels, a link's children, badges, and `quiet` honored; and a foot on `--surface-alt` under a hairline, pushed to the bottom of the screen while the list is short, holding the call to action across its width (with the arrow when `cta.arrow` is set) and a card per header number, an outlined card with the number's words in small caps over the number, the whole card a `tel:` link (the contact block's one phone when the header has none). The light sheet sets no numbers on its entries, and it shows no email and no address: the dark sheet's contact block has them, the light sheet's design does not, so a site that needs them on a phone keeps the dark sheet or puts them on a page. Its top row is the bar's height and is inset as the bar's content is (`--header-max`, `--header-gutter`), so opening the sheet moves neither the lockup nor the button under the reader's thumb, and its row dividers read `--menu-rule` (default `--hairline`). On either sheet the contact dock's launcher steps aside while the menu is open.
|
|
557
662
|
|
|
558
|
-
|
|
663
|
+
The burger takes `menu.burger` (`SiteHeader`'s `burger`): `labelAfter` sets the three lines before the words `menuLabel` puts beside it, and `outlined` draws it in an outlined pill; both are off by default (8.2.0). While the menu is open only the lines fold to an X. The phone's round call button beside the burger is named by its number's `label` and the number, or "Call" and the number when it has no label (8.2.0).
|
|
664
|
+
|
|
665
|
+
The menu's words come from the config: the call to action reads `cta.menuLabel` when set, else `cta.label` ("Order ahead for Saturday" in the menu where the bar says "Order ahead"), and each header number reads its `menuLabel`, else its `label`, else "Call" (8.2.0). A number's `label` keeps its place in the desktop bar's phone pill.
|
|
559
666
|
|
|
560
667
|
```ts
|
|
561
668
|
// src/site.config.ts
|
|
@@ -603,7 +710,9 @@ nav: [
|
|
|
603
710
|
},
|
|
604
711
|
{ label: "About", to: "/about" },
|
|
605
712
|
],
|
|
606
|
-
header: { phones: [{ e164: "+15555550100", display: "(555) 555-0100", label: "The shop" }] },
|
|
713
|
+
header: { phones: [{ e164: "+15555550100", display: "(555) 555-0100", label: "The shop", menuLabel: "Call the shop" }] },
|
|
714
|
+
menu: { surface: "light" },
|
|
715
|
+
cta: { label: "Order ahead", href: "/order", menuLabel: "Order ahead for Saturday", arrow: true },
|
|
607
716
|
```
|
|
608
717
|
|
|
609
718
|
`SiteShell` puts the base path on every link and picture a section holds. The footer's Company column lists the entries themselves and never a group's links. A bar holding a group or a number keeps the burger up to 1180px instead of 900px, since it needs the room; the second of two numbers shows from 1360px, and the menu lists both. `header.phones` takes up to two, each a tel link; the first is also the round call button beside the burger on a phone.
|
|
@@ -622,6 +731,40 @@ The space a section leaves above and below itself is one token, `--section-space
|
|
|
622
731
|
|
|
623
732
|
`.section` pads with it, and the steps derived from it keep their old proportion to it: `.section-md` 0.7, `.section-sm` 0.6, `tight-top` and `tight-bottom` a third, the `PricingBand` 0.84, `PageHero` and the not found opener 0.72 on top and 0.5 below, and the `FeatureDetail` rows 0.6, whose first and last rows now sit flush with the section around them. `--block-gap` is the space between a section's heading and the grid under it (`FeatureGrid`, `ProfileCards`, `LinkColumns`, `CalloutPanel`, and `Gallery` at 0.77 of it), and `--card-min` the least a `FeatureGrid` card stands. A site that wants its own value sets the property on `.atelic-ui` in its own sheet, outside the layer. `ArtifactShell` pins `comfortable`, so a document reads as it did; the app shell reads none of these.
|
|
624
733
|
|
|
734
|
+
### Moving to 8.2.0
|
|
735
|
+
|
|
736
|
+
Nothing breaks: every addition is an optional prop, config key, token, or export. On a site that changes nothing, these change, all in or beside the phone menu: a header number with no label, or the contact block's one phone, reads "CALL" in the menu where it read "CALL / TEXT", which told a reader the business answers texts; the phone's round call button for a number with no label is named "Call" and the number where it was named by the number alone; the link to the page being read is underlined in the menu, as the bar marks its current entry; the contact dock's launcher is hidden while the menu is open, where the sheet already covered it; and a labeled burger, while the menu is open, folds only its lines to an X, where its words and its column of lines were caught by the X's rules too, a fault the open sheet covered. The group's own link in an open group now carries `aria-current` when it is the page being read, as the desktop panel's does. The light sheet, which no site has yet, shows no email and no address.
|
|
737
|
+
|
|
738
|
+
- **A light phone menu.** `menu: { surface: "light" }` in the site config (`SiteHeader`'s `menuSurface`, `SiteMenu`'s `surface` and `brand`) draws the menu on the page's ground: the lockup and a round close button across the top, the entries as rows, and the call to action and a card per number in a foot on the alternate ground (see [The Mega Menu](#the-mega-menu)). `dark` stays the default and draws as before. One component and one behavior: focus is trapped, Escape closes it, focus returns to the burger, the page holds still. `BrandLockup` takes `surface`, to draw one ground's mark alone, and `onClick`.
|
|
739
|
+
- **The menu's own words.** `cta.menuLabel` gives the menu's call to action its words where the bar keeps `label`. A header number's new `menuLabel` names it in the menu, falling back to `label`, then to "Call"; `label` keeps its place in the desktop bar's pill.
|
|
740
|
+
- **The light sheet** shows no email and no address, which the dark sheet's contact block does; its top row sits exactly where the bar's lockup and burger sit, and `--menu-rule` sets its dividers.
|
|
741
|
+
- **The burger** takes `menu.burger: { labelAfter, outlined }` (both off): the lines before the words, in an outlined pill.
|
|
742
|
+
- **The sticky bar on a hero page under a solid bar.** `cta.stickyFromTop` says whether the phone's sticky bar shows from the first paint; unset it does on a page without `heroNav`, as before, and a page with a hero under a solid bar sets it false so the bar slides in once the hero scrolls away.
|
|
743
|
+
- **The not found page's pending view.** `staticNotFoundRouting(NotFoundPage, { useMatches })` draws the page on a miss alone, so a slow client navigation shows no bare 404 body; a site drops its own pending component (see [The Not Found Page](#the-not-found-page)).
|
|
744
|
+
- **A refused send as a report.** `reportRefusedResponse(response, { service, request, tags })` from `@atelic-action/ui/monitoring/server` reports an upstream refusal with the status and the body's `name` and `message` alone, every address in them replaced by `[address]`; `refusalError` builds the error alone.
|
|
745
|
+
- **Every route's render crash reaches Sentry, whichever boundary catches it.** On TanStack Router 1.170 a route with no `errorComponent` already rises to `AppErrorBoundary` and is reported once; a route or a site that sets its own `errorComponent` with no `onCatch` caught the crash and reported it to nobody. A site adds the two lines under [Error Reporting](#error-reporting), `createRouter({ routeTree, ...routerErrorOptions() })` from `@atelic-action/ui/routing`, and every route's crash is reported once by its own boundary. The package's error page's Try Again reloads the page, since a loader's error stays on the router's match. `ErrorCatcherScript` takes `enabled` (default true), so the root route renders it only with a DSN. `reportServerErrorLater` from `@atelic-action/ui/monitoring/server` sends without holding the answer, on the platform's `waitUntil`. `atelic-check-sentry` now fails a DSN with a space or a line break around it, which the build would ship as set.
|
|
746
|
+
- **New tokens, each at today's look** (the table under [Tokens](#tokens)): `--hero-kicker-weight`, `--hero-kicker-tracking`, `--hero-kicker-size`, `--hero-lead-size`, `--hero-lead-measure`, `--hero-stack-gap`, `--menu-card-bg`, `--menu-card-ink`, `--menu-rule`, `--callout-sub-transform`, `--callout-sub-tracking`, `--subheading-tracking`, `--footer-link`, `--footer-link-hover`, `--footer-link-hover-decoration`, `--closing-link`, and `--closing-link-hover`. The 8.1.0 tokens whose default is a literal or a keyword default in `defaults.css` now; every default that names another token stays at its read, so a band that restates the named token still reaches it, exactly as in 8.1.0.
|
|
747
|
+
- **A dark ground says so with `data-ground`.** The sections the package draws on a dark or filled ground (the heroes, the credentials band, the callout panel, the price band, the process band, the contact card) wear `data-ground="dark"` or `"primary"`, and `--heading-color` steps aside on `[data-ground="dark"]`, `[data-ground="primary"]`, `.on-primary`, and `.on-dark`, beside the old list of those sections' classes, kept so markup carrying a class without the attribute behaves as before. A new dark section, the package's or a site's, needs only the attribute.
|
|
748
|
+
- **Fixes:** `atelic-check-sentry` fails a `VITE_SENTRY_DSN` of whitespace alone as malformed on every build, since a site's `Boolean(dsn)` treats it as set; `reportServerErrorLater` falls through to the platform's `waitUntil` when the context it is given has none it can call; the dark sheet's call to action is the `Button` primitive (the same markup, now with the base path and the number held whole); the contact dock measures again only on the header's own transition, never one inside it; a `tel:` link of an icon and its words holds its number whole, and the header's phone pill marks its number; `StickyCTABar` tells a swapped in `onSpaceChange` the height at once, where it waited for a resize; the contact dock measures its ceiling again when the header changes size or ends a transition; the header's call to action is the `Button` primitive (the same markup); `Footer` no longer sets `--footer-columns`, which nothing read.
|
|
749
|
+
|
|
750
|
+
### Moving to 8.1.0
|
|
751
|
+
|
|
752
|
+
Nothing breaks: every addition is an optional prop, config key, token, or entry. On a site that changes nothing, these change: the footer's hours, linked rating, and lockup; the fixes below; the current nav entry's underline on the solid bar; the credit link's underline; the footer's row wrapping a column before it squeezes a word; an email address breaking only at its @ or a dot; the contact dock never rising into the header; and the eyebrow's rule following its last line. Error reporting arrives for a site to wire.
|
|
753
|
+
|
|
754
|
+
- **The hours come back to the footer, on by default.** A site whose config holds `hours` (every site does, for the structured data) shows them in its footer as a column headed Hours, beside the link columns. To keep them out of the footer, and in the structured data and the sections that print them, set `footer: { showHours: false }` in the site config. Rendering `Footer` directly, a site passes `hours` (`HoursRow[]`, already formatted) and, if it wants other words, `hoursHeading`.
|
|
755
|
+
- **The rating links to the Google profile.** With `footer.rating` set, the whole rating line (the stars and the words) is one link, opening in a new tab, to `footer.ratingHref`, else `mapLinkURL`. A site with no `mapLinkURL` and no `ratingHref` keeps the plain line. `footer.ratingLabel` (and `Footer`'s `ratingLabel`) gives the link a fuller accessible name; `Footer` takes `ratingHref` directly.
|
|
756
|
+
- **The footer draws the header's lockup.** A brand with a mark image gets the mark with its wordmark beside it in the footer, as in the header, where 8.0.0 drew the image alone. `logo.wordmark: false` keeps the image alone, named by `logo.alt`. The header and the footer draw it from one composition (`LockupParts`, internal to `BrandLockup.tsx`), so the two never drift.
|
|
757
|
+
- **Fixed: a crowded mega panel no longer breaks words.** A panel's sections wrap to a second row before any is squeezed below its longest word or its floor; no label in a panel breaks inside a word. A panel that already fit lays out as before.
|
|
758
|
+
- **Fixed: the current entry over a hero.** On the transparent bar over a hero the current entry (a page, a group holding it, or a scroll spied stop) reads `--on-dark` with its siblings and is underlined, where it read `--primary` (a dark green primary read 1.64 to 1 over a dark hero). The solid bar's current entry keeps its `--primary-ink` and takes the same 2px underline, since a deep primary can sit within 2 to 1 of the bar's other words (1.67 on a real site), and color alone told the current page.
|
|
759
|
+
- **Error reporting, optional but expected** (see [Error Reporting](#error-reporting)): the early catcher, `startErrorReporting` from `@atelic-action/ui/monitoring`, the server reporter from `@atelic-action/ui/monitoring/server`, the middleware reporting its throws, the `atelic-check-sentry` command, and the source map upload in `marketingConfig`. Nothing changes for a site until it wires them, with two exceptions: `marketingConfig` now defines `import.meta.env.VITE_RELEASE` whenever the build knows its commit, and with `SENTRY_AUTH_TOKEN`, `SENTRY_ORG`, and `SENTRY_PROJECT` all set it uploads hidden source maps and deletes them from `dist/`. The package now depends on `@sentry/browser` and `@sentry/vite-plugin`, so a site drops its own `@sentry/react`. `AppErrorBoundary` hands a caught render crash to error reporting, which holds it in a buffer on the window until the SDK loads; with no DSN it goes nowhere.
|
|
760
|
+
- **Fixed on a crowded page:** the header's lockup never shrinks (a wide mark in a bar with five groups, a number, and the call to action drew at 100 by 39 where it is 141 by 55 at its height); a phone number's no wrap holds the number alone, not a whole call row (a tel link of words alone, or the `.tel-number` the dock, the menu, the panel, `Button`, and `Locations` now put around the number), so a dock row's line wraps inside the panel; links sharing an href are keyed by place everywhere (the bar, the menu, the panels, the footer, the not found page, the dock, the app's nav), so a one page site renders every link and React warns of nothing; a theme whose phone menu sheet's ground equals its primary sets `--menu-badge-bg`, `--menu-badge-ink`, `--menu-cta-bg`, and `--menu-cta-ink` to `--on-primary` and `--primary-ink`, so the badge and the call to action show there rather than vanish; left unset they draw as in 8.0.0. The number's wrapper sits inside one plain span, so a button reading "Call (555) 555-0142" measures exactly what the bare words measure. The contact dock's title is a heading by role, so the brand's heading tokens and a site's heading rules never reach it, and a `BlogIndex` card's title pins its own look against the tokens.
|
|
761
|
+
- **Fixed in the footer:** from 760px its columns are one row that wraps, each at its share as the grid gave it but never narrower than its longest word, so a crowded footer (the hours beside four link columns, or another machine's wider font) wraps a column to a second row rather than break "Instagram" inside itself; an icon stays on its label's line; an email address offers breaks after its @ and before each dot (`<wbr>`), so it never breaks inside a word.
|
|
762
|
+
- **Fixed in the dock:** the launcher never rises into the fixed header. Over a footer taller than the room left it holds 16px under the header (`ContactDock`'s new `header` selector, default `header.nav`), where it once rose over the phone's burger.
|
|
763
|
+
- **Fixed in the eyebrow:** the kicker is inline, so its trailing rule follows the last line of a kicker that wraps rather than standing apart beside the block; `Eyebrow rule={false}` and `Hero eyebrowRule={false}` set the kicker without it. The credit link in the closing bar is underlined, a link in a sentence never marked by color alone.
|
|
764
|
+
- **New options, each off or at today's look by default:** a `LinkColumns` row without `href` is words alone, and `--link-columns-min` (170px) sets a column's least width; a panel link takes `quiet` (the softer words, the regular weight); `site.cta.arrow` puts the hero's arrow on the header's button, `site.cta.stickyLabel` gives the phone's sticky bar its own words, and `site.menuLabel` sets words beside the burger on a phone, which then name it; and the tokens in the table under [Tokens](#tokens) marked 8.1.0.
|
|
765
|
+
- **Error reporting, as wired since:** `startErrorReporting` defaults its environment to `import.meta.env.VITE_ENVIRONMENT`, which `marketingConfig` now defines from `VERCEL_ENV` (else the mode); `window.__atelicErrors.test()` is the launch check; `isMiss` in `@atelic-action/ui/routing` is the miss check a site's root route asks; `atelic-check-sentry` fails a malformed DSN.
|
|
766
|
+
- **Smaller fixes:** `FullBleedVideo` given a `placeholder` and no `poster` never requests its `src`; `LinkColumns` holds two links to one page in a column; on a page wearing the contact dock the hero's scroll cue moves to the middle of the hero's foot, out from under the launcher; `StickyCTABar` hands the space back to the listener it told when a caller swaps `onSpaceChange`; and the app's dark theme sets destructive words in their own `--destructive-ink` (red 400, `0 90.6% 70.8%`, 6.48 to 1 on the dark card), where they read the fill's deep red at 1.79.
|
|
767
|
+
|
|
625
768
|
### Moving to 8.0.0
|
|
626
769
|
|
|
627
770
|
- **The spacing default tightened.** Every section pads by the table above, so a site's pages run shorter. A site that wants its old look sets `density: "comfortable"` in its config. Check any section a site padded by hand in its own sheet against the new rhythm.
|
|
@@ -877,16 +1020,16 @@ The plain text alternative part ports as plain functions with no React anywhere
|
|
|
877
1020
|
|
|
878
1021
|
### Tokens
|
|
879
1022
|
|
|
880
|
-
The sheets read a set of tokens beyond the theme's palette, type, radii, and layout. Each has a default, declared once in `styles/defaults.css` on `:where(.atelic-ui)`, which weighs nothing, so a theme's own `.atelic-ui` rule wins and sets one only to change it; every default is the value the sheets used before it was a token, so a site that sets none looks as it did (8.0.0). Every layered sheet imports `defaults.css` first, so a sheet loaded alone still finds its defaults. No layered sheet paints a raw color anywhere else: `tst/no-raw-colors.test.ts` sweeps every sheet in `src/styles/` but the ones it excludes by name with a reason (`app.css`, Tailwind source outside the layer), and fails on a hex, a color function, or a named color outside a token's declaration in the defaults sheet, with its few exceptions listed in the test, each with its reason.
|
|
1023
|
+
The sheets read a set of tokens beyond the theme's palette, type, radii, and layout. Each has a default, declared once in `styles/defaults.css` on `:where(.atelic-ui)`, which weighs nothing, so a theme's own `.atelic-ui` rule wins and sets one only to change it; every default is the value the sheets used before it was a token, so a site that sets none looks as it did (8.0.0). Every layered sheet imports `defaults.css` first, so a sheet loaded alone still finds its defaults. Only a default that is a literal value or a system keyword is declared there; an inherited color is `currentColor`, which is the same thing. Every other default stays at the read, marked "read in place" below: a default that names another token (`--menu-cta-bg` falls back to `--primary-fill`, then `--primary`), since declared on the root it would resolve once there and a band that restates the named token below it would no longer reach it, as `--primary-fill` and `--primary-ink` never have; a chain read more than once is written once as a private property on the component's own root (`--_menu-cta-bg` on the menu's sheet, `--_header-gutter` on the bar), where it resolves below any band. Also read in place: one computed on the element itself (`--hero-split-pad`), an inherited one other than a color (`--callout-sub-font`, the plain address's `--footer-nap-weight`), since a custom property cannot hold `inherit`, and `--hero-stack-gap`, whose gaps each keep their own value unset. `defaults.css` lists them in one comment, and `Foundations/ThemeTokens`' `BandRestatingPrimary` and `Chrome/SiteMenu`'s `CTAInABandRestatingPrimary` prove a band reaches them (8.2.0). No layered sheet paints a raw color anywhere else: `tst/no-raw-colors.test.ts` sweeps every sheet in `src/styles/` but the ones it excludes by name with a reason (`app.css`, Tailwind source outside the layer), and fails on a hex, a color function, or a named color outside a token's declaration in the defaults sheet, with its few exceptions listed in the test, each with its reason.
|
|
881
1024
|
|
|
882
1025
|
**The primary does three jobs, and each has its own token.** `--primary` is the brand color as a mark: lines, rules, focus rings, icons, stars, dots, and accents that carry no words. `--primary-fill` is the primary as a field that carries words: the primary button, the dock's launcher and panel head, the split hero and the callout panel bands, the price band, the menu's badges and highlighted row, the reveal slider's after label, the map's directions chip, a step bubble's badge; the words on it read `--on-primary`, and its hover and press darken it, so they stay distinct even where a theme's fill is its old hover shade. `--primary-ink` is the primary as words on `--surface` and `--surface-alt`: the eyebrow, a serif accent in a heading, the current nav entry and panel link, inline accent links, a feature number, the info tone. Both new tokens fall back to `--primary` where they are read, so a site that sets neither looks as it did, and a band that restates `--primary` carries both with it. A bright brand color that cannot pass text contrast keeps `--primary` and sets the other two deeper; the Storybook theme (`.storybook/theme.css`) sets `--primary` `#fc4a1a`, `--primary-fill` `#d63a10` (white on it 4.70 to 1), and `--primary-ink` `#b8300b` (5.38 to 1 on `--surface`, 4.97 on `--surface-alt`, 4.80 under the bar's hover tint).
|
|
883
1026
|
|
|
884
1027
|
| Token | Default | What it colors or sets |
|
|
885
1028
|
|---|---|---|
|
|
886
1029
|
| `--primary-fill` | `--primary`, read in place | Every primary field that carries words: `.btn-primary`, the dock's launcher, panel head, and lead icon, the split hero and callout panel bands, the price band, a step bubble's badge, a menu badge, a highlighted menu row, the reveal slider's after label, the map's directions chip. Its hover is 84% of it mixed with `--shade`, its press 74% |
|
|
887
|
-
| `--primary-ink` | `--primary`, read in place | The primary's words on `--surface` and `--surface-alt`: the eyebrow, `em.serif` and a heading's `.serif`, the current nav entry
|
|
1030
|
+
| `--primary-ink` | `--primary`, read in place | The primary's words on `--surface` and `--surface-alt`: the eyebrow, `em.serif` and a heading's `.serif`, the current nav entry and group on the solid bar, the current panel link, inline accent links and hovers, feature numbers and links, the FAQ's links, the gate's brand line and links, the info tone, the surface button inside `.on-primary` |
|
|
888
1031
|
| `--on-primary` | `#fff` | Anything set on the primary fill: a primary button's words, the dock's head and lead icon, the split hero's copy and accent, the callout panel, the price band, a step bubble's badge, a menu badge, a highlighted menu row, the feature card. Read whole, never softened, since a fill cut to pass leaves no room for a mix |
|
|
889
|
-
| `--on-dark` | `#fff` | Anything on a dark band or over a photograph: the skip link, the transparent header, the dark header's text (mixed with `--surface`), the phone menu's rules, the footer's headings and links, a hero's headline, the contact card, the process band, a ghost button and a chip on dark, the reveal slider's handle |
|
|
1032
|
+
| `--on-dark` | `#fff` | Anything on a dark band or over a photograph: the skip link, the transparent header and its current entry (8.1.0), the dark header's text (mixed with `--surface`), the phone menu's rules, the footer's headings and links, a hero's headline, the contact card, the process band, a ghost button and a chip on dark, the reveal slider's handle |
|
|
890
1033
|
| `--on-dark-chip` | `#efe7da` | A chip's words on a dark band (the credentials chips, `Chip onDark`) |
|
|
891
1034
|
| `--on-dark-quiet` | `rgb(248 244 237 / 0.74)` | Quiet text on the dark process band |
|
|
892
1035
|
| `--on-dark-faint` | `rgb(248 244 237 / 0.52)` | The quietest text on a dark band: the closing bar's copyright and credit (5.23 to 1 on `#151515`), where a light ground's gray such as `--neutral-500` falls short |
|
|
@@ -902,9 +1045,31 @@ The sheets read a set of tokens beyond the theme's palette, type, radii, and lay
|
|
|
902
1045
|
| `--weight-light`, `--weight-regular`, `--weight-medium`, `--weight-semibold`, `--weight-strong`, `--weight-bold`, `--weight-heavy` | 300, 400, 500, 600, 650, 700, 800 | Every font weight in every layered sheet. A font kit with only 400 and 700 maps each name to one of those (medium to 400, semibold, strong, and heavy to 700), so the browser synthesizes no weight |
|
|
903
1046
|
| `--brand-mark-height` | `30px` (20px inside `ArtifactShell`) | The header mark's height, and a sent document's recipient mark; the width follows the image's own ratio |
|
|
904
1047
|
| `--sticky-cta-space` | `0px`, read in place | The room the phone's sticky bar takes while it shows, which the closing bar pads its foot by; `SiteShell` sets it on its root from `StickyCTABar`'s measurement, and a theme never does |
|
|
1048
|
+
| `--header-max`, `--header-gutter` | `--max-width`, `--gutter`, read in place (on the bar, and on the light menu's top row, which sits where the bar's content does) | The bar's and the mega panel's width and side gutter, for a design that runs the bar wider than the content (8.1.0) |
|
|
1049
|
+
| `--nav-open-bg`, `--nav-open-ink` | `--hover-tint` read in place, `currentColor` (the bar's words) | The open group's pill (8.1.0) |
|
|
1050
|
+
| `--nav-phone-pad`, `--nav-phone-size` | `6px 16px 6px 12px`, `0.95rem` | The header phone pill's padding and its number's size (8.1.0) |
|
|
1051
|
+
| `--heading-transform`, `--heading-weight`, `--heading-tracking`, `--heading-color` | `none`, `--weight-heavy`, `-0.02em`, `currentColor` (inherited) | Every `h1` and `h2` the package sets (section headings, the heroes', the page hero's). The color never reaches a heading on a ground that says it is dark or the primary fill, by `data-ground` (8.2.0: every such section the package draws wears it, the hero, the process band, the callout panel, the price band, the credentials band, the contact card, and a site's own dark band may) or by `.on-primary` or `.on-dark`, nor one a component colors itself (8.1.0) |
|
|
1052
|
+
| `--subheading-tracking` | `-0.015em` | Every `h3`'s tracking, and two thirds of it every `h4`'s (`-0.01em` at the default), as `--heading-tracking` reaches `h1` and `h2`; a brand setting headings flat sets it to `0` (8.2.0) |
|
|
1053
|
+
| `--hero-kicker-weight`, `--hero-kicker-tracking`, `--hero-kicker-size` | the eyebrow primitive's own (`--weight-medium`, `0.18em`, `0.74rem`), read in place from its private properties | The hero's eyebrow line, both layouts (8.2.0) |
|
|
1054
|
+
| `--hero-lead-measure` | `52ch` | The hero's lead paragraph's measure, both layouts (8.2.0) |
|
|
1055
|
+
| `--hero-stack-gap` | none; unset, each gap keeps its own (18, 22, and 32px on the full hero, 12, 22, and 26px on the split hero), read in place | One gap between the hero's kicker and headline, headline and lead, and lead and actions, both layouts (8.2.0) |
|
|
1056
|
+
| `--hero-lead-size` | `clamp(1.05rem, 2.2vw, 1.35rem)` | The hero's lead paragraph (`subtitle`), both layouts; a split hero whose lead wraps too long sets it smaller (8.2.0) |
|
|
1057
|
+
| `--card-title-color` | `currentColor` (inherited) | A `FeatureGrid` card's title (8.1.0) |
|
|
1058
|
+
| `--callout-transform`, `--callout-sub-font` | `none`, inherited (read in place, since no custom property can hold `inherit`) | A `CalloutPanel` title's case and its line's face (8.1.0) |
|
|
1059
|
+
| `--callout-sub-transform`, `--callout-sub-tracking` | `none`, `normal` | A `CalloutPanel` subtitle's case and tracking (8.2.0) |
|
|
1060
|
+
| `--proof-star-fill` | `--primary`, read in place | A star row in a `ProofStrip` value (8.1.0) |
|
|
1061
|
+
| `--hero-split-pad` | the wrap's edge, computed on the copy (read in place) | The split hero's copy sides (8.1.0) |
|
|
1062
|
+
| `--footer-mark-height`, `--footer-nap-weight` | `38px`, `--weight-semibold` (the plain address: the column's own, read in place, since no custom property can hold `inherit`) | The footer lockup's mark and the address, phone, and email lines (8.1.0) |
|
|
1063
|
+
| `--footer-link`, `--footer-link-hover` | `--neutral-200`, `--on-dark`, read in place | The footer's column links and every footer link's hover, apart from the neutrals that also draw outlines (8.2.0) |
|
|
1064
|
+
| `--footer-link-hover-decoration` | `none` | The line a footer column link and a contact line take on hover (`underline`), for a theme whose links are already the hover's color, where a hover by color alone shows nothing (8.2.0) |
|
|
1065
|
+
| `--closing-link`, `--closing-link-hover` | `--neutral-300`, `--surface` mixed 96% with `--on-dark`, read in place | The closing bar's links, the credit's among them, and their hover. Their own pair, since the closing bar's links have always read a step quieter than the footer's (8.2.0) |
|
|
1066
|
+
| `--menu-card-bg`, `--menu-card-ink` | `--primary-deep`, `--on-primary`, read in place | The mega panel's feature card: its ground, and its eyebrow, headline, line, and ticked points. The card is the primary field (`.on-primary`), so its button stays light; a theme that sets a light ground here checks the button against it (8.2.0) |
|
|
1067
|
+
| `--menu-rule` | `--hairline`, read in place | The light phone menu's row dividers (8.2.0) |
|
|
1068
|
+
| `--menu-badge-bg`, `--menu-badge-ink`, `--menu-cta-bg`, `--menu-cta-ink` | `--primary-fill`, `--on-primary` (as 8.0.0 drew them), read in place | The phone menu's badge and call to action. A theme whose sheet's ground equals its primary sets them to `--on-primary` and `--primary-ink`, or they vanish into the sheet (8.1.0) |
|
|
1069
|
+
| `--link-columns-min` | `170px` | The least a `LinkColumns` column narrows to (8.1.0) |
|
|
905
1070
|
| `--section-space`, `--block-gap`, `--card-min` | `clamp(56px, 9vw, 120px)`, `44px`, `240px` | The section rhythm where no `base.css` sets it (an app importing `components.css` alone); with `base.css` the settings under [Density](#density) win |
|
|
906
1071
|
|
|
907
|
-
Three more read a fallback in place: `--star-fill` colors every filled star (`StarRating`'s, which falls back to the text color, and the footer's rating, which falls back to `--review-gold`), `--font-condensed` sets a `CalloutPanel` title's face, and `--neutral-700` colors prose bodies (`ProseBlocks`, the blog's index and post), falling back to `--ink`. The tone palette (`--tone-good` and its kin) is declared with the defaults and described under [Page Components](#page-components).
|
|
1072
|
+
The review carousel's dots and a ghost button's outline already read neutral tokens a theme sets, so they take none of their own: the dots `--neutral-200` (hover `--neutral-500`, current `--ink`), the outline `--neutral-300` (hover `--ink`). Three more read a fallback in place: `--star-fill` colors every filled star (`StarRating`'s, which falls back to the text color, and the footer's rating, which falls back to `--review-gold`), `--font-condensed` sets a `CalloutPanel` title's face, and `--neutral-700` colors prose bodies (`ProseBlocks`, the blog's index and post), falling back to `--ink`. The tone palette (`--tone-good` and its kin) is declared with the defaults and described under [Page Components](#page-components).
|
|
908
1073
|
|
|
909
1074
|
`@atelic-action/ui/tokens` carries the palette and the font stacks with no React import, so a build script or a plain text renderer can read them. `toThemeCSS(palette)` writes the palette out as the site token declarations (`--surface`, `--surface-dark`, `--card`, `--ink`, `--primary`), and `themeTokenMap` exposes which palette key each token takes.
|
|
910
1075
|
|
|
@@ -1060,7 +1225,7 @@ The import has to come before any other rule, or it is dropped without a word: t
|
|
|
1060
1225
|
|
|
1061
1226
|
Proven on a copy of pinole-app thinned onto a packed tarball: with the line or the import, the built CSS holds every utility the shell uses; with neither, 165 of them are missing.
|
|
1062
1227
|
|
|
1063
|
-
The light theme's words pass 4.5 to 1 on what they sit on, and `tst/app/app-contrast.test.ts` reads the sheet to hold it there (8.0.0). Two stock shadcn values fell short and moved: `--destructive` is `0 72.2% 50.6%` (`#dc2626`; 4.63 to 1 under `--destructive-foreground`, 4.83 as words on a card, 4.66 on the ground) and `--muted-foreground` is `240 3.6% 43.5%` (`#6b6b73`; 4.81 on `--muted` and `--accent`, the grey a highlighted row wears). `--color-destructive-hover` is the fill mixed 85% with black, for a destructive fill's hover and press and for destructive words on the grey while pressed, so hovering never lightens the fill under its words. The provider's sonner toaster shows rich colors, whose stock light tones read 4.25 (success), 4.34 (error), 4.35 (info), and 3.07 (warning); the sheet darkens each tone's words through sonner's own variables, on a selector one element more specific than sonner's so the load order does not matter: success `hsl(140, 100%, 24%)` 5.22, info `hsl(210, 92%, 40%)` 5.28, warning `hsl(31, 92%, 32%)` 5.52, error `hsl(360, 100%, 41%)` 5.11. The dark theme's values are shadcn's and are not yet checked. The sheet sits outside the `atelic-ui` layer on purpose: its tokens and resets are in Tailwind's base layer and the scaffold is unlayered, as the template carried them, so the shell renders as it did.
|
|
1228
|
+
The light theme's words pass 4.5 to 1 on what they sit on, and `tst/app/app-contrast.test.ts` reads the sheet to hold it there (8.0.0). Two stock shadcn values fell short and moved: `--destructive` is `0 72.2% 50.6%` (`#dc2626`; 4.63 to 1 under `--destructive-foreground`, 4.83 as words on a card, 4.66 on the ground) and `--muted-foreground` is `240 3.6% 43.5%` (`#6b6b73`; 4.81 on `--muted` and `--accent`, the grey a highlighted row wears). `--color-destructive-hover` is the fill mixed 85% with black, for a destructive fill's hover and press and for destructive words on the grey while pressed, so hovering never lightens the fill under its words. The provider's sonner toaster shows rich colors, whose stock light tones read 4.25 (success), 4.34 (error), 4.35 (info), and 3.07 (warning); the sheet darkens each tone's words through sonner's own variables, on a selector one element more specific than sonner's so the load order does not matter: success `hsl(140, 100%, 24%)` 5.22, info `hsl(210, 92%, 40%)` 5.28, warning `hsl(31, 92%, 32%)` 5.52, error `hsl(360, 100%, 41%)` 5.11. Destructive words read `--color-destructive-ink`, which falls back to `--destructive`, so the light theme's one red serves both; the dark theme sets `--destructive-ink` to `0 90.6% 70.8%` (red 400, `#f87171`, 6.48 to 1 on its card, 5.62 on the grey highlight), since its fill, `0 62.8% 30.6%`, read 1.79 to 1 as words on the card (8.1.0). The rest of the dark theme's values are shadcn's and are not yet checked. The sheet sits outside the `atelic-ui` layer on purpose: its tokens and resets are in Tailwind's base layer and the scaffold is unlayered, as the template carried them, so the shell renders as it did.
|
|
1064
1229
|
|
|
1065
1230
|
### The Kit
|
|
1066
1231
|
|
package/dist/gate/middleware.js
CHANGED
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
* open file of its own passes `open`; one whose matcher already leaves its
|
|
30
30
|
* open paths out may still pass its own `needsSession`, which wins over both.
|
|
31
31
|
*/
|
|
32
|
+
import { reportServerError } from "../monitoring/server.js";
|
|
32
33
|
import { isAllowed } from "./config.js";
|
|
33
34
|
import { verifyToken } from "./tokens.js";
|
|
34
35
|
import { createNeedsSession } from "./wall.js";
|
|
@@ -45,7 +46,7 @@ function readCookie(header, name) {
|
|
|
45
46
|
}
|
|
46
47
|
export function createMiddleware(options = {}) {
|
|
47
48
|
const needsSession = options.needsSession ?? createNeedsSession(options.open);
|
|
48
|
-
|
|
49
|
+
async function decide(request) {
|
|
49
50
|
const secret = process.env.GATE_SESSION_SECRET;
|
|
50
51
|
if (!secret)
|
|
51
52
|
return; // gate off, let everything through
|
|
@@ -60,6 +61,19 @@ export function createMiddleware(options = {}) {
|
|
|
60
61
|
const login = new URL("/login", url.origin);
|
|
61
62
|
login.searchParams.set("next", url.pathname + url.search);
|
|
62
63
|
return Response.redirect(login.toString(), 302);
|
|
64
|
+
}
|
|
65
|
+
// A throw is reported to Sentry (when a DSN is set) and thrown again, so
|
|
66
|
+
// the request fails exactly as it did; a pass and a block are untouched.
|
|
67
|
+
// The expected misses (a malformed cookie, a token that fails to verify)
|
|
68
|
+
// are answers, not errors, and stay quiet.
|
|
69
|
+
return async function middleware(request) {
|
|
70
|
+
try {
|
|
71
|
+
return await decide(request);
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
await reportServerError(error, { request, tags: { source: "middleware" } });
|
|
75
|
+
throw error;
|
|
76
|
+
}
|
|
63
77
|
};
|
|
64
78
|
}
|
|
65
79
|
export default createMiddleware();
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error reporting on the server: a dependency free Sentry reporter for a
|
|
3
|
+
* Vercel function or middleware. Built to dist/ with the gate (CLAUDE.md,
|
|
4
|
+
* the built corner), since Vercel runs a function's package imports as
|
|
5
|
+
* shipped, so this file imports nothing and touches only what a function and
|
|
6
|
+
* the middleware runtime both have (fetch, `AbortController`, `crypto`).
|
|
7
|
+
*
|
|
8
|
+
* import { reportServerError, reportServerErrorLater, withErrorReporting } from "@atelic-action/ui/monitoring/server";
|
|
9
|
+
*
|
|
10
|
+
* Privacy: a report carries the request's method and path, and its user
|
|
11
|
+
* agent, never its body, its query string, or any other header. A contact
|
|
12
|
+
* form's request holds a person's name, address, and message.
|
|
13
|
+
*/
|
|
14
|
+
/** The parts of a DSN a report is sent with. */
|
|
15
|
+
export interface ParsedDSN {
|
|
16
|
+
/** The public key, sent as `sentry_key`. */
|
|
17
|
+
key: string;
|
|
18
|
+
projectId: string;
|
|
19
|
+
/** Where the envelope is posted. */
|
|
20
|
+
envelopeURL: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ServerReportOptions {
|
|
23
|
+
/** Defaults to `SENTRY_DSN`, then `VITE_SENTRY_DSN`, from the environment. */
|
|
24
|
+
dsn?: string;
|
|
25
|
+
/** The request being handled; only its method, path, and user agent are read. */
|
|
26
|
+
request?: Request;
|
|
27
|
+
/** Tags beside the runtime's, e.g. `{ route: "contact" }`. */
|
|
28
|
+
tags?: Record<string, string>;
|
|
29
|
+
/** Defaults to `VERCEL_GIT_COMMIT_SHA`. */
|
|
30
|
+
release?: string;
|
|
31
|
+
/** Defaults to `VERCEL_ENV`. */
|
|
32
|
+
environment?: string;
|
|
33
|
+
/** How long the send may take, in milliseconds. Defaults to 2000. */
|
|
34
|
+
timeoutMs?: number;
|
|
35
|
+
}
|
|
36
|
+
/** One stack frame in Sentry's exception format. */
|
|
37
|
+
export interface SentryFrame {
|
|
38
|
+
function?: string;
|
|
39
|
+
filename?: string;
|
|
40
|
+
lineno?: number;
|
|
41
|
+
colno?: number;
|
|
42
|
+
in_app: boolean;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Reads a DSN (`https://<key>@<host>[/<path>]/<project>`) into the URL its
|
|
46
|
+
* envelopes are posted to. Undefined for anything that is not one.
|
|
47
|
+
*/
|
|
48
|
+
export declare function parseDSN(dsn: string | undefined): ParsedDSN | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* The frames of a V8 stack (`at fn (file:line:col)`, `at file:line:col`),
|
|
51
|
+
* oldest call first, as Sentry lists them. A frame inside `node_modules` is
|
|
52
|
+
* not the site's own code.
|
|
53
|
+
*/
|
|
54
|
+
export declare function parseStack(stack: string | undefined): SentryFrame[];
|
|
55
|
+
/**
|
|
56
|
+
* The envelope a report is sent as: the envelope header, the item header,
|
|
57
|
+
* and the event, one JSON document to a line. Exported for the tests.
|
|
58
|
+
*/
|
|
59
|
+
export declare function buildEnvelope(error: unknown, dsn: string, options?: Omit<ServerReportOptions, "dsn" | "timeoutMs">, now?: Date): string;
|
|
60
|
+
/**
|
|
61
|
+
* Reports an error to Sentry from a function or the middleware. Resolves
|
|
62
|
+
* true when Sentry took it and false otherwise (no DSN, a bad DSN, a failed
|
|
63
|
+
* or slow send), and never throws, so a report can never become a second
|
|
64
|
+
* failure. With no DSN it sends nothing.
|
|
65
|
+
*/
|
|
66
|
+
export declare function reportServerError(error: unknown, options?: ServerReportOptions): Promise<boolean>;
|
|
67
|
+
/**
|
|
68
|
+
* What a handler's context offers to keep work running after the answer has
|
|
69
|
+
* gone: the second argument of an edge middleware or a Vercel function
|
|
70
|
+
* (`context.waitUntil`), or any object holding a `waitUntil` like it.
|
|
71
|
+
*/
|
|
72
|
+
export interface WaitUntilContext {
|
|
73
|
+
waitUntil(promise: Promise<unknown>): void;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Reports an error without making the caller wait for it. The send starts
|
|
77
|
+
* at once and is handed to the platform's `waitUntil` (the `context` given,
|
|
78
|
+
* else Vercel's request context), which keeps the function alive until it
|
|
79
|
+
* finishes after the answer has gone. With neither, the send still runs,
|
|
80
|
+
* never blocking the answer, and may be cut short if the runtime freezes
|
|
81
|
+
* once the answer is out. Never throws, and returns nothing to wait on.
|
|
82
|
+
*
|
|
83
|
+
* Use `reportServerError`, awaited, where the report must land before the
|
|
84
|
+
* handler goes on (before a throw, in a handler that already waits); use
|
|
85
|
+
* this one where the answer should leave at once (a refusal the person is
|
|
86
|
+
* waiting to read).
|
|
87
|
+
*/
|
|
88
|
+
export declare function reportServerErrorLater(error: unknown, options?: ServerReportOptions & {
|
|
89
|
+
context?: WaitUntilContext;
|
|
90
|
+
}): void;
|
|
91
|
+
/**
|
|
92
|
+
* A refused upstream answer as an error a report may carry: the service's
|
|
93
|
+
* name, the status, and the error body's `name` and `message` fields alone,
|
|
94
|
+
* each with anything shaped like an email address replaced by `[address]`
|
|
95
|
+
* and cut to 300 characters. Nothing else of the body is read, and a body
|
|
96
|
+
* that is not JSON leaves the status alone. Never throws.
|
|
97
|
+
*
|
|
98
|
+
* await refusalError(response, "Resend") // Error("Resend answered 422: validation_error: ...")
|
|
99
|
+
*/
|
|
100
|
+
export declare function refusalError(response: Response, service?: string): Promise<Error>;
|
|
101
|
+
/**
|
|
102
|
+
* Reports a refused upstream answer (a send the mail service would not
|
|
103
|
+
* take) without holding the caller's own answer: the error is built by
|
|
104
|
+
* `refusalError`, so no address in the refusal survives, and sent by
|
|
105
|
+
* `reportServerErrorLater`. Resolves once the refusal's body is read, never
|
|
106
|
+
* waiting on the send, and never throws.
|
|
107
|
+
*
|
|
108
|
+
* if (!response.ok) {
|
|
109
|
+
* await reportRefusedResponse(response, { service: "Resend", request, tags: { route: "contact" } });
|
|
110
|
+
* return json(502, { ok: false, error: "Sending failed. Please try again in a moment." });
|
|
111
|
+
* }
|
|
112
|
+
*/
|
|
113
|
+
export declare function reportRefusedResponse(response: Response, options?: ServerReportOptions & {
|
|
114
|
+
service?: string;
|
|
115
|
+
context?: WaitUntilContext;
|
|
116
|
+
}): Promise<void>;
|
|
117
|
+
/**
|
|
118
|
+
* Wraps a function's handler so a throw is reported, then thrown again: the
|
|
119
|
+
* platform still answers the request as it would have, and Sentry hears of
|
|
120
|
+
* it first. `export const POST = withErrorReporting(async (request) => ...)`.
|
|
121
|
+
*/
|
|
122
|
+
export declare function withErrorReporting<Args extends [Request, ...unknown[]], Result>(handler: (...args: Args) => Result | Promise<Result>, options?: Omit<ServerReportOptions, "request">): (...args: Args) => Promise<Result>;
|