Repository navigation
feat(site/src): redesign Alert to match the Coder kit spec - #30908
Draft
designertyler wants to merge 5 commits into
Draft
designertyler wants to merge 5 commits into
designertyler wants to merge 5 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Restyles the shared
Alertto match the Coder kitalertspec (Figma node 3613:569) and adds the two new kit variants: a single-linecompactalert and an error-only "Technical details" disclosure.ErrorAlertnow fills that disclosure from the error itself: request ID (X-Coder-Request-Id), status, method and URL, the responseDateheader, and any response fields beyondmessage/detail(for examplevalidations). 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.actionsrenders inline after the text and should be a singleLink size="sm".details?: readonly AlertDetail[]({ label, value }): rendered only for non-compacterroralerts, collapsed by default, with a copy button that copieslabel: valuelines.AlertDetailtype export.ErrorAlertaccepts an optionaltitlefor 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. Withouttitle, behavior is unchanged; no existing callers are migrated in this PR.mockApiErroraccepts optionalrequest,status,statusText,headers.Visual changes that affect existing callers
Alerthas no prominent style forinfo/success; passingprominentwith 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 dropsprominentand uses the default style (no green background).site/src/pages/WorkspacePage/AgentAlert.stories.tsx: removed theInfoProminentstory.AgentAlertstill forwardsprominent, butmodules/workspaces/health.tsalways passesprominent: falsefor info.site/src/components/Alert/Alert.stories.tsx: removed theProminentIgnoredForInfoAndSuccessstory. No tests covered prominent success.AlertTitleis semibold (was medium) andAlertDescriptionis regular weight anddisplay: block. This affects all 36 files that useAlertTitle/AlertDescriptionand all inline-text alerts. Two callers already override these:TemplateFilesPage.tsx:58(font-semibold, now redundant) andRoleSelector.tsx:244-249(font-normal).OctagonXIcon(wasCircleAlertIcon). Radius isrounded-md(wasrounded-lg), and there is now ashadow-sm.ErrorAlertdebug 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 themessage/detailalready 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
--shadowtoken and no Tailwind shadow equal to0 2px 3px. I usedshadow-sm(0 1px 3px, the closest one) instead of hardcoding a color.AgentAlert, which passesseverityandprominentas variables.Button size="sm"and the standard outline variant as coded;Buttonis not modified.LinkusesSquareArrowOutUpRightIcon, not lucideexternal-link. I reusedLink(size="sm"gives 12px text and a 14px icon) instead of adding an icon override.Collapsible(native button witharia-expanded). The chevron rotates 90° rather than swapping icons.CopyButton(useClipboard), labeled "Copy technical details".ErrorAlertonly when atitleis passed, because otherwise the message is already the alert title and the kit says not to repeat it.feat(site/src/components/Alert). The scope is widened tosite/srcbecausetestHelpers/entities.tsand two page stories changed.Checks:
pnpm lint(biome, oxlint, tsc, circular deps, compiler), fullpnpm test, andpnpm test:storybookfor the Alert, ErrorAlert, ChatSearchDialog, and SecretsPageView stories all pass. The frontend-deep-review findings are fixed. One remaining nit:SecretsPageView.stories.tsx:773keeps a pre-existingplayassertion, retargeted to the new label.Generated by Coder Agents on behalf of @designertyler.