Repository navigation
docs(demos): let lane flow boxes wrap so demos fit phone screens - #164
Merged
Merged
Conversation
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.
At phone width the circuit breaker and full stack demos made the page scroll sideways. The httpware lane's flow row (client, breaker, server) is a flex row whose
.boxitems werewhite-space: nowrap, so they could not shrink below their one-line width. At 375px the row has about 303px, and client + "breaker CLOSED" + "server ✓" needed about 342px, more with labels like "server slow" or "breaker HALF_OPEN". The retry, bulkhead and timeout demos only have two boxes per row, so they fit.This is a CSS-only change in
docs/demos/demos.css. Droppingnowraplets a box wrap its label at a space when the row runs out of room. Flex items still size to their one-line width while there is space, so nothing wraps at desktop width. Amax-width: 480pxmedia query also cuts the box font from .75rem to .7rem, the padding from 8px 10px to 7px 6px, and the row gap from 6px to 4px. That keeps the resting labels on one line on a phone (294px in the 303px row). Without it, the "✓" in "server ✓" dropped onto a line of its own. Only the longer transient labels ("breaker HALF_OPEN", "server slow") wrap to two lines now.engine.jsis unchanged.Testing
A throwaway headless Playwright script against
mkdocs serveloads each demo page at 375x740 and 1280x800. It checksdocument.documentElement.scrollWidth <= clientWidthbefore playing, then plays every scenario (and the retry herd demo), checks again at every tour stop, and once more at the end of the run. That is 82 checks in all.On main, 13 of the 82 fail, all at 375px on the circuit breaker and full stack pages:
On this branch all 82 pass. The circuit breaker stops 3 and 4 and full stack stops 3 and 4 already passed on main, because the server box there reads "server ✗" and is shorter. Retry, bulkhead and timeout stay at scrollWidth equal to clientWidth at both sizes.
To check that desktop is unchanged, a second script records the bounding box of every element inside each
.hw-demoat 1280x800, on main and on the branch. The two dumps are byte-identical for all five pages.mkdocs build --strictpasses.Screenshots
Circuit breaker at 375px, main then branch:
Full stack at 375px, main then branch:
Full stack at 375px, paused at the first tour stop, main then branch:
Circuit breaker and full stack at 1280px on the branch:
The screenshots live on the
pr-assets/demo-narrow-overflowbranch, which can be deleted once this is merged.