Skip to content

Refactor MenuItem to improve submenu rendering logic#25

Merged
buttonwillowsix merged 3 commits intoCSHARP-65from
buttonwillowsix-patch-3
Feb 20, 2026
Merged

Refactor MenuItem to improve submenu rendering logic#25
buttonwillowsix merged 3 commits intoCSHARP-65from
buttonwillowsix-patch-3

Conversation

@buttonwillowsix
Copy link
Contributor

Update MenuItem component to conditionally render caret and submenu based on child items instead of expanded prop.

READY FOR REVIEW

Summary

  • Possible fix for issue Jen and Dena found late at night. Not to be trusted. Should be tested.
  • Totally disregards the possible utility of the Drupal "Show as Expanded" state, which does have uses (but is not documented and has been causing some general inconsistencies.)

Review By (Date)

  • Before merge of CSHARP-65

Criticality

  • 8?

Urgency

  • Normal. I think we can patchup the existing branch to create version that can be deployed while we look at this further.

Review Tasks

Setup tasks and/or behavior to test

  1. Check out this branch and do whatever build-like things need to happen with the theme
  2. Rebuild Cache and import config drush cr ; drush ci
  3. Go to a site that has a menu item with "show as expanded" set on a menu item that has no children
  4. Verify that appearance of the caret is correct (none)
  5. Verify that the caret shows on items that have children, regardless of their "expanded" state
  6. Verify that the caret also doesn't show on unexpanded, childless menu items
  7. Verify that this impacts the sidebar menu not at all (can't think why it would, but doesn't hurt to look)

Site Configuration Sync

  • Is there a config:export in this PR that changes the config sync directory? NOPE

Front End Validation

Backend / Functional Validation

Code

  • Are the naming conventions following our standards?
  • Does the code have sufficient inline comments?
  • Is there anything in this code that would be hidden or hard to discover through the UI?
  • Are there any code smells?
  • Are tests provided? eg (unit, behat, or codeception)

Code security

General

  • Is there anything included in this PR that is not related to the problem it is trying to solve?
  • Is the approach to the problem appropriate?

Affected Projects or Products

  • Does this PR impact any particular projects, products, or modules?

Associated Issues and/or People

  • JIRA ticket(s)
  • Other PRs
  • Any other contextual information that might be helpful (e.g., description of a bug that this PR fixes, new functionality that it adds, etc.)
  • Anyone who should be notified? (@mention them here)

Resources

Update MenuItem component to conditionally render caret and submenu based on child items instead of expanded prop.
@pookmish pookmish force-pushed the buttonwillowsix-patch-3 branch from 23201be to 19d9ece Compare February 20, 2026 16:46
@buttonwillowsix buttonwillowsix merged commit b467fcc into CSHARP-65 Feb 20, 2026
1 check passed
@buttonwillowsix buttonwillowsix deleted the buttonwillowsix-patch-3 branch February 20, 2026 17:07
buttonwillowsix added a commit that referenced this pull request Feb 20, 2026
…#24)

* CSHARP-65: Removed background color from icon on secondary navigation

* fixup

* Refactor MenuItem to improve submenu rendering logic (#25)

* Refactor MenuItem to improve submenu rendering logic

Update MenuItem component to conditionally render caret and submenu based on child items instead of expanded prop.

* compile

* respect expanded

---------

Co-authored-by: Mike Decker <pookmish@stanford.edu>

---------

Co-authored-by: Dena DeBry <denas@stanford.edu>
Co-authored-by: Mike Decker <pookmish@stanford.edu>
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.

2 participants