Skip to content

Preserved mobile menu close icon with Wave classes - #4706

Merged
pirate-bot merged 4 commits into
developmentfrom
bugfix/4704
Nov 20, 2026
Merged

pirate-bot merged 4 commits into
developmentfrom
bugfix/4704

Conversation

@girishpanchal30

Copy link
Copy Markdown
Contributor

Summary

Improved mobile sidebar close button icon selection to mirror the first menu icon actually rendered in the header layout, preventing unused or inactive menu icons from affecting its appearance. Added comprehensive unit tests to verify icon selection across different header configurations.

Check before Pull Request is ready:

Closes #4704

@pirate-bot

pirate-bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Plugin build for 42d89a4 is ready 🛎️!

@pirate-bot pirate-bot left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🟡 Changes requested

The close button picks menu icons in registration order, not layout order, so it can show a different icon than the toggle that opened the sidebar.

Validation details
  • Files reviewed: 3/3 changed files.
  • The three new PHPUnit tests pass at HEAD with PHP 8.3 and the WordPress test library: rm /var/www/html/wp-content/themes/repo; ln -s /repo /var/www/html/wp-content/repo; cd /repo; set -o pipefail; timeout 2… printed OK (3 tests, 41 assertions) (run R12)
  • Against the base code, all three tests fail on the close-button markup. This base-tree helper run has no run record.
  • A copy of the tests with a reversed mobile layout rendered a Wave close button instead of Dots: cd /workspace/checks/R4 && mv test-order.php TestNeveHfgMenuIconOrder.php && cd /repo && set -o pipefail; timeout 300 ph… (run R14, exit 0)
  • The Neve Pro menu icon registration was read from Codeinwp/neve-pro-addon at commit 3f9930c.
  • The neve_menu_icon_classes callback accepts and uses the new second argument.
Untested areas
  • The close button is shared by the desktop and mobile toggles. Please confirm which toggle it should mirror when each device uses a different menu icon.
  • The real browser rendering of the close glyph was not checked.

🤖 Automated review · run code-review-agent_6afee40f41d115.41543533.


🤖 Review agent — review posted ✅ on b5b73c44 · changes requested · 1 finding · 27 min

Run code-review-agent_6afee40f41d115.41543533 · trail

@pirate-bot pirate-bot left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🟢 Approved

The PR passes: the earlier layout-order finding is conceded, and the close button always gets CSS for the icon it shows.

Validation details
  • Files reviewed: 3/3 changed files. The only commit since the last review changes the get_close_button_icon() docblock, and the new text matches the loop.
  • A source check this run showed that an active menu icon enqueues its glyph CSS on the frontend. Its .hamburger--<icon> selectors reach the close button.
  • The three new PHPUnit tests passed at b5b73c4 with PHP 8.3 in run code-review-agent_6afee40f41d115.41543533 (R12, not rerun).
Untested areas
  • The variant pass was not rerun because the new commit changes only a docblock.
  • The real browser rendering of the close glyph was not checked.

🤖 Automated review · run code-review-agent_6afeed427d50b3.56321001.


🤖 Review agent — review posted ✅ on 07b53187 · approved · 0 findings · 11 min

Run code-review-agent_6afeed427d50b3.56321001 · trail

@pirate-bot pirate-bot left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🟡 Changes requested

The close button must follow the header's render order, but the new lookup follows the saved layout order instead.

Validation details
  • Files reviewed: 3/3 changed files. The review focused on commit 747be82, the only commit since the last review.
  • The close-button test file passed at 747be82 with PHP 8.3 and PHPUnit 9.6. cd /repo; set -o pipefail; timeout 280 phpunit --do-not-cache-result --filter 'TestNeveHfgMenuIconCloseButton::' 2>&1 | … (run R2, exit 0)
  • Each new test failed on an assertion against pr-base or 07b5318 source. These A/B runs have logs but no run records.
  • A source check found that every shipped header preset and the migration save rows and slots in render order.
  • The variant pass found no other place where an unused menu icon picks rendered classes.
Untested areas
  • The real browser rendering of the close glyph was not checked.
  • Neve Pro's own menu icon class is outside this checkout.

🤖 Automated review · run code-review-agent_6affd27badd610.02325027.


🤖 Review agent — review posted ✅ on 747be82c · changes requested · 1 finding · 25 min

Run code-review-agent_6affd27badd610.02325027 · trail

@pirate-bot pirate-bot left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🟢 Approved

The PR passes: the close button now follows the header's render order, and the earlier finding is fixed.

Validation details
  • Files reviewed: 4/4 changed files. Two history questions stayed unchecked: "Warning printed in PHP8.0/8.1 from header builder" and "Blue rectangle surrounding the first menu item on Iphone".
  • The close-button tests pass at HEAD with PHP 8.3 and PHPUnit 9.6. cd /repo; set -o pipefail; timeout 280 phpunit --do-not-cache-result --filter 'TestNeveHfgMenuIconCloseButton::' 2>&1 | … printed OK (8 tests, 130 assertions) (run R3)
  • PHPStan 2.1.22 with the repository configuration reports no error on the two changed classes. cd /workspace/checks/C7/head; set -o pipefail; timeout 280 vendor/bin/phpstan analyse --memory-limit=2G --configuration=… (run R8, exit 0)
  • A source trace found that rows, slots and legacy items follow the renderer's order.
Untested areas
  • The new tests ran against 747be82 and pr-base without run records.
  • "Warning printed in PHP8.0/8.1 from header builder": a hand-made legacy item that is not an array now stops the sort. No builder code saves one.
  • "Blue rectangle surrounding the first menu item on Iphone": not checked again at HEAD.
  • Neve Pro's menu icon source is not public.
  • The close glyph was not checked in a browser.
  • The variant pass did not settle these places, where the fixed cause may still reach:
    • header-footer-grid/Core/Components/MenuIcon.php:720-744 — unverified: Every active instance’s appearance rules target the shared close button, irrespective of the selected close-icon owner. Whether an additional Pro instance inherits this implementat…

🤖 Automated review · run code-review-agent_6affde21173b23.76154576.


🤖 Review agent — review posted ✅ on 42d89a43 · approved · 0 findings · 33 min

Run code-review-agent_6affde21173b23.76154576 · trail

@pirate-bot
pirate-bot merged commit 419e58c into development Nov 20, 2026
17 checks passed
@pirate-bot
pirate-bot deleted the bugfix/4704 branch November 20, 2026 10:01
@vytisbulkevicius

Copy link
Copy Markdown
Contributor

@girishpanchal30 — heads-up: this PR left PHP Tests red on development, and it needs a decision from you since you have the context on the color-function change here.

Symptom: TestSanitization::test_sanitize_colors_rejects_incomplete_rgba fails — neve_sanitize_colors('rgba(1,2,3)') returns 'rgba(1,2,3)' instead of ''.

Cause: the new neve_is_css_function_color() early-return in neve_sanitize_colors() runs before the strict neve_sanitize_rgba() parser. Its regex ^(?:rgb|rgba|hsl|hsla)\(\s*[-0-9.% ,]+\)$ is permissive, so a malformed rgba() (missing alpha, non-integer channel, etc.) is returned unchanged instead of being rejected by the strict parser.

Why it needs a decision, not just a patch: the two tests this PR added encode opposite contracts for rgba() normalization, so no fix makes both green:

Input test_sanitize_colors_with_non_string_values test_sanitize_colors_rejects_incomplete_rgba
rgba(255, 0, 0, 1) expects rgba(255, 0, 0, 1) (spaces kept) —
rgba( 255, 0, 0, 1 ) — expects rgba(255,0,0,1) (spaces stripped)

Options:

  • A — strict: route rgba() to neve_sanitize_rgba() before the function-color check (validate + strip + reject malformed). ~7 lines in neve_sanitize_colors(), plus updating the rgba(255, 0, 0, 1) expectation to rgba(255,0,0,1).
  • B — preserve formatting: keep the function-color path (spaces kept, malformed passed through) and relax test_sanitize_colors_rejects_incomplete_rgba — but then the sanitizer knowingly accepts rgba(1,2,3).

Since you added both the function-color path and these tests, you'll know whether the function-color path was meant to also cover rgb()/hsl()/hsla() (and whether those want component-count validation too). Could you take the call and fix it? Happy to open the PR for whichever option you pick. (It's currently inherited as a red check by in-flight PRs branched off development, e.g. #4717.)

@girishpanchal30 girishpanchal30 mentioned this pull request Nov 24, 2026
6 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants