framework icon indicating copy to clipboard operation
framework copied to clipboard

[2.x] Spacing with Like/Reply is off in Flarum 2.x

Open PrimateCoder opened this issue 5 months ago • 7 comments

Current Behavior

Flarum 1.x:

Image

Flarum 2.x:

Image

You can see the amount of spacing used in Flarum 2.x is exaggerated compared to 1.x.

The same is true even if there are only likes but no replies.

Steps to Reproduce

1.x example: https://forum.pianotell.com/d/2380-pianotell-recital-8-is-now-live/2

2.x example: https://discuss.flarum.org/d/39191-flarum-in-a-box-try-flarum-2x-in-one-command-with-docker/28

Expected Behavior

Could we get the same spacing optimization that we have in 1.x in 2.x?

Screenshots

No response

Environment

  • Flarum version: RC4 on Discuss

Output of php flarum info

Output of "php flarum info", run this in terminal in your Flarum directory.

Possible Solution

No response

Additional Context

No response

PrimateCoder avatar Jun 18 '26 18:06 PrimateCoder

Just so I understand this correctly, you're talking about (from your screenshots) "Reply Unlike" ? Or the list of usernames for likes and replies?

karl-bullock avatar Jun 20 '26 01:06 karl-bullock

Just so I understand this correctly, you're talking about (from your screenshots) "Reply Unlike" ? Or the list of usernames for likes and replies?

Look at the vertical space under Reply and compare it between the two screenshots.

PrimateCoder avatar Jun 20 '26 01:06 PrimateCoder

Okay I see it clearly now. Ones inline and the other stacks.

karl-bullock avatar Jun 20 '26 01:06 karl-bullock

I checked, the issue is not present on my test instance still running 2.0.0-rc.3. Yes, I see it on discuss.flarum.org.

magnetic6 avatar Jun 20 '26 12:06 magnetic6

I checked, the issue is not present on my test instance still running 2.0.0-rc.3. Yes, I see it on discuss.flarum.org.

I agree, I couldn't replicate this on 2.0 RC4.

karl-bullock avatar Jun 20 '26 23:06 karl-bullock

@PrimateCoder as others have also said here, this it not caused by core or it's bundled extensions. I have narrowed this down to potentially two extensions, can you please share the output of php flarum info

imorland avatar Jul 07 '26 18:07 imorland

Thanks for the detailed report and screenshots.

This turned out not to be a core bug — it's caused by fof/best-answer, which is why it reproduces on discuss.flarum.org (and any forum with that extension) but not on a vanilla install.

Root cause: best-answer applied width: 100% to every .Post-footer:

.Post-footer {
  width: 100%;
  .item-bestAnswerPost { ... }
}

Core lays the post footer out as a height: 0 inline-block so the likes/replies line sits on the same row as the floated post actions (Reply/Like). Forcing full width on all footers turns that into a full-width block, dropping the likes/replies line below the actions with the exaggerated gap you saw — on every post, not just ones with a best-answer preview.

Fix (scopes the rule to footers that actually render the preview) is up at FriendsOfFlarum/best-answer#133:

.Post-footer:has(.item-bestAnswerPost) {
  width: 100%;
}

Closing here as it's an extension issue — please follow FriendsOfFlarum/best-answer#133 for the fix.

imorland avatar Jul 07 '26 19:07 imorland