Skip to content

Conversation

sim0nlind
Copy link

@sim0nlind sim0nlind commented Aug 25, 2025

This PR makes it possible for longer strings in the user account dropdown that appears from the sidebar in Ghost Admin. The string width was capped at 188px and this PR updates it to 100%.

Before
before

After
after

  • I've read and followed the Contributor Guide
  • I've explained my change
  • I've written an automated test to prove my change works

This is my first OS contribution ever :).

Copy link
Contributor

coderabbitai bot commented Aug 25, 2025

Walkthrough

Updated CSS in ghost/admin/app/styles/layouts/main.css to change the width of two selectors. The .gh-user-name and .gh-user-email rules were modified from a fixed width of 188px to a flexible width of 100%, altering how these elements occupy horizontal space within their container.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

  • Single file, two property changes
  • Homogeneous CSS edits (width from 188px to 100%)
  • No new selectors, no structural/layout rule additions

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
ghost/admin/app/styles/layouts/main.css (2)

368-378: Avoid overlap with the absolute-positioned sign-out button; improve wrapping semantics

Setting width: 100% risks text flowing underneath the .user-menu-signout button (absolute at right:12px). Also, word-break: break-all hurts readability (especially for emails and CJK). Recommend reserving space for the button and using friendlier wrapping.

Apply this diff within the .gh-user-name block:

 .gh-user-name {
     display: inline-block;
-    width: 100%;
+    /* Reserve space for the sign-out button; adjust if its hit-area changes */
+    width: calc(100% - 56px);
     margin: 1px 0 0;
     padding: 0;
-    word-break: break-all;
+    /* Prefer readable breaking for long names/usernames */
+    overflow-wrap: anywhere;
+    word-break: break-word; /* fallback */
+    hyphens: auto;
     font-size: 1.5rem;
     letter-spacing: 0;
     font-weight: 500;
     line-height: 1;
 }

Verification checklist:

  • Open the account menu with a very long unbroken username and confirm there’s no overlap with the sign-out control at different zoom levels and breakpoints (>=1240px, 801-1239px, <=800px).
  • Check LTR and RTL locales.
  • Ensure the dropdown positioning (top: -324px on the menu) still looks correct when the header increases in height.

380-390: Same concern for email; prefer readable wrapping and reserve space for actions

Emails broken “anywhere” are hard to read; also protect against overlap with the sign-out button like above.

Apply this diff within the .gh-user-email block:

 .gh-user-email {
     display: inline-block;
-    width: 100%;
+    width: calc(100% - 56px);
     margin: 0;
     padding: 0;
-    word-break: break-all;
+    /* Preserve legibility for long email addresses */
+    overflow-wrap: anywhere;
+    word-break: break-word; /* fallback */
+    hyphens: auto;
     font-size: 1.3rem;
     font-weight: 400;
     line-height: 1;
     color: var(--middarkgrey);
 }

Optional follow-up (if you prefer to keep width: 100%): add right padding on the containing .gh-user-info instead to make room for the button:

/* In .gh-account-menu-header .gh-user-info */
padding-right: 56px;

Please verify visually with extreme-length emails (e.g., 120+ chars, long TLDs) across browsers (Chrome, Firefox, Safari).

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between de8d4c2 and 8f39c20.

📒 Files selected for processing (1)
  • ghost/admin/app/styles/layouts/main.css (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: kevinansfield
PR: TryGhost/Ghost#23824
File: ghost/core/core/server/services/email-service/email-templates/partials/styles.hbs:919-926
Timestamp: 2025-06-13T11:57:58.226Z
Learning: In `ghost/core/core/server/services/email-service/email-templates/partials/styles.hbs`, some style blocks (e.g., `.latest-post p` and `.latest-post p a`) still use the legacy colour `#73818c` on purpose; they are later overridden by `emailCustomization` feature rules, as noted by inline TODO comments. These occurrences should not be flagged as inconsistencies.

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