Repository navigation
fix: the app's player starts right under the bar on a wide window too - #169
Merged
Merged
Conversation
On a window 48rem wide or wider, the player screen had 1.25rem of padding above the player. It cost 20 px of the window's height, so a book whose chapter fit the window below the bar scrolled the window by that much. A message above the player now has that space as a top margin of its own. Closes #168.
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 #168.
On a window at least 48rem wide, the app's player screen had 1.25rem of padding above the player. Nothing was drawn there, but it cost 20 px of the window's height. A book whose open chapter fit the window below the bar scrolled the window by those 20 px.
The padding is gone, so the player now starts right under the bar, as it already did on a phone. A message shown above the player has a top margin of the same 1.25rem instead, so it still sits where it did.
Changes
apps/demo/app/app.css: from 48rem up, the player screen'smainhas nopadding-top. Its.messagegetsmargin: 1.25rem 0 1remin place of0 0 1rem. The comment says why.apps/demo/tests/app.test.ts: a new test opens the quiz and checks that the player is 0 px below the bar at 1000 and 600 px wide. It then opens a link that fails and checks that the message sits at least 16 px below the bar.Testing
at 1000px: expected 20 to be +0). It also fails with the padding removed but no margin on the message (expected 0 to be greater than or equal to 16).tscpasses for the demo.Not verified
The installed window is not covered by the test. Chromium will not emulate
display-mode, so the test runs in a tab. The rule this changes applies in both. The bug was found in an installed window, where turning the padding off in DevTools made the book fit.Release
None needed. Only the demo's app changes, and Vercel deploys it when this merges.
Summary by cubic
Fixes the player screen's top padding on windows at least 48rem wide, so the player now starts right under the bar as it already did on a phone. The old 1.25rem of padding cost 20px of window height, which could make a book chapter that fit below the bar scroll the window instead. Closes #168.
The space now lives on the message shown above the player, keeping its position, and a new test verifies both the player's position at wide and narrow widths and the message's spacing.
Written for commit e8b4564. Summary will update on new commits.