Skip to content

feat(site/src): redesign Alert to match the Coder kit spec - #30908

Draft
designertyler wants to merge 5 commits into
mainfrom
alert-redesign-coder-kit
Draft

designertyler wants to merge 5 commits into
mainfrom
alert-redesign-coder-kit

Conversation

@designertyler

@designertyler designertyler commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Restyles the shared Alert to match the Coder kit alert spec (Figma node 3613:569) and adds the two new kit variants: a single-line compact alert and an error-only "Technical details" disclosure.

ErrorAlert now fills that disclosure from the error itself: request ID (X-Coder-Request-Id), status, method and URL, the response Date header, and any response fields beyond message/detail (for example validations). Non-request errors show the stack trace. This replaces its two <details> blocks ("Response data", "Stack Trace").

API changes (all additive)

  • compact?: boolean: one line, items centered, min height 54px. actions renders inline after the text and should be a single Link size="sm".
  • details?: readonly AlertDetail[] ({ label, value }): rendered only for non-compact error alerts, collapsed by default, with a copy button that copies label: value lines.
  • AlertDetail type export.
  • ErrorAlert accepts an optional title for a user-facing outcome (for example "We couldn't create this workspace"), per the kit's "name the failure" guidance. With a title, the error's detail becomes the description and the raw API message moves to a "Message" row in Technical details. When there is no detail, the raw message stays as the description and gets no row. Without title, behavior is unchanged; no existing callers are migrated in this PR.
  • mockApiError accepts optional request, status, statusText, headers.

Visual changes that affect existing callers

  • Prominent success (and info) is removed, per the designer's decision. Alert has no prominent style for info/success; passing prominent with them renders the default style. The prop type is unchanged so dynamic callers still compile. Callers updated:
    • site/src/pages/TemplateVersionEditorPage/TemplateVersionEditor.tsx:309: the floating "published" success alert drops prominent and uses the default style (no green background).
    • site/src/pages/WorkspacePage/AgentAlert.stories.tsx: removed the InfoProminent story. AgentAlert still forwards prominent, but modules/workspaces/health.ts always passes prominent: false for info.
    • site/src/components/Alert/Alert.stories.tsx: removed the ProminentIgnoredForInfoAndSuccess story. No tests covered prominent success.
  • Text is 12px/18px everywhere (previously 14px). AlertTitle is semibold (was medium) and AlertDescription is regular weight and display: block. This affects all 36 files that use AlertTitle/AlertDescription and all inline-text alerts. Two callers already override these: TemplateFilesPage.tsx:58 (font-semibold, now redundant) and RoleSelector.tsx:244-249 (font-normal).
  • Error icon is OctagonXIcon (was CircleAlertIcon). Radius is rounded-md (was rounded-lg), and there is now a shadow-sm.
  • ErrorAlert debug output (116 non-story files): the "Response data"/"Stack Trace" disclosures become one "Technical details" disclosure. Axios errors no longer show a JS stack trace, and response JSON leaves out the message/detail already shown in the alert, per the kit's alert pattern guidance. showDebugDetail={false} still hides it. Two page stories that clicked or checked the old labels are updated.

Apart from the prominent success caller above, I did not rewrite any callers.

Decision log and spec ambiguities
  • Shadow: the repo has no --shadow token and no Tailwind shadow equal to 0 2px 3px. I used shadow-sm (0 1px 3px, the closest one) instead of hardcoding a color.
  • Prominent info/success: removed from the design. The boolean prop stays (warning/error only) instead of a type-level union, which would break AgentAlert, which passes severity and prominent as variables.
  • Action buttons: per the designer, use Button size="sm" and the standard outline variant as coded; Button is not modified.
  • Link action icon: the shared Link uses SquareArrowOutUpRightIcon, not lucide external-link. I reused Link (size="sm" gives 12px text and a 14px icon) instead of adding an icon override.
  • Prominent single action: the design shows a single primary action, but this is left to callers. The component does not enforce it.
  • Details only for error, compact without details or buttons: enforced at runtime (documented in JSDoc) instead of with types, for the same compatibility reason.
  • Disclosure: uses the existing Radix Collapsible (native button with aria-expanded). The chevron rotates 90° rather than swapping icons.
  • Copy: reuses CopyButton (useClipboard), labeled "Copy technical details".
  • Figma "Message" row: shown by ErrorAlert only when a title is passed, because otherwise the message is already the alert title and the kit says not to repeat it.
  • Title: the user asked for feat(site/src/components/Alert). The scope is widened to site/src because testHelpers/entities.ts and two page stories changed.

Checks: pnpm lint (biome, oxlint, tsc, circular deps, compiler), full pnpm test, and pnpm test:storybook for the Alert, ErrorAlert, ChatSearchDialog, and SecretsPageView stories all pass. The frontend-deep-review findings are fixed. One remaining nit: SecretsPageView.stories.tsx:773 keeps a pre-existing play assertion, retargeted to the new label.


Generated by Coder Agents on behalf of @designertyler.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant