Skip to content

Fix Menu dropdown items being normalized twice + Fix Dropdown not wrapping a nested submenu toggle in <li> - #168

Open
vjik wants to merge 5 commits into
masterfrom
fix-menu-encode
Open

Fix Menu dropdown items being normalized twice + Fix Dropdown not wrapping a nested submenu toggle in <li>#168
vjik wants to merge 5 commits into
masterfrom
fix-menu-encode

Conversation

@vjik

@vjik vjik commented Aug 14, 2026

Copy link
Copy Markdown
Member
Q A
Is bugfix? ✔️
New feature?
Breaks BC?

@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (c3ae973) to head (0b6a477).

Additional details and impacted files
@@             Coverage Diff             @@
##              master      #168   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity       327       333    +6     
===========================================
  Files              8         8           
  Lines           1038      1057   +19     
===========================================
+ Hits            1038      1057   +19     

☔ View full report in Codecov by Harness.
📢 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.

@vjik
vjik requested a balanced review from Copilot August 15, 2026 12:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Fixes double normalization of Menu dropdown items.

Changes:

  • Defers submenu normalization to Dropdown.
  • Propagates menu context into nested items.
  • Adds regression tests and changelog entry.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/Helper/Normalizer.php Revises submenu normalization flow.
tests/Menu/MenuTest.php Tests encoding, icons, and active paths.
CHANGELOG.md Documents the bug fix.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/Helper/Normalizer.php Outdated
@vjik
vjik requested a balanced review from Copilot August 15, 2026 12:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (1)

src/Helper/Normalizer.php:83

  • Normalizer::menu() is public and previously recursively normalized submenu leaves, including removing encode, icon, and related raw keys. Returning injectMenuContext() here now leaves those children partially raw, reversing the behavior recorded in CHANGELOG.md:13 and creating a backward-incompatible result for direct callers despite the PR's no-BC claim. Please keep menu() fully normalized and move the single-normalization Menu→Dropdown handoff to a separate internal path/API.
                    $items[$i]['items'] = self::injectMenuContext(

@vjik vjik changed the title Fix Menu dropdown items being normalized twice Fix Menu dropdown items being normalized twice + Fix Dropdown not wrapping a nested submenu toggle in <li> Aug 15, 2026
@vjik
vjik requested a balanced review from Copilot August 15, 2026 12:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (1)

src/Helper/Normalizer.php:83

  • Normalizer::menu() is public and promises fully normalized menu items, but this branch now returns submenu leaves with raw encode, icon, and related keys intact instead of rendered labels. That reverses the behavior documented in CHANGELOG.md:13 and can break direct callers despite the PR’s no-BC claim. Keep menu()’s recursive normalization contract and introduce a separate internal handoff for MenuDropdown so widget rendering still normalizes each item only once.
                    $items[$i]['items'] = self::injectMenuContext(

@vjik
vjik requested a review from a team August 15, 2026 12:57
@vjik vjik added the status:code review The pull request needs review. label Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:code review The pull request needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants