-
Notifications
You must be signed in to change notification settings - Fork 115
[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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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.* |
There was a problem hiding this comment.
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.
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.* |
There was a problem hiding this comment.
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.
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.* |
There was a problem hiding this comment.
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.
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.* |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
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) } |
There was a problem hiding this comment.
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.
// var subtitle: String? by rememberSaveable { mutableStateOf(null) } |
Copilot uses AI. Check for mistakes.
Problem
Root cause
Fix
Validations
(how the change was tested, including both manual and automated tests)
Screenshots
Pull request checklist
This PR has considered: