Skip to content

Conversation

ClearlyClaire
Copy link
Contributor

Fixes #32652

For some reason, the overflowing (but hidden) text in preview cards push the container's size and prevent the flex shrinking for occurring.

I have found no way to handle that except for contain: inline-size, which should be safe because both containers are expected to take the available horizontal space with no regards to their contents.

@ClearlyClaire ClearlyClaire added bug Something isn't working area/web interface Related to the Mastodon web interface labels Oct 28, 2024
@ClearlyClaire ClearlyClaire requested a review from a team October 28, 2024 12:02
@ClearlyClaire ClearlyClaire added the to backport PR needed to be backported label Oct 29, 2024
Copy link
Contributor

@oneiros oneiros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for not approving this sooner. It felt like a workaround and I usually like to understand the root cause first. But most of all, I was not aware of contain.

Having read up a bit about it, it might even offer performance benefits, but more importantly it will prevent similar problems from reappearing in the future. That would not be the case if we only fixed it for the preview cards. So 👍

@ClearlyClaire ClearlyClaire added this pull request to the merge queue Oct 30, 2024
Merged via the queue into main with commit 742eb54 Oct 30, 2024
36 checks passed
@ClearlyClaire ClearlyClaire deleted the fixes/layout-change branch October 30, 2024 09:10
rezhajulio added a commit to PegelinuxTop/mastodon that referenced this pull request Nov 10, 2024
* Use `likes` and `shares` totalItems on status creations and updates (mastodon#32620)

* Enhance coverage for `StatusPin` model (mastodon#32515)

* Update rails to version 7.1.4.2 (mastodon#32670)

* Update dependency react-select to v5.8.2 (mastodon#32661)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update DefinitelyTyped types (non-major) (mastodon#32674)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency @formatjs/cli to v6.3.5 (mastodon#32675)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* New Crowdin Translations (automated) (mastodon#32589)

Co-authored-by: GitHub Actions <noreply@github.com>

* Feat: Implement interaction modal for Polls (mastodon#32609)

* Fix and improve batch attachment deletion handling when using OpenStack Swift (mastodon#32637)

* Mailer header partial access cleanup (mastodon#32585)

* Update babel monorepo to v7.26.0 (mastodon#32659)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Misc gem version bumps (mastodon#32684)

* Use nil for timestamp column in admin/confirmations spec (mastodon#32682)

* Add test coverage for POST /api/v2/media's max description length (mastodon#32683)

* New Crowdin Translations (automated) (mastodon#32687)

Co-authored-by: GitHub Actions <noreply@github.com>

* Add telemetry for status / bio formatting (mastodon#32677)

* Update dependency fog-core to '<= 2.6.0' (mastodon#32660)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Embed modal mobile fix (mastodon#32641)

* Add `DomainHelpers` spec support module for DNS/MX stub (mastodon#32690)

* Add coverage for `StatusTrend` and `PreviewCardTrend` models, add `locales` class method to `RankedTrend` (mastodon#32688)

* Fix preview cards with long titles erroneously causing layout changes (mastodon#32678)

* Update dependency libvips to v8.16.0 (mastodon#32679)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update workbox monorepo to v7.3.0 (mastodon#32691)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* New Crowdin Translations (automated) (mastodon#32695)

Co-authored-by: GitHub Actions <noreply@github.com>

* Add userinfo oauth endpoint (mastodon#32548)

* Fix 'unknown' media attachment rendering in detailed view (mastodon#32713)

* Fix IDs not being serialized as strings in annual reports API (mastodon#32710)

* New Crowdin Translations (automated) (mastodon#32708)

Co-authored-by: GitHub Actions <noreply@github.com>

* Update dependency strong_migrations to v2.0.2 (mastodon#32705)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency selenium-webdriver to v4.26.0 (mastodon#32698)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency core-js to v3.39.0 (mastodon#32707)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update dependency node to v22 (mastodon#32689)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Migrate from the deprecated `azure-storage-blob` to `azure-blob` (mastodon#32080)

Co-authored-by: Renaud Chaput <renchap@gmail.com>

* Add model spec for `Tombstone` (mastodon#32697)

* Drop support for ruby 3.1 (mastodon#32363)

* Update `rails-i18n` to version 7.0.10 (mastodon#32719)

* Update `zeitwerk` to version 2.7.1 (mastodon#32723)

* [Glitch] Feat: Implement interaction modal for Polls

Port dc0b194 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>

* [Glitch] Embed modal mobile fix

Port de1d8dc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>

* [Glitch] Fix preview cards with long titles erroneously causing layout changes

Port 742eb54 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>

* [Glitch] Fix 'unknown' media attachment rendering in detailed view

Port 01e25af to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>

* Fix ruby linting issue

---------

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
Co-authored-by: Jonny Saunders <sneakers-the-rat@protonmail.com>
Co-authored-by: Matt Jankowski <matt@jankowski.online>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <noreply@github.com>
Co-authored-by: Emelia Smith <ThisIsMissEm@users.noreply.github.com>
Co-authored-by: Hugo Gameiro <email@hugogameiro.com>
Co-authored-by: David Roetzel <david@roetzel.de>
Co-authored-by: Nathan Sparrow <24910097+DismalShadowX@users.noreply.github.com>
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
Co-authored-by: Renato "Lond" Cerqueira <renato@lond.com.br>
Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
Co-authored-by: Joé Dupuis <1518299+JoeDupuis@users.noreply.github.com>
Co-authored-by: Renaud Chaput <renchap@gmail.com>
@Gargron
Copy link
Member

Gargron commented Nov 15, 2024

I've found that this makes it impossible to position: fixed any element inside.

@ClearlyClaire
Copy link
Contributor Author

ClearlyClaire commented Nov 18, 2024

I've found that this makes it impossible to position: fixed any element inside.

Is that still the case if you keep only contain: inline-size? This should be enough for the bug at hand, the other values were just free micro-optimizations.

EDIT: keeping contain: inline-size would indeed work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/web interface Related to the Mastodon web interface bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scrolling induces layout shift
3 participants