Skip to content

feat: make icon optional in WorkSideMenuGroup and WorkSideMenuItem#3595

Open
Copilot wants to merge 2 commits intodevfrom
copilot/add-optional-icon-to-workside-menu-group
Open

feat: make icon optional in WorkSideMenuGroup and WorkSideMenuItem#3595
Copilot wants to merge 2 commits intodevfrom
copilot/add-optional-icon-to-workside-menu-group

Conversation

Copy link
Contributor

Copilot AI commented Mar 16, 2026

WorkSideMenuGroup always rendered a leading icon, reserving space for it even when none was needed — requiring shadow DOM workarounds to hide it. WorkSideMenuItem had the same issue: the goa-icon element was always mounted even with an empty icon prop.

image

Before (the change)

  • WorkSideMenuGroup.icon was required; always rendered a goa-icon in the summary header
  • WorkSideMenuItem always mounted a goa-icon element even when icon="", consuming layout space

After (the change)

  • WorkSideMenuGroupicon is now optional across all three frameworks. The leading goa-icon is only rendered when icon is provided; no space is reserved when omitted.
  • WorkSideMenuItemgoa-icon is conditionally rendered via {#if icon}, consistent with the existing optional prop contract.
<!-- WorkSideMenuGroup with no icon: clean text-only header -->
<goa-work-side-menu-group heading="Content layout" />

<!-- WorkSideMenuGroup with icon: unchanged behavior -->
<goa-work-side-menu-group heading="Dashboard" icon="home" />

React / Angular: icon prop changed from required to optional in both wrappers (GoabWorkSideMenuGroupProps, @Input() icon?: GoabIconType).

Make sure that you've checked the boxes below before you submit the PR

  • I have read and followed the setup steps
  • I have created necessary unit tests
  • I have tested the functionality in both React and Angular.

Steps needed to test

  1. Render WorkSideMenuGroup without the icon prop — confirm no icon element is mounted and heading text is flush left with no reserved icon gap.
  2. Render WorkSideMenuGroup with icon="star" — confirm existing icon behavior is unchanged.
  3. Render WorkSideMenuItem without icon — confirm no icon element is mounted.
  4. Render WorkSideMenuItem with icon="star" — confirm icon renders as before.
Original prompt

This section details on the original issue you should resolve

<issue_title>Add optional icon to WorkSideMenuGroup</issue_title>
<issue_description>## Description

WorkSideMenuGroup always renders a leading icon in the group header. There's no way to hide it or make it optional. When used without an icon, the component still reserves space for one, requiring shadow DOM workarounds to hide it and fix alignment.

Use case

The docs website uses WorkSideMenuGroup for nav categories (Components: Content layout, Feedback and alerts, etc.) and Get Started groups (Designers, Developers). These groups don't need icons, just text headers.

Image

Expected behavior

WorkSideMenuGroup should support rendering without an icon. Either:

  • Make the icon prop optional (no icon rendered when omitted)
    • No space reserved for icon if not provided
Image

Current workaround

docs/src/components/nav/useGroupShadowDomFixes.ts injects styles into shadow DOM to hide the icon and adjust padding/margins.</issue_description>

<agent_instructions>The icon should be optional both for WorkSideMenuGroup.svelte and WorkSideMenuItem.svelte. The optional property should be for the respective React and Angular wrappers as well.

Here's a list of files to review:
libs/web-components/src/components/work-side-menu/WorkSideMenuGroup.svelte
libs/angular-components/src/experimental/work-side-menu-group/work-side-menu-group.ts
libs/react-components/src/experimental/work-side-menu-group/work-side-menu-group.tsx
libs/web-components/src/components/work-side-menu/WorkSideMenuItem.svelte
libs/angular-components/src/experimental/work-side-menu-item/work-side-menu-item.ts
libs/react-components/src/experimental/work-side-menu-item/work-side-menu-item.tsx</agent_instructions>

Comments on the Issue (you are @copilot in this section)


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Copilot AI changed the title [WIP] Add optional icon to WorkSideMenuGroup feat: make icon optional in WorkSideMenuGroup and WorkSideMenuItem Mar 16, 2026
Copilot AI requested a review from bdfranck March 16, 2026 23:14
@bdfranck bdfranck force-pushed the copilot/add-optional-icon-to-workside-menu-group branch from 29096fe to d0d5758 Compare March 18, 2026 16:35
@bdfranck
Copy link
Collaborator

Here was my process:

  1. Asked GitHub Copilot to create the initial PR
  2. Tweaked the results
  3. Asked Copilot to create the PR test pages
  4. Squashed the commits

@bdfranck bdfranck force-pushed the copilot/add-optional-icon-to-workside-menu-group branch from d0d5758 to e14d613 Compare March 19, 2026 14:43
@bdfranck bdfranck marked this pull request as ready for review March 19, 2026 14:43
@bdfranck bdfranck requested a review from chrisolsen March 19, 2026 14:43
@Spark450 Spark450 added the P3 Priority 3 (nice to have): Valuable, but safe to release after launch. label Mar 19, 2026
@Spark450 Spark450 removed the request for review from bdfranck March 20, 2026 15:48
@bdfranck bdfranck force-pushed the copilot/add-optional-icon-to-workside-menu-group branch from e14d613 to 329c9e5 Compare March 23, 2026 16:13
@bdfranck
Copy link
Collaborator

I've rebased this commit against the latest dev and resolved the merge conflicts.

Added a third test panel showing a back arrow icon on the first item
with iconless items and groups below, matching the docs site pattern.
Copy link
Collaborator

@twjeffery twjeffery left a comment

Choose a reason for hiding this comment

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

@bdfranck Approved, looks good to me. I added a test page as well, feel free to squash that in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Priority 3 (nice to have): Valuable, but safe to release after launch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add optional icon to WorkSideMenuGroup

5 participants