fix(copy-page): right-align Copy page button on pages without a TOC#5161
Merged
Conversation
The in-article Copy page button sits in `.docHeaderContainer` (a flex row with `justify-content: space-between`) next to `<DocVersionBadge />`. On the current release `DocVersionBadge` renders nothing, leaving a single flex child that space-between pins to the left. `.copyPageArticleAction` was referenced in the component but never defined in the CSS module, so the no-TOC wrapper had no class to right-align it. Define `.copyPageArticleAction` with `margin-left: auto` so the button stays right-aligned whether or not the version badge renders.
Simek
reviewed
Jun 28, 2026
Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com>
Simek
approved these changes
Jun 28, 2026
Simek
left a comment
Collaborator
There was a problem hiding this comment.
Tested the changes on preview deployment on few different pages, looks good! 🙏
Ref:
Contributor
Author
|
Thanks @Simek for the review! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #5160.
Summary
On doc pages without a table of contents (e.g.
hide_table_of_contents: true), the "Copy page" button appeared at the top-left (above the title) instead of the top-right.The in-article button is rendered in
.docHeaderContainer— a flex row withjustify-content: space-between— next to<DocVersionBadge />. On the current/latest release the stockDocVersionBadgerenders nothing, so the container is left with a single flex child, whichspace-betweenpins to flex-start (the left). In addition,.copyPageArticleActionwas referenced viastyles.copyPageArticleActionin the component but never defined instyles.module.css, so in the no-TOC case the wrapper had no class to right-align it.Fix
Define the class with
margin-left: auto:margin-left: autopushes the button to the right edge whether it is the only child (no version badge) or sharing the row with the badge (badge stays left, button right). When a TOC is present the article button isdisplay: noneon desktop and the aside button is used instead, so that path is unaffected.Test plan
prettier --checkpasses on the changed file.Screenshots
Before:

After: