Skip to content

Use tooltip icons to show tooltips rather than label/input elements#2130

Merged
Crabcyborg merged 6 commits into
masterfrom
issue-5103-add_additional_remove_icon_for_cc_bcc_fields
Dec 4, 2024
Merged

Use tooltip icons to show tooltips rather than label/input elements#2130
Crabcyborg merged 6 commits into
masterfrom
issue-5103-add_additional_remove_icon_for_cc_bcc_fields

Conversation

@AbdiTolesa
Copy link
Copy Markdown
Contributor

@AbdiTolesa AbdiTolesa commented Nov 21, 2024

Fix https://github.com/Strategy11/formidable-pro/issues/5103

Quoting the third item in the checklist from the issue:

  1. Tooltip appears outside the input field when sending email (https://imgur.com/95zn8IO / https://imgur.com/WWApGOX). It can be confusing when wanting to remove CC or BCC and hovering over the remove icon where it shows the add CC/BCC tooltip (https://imgur.com/6LfXmsy). See https://github.com/Strategy11/formidable-pro/issues/5103#issuecomment-2488774002 for a new design update

Design reference:
https://github.com/Strategy11/formidable-pro/issues/5103#issuecomment-2488774002

CleanShot 2024-11-21 at 16 06 21

image

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 21, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

The changes in this pull request involve updates to the email settings form, CSS styles, and JavaScript functionality within a form builder. The email settings form has new anchor elements for removing email addresses in the CC and BCC sections. The CSS file has been extensively modified to introduce new variables and styles, improving the overall UI. Additionally, the JavaScript file has enhancements for error handling, visibility toggling, and improved user feedback in the form builder's interface.

Changes

File Change Summary
classes/views/frm-form-actions/_email_settings.php Added new anchor elements for CC and BCC sections to replace the previous icons and updated class references.
css/frm_admin.css Updated CSS variables, introduced new styles for components, and refined layout for better usability.
js/formidable_admin.js Enhanced error handling for AJAX requests, added visibility toggling methods, and improved modal management.
classes/views/frm-form-actions/_action_inside.php Added tooltip icon next to "Action Name" label, simplified input field class, and adjusted event handling logic.

Possibly related PRs

Suggested reviewers

  • truongwp

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 91722c5 and 46665c0.

📒 Files selected for processing (1)
  • classes/views/frm-form-actions/_email_settings.php (2 hunks)

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 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: 2

🧹 Outside diff range and nitpick comments (3)
classes/views/frm-form-actions/_email_settings.php (1)

Line range hint 23-73: Maintain consistent UI patterns across form elements

The Reply To field implementation (around line 64) establishes a clear pattern:

  • Single remove icon in the label
  • Uses frm_cancel1_icon class
  • Proper data-emailrow attribute

The CC and BCC fields should follow this same pattern for consistency and maintainability.

Consider standardizing all email field remove icons to:

  1. Always appear in the label
  2. Always use the frm_cancel1_icon class
  3. Have correct data-emailrow attributes matching their respective fields
css/frm_admin.css (1)

5832-5836: Consider Using CSS Variables for Consistent Spacing

The hardcoded value 20px in the width calculation could be replaced with a CSS variable to enhance consistency and maintainability. This aligns with the existing use of spacing variables in the stylesheet.

You might define a new variable if one doesn't already exist:

--gap-base: 20px;

Then update the code:

-.frm_cc_row.frm_email_row .frm-with-right-icon,
-.frm_bcc_row.frm_email_row .frm-with-right-icon {
-  width: calc(100% - 20px);
+  width: calc(100% - var(--gap-base));
}
js/formidable_admin.js (1)

8573-8576: Refactor suggestion: Use a switch statement instead of multiple if statements.

Instead of using multiple if statements to check the value of useTagHref, consider using a switch statement for better readability and performance.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 0914679 and 2874296.

📒 Files selected for processing (3)
  • classes/views/frm-form-actions/_email_settings.php (2 hunks)
  • css/frm_admin.css (1 hunks)
  • js/formidable_admin.js (1 hunks)
🔇 Additional comments (1)
css/frm_admin.css (1)

5838-5840: Consistent Use of CSS Variables Enhances Maintainability

Setting the fill property using var(--grey-500) promotes consistency across the stylesheet and makes future theming adjustments easier.

Comment thread classes/views/frm-form-actions/_email_settings.php
Comment thread classes/views/frm-form-actions/_email_settings.php Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 27.16%. Comparing base (64eab69) to head (2874296).
Report is 58 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2130      +/-   ##
============================================
- Coverage     27.17%   27.16%   -0.01%     
- Complexity     8158     8170      +12     
============================================
  Files           127      127              
  Lines         27104    27143      +39     
============================================
+ Hits           7365     7374       +9     
- Misses        19739    19769      +30     

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


🚨 Try these New Features:

@AbdiTolesa AbdiTolesa requested a review from truongwp November 27, 2024 06:36
@truongwp
Copy link
Copy Markdown
Contributor

@AbdiTolesa Should these be the tooltip icon (i icon)?

Screenshot 2024-11-27 at 23 20 06

@AbdiTolesa
Copy link
Copy Markdown
Contributor Author

Strategy11/formidable-pro#5103 (comment)

@truongwp That's what Razvan's design look in https://github.com/Strategy11/formidable-pro/issues/5103#issuecomment-2488774002

@Crabcyborg
Copy link
Copy Markdown
Contributor

@AbdiTolesa Look a bit closer at Razvan's design and the conversation. That icon should be the tooltip icon now.

@AbdiTolesa
Copy link
Copy Markdown
Contributor Author

@AbdiTolesa Should these be the tooltip icon (i icon)?

Screenshot 2024-11-27 at 23 20 06

@truongwp Sorry for the oversight! The icons indeed should be tooltip icons and that is changed now.

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 (1)
css/frm_admin.css (1)

5838-5842: Consider using CSS custom properties for icon colors

The icon styling looks good but could be improved by using CSS custom properties for colors to maintain consistency.

.frm_email_row .frm_remove_field .frm_close_icon {
  position: relative;
-  fill: var(--grey-500);
+  fill: var(--icon-color, var(--grey-500));
  vertical-align: middle;
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between b5b0bba and 10ffb86.

📒 Files selected for processing (2)
  • css/frm_admin.css (2 hunks)
  • js/formidable_admin.js (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • js/formidable_admin.js
🔇 Additional comments (1)
css/frm_admin.css (1)

5832-5836: LGTM! Width calculation for email fields

The width calculation ensures proper spacing for the remove icon while maintaining a clean layout.

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.

@AbdiTolesa This issue isn't totally fixed.

  1. I still see a tooltip when hovering over the "To", "From", and "Subject" labels (and inputs). There is no tooltip icon in this case. We want to stop showing tooltips on labels/inputs, and instead use tooltip icons.
  2. The tooltips should only appear when hovering over the tooltip icon. The main goal of this issue is to remove the tooltip on the whole label spanning the full width. We don't want the tooltips to show up everywhere.
  3. It looks like you missed "Reply To". It should be the same as CC/BCC.
  4. I think we should do this everywhere we show a tooltip without an icon. I see "Action Name" also does this. When I hover it, I see a double tooltip issue coming from the input as well right now.

@Crabcyborg Crabcyborg removed the request for review from truongwp November 29, 2024 17:49
@AbdiTolesa AbdiTolesa changed the title Add additional remove icon for css and bcc fields Use tooltip icons to show tooltips rather than label/input elements Dec 2, 2024
@AbdiTolesa
Copy link
Copy Markdown
Contributor Author

@AbdiTolesa This issue isn't totally fixed.

  1. I still see a tooltip when hovering over the "To", "From", and "Subject" labels (and inputs). There is no tooltip icon in this case. We want to stop showing tooltips on labels/inputs, and instead use tooltip icons.
  2. The tooltips should only appear when hovering over the tooltip icon. The main goal of this issue is to remove the tooltip on the whole label spanning the full width. We don't want the tooltips to show up everywhere.
  3. It looks like you missed "Reply To". It should be the same as CC/BCC.
  4. I think we should do this everywhere we show a tooltip without an icon. I see "Action Name" also does this. When I hover it, I see a double tooltip issue coming from the input as well right now.

@Crabcyborg Sorry I thought this update should only over cc/bcc fields and primarily be focused on the remove icon for those fields.

@AbdiTolesa AbdiTolesa requested a review from Crabcyborg December 2, 2024 08:28
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 @AbdiTolesa!

This looks close now. I still see one issue though.

The reply-to icon doesn't have any X icon like the CC/BCC do. Since these are hidden by default and can be toggled on, all three of these should work the same.

@AbdiTolesa AbdiTolesa requested a review from Crabcyborg December 3, 2024 06: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 (1)
css/frm_admin.css (1)

5832-5837: Consider using CSS custom properties for width calculation

The width calculation could be made more maintainable by using CSS custom properties.

-.frm_cc_row.frm_email_row .frm-with-right-icon,
-.frm_bcc_row.frm_email_row .frm-with-right-icon,
-.frm_reply_to_row.frm_email_row .frm-with-right-icon {
-  width: calc(100% - 20px);
-  display: inline-block;
-}
+.frm_cc_row.frm_email_row .frm-with-right-icon,
+.frm_bcc_row.frm_email_row .frm-with-right-icon,
+.frm_reply_to_row.frm_email_row .frm-with-right-icon {
+  --icon-width: 20px;
+  width: calc(100% - var(--icon-width));
+  display: inline-block;
+}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 67ead19 and 91722c5.

📒 Files selected for processing (2)
  • classes/views/frm-form-actions/_email_settings.php (2 hunks)
  • css/frm_admin.css (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • classes/views/frm-form-actions/_email_settings.php
🔇 Additional comments (1)
css/frm_admin.css (1)

5839-5844: LGTM! Clean styling for the remove icon

The styling for the remove field icon is clean and follows the existing color scheme using the grey-500 variable.

Comment thread classes/views/frm-form-actions/_email_settings.php Outdated
@Crabcyborg Crabcyborg added this to the 6.16.3 milestone Dec 4, 2024
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.

I just fixed an issue.

I think this is good to merge now.

Thank you Abdi and Laura for working on this!

🚀

@Crabcyborg Crabcyborg merged commit 7ab007a into master Dec 4, 2024
@Crabcyborg Crabcyborg deleted the issue-5103-add_additional_remove_icon_for_cc_bcc_fields branch December 4, 2024 16:18
@coderabbitai coderabbitai Bot mentioned this pull request Aug 29, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Oct 20, 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.

4 participants