-
Notifications
You must be signed in to change notification settings - Fork 160
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
[Feature] Pinned message : banner logic #3275
Conversation
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
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.
LGTM, a couple of minor comments, but nothing important.
|
||
@ContributesTo(SessionScope::class) |
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.
Good catch.
if (currentPinnedMessageIndex > 0) { | ||
currentPinnedMessageIndex-- | ||
} else { | ||
currentPinnedMessageIndex = 0 | ||
currentPinnedMessageIndex = pinnedItems.value.size - 1 |
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.
Not a big deal, but maybe this could be done with just (currentPinnedMessageIndex - 1).floorMod(pinnedItems.value.size)
.
sealed interface PinnedMessagesBannerState { | ||
data object Hidden : PinnedMessagesBannerState | ||
sealed interface Visible : PinnedMessagesBannerState | ||
data class Loading(val realPinnedMessagesCount: Int) : Visible |
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.
expectedPinnedMessageCount
maybe?
import androidx.compose.ui.text.font.FontWeight | ||
import androidx.compose.ui.text.withStyle | ||
|
||
internal fun CharSequence.prefixWith(prefix: String): AnnotatedString { |
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.
👌
Quality Gate passedIssues Measures |
Content
Branch logic to display pinned messages banner.
Motivation and context
Handles #3213
Screenshots / GIFs
Tests
Tested devices
Checklist