Skip to content

[V2 Snackbar] Added Elevation Tokens to Snackbar #788

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

Merged
merged 4 commits into from
Jun 18, 2025

Conversation

Dhruv-Mishra
Copy link
Collaborator

@Dhruv-Mishra Dhruv-Mishra commented Jun 17, 2025

Changes

Added Elevation and Shadow to Fluent Snackbar V2

Screenshots

Before After
image image

Pull request checklist

This PR has considered:

  • Light and Dark appearances
  • Automated Tests
  • Documentation and demo app examples
  • VoiceOver and Keyboard Accessibility
  • Internationalization and RTL layouts
  • Size classes and window sizes (notched devices, multitasking, different window sizes, etc)

@Copilot Copilot AI review requested due to automatic review settings June 17, 2025 07:26
@Dhruv-Mishra Dhruv-Mishra requested a review from a team as a code owner June 17, 2025 07:26
@Dhruv-Mishra Dhruv-Mishra changed the title Dhruv mishra/snackbar token and elevation [Snackbar v2] Added Elevation Tokens to Snackbar Jun 17, 2025
@Dhruv-Mishra Dhruv-Mishra changed the title [Snackbar v2] Added Elevation Tokens to Snackbar [V2 Snackbar] Added Elevation Tokens to Snackbar Jun 17, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds elevation and shadow to the Fluent Snackbar component by introducing a new token for elevation values and applying a shadow modifier in the composable.

  • Imported shadow API and applied .shadow() to the Snackbar container
  • Introduced shadowElevationValue token mapping each SnackbarStyle to a Dp elevation
  • Added corresponding method in SnackBarTokens and updated imports

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
fluentui_notification/src/main/java/com/microsoft/fluentui/tokenized/notification/Snackbar.kt Imported shadow API, retrieved elevation from token, and applied .shadow() modifier
fluentui_core/src/main/java/com/microsoft/fluentui/theme/token/controlTokens/SnackbarTokens.kt Added shadowElevationValue composable method mapping styles to Dp elevations
Comments suppressed due to low confidence (2)

fluentui_core/src/main/java/com/microsoft/fluentui/theme/token/controlTokens/SnackbarTokens.kt:95

  • [nitpick] Add KDoc to shadowElevationValue explaining its purpose and detailing elevation values for each SnackbarStyle.
@Composable

fluentui_core/src/main/java/com/microsoft/fluentui/theme/token/controlTokens/SnackbarTokens.kt:96

  • Add automated tests for shadowElevationValue to ensure each SnackbarStyle returns the correct elevation.
open fun shadowElevationValue(snackBarInfo: SnackBarInfo): Dp {

…enized/notification/Snackbar.kt

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Dhruv-Mishra Dhruv-Mishra merged commit d93eb3a into master Jun 18, 2025
2 checks passed
@Composable
open fun shadowElevationValue(snackBarInfo: SnackBarInfo): Dp {
return when (snackBarInfo.style) {
SnackbarStyle.Neutral -> FluentGlobalTokens.ShadowTokens.Shadow02.value
Copy link
Contributor

Choose a reason for hiding this comment

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

should we have common shadow for all styles ?

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