Skip to content

[V2 Stacking Snackbar] Added Stackable Snackbar Component #801

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

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

Dhruv-Mishra
Copy link
Collaborator

Problem

Root cause

Fix

Validations

(how the change was tested, including both manual and automated tests)

Screenshots

Before After
Screenshot or description before this change Screenshot or description with this change

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 August 17, 2025 16:38
@Dhruv-Mishra Dhruv-Mishra requested a review from a team as a code owner August 17, 2025 16:38
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

This PR introduces a new stackable snackbar component that allows multiple notification cards to be displayed in a stacked visual format. The implementation provides an alternative to traditional single snackbar notifications by supporting multiple cards with expand/collapse functionality and swipe-to-dismiss gestures.

  • Added a complete StackableSnackbar component with card stacking, animations, and gesture support
  • Updated the demo activity to showcase the new stackable functionality
  • Implemented state management for card operations with mutex-based synchronization

Reviewed Changes

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

File Description
StackableSnackbar.kt New stackable snackbar component with card management, animations, and gesture handling
V2SnackbarActivity.kt Updated demo to use the new stackable snackbar instead of traditional snackbar

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

import com.microsoft.fluentui.tokenized.controls.Button
import com.microsoft.fluentui.util.clickableWithTooltip
import kotlinx.coroutines.launch
import androidx.compose.animation.core.*
Copy link
Preview

Copilot AI Aug 17, 2025

Choose a reason for hiding this comment

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

Duplicate import of androidx.compose.animation.core.*. This import already exists at line 5-6 with specific classes imported.

Suggested change
import androidx.compose.animation.core.*

Copilot uses AI. Check for mistakes.

import androidx.compose.animation.core.*
import androidx.compose.foundation.background
import androidx.compose.foundation.gestures.detectDragGestures
import androidx.compose.foundation.layout.*
Copy link
Preview

Copilot AI Aug 17, 2025

Choose a reason for hiding this comment

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

Duplicate import of androidx.compose.foundation.layout.*. Several layout classes are already imported individually at lines 7-11.

Suggested change
import androidx.compose.foundation.layout.*

Copilot uses AI. Check for mistakes.

import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.*
Copy link
Preview

Copilot AI Aug 17, 2025

Choose a reason for hiding this comment

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

Duplicate import of androidx.compose.runtime.*. Several runtime classes are already imported individually at lines 13-18.

Suggested change
import androidx.compose.runtime.*

Copilot uses AI. Check for mistakes.

import androidx.compose.ui.unit.IntOffset
import androidx.compose.ui.unit.times
import com.microsoft.fluentui.tokenized.controls.BasicCard
import kotlinx.coroutines.*
Copy link
Preview

Copilot AI Aug 17, 2025

Choose a reason for hiding this comment

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

Duplicate import of kotlinx.coroutines.*. kotlinx.coroutines.launch is already imported at line 25.

Copilot uses AI. Check for mistakes.


Spacer(modifier = Modifier.height(20.dp))

Row {
Copy link
Preview

Copilot AI Aug 17, 2025

Choose a reason for hiding this comment

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

[nitpick] Row should have proper horizontal arrangement specified. Consider adding horizontalArrangement = Arrangement.spacedBy(12.dp) instead of using multiple Spacer components.

Suggested change
Row {
Row(horizontalArrangement = Arrangement.spacedBy(12.dp)) {

Copilot uses AI. Check for mistakes.

// ) {
// var icon: Boolean by rememberSaveable { mutableStateOf(false) }
// var actionLabel: Boolean by rememberSaveable { mutableStateOf(false) }
// var subtitle: String? by rememberSaveable { mutableStateOf(null) }
Copy link
Preview

Copilot AI Aug 17, 2025

Choose a reason for hiding this comment

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

Large blocks of commented-out code should be removed rather than left in the codebase. This makes the file difficult to read and maintain.

Suggested change
// var subtitle: String? by rememberSaveable { mutableStateOf(null) }

Copilot uses AI. Check for mistakes.

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