Skip to content

Limit pages small device message appears in#2302

Merged
Crabcyborg merged 4 commits into
masterfrom
issue-5728-limit_pages_small_device_message_appears_in
Apr 7, 2025
Merged

Limit pages small device message appears in#2302
Crabcyborg merged 4 commits into
masterfrom
issue-5728-limit_pages_small_device_message_appears_in

Conversation

@AbdiTolesa
Copy link
Copy Markdown
Contributor

@AbdiTolesa AbdiTolesa commented Apr 7, 2025

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

Test procedure

Go to different WP admin pages that are not Formidable pages and confirm the 'More on bigger devices' message does not appear anywhere on the page.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 7, 2025

Walkthrough

The changes modify the include_device_too_small_message method within the FrmFormsController class. An early return condition is introduced that checks if the current user is a Formidable admin using FrmAppHelper::is_formidable_admin(). If this check fails, the method exits immediately, preventing the inclusion of the small device message for non-admin users. Additionally, the CSS selector for the #posts-filter element has been updated to apply styles only when it is a descendant of an element with the class toplevel_page_formidable or post-type-frm_display.

Changes

File Summary
classes/.../FrmFormsController.php Updated include_device_too_small_message to include an early return if the user is not an admin, restricting message inclusion to admin users only.
css/frm_admin.css Changed CSS selector from #posts-filter to .toplevel_page_formidable #posts-filter, .post-type-frm_display #posts-filter, narrowing the scope of the style application while keeping it hidden.

Possibly related PRs

  • Make admin nav responsive #2241: The changes in this PR are related to the modifications in the include_device_too_small_message method, which also involves its usage in the admin interface.

Suggested reviewers

  • truongwp
  • lauramekaj1

📜 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 1c97b09 and 47f4007.

📒 Files selected for processing (1)
  • css/frm_admin.css (1 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 (3)
  • GitHub Check: PHP 8 tests in WP trunk
  • GitHub Check: PHP 7.4 tests in WP trunk
  • GitHub Check: Cypress

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

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 7, 2025

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 26.98%. Comparing base (703aac3) to head (47f4007).
Report is 88 commits behind head on master.

Files with missing lines Patch % Lines
classes/controllers/FrmFormsController.php 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2302      +/-   ##
============================================
+ Coverage     26.95%   26.98%   +0.03%     
- Complexity     8392     8398       +6     
============================================
  Files           134      134              
  Lines         27859    27883      +24     
============================================
+ Hits           7509     7524      +15     
- Misses        20350    20359       +9     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@AbdiTolesa AbdiTolesa requested a review from Crabcyborg April 7, 2025 10:07
@Crabcyborg Crabcyborg added this to the 6.20 milestone Apr 7, 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: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 011c96d and 1695c3f.

📒 Files selected for processing (1)
  • classes/controllers/FrmFormsController.php (1 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
classes/controllers/FrmFormsController.php (1)
classes/helpers/FrmAppHelper.php (2)
  • FrmAppHelper (6-4460)
  • is_formidable_admin (324-332)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: PHP 8 tests in WP trunk
  • GitHub Check: PHP 7.4 tests in WP trunk
  • GitHub Check: Cypress

Comment thread classes/controllers/FrmFormsController.php
@AbdiTolesa AbdiTolesa requested review from Crabcyborg April 7, 2025 12:41
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!

I made a small commit to fix an issue I had introduced by hiding #posts-filter. Nothing on the logs page was really appearing on the mobile width because of that. Now that should only get hidden on the "formidable" top level page.

@Crabcyborg Crabcyborg merged commit 1a06a9e into master Apr 7, 2025
16 of 18 checks passed
@Crabcyborg Crabcyborg deleted the issue-5728-limit_pages_small_device_message_appears_in branch April 7, 2025 13:14
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.

2 participants