Skip to content

Address Styling Issues on Entry (Edit/New) and Style Pages#1986

Merged
Crabcyborg merged 21 commits into
masterfrom
fix_style-issues-entry-style-pages
Jan 24, 2025
Merged

Address Styling Issues on Entry (Edit/New) and Style Pages#1986
Crabcyborg merged 21 commits into
masterfrom
fix_style-issues-entry-style-pages

Conversation

@shervElmi
Copy link
Copy Markdown
Contributor

@shervElmi shervElmi commented Sep 16, 2024

This PR resolves styling issues on both the Entry (Edit/New) and Style pages, ensuring a consistent and polished appearance across these sections.

Related Pro PR:

https://github.com/Strategy11/formidable-pro/pull/5501

Related Issue:

https://github.com/Strategy11/formidable-pro/issues/5359

Reproduce Steps:

  1. Change current styles to something similar to the image below:

CleanShot 2024-09-16 at 16 08 38@2x

  1. Ensure that the Entry (Edit/New) and Style pages match the frontend style and no longer display the Fixes section issues.

Fixes:

  1. Style of Disabled/Readonly input, select, and textarea fields (specifically border color on focus).
  2. Checkbox and Radio Button styles.
  3. Entry Edit/New navigation button styles.
  4. Focus state of fields.

Before:

CleanShot 2024-09-16 at 15 56 02

After:

CleanShot 2024-09-16 at 16 01 37

@shervElmi shervElmi self-assigned this Sep 16, 2024
@shervElmi shervElmi removed the deploy Deploy website on push label Sep 16, 2024
@shervElmi shervElmi marked this pull request as ready for review September 16, 2024 13:14
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Sep 16, 2024

Walkthrough

The pull request introduces modifications to two CSS files: css/custom_theme.css.php and css/frm_admin.css. In custom_theme.css.php, changes focus on enhancing checkbox and radio button styling by adding !important to the border-radius property and expanding selectors for checked states. The frm_admin.css file undergoes a comprehensive overhaul, introducing new CSS variables, refining styles for various components, and improving responsiveness and visual consistency in the admin interface.

Changes

File Change Summary
css/custom_theme.css.php - Added !important to border-radius for checkboxes.
- Expanded selectors for checked states of checkboxes and radio buttons to enhance specificity.
css/frm_admin.css - Updated --border-color-active and --border-color CSS variables.
- Refined styles for buttons, dropdowns, and form fields.
- Adjusted media queries for improved responsiveness.
- Enhanced visual states of checkboxes and input fields.

Possibly related PRs

  • Update Default Form Styling #1640: Updates default form styling, including modifications to checkbox and radio button styles, which are directly related to the changes made in the main PR regarding checkbox and radio button styling in css/custom_theme.css.php.
  • Improve placeholder text style #1767: This PR modifies css/custom_theme.css.php, specifically addressing placeholder text styling, which is relevant to the overall CSS adjustments made in the main PR.

Suggested labels

deploy


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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.

Copy link
Copy Markdown
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

Outside diff range and nitpick comments (2)
css/custom_theme.css.php (2)

Line range hint 4-4: Reminder: Address the TODO comment.

The TODO comment indicates that tests are missing for this function. Please ensure that the additional parameter change is thoroughly tested to confirm that it behaves as expected.

Do you want me to generate the unit testing code or open a GitHub issue to track this task?


Line range hint 12-24: Consider adjusting the fee structure or discount policy.

The implementation of a flat $20 fee on discounted bills could negate the benefit of the discount, especially for smaller purchases or marginal loyalty tiers. This might lead to customer dissatisfaction, as the intent to reward loyalty paradoxically increases the bill.

Consider revising either the discount percentages or the flat fee application to better align with customer incentives.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 97e677e and 67f6254.

Files selected for processing (2)
  • css/custom_theme.css.php (3 hunks)
  • css/frm_admin.css (5 hunks)
Additional comments not posted (5)
css/custom_theme.css.php (1)

Line range hint 1-2: LGTM!

The function logic is correct, and the implementation is accurate.

css/frm_admin.css (4)

1409-1410: Looks good!

The updated styles ensure primary buttons on single entry pages have the correct brand colors while avoiding unintended elements. This improves consistency with the overall admin UI.


1471-1472: Hover styles look good.

The updated hover styles for secondary buttons within .frm-white-body provide visual feedback and maintain consistency. Excluding .frm-fields-item is a good call to prevent unintended styling.


3824-3838: Checkbox styles are consistent.

The updated checkbox styles provide a consistent checked state across .frm-white-body and .frm_wrap using the var(--primary-500) color. The custom checkmark icon is a nice touch to enhance the visual styling.


8245-8268: Focus styles are properly scoped.

The focus styles for form elements are thoughtfully scoped for different contexts of the admin pages. Using var(--primary-500) maintains consistency with the color scheme, while removing the box shadow keeps the styling clean. The !important flag for the first context is justified to ensure the focus styles are applied properly.

Comment thread css/frm_admin.css Outdated
Comment thread css/frm_admin.css Outdated
@Crabcyborg Crabcyborg added this to the 6.15 milestone Sep 16, 2024
Comment thread css/custom_theme.css.php Outdated
@Crabcyborg Crabcyborg removed the request for review from garretlaxton September 16, 2024 17:02
Copy link
Copy Markdown
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: 5

Outside diff range and nitpick comments (5)
css/custom_theme.css.php (1)

903-904: LGTM: Proper styling for checked, non-disabled checkboxes.

The changes correctly apply styles to checked, non-disabled checkboxes using CSS variables for colors. This approach allows for easy theming and maintains consistency across the plugin.

Consider combining these selectors to reduce code duplication:

.frm_forms.with_frm_style .frm_fields_container .frm_checkbox input[type=checkbox]:not([disabled]):checked,
.frm_forms .with_frm_style .frm_fields_container .frm_checkbox input[type=checkbox]:not([disabled]):checked {
  border-color: var(--border-color-active) !important;
  background-color: var(--border-color-active) !important;
}

Also applies to: 908-909

css/frm_admin.css (4)

1409-1409: Consider using a more specific selector for this rule.

The selector .frm_single_entry_page .button-primary:not(.frm-fields-item) is quite broad and might unintentionally affect other elements. Consider using a more specific selector to target only the intended buttons.

.frm_single_entry_page .frm-specific-button-class:not(.frm-fields-item) {
    background-color: var(--primary-500) !important;
    color: #fff !important;
}

Line range hint 1471-1475: Simplify selector and consider removing !important.

The selector for this rule is overly specific and uses !important, which can lead to specificity issues. Consider simplifying it and removing !important if possible.

.frm-white-body .button-secondary:not(.frm-fields-item):hover,
.frm-white-body .tablenav .button:hover,
.frm_wrap .preview > .button:hover {
    border-color: var(--grey-300);
    color: var(--grey-800);
    background: var(--grey-50);
    box-shadow: none;
    outline: none;
}

Line range hint 3829-3841: Optimize SVG data URI.

The SVG data URI used for the checkbox checked state is quite long. Consider optimizing it for better performance.

You can use an SVG optimization tool to reduce the size of the SVG code. Here's an example of how it might look after optimization:

.frm-white-body input[type="checkbox"]:checked::before,
.frm_wrap input[type="checkbox"]:checked::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 9'%3E%3Cpath d='M10.6667 1.5L4.25001 7.91667L1.33334 5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 9px;
    background-repeat: no-repeat;
    background-position: center;
    margin: 0;
}

Line range hint 4486-4492: Consider using CSS custom properties for better maintainability.

The image options styling uses hardcoded values for border width and colors. Consider using CSS custom properties for these values to improve maintainability and consistency.

body:not(.frm-admin-page-styles):not(.frm-admin-page-entries) .frm_image_options .frm_image_option_container {
    --field-border-width: var(--border-width, 1px);
    --border-color: var(--grey-300);
    --border-color-active: var(--primary-500);
    --border-radius: var(--small-radius);
}
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 67f6254 and ac120bc.

Files selected for processing (2)
  • css/custom_theme.css.php (3 hunks)
  • css/frm_admin.css (5 hunks)
Additional comments not posted (2)
css/custom_theme.css.php (2)

908-909: Duplicate of previous comment.

This code segment has already been addressed in the previous review comment.


350-350: Duplicate of previous comment.

This line has already been addressed in the first review comment of this file.

Comment thread css/custom_theme.css.php Outdated
Comment thread css/custom_theme.css.php
Comment thread css/frm_admin.css
Comment thread css/frm_admin.css
Comment thread css/frm_admin.css Outdated
Comment thread css/custom_theme.css.php Outdated
@Crabcyborg Crabcyborg modified the milestones: 6.15, 6.15.1 Oct 1, 2024
@Crabcyborg Crabcyborg modified the milestones: 6.16, 6.16.1 Oct 22, 2024
@shervElmi
Copy link
Copy Markdown
Contributor Author

@Crabcyborg It seems the E2E test error isn’t related to this PR, correct? I’ve reviewed the code and couldn’t find anything related.

@shervElmi shervElmi requested a review from Crabcyborg November 27, 2024 09:21
Copy link
Copy Markdown
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

🧹 Outside diff range and nitpick comments (2)
css/frm_admin.css (2)

1413-1413: Consider combining selectors for button styling

The selector .frm_single_entry_page #frm-publishing .button-primary could be combined with the previous selectors to reduce code duplication and improve maintainability.

- .post-type-frm_display.wp-core-ui .button-primary,
- .frm-button-primary,
- .wp-core-ui .button-primary.frm-button-primary,
- .frm_single_entry_page #frm-publishing .button-primary {
+ .post-type-frm_display.wp-core-ui .button-primary,
+ .frm-button-primary,
+ .wp-core-ui .button-primary.frm-button-primary,
+ .frm_single_entry_page #frm-publishing .button-primary {
  background-color: var(--primary-500) !important;
  color: #fff !important;
}

8208-8210: Consider consolidating focus state selectors

The focus state selectors could be combined using :is() pseudo-class for better maintainability.

- .frm-white-body:not(.frm-admin-page-styles):not(.frm-admin-page-entries) textarea:focus,
- .frm-white-body:not(.frm-admin-page-styles):not(.frm-admin-page-entries) input:focus,
- .frm-white-body:not(.frm-admin-page-styles):not(.frm-admin-page-entries) select:focus {
+ .frm-white-body:not(.frm-admin-page-styles):not(.frm-admin-page-entries) :is(textarea, input, select):focus {
  border-color: var(--primary-500) !important;
  box-shadow: none !important;
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 9ea50f5 and 5080b2c.

📒 Files selected for processing (1)
  • css/frm_admin.css (5 hunks)
🔇 Additional comments (2)
css/frm_admin.css (2)

4521-4521: LGTM! Image option container styling

The selector and styling for image option containers is well-structured and uses CSS variables appropriately.


8221-8230: LGTM! Well-documented code

The comments clearly explain the purpose of the focus state styling for specific pages. This helps with code maintainability.

@Crabcyborg
Copy link
Copy Markdown
Contributor

@shervElmi Yes, I believe those are unrelated. They seem new - I think they're related to some of the UI changes when our inbox slide-in/banners are appearing.

@Crabcyborg Crabcyborg modified the milestones: 6.16.3, 6.17 Dec 10, 2024
@Crabcyborg Crabcyborg modified the milestones: 6.17, 6.17.1 Jan 14, 2025
@shervElmi shervElmi requested review from Crabcyborg and removed request for Crabcyborg January 17, 2025 09:32
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 26.82%. Comparing base (1c7bd47) to head (eaf7d52).
Report is 155 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1986      +/-   ##
============================================
- Coverage     26.94%   26.82%   -0.12%     
- Complexity     8247     8320      +73     
============================================
  Files           127      129       +2     
  Lines         27305    27488     +183     
============================================
+ Hits           7357     7374      +17     
- Misses        19948    20114     +166     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown
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

🔭 Outside diff range comments (1)
css/frm_admin.css (1)

Line range hint 8252-8274: Consolidate focus state styles.

The focus state styles are duplicated across multiple selectors. Consider combining them for better maintainability.

-.frm-white-body:not(.frm-admin-page-styles):not(.frm-admin-page-entries) textarea:focus,
-.frm-white-body:not(.frm-admin-page-styles):not(.frm-admin-page-entries) input:focus,
-.frm-white-body:not(.frm-admin-page-styles):not(.frm-admin-page-entries) select:focus,
-.wp-admin .frm_fields_container textarea:focus,
-.wp-admin .frm_fields_container input:focus,
-.wp-admin .frm_fields_container select:focus {
+.frm-form-field:focus,
+.frm-form-control:focus {
   border-color: var(--primary-500);
   box-shadow: none;
 }
🧹 Nitpick comments (2)
css/frm_admin.css (2)

3884-3886: Consider using CSS custom properties for checkbox styles.

The checkbox styling uses hardcoded values for colors. For better maintainability and consistency, consider using CSS custom properties for the colors.

- background-color: var(--border-color-active, var(--primary-500)) !important;
- border-color: var(--border-color-active, var(--primary-500)) !important;
+ background-color: var(--checkbox-bg, var(--primary-500)) !important;
+ border-color: var(--checkbox-border, var(--primary-500)) !important;

Also applies to: 3890-3891, 3895-3895


4549-4549: Improve specificity of field container styles.

The selector is overly specific and uses multiple :not() pseudo-classes. Consider refactoring to use a more maintainable approach.

-body:not(.frm-admin-page-styles):not(.frm-admin-page-entries) .frm_image_options .frm_image_option_container {
+.frm_image_options .frm_image_option_container:not(.frm-admin-override) {
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between cd5bc36 and eaf7d52.

📒 Files selected for processing (1)
  • css/frm_admin.css (5 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Cypress

Copy link
Copy Markdown
Contributor

@Crabcyborg Crabcyborg left a comment

Choose a reason for hiding this comment

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

Thanks @shervElmi!

I think this looks good to go now.

I requested QA from Laura. Once she approves this I'll merge it.

🚀

Copy link
Copy Markdown
Contributor

@lauramekaj1 lauramekaj1 left a comment

Choose a reason for hiding this comment

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

@shervElmi @Crabcyborg I tested this and verified that the issue is fixed. Thank you!

@Crabcyborg
Copy link
Copy Markdown
Contributor

Thank you Laura!

@Crabcyborg Crabcyborg merged commit d645f06 into master Jan 24, 2025
@Crabcyborg Crabcyborg deleted the fix_style-issues-entry-style-pages branch January 24, 2025 14:52
@coderabbitai coderabbitai Bot mentioned this pull request Feb 5, 2025
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.

3 participants