Skip to content

Fixed visual regression in email preview#22666

Merged
sanne-san merged 1 commit intomainfrom
email-preview-header
Mar 27, 2025
Merged

Fixed visual regression in email preview#22666
sanne-san merged 1 commit intomainfrom
email-preview-header

Conversation

@sanne-san
Copy link
Contributor

No ref

  • The From, To and Subject fields were off both in terms of alignment and background color.

No ref
- The From, To and Subject fields were off both in terms of alignment and background color.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 27, 2025

Walkthrough

This pull request makes several updates to both templating and styling for email preview components. In the Handlebars file, it modifies a PowerSelect component by appending an additional CSS class, which alters the appearance of newsletter and segment selection dropdowns without changing their functionality. The CSS changes adjust spacing, layout, and padding for the email preview elements as well as update text color, font weight, and width on subject elements. Additionally, the focus styles for form inputs are refined by excluding certain dropdown triggers. No changes were made to public API declarations.

Possibly related PRs

Suggested labels

browser-tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it’s a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ghost/admin/app/styles/layouts/post-preview.css

Oops! Something went wrong! :(

ESLint: 8.44.0

Error: Failed to load parser '@babel/eslint-parser' declared in 'ghost/admin/.eslintrc.js': Cannot find module '@babel/eslint-parser'
Require stack:

  • /ghost/admin/.eslintrc.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
    at Function.resolve (node:internal/modules/helpers:145:19)
    at Object.resolve (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2346:46)
    at ConfigArrayFactory._loadParser (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3325:39)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3099:43)
    at _normalizeObjectConfigDataBody.next ()
    at ConfigArrayFactory._normalizeObjectConfigData (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3040:20)
    at _normalizeObjectConfigData.next ()
    at ConfigArrayFactory.loadInDirectory (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2886:28)
    at CascadingConfigArrayFactory._loadConfigInAncestors (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3871:46)
ghost/admin/app/styles/patterns/forms.css

Oops! Something went wrong! :(

ESLint: 8.44.0

Error: Failed to load parser '@babel/eslint-parser' declared in 'ghost/admin/.eslintrc.js': Cannot find module '@babel/eslint-parser'
Require stack:

  • /ghost/admin/.eslintrc.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
    at Function.resolve (node:internal/modules/helpers:145:19)
    at Object.resolve (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2346:46)
    at ConfigArrayFactory._loadParser (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3325:39)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3099:43)
    at _normalizeObjectConfigDataBody.next ()
    at ConfigArrayFactory._normalizeObjectConfigData (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3040:20)
    at _normalizeObjectConfigData.next ()
    at ConfigArrayFactory.loadInDirectory (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2886:28)
    at CascadingConfigArrayFactory._loadConfigInAncestors (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3871:46)
ghost/admin/app/styles/layouts/preview-email.css

Oops! Something went wrong! :(

ESLint: 8.44.0

Error: Failed to load parser '@babel/eslint-parser' declared in 'ghost/admin/.eslintrc.js': Cannot find module '@babel/eslint-parser'
Require stack:

  • /ghost/admin/.eslintrc.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
    at Function.resolve (node:internal/modules/helpers:145:19)
    at Object.resolve (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2346:46)
    at ConfigArrayFactory._loadParser (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3325:39)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3099:43)
    at _normalizeObjectConfigDataBody.next ()
    at ConfigArrayFactory._normalizeObjectConfigData (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3040:20)
    at _normalizeObjectConfigData.next ()
    at ConfigArrayFactory.loadInDirectory (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2886:28)
    at CascadingConfigArrayFactory._loadConfigInAncestors (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3871:46)

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6ef835b and 0f7c375.

📒 Files selected for processing (4)
  • ghost/admin/app/components/editor/modals/preview/email.hbs (2 hunks)
  • ghost/admin/app/styles/layouts/post-preview.css (3 hunks)
  • ghost/admin/app/styles/layouts/preview-email.css (3 hunks)
  • ghost/admin/app/styles/patterns/forms.css (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Admin tests - Chrome
🔇 Additional comments (12)
ghost/admin/app/components/editor/modals/preview/email.hbs (2)

14-14: Update PowerSelect trigger class for newsletter selection.

The addition of "gh-input-x" alongside the existing "gh-preview-newsletter-trigger" ensures that the new focus and style rules (as defined in the forms CSS) are applied. Please verify that this additional class does not conflict with any legacy styles.


36-36: Update PowerSelect trigger class for segment selection.

Similar to the newsletter selection component, adding "gh-input-x" in the trigger class enhances consistency and lets the revised focus styles take effect. Confirm that the visual presentation remains as expected in both dropdowns.

ghost/admin/app/styles/patterns/forms.css (1)

295-301: Refine focus styles for .gh-input-x elements.

The updated selectors using :focus:not(.ember-basic-dropdown-trigger) and :focus-visible:not(.ember-basic-dropdown-trigger) ensure that focus styles (background, border, and box-shadow) are only applied when the input is not a dropdown trigger. This targeted approach prevents unintended styling conflicts with Ember Basic Dropdown components.

ghost/admin/app/styles/layouts/preview-email.css (3)

154-157: Update email subject styling for improved legibility.

The .gh-preview-email-subject class now uses var(--black) for its text color, sets a font size of 1.4rem, and reduces the font weight to 400. These changes should result in a clearer presentation for the email subject while aligning with the overall visual revisions.


183-194: Standardize email subject input appearance.

The .gh-preview-email-subject-input class has been modified to occupy the full width (100%) and now matches the updated style (color, font size, and weight) of the email subject. This change ensures a consistent look between the subject label and its input field.


201-205: Enhance layout consistency for the email subject container.

Adding width: 100%; to the .gh-email-subject container ensures that it fills the available space, promoting a more uniform layout in the email preview. Verify that this change provides the desired responsiveness across different viewports.

ghost/admin/app/styles/layouts/post-preview.css (6)

193-197: Improve spacing in email group container.

Adding gap: .8rem; to the .gh-post-preview-email-group class enhances the vertical spacing between its child elements. This small adjustment helps to produce a cleaner and more readable layout for the email preview section.


199-205: Refine email header layout for better structure.

The updates on .gh-post-preview-email-header—including switching to a column flex layout with a gap and reduced padding—aim to create a more organized header. Please confirm that the new dimensions and spacing integrate well with the overall design.


214-221: Ensure sufficient width for newsletter select labels.

The new min-width: 56px; on paragraphs within .gh-email-preview-newsletter-select prevents label text from collapsing and ensures uniform spacing across elements. This addition should help maintain legibility even in constrained layouts.


223-227: Adopt a flexible layout for newsletter select container.

Changing .gh-email-preview-newsletter-select to display as a flex container—with aligned items and a gap of 1.2rem—improves the arrangement and responsiveness of the dropdown components. This approach also makes the styling more future-proof.


229-231: Simplify dropdown trigger width setting.

Setting .gh-preview-newsletter-trigger to use width: auto; allows the trigger element to adapt naturally to its content. This change simplifies the styling without compromising alignment.


232-235: Adjust expanded state styling for dropdown trigger.

The rule for .ember-basic-dropdown-trigger.gh-preview-newsletter-trigger[aria-expanded="true"] now resets the border color and applies a consistent border radius using var(--border-radius). This ensures that when the dropdown is expanded, its trigger maintains a clean and defined appearance.


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.
    • Generate unit testing code for this file.
    • 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. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

  • 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.

@sanne-san sanne-san enabled auto-merge (squash) March 27, 2025 09:20
@sanne-san sanne-san merged commit 09e617a into main Mar 27, 2025
22 checks passed
@sanne-san sanne-san deleted the email-preview-header branch March 27, 2025 09:25
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