Repository navigation
fix(booking): cap the host face stack so it cannot spill into the calendar (#166) - #169
Merged
Merged
Conversation
…endar (#166) With several hosts on an event type the info panel drew every face. The panel is 240px wide with 1.5rem padding (192px of content); faces are 56px and overlap by 16px, so six hosts is 256px — 64px of avatars ran over the panel border into the calendar column. Draw at most three faces, matching hostsLabel, which already names only three ('Wynne, Bob, Cara & 3 others'). When more are hidden, render a '+N' chip in the fourth slot; four circles is 176px and fits with room to spare. Applied to both surfaces that draw faces: book.html (server-rendered plus the renderHosts rewrite on slot pick) and embed.js (the shadow-DOM widget). The chip is styled once in the shared booking.css, which both load. manage.html does not render host faces. Verified in a real browser at 1280px and 390px: 4 elements (3 faces + chip), scrollWidth == clientWidth, no overflow. Against the uncapped build the same page measured 6 faces and 64px of spill, matching the report. Tests: a unit test for the cap helper, plus an end-to-end test through BookPage with six required hosts asserting the rendered #host-faces block holds three faces and a '+3' chip. The latter fails against the uncapped code.
Contributor
There was a problem hiding this comment.
ℹ️ No critical issues — one small widget-layout inconsistency.
Reviewed changes
- Server-side cap —
book.goaddsmaxHostFaces = 3,capHostFaces/hostsOverflow, andBookPagepasses a cappedHostsplus the newHostsMore;HostsLabel/SoleHostNamestill use the full list. book.html— server-rendered+Nchip and therenderHostsslot-pick re-render both cap at three and appendface-more.embed.js—MAX_HOST_FACES = 3,infoPane()slices the stack and appends the chip.booking.css— shared.face-morechip styling (56px, border-box, centered).- Tests — helper boundary cases plus an end-to-end
BookPagerender with six required hosts asserting three faces and+3.
Verified the full ./internal/handler/ suite passes, including both new tests. manage.html correctly stays out of scope since it renders a single avatar.
deepseek-v4.1-flash | 𝕏
| /* "+N" chip when the stack is capped (see maxHostFaces). Painted above the last | ||
| face and inset the same 16px, so its text is never clipped by the overlap. */ | ||
| .host-faces .face-more { | ||
| width: 56px; height: 56px; |
Contributor
There was a problem hiding this comment.
.face-more is fixed at 56px, but the embed widget's compact container query (@container (max-width:719px), embed.js:142) shrinks .info .avatar-img/.avatar-initials to 46px and has no .face-more override. At that breakpoint the chip renders 10px larger than the faces beside it and extends below their baseline, so the stack looks off on mobile embeds.
Technical details
# Compact embed: overflow chip does not inherit the shrunk face size
## Affected sites
- internal/handler/templates/booking.css:322-332 — `.face-more` hardcodes 56px.
- internal/handler/embed.js:142 — compact rule shrinks `.avatar-img`/`.avatar-initials` to 46px, but never `.face-more`.
## Required outcome
- At `@container (max-width:719px)`, the `+N` chip matches the 46x46 face size (and shrinks its font if needed) so the stack stays visually uniform.
## Suggested approach (optional)
- Append `.info .face-more{width:46px;height:46px;}` to the same compact rule at `embed.js:142` (the page templates keep 56px, so this belongs in the widget's layer, not the shared rule).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes #166.
The bug
The info panel drew one avatar per host with no cap. The arithmetic is unforgiving:
So 64px of avatars ran over the panel border into the calendar. I measured the uncapped build in a real browser before fixing: 6 faces,
scrollWidth256px againstclientWidth191px, last face 64px past the panel's content edge. Exactly the screenshot.One correction to the report
You mentioned it previously capped at three. I checked the full git history (
git log -Sacrossbook.html,book.go,embed.jsfor a slice/limit) and no cap ever existed. What was limited to three was the label —hostsLabelhas always said "Wynne, Bob, Cara & 3 others" while the faces drew everyone. So the label and the faces disagreed, which is likely what you remembered. That's now consistent.The fix
Draw at most three faces, matching the label. When more are hidden, show a
+Nchip in the fourth slot.Applied to both surfaces that draw faces, per the three-surface rule:
book.html— the server-rendered stack, andrenderHostswhich rebuilds it on slot pick.embed.js— the shadow-DOM widget, which carries its own copy of the logic.manage.htmldoes not render host faces, only the shared CSS.The chip itself is styled once in
booking.css, which all surfaces load.Verification
Real browser, fresh instance, event type with six required hosts:
+3+3Embed widget verified the same way in its shadow root: 4 elements, no overflow, label reads "Wynne, Bob, Cara & 3 others".
Tests:
TestCapHostFaces— the helper, including the exact-limit boundary.TestBookPageCapsHostFacesAtThree— end-to-end throughBookPagewith six required hosts, asserting the rendered#host-facesblock holds three faces plus a+3chip. It fails against the uncapped code.go test ./...green.🤖 Generated with Claude Code