Skip to content

fix(sources): use container queries instead of viewport breakpoints - #209

Merged
dgesteves merged 2 commits into
dgesteves:mainfrom
Mittalnew:fix-sources-container-queries
Oct 25, 2026
Merged

dgesteves merged 2 commits into
dgesteves:mainfrom
Mittalnew:fix-sources-container-queries

Conversation

@Mittalnew

Copy link
Copy Markdown
Contributor

Sources now responds to its own width instead of the viewport. The root gets @container, the cards grid uses @lg:grid-cols-2 instead of sm:grid-cols-2, and the host label uses @lg:inline instead of sm:inline. I also updated the snapshots and added a patch changeset.

Closes #191

before:
Screenshot 2026-10-24 154111

after:
Screenshot 2026-10-24 153012

@dgesteves dgesteves left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for this! The change itself looks right: @lg works well for both the cards and the host name, and the AgentMessage demo, the components page and the Next.js example all still give Sources its full width. Lint, typecheck, size and the browser jobs pass.

Two things before it can merge:

  1. The React 19 snapshot doesn't match the output. default-markdown-output.react-19.txt has @container font-signoff-sans text-signoff-fg mt-1, but the component renders font-signoff-sans text-signoff-fg @container mt-1 (the React 18 file is right). That's the one failing test in CI. Please regenerate it rather than editing it by hand. React 19 is the default install, so from packages/signoff-ui:

    pnpm vitest run test/default-markdown-output.test.tsx -u
  2. The class test from the issue. #191 asks for a test in test/sources.test.tsx that checks the new classes, since jsdom has no layout: the root has @container, the cards list has @lg:grid-cols-2, and the chip's host name has @lg:inline. test/narrow-layout.test.tsx (around line 80, toHaveClass('@container')) shows the pattern.

Once both are in, I'll approve the CI run and merge.

@Mittalnew

Copy link
Copy Markdown
Contributor Author

Both items are done. I regenerated the React 19 snapshot with the vitest -u command, so the class order now matches the output (@container after text-signoff-fg). I also added a class test in test/sources.test.tsx covering @container on the root, @lg:grid-cols-2 on the cards list and @lg:inline on the chip's host name. The full test suite, lint and typecheck pass locally. This should be ready for the CI run.

@dgesteves dgesteves left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Both fixes are in: the React 19 snapshot now matches the output, and the new test covers the root container, the cards grid and the chip's host label. CI is green on 044b3b7. Thanks for the clean PR, merging now.

@dgesteves
dgesteves merged commit 10038b4 into dgesteves:main Oct 25, 2026
10 checks passed
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.

Sources: lay out cards by the container's width, not the screen's

2 participants