Skip to content

AO3-6806 Fix first comment layout on short admin posts#5834

Open
noahbravo wants to merge 1 commit into
otwcode:masterfrom
noahbravo:AO3-6806-admin-post-comments-layout-fix
Open

AO3-6806 Fix first comment layout on short admin posts#5834
noahbravo wants to merge 1 commit into
otwcode:masterfrom
noahbravo:AO3-6806-admin-post-comments-layout-fix

Conversation

@noahbravo
Copy link
Copy Markdown
Contributor

Pull Request Checklist

Issue

https://otwarchive.atlassian.net/browse/AO3-6806

Purpose

Fixes a layout issue where the first comment on a short admin post had an oversized byline and a misplaced icon when the comment form was not present.

Root cause:

  • The #dashboard sidebar has float: left at page level, and comment pseudo-elements have clear: both. When an admin post is shorter than the sidebar, the first comment's clear: both catches the active sidebar float and forces the comment to expand until the float clears.
  • When the comment form is present, its height pushes the comments below the sidebar and the issue does not occur.

Changes made:

  • Added a scoped clear: none rule under .news.admin.home in 15-group-comments.css to prevent comment pseudo-elements from interacting with the sidebar float. Only affects admin post views. Works and chapters are unaffected.
  • Replaced slideDown()/slideUp() with show()/hide() on admin posts in show_comments.js.erb and hide_comments.js.erb. The slide animation creates a temporary BFC that triggers a layout reflow on completion, which was hidden before the CSS fix but became noticeable after. Works and chapters are unaffected.

Testing Instructions

Follow the reproduction steps in AO3-6806:
https://otwarchive.atlassian.net/browse/AO3-6806

Expected behavior:

  • The first comment on a short admin post should render normally, with the byline and icon displayed at the correct height.
  • The rest of the comments should be unaffected.
  • Comments on works and chapters should still animate with slideDown/slideUp as before.
  • No visual difference on admin posts where the comment form is present.

Automated tests:

  • No automated tests were added for this change, as the bug is a visual/layout issue dependent on relative content length.

Credit

Name: Noah Bravo
Pronouns: they/them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant