Shorten Posts: Update post height calculation #1795
Merged
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.
Description
This updates the Shorten Posts maximum post height calculation, which was based on the old tumblr layout with the horizontal nav bar across the top of the page and on (I assume?) an older, larger gap between posts.
Specifically, this makes posts as tall as possible given the limitation that:
... whether the site is in the desktop layout (no header/16px gap), tablet layout (44px header/16px gap), or mobile phone layout (44px header/8px gap).
(Also, the reverted with-header layout—54px header, 16px gap, for those that use a user style that does so—will display the relevant number of posts in their entirety too; it's a bit tighter but I think that's fine).
We could, of course, use media queries to dial these in more precisely in different layouts, but I think adding to the layout jumps when you resize the page isn't worth it. It's not like we're creating some precise layout with these breakpoints, anyway; even when j/k scrolling there will be unshortened posts that mean the bottom edges of posts wouldn't have a consistent gap with/line up with the bottom of the page even if we precisely computed the height to do so. These are just approximate. They are, though, pretty far off in the short direction at the moment.
Resolves #1396.
Testing steps