Skip to content

[DO NOT MERGE] chore: system aware icons storybook in menu fast follows #5402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Rajdeepc
Copy link
Contributor

@Rajdeepc Rajdeepc commented Apr 25, 2025

Description

This PR introduces a SystemAwareMenu class that demonstrates that the component only overrides the update lifecycle method to re-render itself and cascade the system context to its children. This minimalist approach allows the system context to flow through the component tree and ensures all descendant components can respond to system changes.

This serves as a container component that can wrap any menu or other component, providing system resolution capabilities through Lit's slot mechanism. This approach allows components to automatically adapt to system context changes (e.g., Spectrum 1, Spectrum 2, Express) without requiring direct modification of each individual component.

Features

  • Added a system-aware menu component that detects the current system context
  • Created a demonstration story showing its usage with standard menu components
  • Allows icons and other system-dependent UI elements to automatically adapt

TODO

  • This is a temporary solution for fast follows. Future implementation should handle this either via:
    1. Context-aware icons that can directly consume system context without wrapper components
    2. A more robust contextProvider implementation using @lit/context throughout the codebase

How has this been tested?

  • Test case 1

    1. Go here
    2. Switch between system
    3. Check the icons with the menu items are changing based on system
  • Test case 2

    1. Go here
    2. Do this
  • Did it pass in Desktop?

  • Did it pass in Mobile?

  • Did it pass in iPad?

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (minor updates related to the tooling or maintenance of the repository, does not impact compiled assets)

Checklist

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • If my change required a change to the documentation, I have updated the documentation in this pull request.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have reviewed at the Accessibility Practices for this feature, see: Aria Practices

Best practices

This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against main.

@Rajdeepc Rajdeepc self-assigned this Apr 25, 2025
Copy link

changeset-bot bot commented Apr 25, 2025

⚠️ No Changeset found

Latest commit: 8d090dd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Rajdeepc Rajdeepc marked this pull request as ready for review April 25, 2025 07:12
@Rajdeepc Rajdeepc requested a review from a team as a code owner April 25, 2025 07:12
Copy link

Branch preview

Review the following VRT differences

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

Copy link

Tachometer results

Currently, no packages are changed by this PR...

@Rajdeepc Rajdeepc changed the title chore: added system aware icons story in menu fast follows chore: fast-follows - added system aware icons story in menu Apr 25, 2025
@Rajdeepc Rajdeepc changed the title chore: fast-follows - added system aware icons story in menu chore: system aware icons storybook in menu fast follows Apr 25, 2025
@Rajdeepc
Copy link
Contributor Author

Note: This change has been made for the design to sign off on our Menu fast follows, but to make it more robust we would need to update our context Switcher(System Resolver) to also cascade the context of system down to slotted content also. Lit's context API doesn't allow this out of the box but we can update SystemResolverController to extend this capability. Let this PR be open for now, I will make the necessary changes on a high level which would need some deeper dive.

@Rajdeepc Rajdeepc marked this pull request as draft April 25, 2025 15:57
@Rajdeepc Rajdeepc changed the title chore: system aware icons storybook in menu fast follows [DO NOT MERGE] chore: system aware icons storybook in menu fast follows Apr 25, 2025
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.

1 participant