Skip to content

[2.x] fix: correct mobile layout and alignment of avatar in edited posts#4610

Open
huoxin233 wants to merge 2 commits intoflarum:2.xfrom
huoxin233:huoxin/2.x-fix-avatar-layout
Open

[2.x] fix: correct mobile layout and alignment of avatar in edited posts#4610
huoxin233 wants to merge 2 commits intoflarum:2.xfrom
huoxin233:huoxin/2.x-fix-avatar-layout

Conversation

@huoxin233
Copy link
Copy Markdown
Contributor

@huoxin233 huoxin233 commented Apr 29, 2026

Fixes #0000

Changes proposed in this pull request:

When a user edits an existing post on a mobile device (@media @phone), the layout is broken:

  1. Duplicate Avatars: The user's avatar is displayed twice (once in the left sidebar space, and once inline in the header).
  2. Misaligned Default Avatars: If the user has a default letter avatar, the letter is pushed to the top-left corner instead of being perfectly centered.
    (reproducible on discuss.flarum.org)

This PR add a CSS rule to

  1. Hide the .Post-header .Post-avatar whenever .CommentPost.editing is active in mobile view.
  2. Changed .Post-side .Post-avatar from display: block; to display: inline-flex; inside the editing block.

Misalignment of badges should be fix in #4582

Reviewers should focus on:

Screenshot

Before:
PixPin_2026-04-29_05-33-55

After:
image

Necessity

  • Has the problem that is being solved here been clearly explained?
  • If applicable, have various options for solving this problem been considered?
  • For core PRs, does this need to be in core, or could it be in an extension?
  • Are we willing to maintain this for years / potentially forever?

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Backend changes: tests are green (run composer test).
  • Core developer confirmed locally this works as intended.
  • Tests have been added, or are not appropriate here.

Required changes:

  • Related documentation PR: (Remove if irrelevant)

@huoxin233 huoxin233 requested a review from a team as a code owner April 29, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant