fix(site/src): repair failing Storybook stories by ethanndickson · Pull Request #28462 · coder/coder · GitHub
Skip to content

fix(site/src): repair failing Storybook stories - #28462

Merged
ethanndickson merged 4 commits into
mainfrom
stories-pyp3
Aug 24, 2026
Merged

fix(site/src): repair failing Storybook stories#28462
ethanndickson merged 4 commits into
mainfrom
stories-pyp3

Conversation

@ethanndickson

@ethanndickson ethanndickson commented Aug 24, 2026

Copy link
Copy Markdown
Member

Summary

Repair the Storybook interaction and Pixel failures currently present on main. The failures came from organization-scoped model changes leaving stories with incomplete providers and query fixtures, product copy and route changes leaving stale assertions, and several interaction tests depending on implementation details or teardown timing.

Broken stories and fixes

Organization-scoped chat models

PR #27960 introduced organization-scoped chat models and the following regressions:

  • OrganizationModelsLayout / Switch Organization Preserves Auxiliary Parameters, Invalid Requested Organization Falls Back To Default, Invalid Requested Organization Denies Add, Duplicate Display Names Are Disambiguated, and No Readable Organization Is Not Found: the stories only populated permission query keys for individual organizations, while the accessible-organization lookup requests authorization for all visible organization IDs together. The unmatched /api/v2/authcheck request returned a Storybook proxy 502, so the layout rendered an error instead of the intended picker, fallback, denied, disambiguation, or not-found state. Add fixtures for the combined organization-permission keys, preserve the intentionally denied permission map, and return an explicit empty authorization result for the no-readable-organization case.
  • ModelFormProviderConfig / Provider Config Open AI, Provider Config Anthropic, and Provider Config Open AI Web Search: ModelForm began consuming OrganizationModelsContext, but these stories were not wrapped in its provider and rendered the router error boundary. Add the same organization-model context decorator used by the sibling model form stories.
  • AgentChatPage / Queued For Capacity After Polling: the story retained a manually assembled chat-and-messages fixture after the page gained organization-model, provider, workspace, prompt, diff, chat-list, and authorization dependencies. Those missing queries prevented the polling request from being reached. Replace the partial fixture list with the shared buildQueries() setup.
  • DashboardLayout / Custom Organization Role Can Open Models, DashboardLayout / ACL Readable Member Can Open Models, and NavbarView / For Member With Model Access: these stories also landed in feat: use organization-scoped chat models #27960 and inherited Pixel's tablet-and-desktop matrix, but their play functions exercise the desktop Models link. Pixel's 744px tablet viewport renders that link inside the closed mobile menu, so the desktop query always failed there. Restrict these authorization-to-navigation stories to the desktop matrix; mobile Models navigation remains covered by the dedicated MobileMenu story.

Premium copy and navigation

  • DeploymentSidebarView / Premium Tab Visible and Premium Tab Hidden: PR feat: Premium Page CTA updates and form handling #28226 renamed the production navigation item from Premium to Trial Upgrade, but added stories that still queried the old name. Update both the positive and negative assertions so the hidden-state story cannot pass while the real CTA is present.
  • PremiumPageView / No License: PR feat: Premium Page CTA updates and form handling #28226 changed the production heading to Start an unlimited 30-day Coder trial while the story asserted the previous Premium wording. Update the accessible heading assertion to the rendered copy.
  • AgentChatPageView / Queued For Capacity Community Admin: PR fix(site): point queued-capacity trial link to /deployment/premium #28437 intentionally moved the trial CTA from https://coder.com/trial to the internal /deployment/premium route, leaving the story's href assertion stale. Update the expected route while retaining the link-name and callout checks.

MCP server refetch behavior

  • AgentCreateForm / MCP Servers Error Shows Alert And Disables Send and MCP Servers Refetch Error Keeps Send Enabled: the MCP coverage was introduced in feat!: org-scope MCP server configs with RBAC #27942. PR feat!: scope chat model override settings to organizations #28442 later added a second unconditional MCP ErrorAlert, so a background refetch error appeared even when cached MCP data remained usable. The refetch story also called refetchQueries() without a key, which began refetching unrelated active model queries as the form's query surface expanded and produced unmatched API failures. Remove the duplicate unconditional alert, refetch only the organization's MCP query, and use semantic alert and heading assertions. Initial-load failures still disable Send, while background failures with cached data keep Send enabled without replacing the form with an error.

Interaction and teardown stability

  • IconField / Open Picker: PR test: fix failing storybook stories #27674 changed this story to wait for the em-emoji-picker custom element. That implementation-specific query races the lazy-loaded picker chunk and violates the component's observable contract. Keep the button state assertion and wait for the visible dialog instead.
  • AgentChatPage / Slash Compact Command Submits and Slash Compact Yields To Personal Skill: the command story added in feat: add manual chat compaction via /compact #27081 waited on cmdk's Commands group heading, which is accessibility-hidden, while the skill variant queried raw implementation text. Menu placement and visibility are asynchronous, especially after the positioning changes in fix(site): improve chat slash menu enter handling, anchoring, and placement #28411. Wait for the visible selectable options by role before pressing Enter.
  • AgentChatPageView / Terminal Focus On Tab Switch: the focus coverage added in fix(site): focus agents terminal on tab switch #24677 exposed an xterm teardown race rather than a product navigation regression. xterm queues its initial viewport synchronization, but Storybook could synchronously dispose the terminal first, leaving the queued callback to read a cleared renderer and report an unhandled error. Clear React state immediately, defer xterm disposal by one timer turn, query the labeled terminal textbox semantically, and remove the unnecessary empty WebSocket message fixture.

@ethanndickson ethanndickson changed the title fix(site/src/pages): repair chat model stories fix(site/src): repair failing Storybook stories Aug 24, 2026
@ethanndickson
ethanndickson requested a review from jakehwll August 24, 2026 12:23
@ethanndickson
ethanndickson marked this pull request as ready for review August 24, 2026 12:23

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ea16a6b747

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread site/src/components/IconField/IconField.stories.tsx
@ethanndickson

Copy link
Copy Markdown
Member Author

@chatgpt-codex-connector

Copy link
Copy Markdown

@ethanndickson
ethanndickson merged commit 9b5f47e into main Aug 24, 2026
44 of 46 checks passed
@ethanndickson
ethanndickson deleted the stories-pyp3 branch August 24, 2026 12:46
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants