diff --git a/AGENTS.md b/AGENTS.md index 0430104..47ad03e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -135,9 +135,19 @@ conflict on, do an existence check instead. flag set to false was silently on. Use the `envBoolean` helper in `apps/api/src/lib/config.ts`. -**Grid children that truncate need `min-w-0`.** Grid items default to -`min-width: auto` and `truncate` sets `nowrap`, so a long title becomes -unshrinkable content and the page scrolls sideways on a phone. +**Grid and flex children need `min-w-0`.** They default to +`min-width: auto`, meaning they refuse to shrink below their content — and a +`tabular-nums` figure, a `whitespace-nowrap` badge or a `truncate` title is all +it takes. The page then scrolls sideways on a phone and nothing reports an +error. This was fixed three separate times at individual call sites before +`Card` was given `min-w-0` on its base class; **any new container primitive +needs the same**. Check with: + +```js +document.documentElement.scrollWidth - document.documentElement.clientWidth +``` + +It should be 0 on every route at 393px wide. **Drizzle-generated migrations are not always valid SQL.** A `jsonb → integer` cast was emitted without the `USING` clause Postgres requires. Always apply a diff --git a/apps/cli/src/main.ts b/apps/cli/src/main.ts old mode 100644 new mode 100755 diff --git a/apps/web/src/components/ui/index.tsx b/apps/web/src/components/ui/index.tsx index 70c4a95..1822b97 100644 --- a/apps/web/src/components/ui/index.tsx +++ b/apps/web/src/components/ui/index.tsx @@ -83,8 +83,22 @@ Input.displayName = 'Input'; // --------------------------------------------------------------------- card +/** + * `min-w-0` is on the base class deliberately, not left to each call site. + * + * A grid or flex child defaults to `min-width: auto`, meaning it refuses to + * shrink below its content — and cards routinely contain something + * unshrinkable (a `tabular-nums` figure, a `whitespace-nowrap` badge, a long + * unbroken title). The result is a card wider than its column, which drags the + * whole page into horizontal scrolling on a phone. + * + * This has now been fixed three separate times at individual call sites, which + * is the signal that it belongs here instead. `min-width: 0` is inert for a + * block-level card outside a flex or grid container, so applying it always + * costs nothing and removes the entire class of bug. + */ export function Card({ className, ...props }: HTMLAttributes) { - return
; + return
; } export function CardHeader({ className, ...props }: HTMLAttributes) {