Repository navigation
fix(sources): use container queries instead of viewport breakpoints - #209
Conversation
dgesteves
left a comment
There was a problem hiding this comment.
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:
-
The React 19 snapshot doesn't match the output.
default-markdown-output.react-19.txthas@container font-signoff-sans text-signoff-fg mt-1, but the component rendersfont-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 frompackages/signoff-ui:pnpm vitest run test/default-markdown-output.test.tsx -u
-
The class test from the issue. #191 asks for a test in
test/sources.test.tsxthat 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.
|
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. |
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:

after:
