Skip to content

Forms: keep Form Responses admin bar link visible on mobile#50421

Open
dhasilva wants to merge 2 commits into
trunkfrom
fix/dsgcom-595-form-responses-masterbar-mobile
Open

Forms: keep Form Responses admin bar link visible on mobile#50421
dhasilva wants to merge 2 commits into
trunkfrom
fix/dsgcom-595-form-responses-masterbar-mobile

Conversation

@dhasilva

Copy link
Copy Markdown
Contributor

Fixes DSGCOM-595

Proposed changes

  • The "Form Responses" quick link that Jetpack Forms adds to the admin bar on singular pages containing a form was disappearing on mobile viewports (≤782px). WordPress core's admin-bar.css hides every top-level admin bar item below 782px and only re-shows a hardcoded allowlist of core node IDs; the custom jetpack-forms node was never on that list.
  • Emit a small, scoped <style> alongside the node that re-shows #wp-admin-bar-jetpack-forms on mobile. The selector carries two IDs, so it beats core's single-ID hiding rule on specificity (no !important needed for the un-hide).
  • Size the icon to match the native mobile items: the anchor becomes a 52px-wide flex box centering a 28px SVG glyph, mirroring core's 52×46 icon boxes. The .ab-icon overrides use !important because the SVG carries its desktop sizing in an inline style attribute, which otherwise wins the cascade.
  • Desktop rendering (icon + "Form Responses" label) is unchanged — everything lives inside @media (max-width: 782px).

Related product discussion/links

Does this pull request change what data or activity we track or use?

No.

Testing instructions

  • On a site with Jetpack (or the standalone Jetpack Forms plugin) active, publish a page/post that contains a Jetpack Form and includes a form block, and make sure you're logged in as a user who can edit_pages.
  • View that page on the front end at a desktop width (>782px). Confirm the admin bar shows the "Form Responses" item with its icon and text label, as before.
  • Narrow the browser to a mobile width (≤782px), e.g. 430px, and reload.
    • Before: the Form Responses item is absent from the admin bar.
    • After: the Form Responses icon appears in the admin bar, the same size and vertical alignment as the native icons (Edit, New, Comments, etc.), with the text label hidden like the native items.
  • Tapping the icon still opens the Form Responses (Feedback) dashboard.

dhasilva and others added 2 commits July 10, 2026 16:02
WordPress core hides all non-allowlisted top-level admin bar items below
782px, dropping the custom jetpack-forms quick link. Re-show it and size
the icon to match the native mobile items (52px box, centered 28px glyph).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@dhasilva dhasilva added the [Status] Needs Review This PR is ready for review. label Jul 10, 2026
@dhasilva dhasilva self-assigned this Jul 10, 2026
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the fix/dsgcom-595-form-responses-masterbar-mobile branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack fix/dsgcom-595-form-responses-masterbar-mobile

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@jp-launch-control

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/packages/forms/src/contact-form/class-contact-form.php 1017/1575 (64.57%) -0.21% 5 💔

Full summary · PHP report · JS report

If appropriate, add one of these labels to override the failing coverage check: Covered by non-unit tests Use to ignore the Code coverage requirement check when E2Es or other non-unit tests cover the code Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage.

@CGastrell

Copy link
Copy Markdown
Contributor

Works nicely! Maybe tweak the icon a bit so it blends better with the others on mobile? Font color on those is rgba(240, 246, 252, 0.6)

image

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