Commit a8e4a30
authored
Sort instant commands universal-first preserving backend order (#6418)
Extends sortedByAvailability with a tier tie-breaker so command suggestions
surface universal commands (set != moderation_set) before contextual ones.
The sort is stable, so within each tier the input order from the backend's
Channel.config.commands is preserved — no client-side opinion on relative
order between commands of the same tier.
Affects the Compose composer suggestion list (via
MessageComposerController.orderedForComposer) and the Compose attachment
command picker (AttachmentCommandPicker), which both call into
sortedByAvailability.1 parent 2c2e9e8 commit a8e4a30
3 files changed
Lines changed: 33 additions & 15 deletions
File tree
- stream-chat-android-ui-common/src
- main/kotlin/io/getstream/chat/android/ui/common
- feature/messages/composer
- state/messages/composer
- test/kotlin/io/getstream/chat/android/ui/common/feature/messages/composer
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1125 | 1125 | | |
1126 | 1126 | | |
1127 | 1127 | | |
1128 | | - | |
1129 | | - | |
| 1128 | + | |
| 1129 | + | |
1130 | 1130 | | |
1131 | 1131 | | |
1132 | 1132 | | |
| |||
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
53 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
54 | 60 | | |
55 | 61 | | |
Lines changed: 22 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1081 | 1081 | | |
1082 | 1082 | | |
1083 | 1083 | | |
1084 | | - | |
1085 | | - | |
1086 | | - | |
1087 | | - | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
1088 | 1093 | | |
1089 | 1094 | | |
1090 | 1095 | | |
| |||
1093 | 1098 | | |
1094 | 1099 | | |
1095 | 1100 | | |
1096 | | - | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
1097 | 1106 | | |
1098 | 1107 | | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
1099 | 1111 | | |
1100 | 1112 | | |
1101 | | - | |
1102 | 1113 | | |
1103 | | - | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
1104 | 1118 | | |
1105 | 1119 | | |
1106 | | - | |
1107 | | - | |
1108 | | - | |
| 1120 | + | |
1109 | 1121 | | |
1110 | 1122 | | |
1111 | 1123 | | |
| |||
0 commit comments