Skip to content

Make admin nav responsive#2241

Merged
Crabcyborg merged 31 commits into
masterfrom
issue-4076-adjust_admin_nav_for_smaller_screens
Apr 2, 2025
Merged

Make admin nav responsive#2241
Crabcyborg merged 31 commits into
masterfrom
issue-4076-adjust_admin_nav_for_smaller_screens

Conversation

@AbdiTolesa
Copy link
Copy Markdown
Contributor

@AbdiTolesa AbdiTolesa commented Feb 5, 2025

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 5, 2025

Walkthrough

The changes update the responsive styling and user interface for Formidable Forms’ admin area to better support small devices. A new CSS rule and media queries are added to adjust layout elements. Additionally, a new HTML block is introduced in the edit page, and controller methods are updated to include a device-too-small message—with an SVG graphic, bold text, and a “Go back” button—for users operating on smaller screens.

Changes

File(s) Change Summary
css/frm_admin.css Revised responsive styles with new media queries (max-widths: 1200px, 850px) and updated rules for #frm_top_bar h1, #frm_bs_dropdown, and its tooltip. Added new rules for #frm_small_device_message_container (default display: none; and display: flex;) and ensured the top bar is fixed with a white background.
classes/views/frm-forms/edit.php Implemented a new <div> with class frm_small_device_message_container containing an SVG graphic, a bold message, and a “Go back” button for users on small devices.
classes/controllers/FrmFormsController.php
classes/controllers/FrmAppController.php
Introduced include_device_too_small_message() in FrmFormsController to generate the device message HTML and updated the route() method to call it. Updated add_admin_footer_links in FrmAppController to include the device message by calling the aforementioned method.
classes/views/shared/small-device-message.php Created a new file for the HTML markup of the small device message, including localization support.

Suggested labels

run tests

Suggested reviewers

  • truongwp
  • tuguirazvan

Possibly related PRs

  • Stop using font icon in section field icons in form builder #2146: The changes in the main PR are related to the addition of a new CSS rule for #frm_small_device_message_container, which is directly connected to the new <div> element with the same class added in the retrieved PR.
  • Add redirect delay settings #2117: The changes in the main PR are related to the retrieved PR as both involve modifications to the FrmFormsController class, specifically with the addition of methods that enhance user experience based on device compatibility and redirection logic.
  • Address Styling Issues on Entry (Edit/New) and Style Pages #1986: The changes in the main PR, which involve new CSS rules and modifications for responsive design in css/frm_admin.css, are related to the adjustments made in the retrieved PR that also modifies CSS styles in css/frm_admin.css, specifically focusing on improving the styling of various components.

📜 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 3087da3 and dc3a6d8.

📒 Files selected for processing (1)
  • css/frm_admin.css (7 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • css/frm_admin.css
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Run PHP Syntax inspection (8.3)

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

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

🧹 Nitpick comments (2)
css/frm_admin.css (2)

8788-8791: Adjust publishing button alignment

The margin-left: auto on #frm-publishing could be made more explicit with flexbox:

-#frm-publishing {
-  margin-left: auto;
-}
+#frm-publishing {
+  display: flex;
+  justify-content: flex-end;
+  flex: 1;
+}

This makes the alignment intention clearer and provides better browser compatibility.


8789-8791: Improve last child margin handling

The margin-left: 0 on the last child could be handled more elegantly:

-#frm_top_bar > .frm-full-close:last-child {
-  margin-left: 0;
-}
+#frm_top_bar > :last-child {
+  margin-left: 0;
+}

This makes the rule more generic and maintainable.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9ace900 and 2bd0ca3.

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

8774-8791: Consider accessibility implications

The fixed navigation at the bottom may cause accessibility issues:

  1. Verify that keyboard navigation works properly with the fixed positioning
  2. Ensure sufficient touch targets for mobile users
  3. Consider adding aria-labels for screen readers
  4. Test with different screen sizes and orientations

Run the following to check for potential accessibility issues:

Comment thread css/frm_admin.css
Comment thread css/frm_admin.css
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: 1

🧹 Nitpick comments (2)
classes/views/frm-forms/edit.php (1)

8-21: LGTM! Good implementation with some suggested improvements.

The small device message container is well-structured and properly internationalized. Here are some suggested improvements:

  1. The "Go back" button should have a proper destination or use JavaScript event handler instead of "#"
  2. Add ARIA attributes to make the SVG icon accessible
  3. Consider including the minimum recommended screen size in the message

Apply these improvements:

-<svg width="32" height="49" viewBox="0 0 32 49" fill="none" xmlns="http://www.w3.org/2000/svg">
+<svg width="32" height="49" viewBox="0 0 32 49" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Mobile device icon">
-<a href="#" class="frm-button-primary"><?php esc_html_e( 'Go back', 'formidable' ); ?></a>
+<button type="button" onclick="window.history.back()" class="frm-button-primary"><?php esc_html_e( 'Go back', 'formidable' ); ?></button>
-<p><?php esc_html_e( 'For the best experience, we recommend using Formidable Forms on larger devices such as a desktop or tablet.', 'formidable' ); ?></p>
+<p><?php esc_html_e( 'For the best experience, we recommend using Formidable Forms on devices with screens larger than 475px, such as a desktop or tablet.', 'formidable' ); ?></p>
css/frm_admin.css (1)

8796-8802: Inconsistent margin handling in responsive layout

The margin reset for the last child element is inconsistent with the rest of the responsive styles.

Consider standardizing margin handling:

#frm_top_bar > .frm-full-close:last-child {
-  margin-left: 0;
+  margin: 0;
}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1aeff87 and a970a64.

📒 Files selected for processing (2)
  • classes/views/frm-forms/edit.php (1 hunks)
  • css/frm_admin.css (4 hunks)
🔇 Additional comments (3)
css/frm_admin.css (3)

8623-8625: LGTM: Base class for small device message container

The base class .frm_small_device_message_container is properly defined with display: none as the default state.


8653-8661: Verify Bootstrap dropdown visibility

The code hides the Bootstrap dropdown and its tooltip on smaller screens. We should verify this doesn't break any critical functionality.

✅ Verification successful

🏁 Script executed:

#!/bin/bash
# Search for any references to #frm_bs_dropdown to ensure hiding it won't break functionality
rg -l "frm_bs_dropdown" --type html --type php --type js

Length of output: 152


Bootstrap Dropdown Visibility Verified

The #frm_bs_dropdown element is referenced in a few places (in a PHP helper, a header file, and the admin JavaScript), and its usage is consistent with responsive design adjustments. Hiding it on smaller screens does not appear to break any critical functionality.


8778-8795: 🛠️ Refactor suggestion

Responsive navigation bar styles need improvement

The navigation bar styles for mobile view have a few issues:

  1. The fixed positioning with transform: translate(-50%, 0) and left: 50% is unnecessarily complex.
  2. The z-index of 99 may be too low to ensure the navigation stays above all content.

Apply this diff to improve the mobile navigation styles:

#frm_top_bar ul.frm_form_nav {
  padding: 1em 0;
  position: fixed;
  bottom: 0;
  width: 100%;
  background: white;
  z-index: 999;
-  transform: translate(-50%, 0);
-  left: 50%;
+  left: 0;
+  box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
}

Likely invalid or redundant comment.

Comment thread css/frm_admin.css Outdated
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

🧹 Nitpick comments (1)
classes/controllers/FrmFormsController.php (1)

1898-1898: Consider conditional server-side rendering of the device message.

While the current implementation works, consider conditionally rendering the message based on device detection to avoid unnecessary DOM nodes on desktop devices. This would improve performance and reduce page weight.

-		self::include_device_too_small_message();
+		if ( wp_is_mobile() ) {
+			self::include_device_too_small_message();
+		}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1f9fcf0 and 58cc6f3.

📒 Files selected for processing (3)
  • classes/controllers/FrmFormsController.php (1 hunks)
  • classes/views/frm-forms/edit.php (0 hunks)
  • css/frm_admin.css (6 hunks)
💤 Files with no reviewable changes (1)
  • classes/views/frm-forms/edit.php
🚧 Files skipped from review as they are similar to previous changes (1)
  • css/frm_admin.css
🔇 Additional comments (1)
classes/controllers/FrmFormsController.php (1)

1869-1892: Well-structured implementation of the device message component!

The implementation follows best practices with:

  • Proper escaping of translations
  • Semantic HTML structure
  • Accessibility considerations with role="status"
  • Clear visual hierarchy in the UI components

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

🧹 Nitpick comments (1)
css/frm_admin.css (1)

8787-8789: Improve publishing button positioning

-#frm-publishing {
-  margin-left: auto;
-}
+#frm-publishing {
+  margin-left: auto;
+  margin-right: var(--gap-sm);
+}

Add right margin for better spacing and alignment with other elements.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 57633d8 and b86f05e.

📒 Files selected for processing (3)
  • classes/controllers/FrmEntriesController.php (1 hunks)
  • classes/controllers/FrmStylesController.php (1 hunks)
  • css/frm_admin.css (6 hunks)
🔇 Additional comments (7)
classes/controllers/FrmStylesController.php (1)

863-863: LGTM! Verify message visibility logic.

The addition of the device message before action routing is well-placed. The message will be consistently available across all routes, with visibility likely controlled via CSS based on device size.

Let's verify the CSS breakpoints that control the message visibility:

✅ Verification successful

🏁 Script executed:

#!/bin/bash
# Search for CSS rules that control the visibility of the device message container
rg -A 5 "frm_small_device_message_container"

Length of output: 1692


Based on the output from the CSS search, the message container (frm_small_device_message_container) is styled in two different blocks. One rule hides the container (using display: none;), and another sets it to a flex container. This indicates that the visibility is controlled by CSS (likely via media queries or other context-specific rules) so that the message only appears on small devices as intended.

LGTM! The change in FrmStylesController.php correctly calls the method to include the device message, and CSS rules confirm that its visibility is appropriately managed. Please verify that the media query conditions correctly trigger the “display: flex” rule on small devices.

classes/controllers/FrmEntriesController.php (1)

113-113: LGTM! Verify the implementation of the device message.

The addition of the device size message aligns with the PR objectives for responsive styles.

Let's verify the implementation of the called method:

✅ Verification successful

🏁 Script executed:

#!/bin/bash
# Description: Check the implementation of include_device_too_small_message()

# Search for the method definition
ast-grep --pattern 'public static function include_device_too_small_message() {
  $$$
}'

# Search for other usages of this method
rg -A 5 'include_device_too_small_message'

Length of output: 2232


LGTM! The device message implementation is correctly integrated.

  • The method include_device_too_small_message() is implemented in classes/controllers/FrmFormsController.php and outputs the expected HTML (including the SVG icon) for a small device message.
  • The new call in FrmEntriesController.php (and similar usage in FrmStylesController.php) confirms consistent usage across the codebase.
css/frm_admin.css (5)

8623-8626: Add small device message container styles

The styles define a container for displaying messages on small devices.

The implementation follows best practices by:

  1. Using display: none by default
  2. Using semantic class names
  3. Keeping styles modular and reusable

8656-8659: Hide tooltip on smaller screens

Good practice to hide the tooltip when there isn't enough screen space to display it properly. The !important flag is justified here to ensure the tooltip stays hidden.


9060-9102: 🛠️ Refactor suggestion

Improve small device message container layout and accessibility

.frm_small_device_message_container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  background: var(--primary-500);
+ role: "dialog";
+ aria-modal: "true";
+ aria-label: "Device size warning";
}

Add ARIA attributes to improve accessibility for screen readers.

Likely invalid or redundant comment.


8776-8793: 🛠️ Refactor suggestion

Refactor navigation bar styles for mobile view

The changes add styles for a fixed navigation bar at the bottom of the screen on mobile devices. The implementation can be improved for better maintainability and performance.

-#frm_top_bar ul.frm_form_nav {
-  padding: 1em 0;
-  position: fixed;
-  bottom: 0;
-  width: 100%;
-  background: white;
-  z-index: 99;
-  transform: translate(-50%, 0);
-  left: 50%;
-}
+#frm_top_bar ul.frm_form_nav {
+  padding: var(--gap-sm) 0;
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  width: 100%;
+  background: #fff;
+  z-index: 99;
+}

The changes:

  1. Use CSS variables for consistent padding
  2. Remove transform/left positioning in favor of left/right: 0
  3. Use #fff instead of white for consistency

Likely invalid or redundant comment.


8794-8800: Verify dropdown button display properties

The dropdown button display property is being modified. Need to verify this won't affect other uses of the dropdown button in the codebase.

✅ Verification successful

🏁 Script executed:

#!/bin/bash
# Check if the dropdown button is used elsewhere in the codebase
rg -l "frm_bs_dropdown" .

Length of output: 176


We’ve confirmed that the #frm_bs_dropdown identifier is referenced in several files:

  • ./classes/helpers/FrmFormsHelper.php
  • ./classes/views/applications/header.php
  • ./css/admin/applications.css
  • ./css/frm_admin.css
  • ./js/formidable_admin.js

Before finalizing the verification, we need to review the context in which #frm_bs_dropdown is used in these files to ensure that forcing a display: block (and similarly for .frm_bstooltip) in frm_admin.css doesn’t unintentionally override styles needed elsewhere (for example, in the admin area versus public application views).

Let's inspect the surrounding context for each occurrence. Please run the following shell script to show several lines around each match:



Once we review the context from these files, we can determine whether the forced display: block in css/frm_admin.css is appropriate and isolated (for example, if it only applies to the admin interface) or if it might conflict with other areas of the codebase that rely on different behavior for the dropdown.


🏁 Script executed:

#!/bin/bash
# Display occurrences with context for "#frm_bs_dropdown" in all related files
FILES=(
    "css/admin/applications.css"
    "css/frm_admin.css"
    "classes/helpers/FrmFormsHelper.php"
    "classes/views/applications/header.php"
    "js/formidable_admin.js"
)
for file in "${FILES[@]}"; do
    echo "=== $file ==="
    rg -C 3 "#frm_bs_dropdown" "$file" || echo "No matches found"
    echo ""
done

Length of output: 2618


Review Confirmed: Dropdown Button Display Styles Are Intentional

After inspecting all occurrences:

  • In css/frm_admin.css, the dropdown button is initially set with conflicting tooltip visibility (first hidden then forced to display). The final state is ensured by the later display: block !important rules.
  • In the admin-specific files (css/frm_admin.css, js/formidable_admin.js, etc.), the styles are intended for the admin interface.
  • Other files (like css/admin/applications.css) reference the element in contexts that do not conflict with this behavior.

The forced display: block in css/frm_admin.css appears to be a deliberate override for the admin interface and does not adversely affect other areas.

@AbdiTolesa AbdiTolesa changed the title Add responsive styles for different breaking points Make admin nav responsive Feb 6, 2025
@Crabcyborg Crabcyborg added this to the 6.19 milestone Feb 10, 2025
Comment thread classes/controllers/FrmFormsController.php Outdated
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

♻️ Duplicate comments (1)
css/frm_admin.css (1)

9057-9099: 🛠️ Refactor suggestion

Implement small device warning message

The changes add a warning message container for small devices. A few suggestions to improve accessibility:

.frm-admin-page-formidableedit #wpbody-content #frm_small_device_message_container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  background: var(--primary-500);
+ role="dialog"
+ aria-modal="true"
+ aria-label="Device size warning"
}

#frm_small_device_message {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 80%;
  padding: 1rem;
  background: #fff;
  border: solid 1px #fff;
  border-radius: var(--medium-radius);
+ color: var(--grey-900); /* Ensure sufficient contrast */
+ box-shadow: 0 2px 4px rgba(0,0,0,0.2); /* Add visual depth */
}

The modal should have proper ARIA attributes for accessibility and ensure sufficient color contrast for readability.

🧹 Nitpick comments (3)
classes/controllers/FrmFormsController.php (2)

1869-1892: Consider using an ID instead of a class for the message container.

The message container uses a class frm_small_device_message_container but since this element will only appear once on a page, using an ID would be more appropriate and make styling easier.

Apply this diff to improve the code:

-<div class="frm_small_device_message_container">
+<div id="frm_small_device_message_container">

1872-1873: Add version number to @SInCE tag.

The @since tag is using a placeholder x.x version number. This should be updated with the actual version number where this feature is being introduced.

css/frm_admin.css (1)

8772-8789: Enhance navigation bar responsiveness

The changes add a fixed navigation bar at the bottom of the screen for mobile views. A few suggestions to improve this implementation:

#frm_top_bar ul.frm_form_nav {
  padding: 1em 0;
  position: fixed;
  bottom: 0;
  width: 100%;
  background: white;
  z-index: 99;
-  transform: translate(-50%, 0);
-  left: 50%;
+  left: 0;
  box-shadow: 0 -2px 4px rgba(0,0,0,0.1); /* Add shadow for visual separation */
}

The transform/left 50% positioning could be simplified to just left: 0 since we want the nav to span the full width anyway. Also consider adding a subtle box shadow to visually separate it from content.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b86f05e and 4493be1.

📒 Files selected for processing (2)
  • classes/controllers/FrmFormsController.php (1 hunks)
  • css/frm_admin.css (4 hunks)
🔇 Additional comments (3)
classes/controllers/FrmFormsController.php (1)

1898-1898: Verify the impact of device message on form functionality.

The include_device_too_small_message() is called unconditionally in the route() method. This means the message container will always be present in the DOM even when not needed.

Consider:

  1. Moving this inside a conditional check to only include it when needed.
  2. Verifying that the presence of this container doesn't affect form functionality on larger devices.
css/frm_admin.css (2)

8633-8635: Improve menu item layout for responsive design

The change prevents menu items from stacking vertically when the screen width is below 1200px by resetting the min-width of the title. This is a good responsive design fix.


8652-8655: Hide title tooltip for better mobile UX

The change hides the title tooltip on screens below 1050px width since there isn't enough room. This improves the mobile user experience by removing potentially overlapping UI elements.

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

♻️ Duplicate comments (1)
css/frm_admin.css (1)

9061-9103: 🛠️ Refactor suggestion

Enhance small device message container accessibility and styling

The small device message container implementation needs accessibility improvements.

Apply these enhancements:

 #wpbody-content #frm_small_device_message_container {
   display: flex;
   flex-direction: column;
   align-items: center;
   justify-content: center;
   position: fixed;
   top: 0;
   width: 100%;
   height: 100%;
   z-index: 100;
   background: var(--primary-500);
+  /* Add accessibility attributes */
+  role="alert";
+  aria-live="polite";
 }

 #frm_small_device_message {
   text-align: center;
   display: flex;
   flex-direction: column;
   align-items: center;
   width: 80%;
   padding: 1rem;
   background: #fff;
   border: solid 1px #fff;
   border-radius: var(--medium-radius);
+  /* Improve readability */
+  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
+  max-width: 400px; /* Prevent too wide on larger tablets */
 }
🧹 Nitpick comments (2)
css/frm_admin.css (2)

8623-8625: Add a comment to explain the purpose of this container

The #frm_small_device_message_container is used for displaying messages on small devices, but its purpose isn't immediately clear from the code alone.

Add a comment to explain when and why this container is used:

+/* Container for displaying warning messages when screen size is too small for optimal use */
 #frm_small_device_message_container {
   display: none;
 }

8776-8793: Improve mobile navigation bar styles

The fixed navigation bar implementation could be enhanced for better mobile usability.

Consider these improvements:

 #frm_top_bar ul.frm_form_nav {
   padding: 1em 0;
   position: fixed;
   bottom: 0;
   width: 100%;
   background: white;
   z-index: 99;
   transform: translate(-50%, 0);
   left: 50%;
+  box-shadow: 0 -2px 4px rgba(0,0,0,0.1); /* Add shadow for visual separation */
+  border-top: 1px solid var(--grey-300); /* Add border for better definition */
+  transition: transform 0.3s ease; /* Smooth transition for showing/hiding */
 }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4493be1 and 9dafec7.

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

8637-8639: LGTM: Responsive design fix for menu items

The change to reset min-width to 0 for #frm_top_bar h1 at 1200px breakpoint is a good solution to prevent menu items from stacking vertically.


8656-8659: LGTM: Hide title tooltip on smaller screens

Good use of !important here since this is a critical display override for responsive design. The comment clearly explains why the title is being hidden.

@Crabcyborg Crabcyborg requested a review from truongwp February 17, 2025 13:24
Comment thread classes/controllers/FrmFormsController.php Outdated
@truongwp
Copy link
Copy Markdown
Contributor

@tuguirazvan I think we need a line or shadow here to separate the bottom nav and the content.

Screenshot 2025-02-18 at 22 47 14

Comment thread classes/controllers/FrmEntriesController.php Outdated
@tuguirazvan
Copy link
Copy Markdown

@tuguirazvan I think we need a line or shadow here to separate the bottom nav and the content.

Screenshot 2025-02-18 at 22 47 14

I've added a slight shadow. Let me know if you need help here. Thank you!

@AbdiTolesa AbdiTolesa requested review from Crabcyborg and removed request for Crabcyborg March 24, 2025 08:07
@Crabcyborg
Copy link
Copy Markdown
Contributor

@AbdiTolesa

I see a couple things when it shows the mobile size.

  1. It appears, at 400x500, my modal doesn't fix the screen.
  2. When I click "Go back", it will take me to https://dev-site.local/wp-admin/admin.php?page=formidable, where it still shows this warning, but clicking Go back now takes me nowhere. I get stuck on the blue screen.
Screen Shot 2025-03-24 at 10 35 00 AM

@AbdiTolesa
Copy link
Copy Markdown
Contributor Author

2. When I click "Go back", it will take me to https://dev-site.local/wp-admin/admin.php?page=formidable, where it still shows this warning, but clicking Go back now takes me nowhere. I get stuck on the blue screen.

I have changed the url to the admin dashboard now.

@AbdiTolesa
Copy link
Copy Markdown
Contributor Author

  • It appears, at 400x500, my modal doesn't fix the screen.

@Crabcyborg I believe you mean the modal is not covering the whole screen when you say "fix" and I have updated it with that assumption.

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

🧹 Nitpick comments (1)
css/frm_admin.css (1)

9262-9303: Well-designed small device warning

The small device message is thoughtfully styled with:

  1. Flexbox layout for proper centering
  2. Clean white message container against a colored background
  3. Visual enhancements including a circular background element
  4. Proper z-index to ensure it appears above all other content

This provides a clear indication to users that their device is too small for optimal form editing.

Consider adding a subtle transition effect when showing this container to make it less jarring for users:

#frm_small_device_message_container {
	display: none;
+	transition: opacity 0.3s ease-in-out;
}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9aba162 and 2966c84.

📒 Files selected for processing (2)
  • classes/views/shared/small-device-message.php (1 hunks)
  • css/frm_admin.css (7 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • classes/views/shared/small-device-message.php
🔇 Additional comments (9)
css/frm_admin.css (9)

8806-8808: Nice addition for small device messaging

This creates a container for displaying a message on small devices, which is hidden by default and only appears when needed.


8820-8822: Good responsive optimization

Setting min-width to 0 prevents menu items from stacking vertically on smaller screens, which improves the responsive behavior.


8839-8842: Appropriate space optimization

Hiding the tooltip for smaller screens is a good decision as it saves valuable screen space when there isn't enough room for the title.


8959-8972: Effective bottom navigation implementation

This creates a fixed navigation bar at the bottom of the screen for smaller devices (under 850px), with proper styling including box shadow, padding, positioning, and z-index to ensure it remains visible.


8974-8977: Important padding adjustment

Adding bottom padding to these containers prevents content from being hidden behind the fixed bottom navigation bar. This addresses the feedback from lauramekaj1 about content being hidden behind the navigation bar.


8979-8982: Good positioning correction

Changing floating button positioning prevents UI conflicts when the navigation bar is at the bottom of the screen.


8988-8994: Clean layout adjustment

These adjustments to margins and positioning ensure the publishing area elements display correctly with the new responsive navigation layout.


8995-9001: Improved visibility for small screens

Making the Bootstrap dropdown visible and ensuring the tooltip displays properly on small screens improves usability.


8832-8837: Good spacing adjustment for bottom navigation

Setting the bottom form padding to 64px creates enough space for the fixed navigation bar and prevents content from being cut off. This directly addresses the client's feedback about the bottom navigation covering page elements.

@Crabcyborg
Copy link
Copy Markdown
Contributor

when you say "fix"

Sorry @AbdiTolesa. I just meant fit.

@AbdiTolesa
Copy link
Copy Markdown
Contributor Author

Sorry @AbdiTolesa. I just meant fit.

I assumed the same. That was because of a z-index value set lower that the WP admin styles and it is fixed 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

🧹 Nitpick comments (1)
classes/controllers/FrmFormsController.php (1)

1924-1932: The method implementation looks good but needs proper versioning.

This method provides a nice encapsulation of the device size message functionality by including a view file. However, the version marker "x.x" in the PHPDoc comment should be updated to the actual version number before release.

-	 * @since x.x
+	 * @since 6.x.x
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ef50bd5 and fdddf2a.

📒 Files selected for processing (1)
  • classes/controllers/FrmFormsController.php (1 hunks)

@Crabcyborg
Copy link
Copy Markdown
Contributor

@AbdiTolesa After pulling the latest changes it still seems like the modal gets cut off.

Are we able to get it to fit screens better? There shouldn't be overflow.

Screen Shot 2025-03-27 at 9 57 08 AM

@AbdiTolesa
Copy link
Copy Markdown
Contributor Author

@AbdiTolesa After pulling the latest changes it still seems like the modal gets cut off.

@Crabcyborg It looks good for me, as in this screen record. Can you inspect what is making it cutoff for you?
CleanShot 2025-04-01 at 11 00 03

@Crabcyborg
Copy link
Copy Markdown
Contributor

@AbdiTolesa I took a closer look. #2291 fixes it for me.

Comment thread classes/views/shared/small-device-message.php
@AbdiTolesa AbdiTolesa requested a review from Crabcyborg April 2, 2025 07:51
…ng_mobile_go_back_option

Hide posts filter when showing mobile go back option
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.

Thank you @AbdiTolesa @truongwp and @lauramekaj1 for working on this!

I think this is good to merge now.

🚀

@Crabcyborg Crabcyborg merged commit a129d38 into master Apr 2, 2025
22 of 23 checks passed
@Crabcyborg Crabcyborg deleted the issue-4076-adjust_admin_nav_for_smaller_screens branch April 2, 2025 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants