Commit 8657a15
authored
Channel pinning: list indicator and sheet header icons (#6474)
* refactor(compose): move Pin to slot 2 in channel options sheet
Aligns the DM action order with the channel-pinning redesign:
View Info -> Pin/Unpin Chat -> Mute/Unmute User -> Block/Unblock User
-> Archive/Unarchive Chat -> Delete Chat. Group order was already correct;
only KDoc refreshed to reflect the actual default flow and the opt-in
nature of Pin and Archive.
* feat(compose): render muted/pinned icons in SelectedChannelMenu header
The selected-channel menu header now renders inline mute and pin icons
next to the channel name when the respective attribute is active, in a
fixed name -> mute -> pin order matching the redesign.
Adds defaulted isMuted/isPinned fields to ChannelMenuParams and
ChannelMenuHeaderContentParams; ChannelsScreen composes the channel-mute
OR DM-counterpart-user-mute signal inline using existing
isChannelMuted/isUserMuted accessors. Extracts a small internal
Channel.dmCounterpartId helper to remove a duplicate member-iteration
that also appeared in buildDmChannelActions.
Localizes stream_compose_channel_item_pinned across the seven supported
locales. Enables isPinChannelVisible in the compose sample so the
behaviour is reachable from the dogfooding app. The preview-vs-snapshot
duplication for SelectedChannelMenu is removed via three internal
content composables called by both the previews and the Paparazzi tests.
* feat(compose): support pinned indicator on the channel list item
Adds a PinIndicatorPosition enum mirroring MuteIndicatorPosition, plus a
trailing pinIndicatorPosition field on ChannelListConfig so the pin icon
can be placed inline with the channel name or at the trailing bottom of
the preview row, independent of the mute icon position. The render order
in TitleRow is name -> mute -> pin (matching the redesign) and the trailing
branch in MessageRow renders mute before pin. The mute/pin icon rendering
is extracted into MutedIcon/PinnedIcon helpers and the preview/snapshot
config overrides now use CompositionLocalProvider(LocalChatUiConfig) to
keep snapshotWithDarkMode's dark-mode flag intact across nested overrides.
In the sample, channel pinning becomes a CustomSettings feature flag
(isChannelPinningEnabled, default false) toggled from the Custom Login
settings panel and consumed by both ChannelsActivity and ChatsActivity.
Activities adopt the canonical settings field pattern via
private val settings by lazy { customSettings() }.
Snapshot baselines: five new ChannelItem tests (pinned only, pinned
trailing, muted+pinned both inline, muted+pinned both trailing, mixed)
and a refreshed muted_channel_trailing_bottom to fix a pre-existing
dark-mode rendering bug exposed by the same nested-ChatTheme issue.
Also folds in KDoc cleanup on the muted/pinned param docs added in the
previous commit, removing implementation rationale per the engineering
principles.
* feat(compose-sample): sort pinned channels to top in the channel list
Composes the existing last_updated sort with a leading desc("pinned_at")
in both ChannelsActivity and ChatsActivity so pinned channels surface at
the top of the channel list while unpinned channels keep their
recent-activity ordering. Acts as the recipe integrators can mirror to
enable pinned-first sorting without a SDK-default change.
* refactor(compose): deprecate unused isMuted on buildDefaultChannelActions
Adds a new public overload of buildDefaultChannelActions without the
isMuted parameter and marks the previous five-arg overload @deprecated
with a ReplaceWith quick-fix. The parameter was received but never read
by either the DM or group action builders. ChannelsScreen, the sample
ChannelsActivity, and the docs example are updated to call the new
overload so the SDK does not dogfood the deprecated API.
* refactor(compose): derive muted/pinned icon state inside the menu
Drops the isMuted/isPinned params on ChannelMenuParams,
ChannelMenuHeaderContentParams, and SelectedChannelMenu. The default
header now derives the pinned state from selectedChannel.isPinned() and
the muted state from currentUser.channelMutes (channel-level) and
currentUser.mutes (DM-counterpart) via a private helper. ChannelsScreen
reverts to its pre-PR shape — no OR computation, no flags on the params.
Addresses the review concern that isMuted was ambiguous (channel vs.
user mute) and that both flags duplicate state the menu already has via
selectedChannel + currentUser. Net effect on the public API vs. develop
is zero new fields on the params data classes for icon state.1 parent 339cd7e commit 8657a15
34 files changed
Lines changed: 661 additions & 171 deletions
File tree
- stream-chat-android-compose-sample/src/main
- java/io/getstream/chat/android/compose/sample
- data
- feature/channel/list
- ui
- chats
- login
- res/values
- stream-chat-android-compose
- api
- src
- main
- java/io/getstream/chat/android/compose/ui
- channels
- info
- list
- components/channels
- theme
- util
- res
- values-es
- values-fr
- values-hi
- values-in
- values-it
- values-ja
- values-ko
- values
- test
- kotlin/io/getstream/chat/android/compose/ui
- channels
- util
- snapshots/images
- stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/compose/channels
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| |||
Lines changed: 16 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| 85 | + | |
84 | 86 | | |
85 | 87 | | |
| 88 | + | |
86 | 89 | | |
87 | 90 | | |
88 | 91 | | |
89 | 92 | | |
| 93 | + | |
90 | 94 | | |
91 | 95 | | |
92 | 96 | | |
| |||
106 | 110 | | |
107 | 111 | | |
108 | 112 | | |
| 113 | + | |
| 114 | + | |
109 | 115 | | |
110 | 116 | | |
111 | 117 | | |
| |||
120 | 126 | | |
121 | 127 | | |
122 | 128 | | |
123 | | - | |
| 129 | + | |
124 | 130 | | |
125 | 131 | | |
126 | 132 | | |
| |||
161 | 167 | | |
162 | 168 | | |
163 | 169 | | |
164 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
165 | 179 | | |
166 | 180 | | |
167 | 181 | | |
| |||
348 | 362 | | |
349 | 363 | | |
350 | 364 | | |
351 | | - | |
352 | 365 | | |
353 | 366 | | |
354 | 367 | | |
| |||
Lines changed: 25 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | 54 | | |
56 | 55 | | |
57 | 56 | | |
| |||
92 | 91 | | |
93 | 92 | | |
94 | 93 | | |
95 | | - | |
96 | 94 | | |
97 | | - | |
98 | 95 | | |
99 | 96 | | |
100 | 97 | | |
| |||
131 | 128 | | |
132 | 129 | | |
133 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
134 | 150 | | |
135 | 151 | | |
136 | 152 | | |
137 | 153 | | |
138 | 154 | | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
144 | 159 | | |
145 | 160 | | |
146 | 161 | | |
| |||
165 | 180 | | |
166 | 181 | | |
167 | 182 | | |
| 183 | + | |
168 | 184 | | |
169 | 185 | | |
170 | 186 | | |
| |||
608 | 624 | | |
609 | 625 | | |
610 | 626 | | |
611 | | - | |
| 627 | + | |
612 | 628 | | |
613 | 629 | | |
614 | 630 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
129 | 132 | | |
130 | 133 | | |
131 | 134 | | |
| |||
150 | 153 | | |
151 | 154 | | |
152 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
153 | 165 | | |
154 | 166 | | |
155 | 167 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| |||
Lines changed: 27 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
881 | 881 | | |
882 | 882 | | |
883 | 883 | | |
| 884 | + | |
884 | 885 | | |
885 | 886 | | |
886 | 887 | | |
| |||
902 | 903 | | |
903 | 904 | | |
904 | 905 | | |
| 906 | + | |
| 907 | + | |
905 | 908 | | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
906 | 913 | | |
907 | 914 | | |
908 | 915 | | |
| 916 | + | |
| 917 | + | |
909 | 918 | | |
910 | 919 | | |
911 | 920 | | |
912 | 921 | | |
| 922 | + | |
913 | 923 | | |
914 | 924 | | |
915 | 925 | | |
| |||
1210 | 1220 | | |
1211 | 1221 | | |
1212 | 1222 | | |
| 1223 | + | |
1213 | 1224 | | |
1214 | 1225 | | |
1215 | 1226 | | |
| |||
2895 | 2906 | | |
2896 | 2907 | | |
2897 | 2908 | | |
2898 | | - | |
2899 | | - | |
| 2909 | + | |
| 2910 | + | |
2900 | 2911 | | |
2901 | | - | |
2902 | | - | |
2903 | | - | |
2904 | | - | |
| 2912 | + | |
| 2913 | + | |
| 2914 | + | |
| 2915 | + | |
| 2916 | + | |
2905 | 2917 | | |
2906 | 2918 | | |
2907 | 2919 | | |
| 2920 | + | |
2908 | 2921 | | |
2909 | 2922 | | |
2910 | 2923 | | |
| |||
5523 | 5536 | | |
5524 | 5537 | | |
5525 | 5538 | | |
| 5539 | + | |
| 5540 | + | |
| 5541 | + | |
| 5542 | + | |
| 5543 | + | |
| 5544 | + | |
| 5545 | + | |
| 5546 | + | |
5526 | 5547 | | |
5527 | 5548 | | |
5528 | 5549 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | | - | |
211 | 210 | | |
212 | 211 | | |
213 | 212 | | |
| |||
0 commit comments