1 Commits
Author SHA1 Message Date
CatoandClaude Opus 5.5 ad4c1ed6f6 fix: the day strip never props open a dialog or grid column (0.2.1) (#3)
Fourteen chips side by side gave the strip a wide min-content width, and a
CSS grid item (a modal dialog's content) grows to that: in OrangeCat's
booking dialog it pushed Send off-screen at 390px. The strip now claims no
inline size of its own (contain: inline-size) and scrolls inside whatever
it is given.

The browser check could not see this: the demo gave its grid cells
min-width: 0. It now has a dialog-shaped container and checks the dialog's
button stays on screen — verified to FAIL without the fix.

Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 03:05:22 -07:00
6 changed files with 50 additions and 5 deletions

No files matched your search

+1 -1
View File
@@ -5,7 +5,7 @@ length chips, a readable date field over the native picker, and a booking
request that resolves to `{ startsAt, endsAt }` in the provider's time zone.
```bash
pnpm add github:bitbaum/whenkit#v0.2.0
pnpm add github:bitbaum/whenkit#v0.2.1
```
```tsx
+9
View File
@@ -34,3 +34,12 @@ function Field() {
createRoot(document.getElementById("hourly")!).render(<Booking unit="hour" id="hourly" />);
createRoot(document.getElementById("daily")!).render(<Booking unit="day" id="daily" />);
createRoot(document.getElementById("field")!).render(<Field />);
createRoot(document.getElementById("dialog")!).render(
<>
<strong>Book a long studio name that goes on and on</strong>
<Booking unit="day" id="dialog" />
<button type="button" id="dialog-send">
Send booking request
</button>
</>,
);
+16 -3
View File
@@ -26,15 +26,27 @@
max-width: 1200px;
margin: 0 auto;
}
.grid > section {
min-width: 0;
}
h2 {
font-size: 14px;
margin: 0 0 12px;
opacity: 0.6;
font-weight: 500;
}
/* Shaped like a modal dialog (shadcn/Radix DialogContent): a grid whose
column is sized by its content. A picker that props this open
pushes the dialog's buttons off-screen. */
.dialog-like {
display: grid;
gap: 16px;
width: calc(100% - 32px);
max-width: 28rem;
margin: 32px auto 0;
padding: 24px;
border: 1px solid hsl(var(--border-default, 0 0% 82%));
border-radius: 12px;
background: hsl(var(--surface-base, 0 0% 100%));
box-sizing: border-box;
}
.resolved {
font-size: 11px;
opacity: 0.5;
@@ -59,6 +71,7 @@
<div id="field"></div>
</section>
</div>
<div class="dialog-like" id="dialog"></div>
</main>
<script src="./dist/demo.js"></script>
</body>
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@bitbaum/whenkit",
"version": "0.2.0",
"version": "0.2.1",
"description": "Dates and times people can pick without typing: day chips, time chips, length chips, a readable date field over the native picker, and a low-friction booking request that resolves to {startsAt, endsAt} in the provider's zone.",
"license": "MIT",
"author": "Cato",
+6
View File
@@ -126,6 +126,12 @@
/* ---- the day strip ---- */
.wk-strip {
/* Claim no width of its own: fourteen chips side by side must scroll inside
whatever space the strip is given, not prop open a grid or dialog column
(a CSS grid item's min-width is its content's). Found in OrangeCat's
booking dialog, where it pushed Send off-screen at 390px. */
contain: inline-size;
width: 100%;
display: flex;
gap: 0.5rem;
overflow-x: auto;
+17
View File
@@ -115,6 +115,23 @@ try {
await page.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth),
`${name}: still no horizontal scroll after picking`,
);
// Nothing may be wider than its column: a grid cell (like a dialog's) must
// not be propped open by the day strip.
const wider = await page.evaluate(
() =>
[...document.querySelectorAll(".grid > section, #dialog")].filter(
(s) =>
s.scrollWidth > s.clientWidth + 1 ||
s.getBoundingClientRect().right > window.innerWidth + 1,
).length,
);
check(wider === 0, `${name}: no column or dialog propped open by the picker (${wider})`);
const sendVisible = await page.evaluate(() => {
const r = document.getElementById("dialog-send").getBoundingClientRect();
return r.right <= window.innerWidth + 1;
});
check(sendVisible, `${name}: the dialog's button stays on screen`);
check(errors.length === 0, `${name}: no page errors ${errors.join(" | ")}`);
// Let chip colour transitions finish so the screenshot shows real states.
await page.waitForTimeout(300);