Skip to content

Enhance UI/UX of Application cards#2079

Merged
Crabcyborg merged 7 commits into
masterfrom
issue-5328-enhance_ui_ux_of_application_cards
Nov 5, 2024
Merged

Enhance UI/UX of Application cards#2079
Crabcyborg merged 7 commits into
masterfrom
issue-5328-enhance_ui_ux_of_application_cards

Conversation

@AbdiTolesa
Copy link
Copy Markdown
Contributor

@AbdiTolesa AbdiTolesa commented Nov 1, 2024

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

Design by Razvan: https://github.com/Strategy11/formidable-pro/issues/5328#issuecomment-2332233644

CleanShot 2024-11-01 at 11 10 05

Test procedure

  1. Go to Formidable -> Applications and confirm that the 'NEW' badge and Add/Learn more buttons are inline with the Application title and hovering on the cards would switch between the badge and buttons.
  2. Confirm that Applications with a really long name are truncated with ... but the buttons are always appear inline with it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 1, 2024

Walkthrough

The changes in this pull request involve updates to both CSS and JavaScript files related to application cards in the admin interface. The CSS modifications enhance the layout, hover effects, and visibility of elements within the application cards. The JavaScript changes improve the rendering of application cards, including the management of template controls and user feedback for search results. Collectively, these updates aim to refine the visual structure and interactivity of the application cards.

Changes

File Change Summary
css/admin/applications.css - Added .frm-new-pill class with styles for height, font size, and alignment.
- Set min-height for .frm-application-card h3.
- Implemented hover effect to hide .frm-new-pill.
- Changed visibility of .frm-button-secondary to display: none by default.
- Adjusted grid layout for responsiveness.
js/admin/applications.js - Modified getCardHeader to include getUseThisTemplateControl(data) in the card header.
- Updated class name for getUseThisTemplateControl button to include frm-fadein.
- Added logic in handleTemplateSearch for no-results placeholder.
- Introduced getNoResultsPlaceholder() function.

Possibly related PRs

  • Add missing thumbnails for new applications #2030: This PR modifies the js/admin/applications.js file, specifically the createApplicationCard function, which relates to the rendering of application cards, similar to the changes made in the main PR to enhance the layout and interactivity of application cards.
  • Exclude invalid applications on applications page #2080: This PR also involves changes to the FrmApplicationTemplate class, which is relevant to the handling of application templates, aligning with the focus on improving the application card functionality in the main PR.

Suggested reviewers

  • Crabcyborg
  • shervElmi

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 (2)
css/admin/applications.css (1)

Line range hint 201-216: Consider adding intermediate breakpoint for better responsive behavior

The current responsive implementation is good, but there might be a significant jump in card sizes between 1200px (2 columns) and 600px (1 column).

Consider adding an intermediate breakpoint:

/* Add this between the existing breakpoints */
@media only screen and (max-width: 900px) {
    .frm-application-card {
        grid-column: span 8/span 8; /* 1.5 cards per row */
    }
}
js/admin/applications.js (1)

298-305: LGTM! Consider adding ARIA attributes for the "NEW" pill.

The changes improve the visual hierarchy and user experience by adding clear indicators for new items with smooth fade-in animations.

Consider adding role="status" and aria-label to the "NEW" pill for better screen reader support:

-				titleWrapper.appendChild( span({ className: 'frm-new-pill frm-meta-tag frm-fadein', text: __( 'NEW', 'formidable' ) }) );
+				titleWrapper.appendChild( span({ 
+					className: 'frm-new-pill frm-meta-tag frm-fadein', 
+					text: __( 'NEW', 'formidable' ),
+					role: 'status',
+					'aria-label': __( 'New template', 'formidable' )
+				}) );
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between e07b7f2 and d868f12.

📒 Files selected for processing (2)
  • css/admin/applications.css (2 hunks)
  • js/admin/applications.js (2 hunks)
🔇 Additional comments (2)
css/admin/applications.css (1)

70-70: LGTM: Good improvement for layout consistency

Adding a minimum height to card titles prevents layout shifts and ensures visual consistency across all application cards.

js/admin/applications.js (1)

372-372: LGTM! Good use of consistent animations.

The addition of the frm-fadein class maintains visual consistency with other animated elements while preserving proper button styling and accessibility attributes.

Comment thread css/admin/applications.css
Comment thread css/admin/applications.css
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 27.17%. Comparing base (999def7) to head (f82ae72).
Report is 18 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2079      +/-   ##
============================================
- Coverage     27.18%   27.17%   -0.02%     
- Complexity     8111     8114       +3     
============================================
  Files           127      127              
  Lines         26970    26980      +10     
============================================
- Hits           7333     7332       -1     
- Misses        19637    19648      +11     

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

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.

@AbdiTolesa I tested this and verified it's working as expected. Thank you!

@AbdiTolesa AbdiTolesa requested a review from truongwp November 4, 2024 07:43
Copy link
Copy Markdown
Contributor

@truongwp truongwp left a comment

Choose a reason for hiding this comment

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

This looks good. Thanks @AbdiTolesa!

@truongwp truongwp requested a review from Crabcyborg November 4, 2024 15:24
@Crabcyborg Crabcyborg added this to the 6.16.1 milestone Nov 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.

Thanks @AbdiTolesa @truongwp and @lauramekaj1 for working on this!

I think this looks good to merge.

🚀

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 I noticed a bug with this update.

The custom applications no longer have a delete icon.
Screen Shot 2024-11-04 at 11 51 26 AM

This results in JS errors from Pro as well.
image

@Crabcyborg Crabcyborg removed this from the 6.16.1 milestone Nov 4, 2024
@AbdiTolesa AbdiTolesa requested a review from Crabcyborg November 5, 2024 08:33
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)
js/admin/applications.js (1)

298-309: LGTM! Consider adding ARIA attributes for accessibility.

The implementation correctly handles the placement of controls and the NEW badge, aligning with the PR objectives. The conditional placement ensures proper inline alignment with the title.

Consider adding ARIA attributes to improve accessibility:

-				titleWrapper.appendChild( span({ className: 'frm-new-pill frm-meta-tag frm-fadein', text: __( 'NEW', 'formidable' ) }) );
+				titleWrapper.appendChild( span({ 
+					className: 'frm-new-pill frm-meta-tag frm-fadein', 
+					text: __( 'NEW', 'formidable' ),
+					'aria-label': __( 'New application template', 'formidable' )
+				}) );
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 7d45c54 and 680460e.

📒 Files selected for processing (1)
  • js/admin/applications.js (2 hunks)
🔇 Additional comments (1)
js/admin/applications.js (1)

377-377: LGTM! Button styling aligns with design requirements.

The button styling with frm-button-secondary frm-button-sm class ensures proper inline alignment, and the frm-fadein class provides a consistent animation effect matching the NEW badge.

@Crabcyborg Crabcyborg added this to the 6.16.1 milestone Nov 5, 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.

Thanks for updating that @AbdiTolesa!

Some Cypress tests are failing but it looks like it's happening in master as well. It looks related to changes on formidableforms.com and not related to this PR.

I'll go ahead and merge this.

🚀

@Crabcyborg Crabcyborg merged commit d40bca3 into master Nov 5, 2024
@Crabcyborg Crabcyborg deleted the issue-5328-enhance_ui_ux_of_application_cards branch November 5, 2024 13:55
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