Commit 68ecf4f
authored
Introduce
* Introduction of ChatMessageViewModel
* Add ChatChannelViewModel and ChatMessageViewModel as environment objects
* Extract the Message View Model to a separate file
* Fix show original text not working properly
* Extract some properties from the view to the MessageViewModel
* Fix MessageContainerView_Tests
* Fix MessageListView_Tests
* Fix MessageListViewAvatars_Tests
* Use EnvironmentObject for the main container and EnvironmentValue for the child views
* Fix existing unit tests
* Add Stream's show original translation button + make it configurable
* Add test coverage to show original text feature
* Fix reaction overlay tests
* Fix message container tests
* Refactor code to avoid environment objects in MessageContainerView
* Provide view model by default
* Add warning about thread-safeness in the singletone store
* Example of performing translations from message actions
* Revert "Example of performing translations from message actions"
This reverts commit afd7e0e.
* Fix reactions overlay view not shown correct translated or original text
* Open `ChatChannelViewModel.messageActionExecuted` so that it can be observed from channel view model
* Rename originalTextTranslationsStore to originalTranslationsStore
* Make the LinkDetectionTextView change wheneve the translations store changes
* Clear the original translations when opening the channel
* Add TODO v5 comments
* PR Feedback
* Refactor using utils
* Reapply "Example of performing translations from message actions"
This reverts commit 4584aa7.
* Revert "Reapply "Example of performing translations from message actions""
This reverts commit 33520f9.
* Update CHANGELOG.md
* Fix editing message not working
* Revert "Fix MessageListView_Tests"
This reverts commit b3b00ef.
* Revert "Fix MessageListViewAvatars_Tests"
This reverts commit 43df718.
* Revert "Fix MessageContainerView_Tests"
This reverts commit ab0e511.
# Conflicts:
# Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageContainerView.swift
# StreamChatSwiftUITests/Tests/ChatChannel/MessageContainerView_Tests.swift
* Revert "Fix existing unit tests"
This reverts commit bd695bf.
# Conflicts:
# Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageListView.swift
* Revert "Fix message container tests"
This reverts commit ab8f758.
# Conflicts:
# StreamChatSwiftUITests/Tests/ChatChannel/MessageContainerView_Tests.swift
* Fix message container tests
* Allow providing custom view models to reactions viewMessageViewModel + Show original translated message (#815)1 parent 15a0f70 commit 68ecf4f
File tree
22 files changed
+476
-116
lines changed- DemoAppSwiftUI
- Sources/StreamChatSwiftUI
- ChatChannel
- MessageList
- Reactions
- Generated
- Resources/en.lproj
- StreamChatSwiftUI.xcodeproj
- StreamChatSwiftUITests/Tests/ChatChannel
- __Snapshots__/MessageContainerView_Tests
22 files changed
+476
-116
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| |||
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | | - | |
| 224 | + | |
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| |||
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
493 | | - | |
| 493 | + | |
494 | 494 | | |
495 | 495 | | |
496 | 496 | | |
497 | 497 | | |
498 | 498 | | |
499 | 499 | | |
500 | 500 | | |
| 501 | + | |
501 | 502 | | |
502 | 503 | | |
503 | 504 | | |
| |||
Lines changed: 35 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | 45 | | |
49 | 46 | | |
50 | 47 | | |
| |||
55 | 52 | | |
56 | 53 | | |
57 | 54 | | |
58 | | - | |
| 55 | + | |
| 56 | + | |
59 | 57 | | |
60 | 58 | | |
61 | 59 | | |
| |||
65 | 63 | | |
66 | 64 | | |
67 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
68 | 72 | | |
69 | 73 | | |
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
73 | 77 | | |
74 | | - | |
| 78 | + | |
75 | 79 | | |
76 | 80 | | |
77 | | - | |
| 81 | + | |
78 | 82 | | |
79 | 83 | | |
80 | | - | |
| 84 | + | |
81 | 85 | | |
82 | | - | |
| 86 | + | |
83 | 87 | | |
84 | 88 | | |
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
88 | 92 | | |
89 | 93 | | |
90 | | - | |
91 | | - | |
| 94 | + | |
| 95 | + | |
92 | 96 | | |
93 | 97 | | |
94 | 98 | | |
| |||
115 | 119 | | |
116 | 120 | | |
117 | 121 | | |
118 | | - | |
119 | | - | |
120 | | - | |
| 122 | + | |
121 | 123 | | |
122 | 124 | | |
123 | 125 | | |
| |||
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
146 | | - | |
| 148 | + | |
147 | 149 | | |
148 | 150 | | |
149 | 151 | | |
| |||
235 | 237 | | |
236 | 238 | | |
237 | 239 | | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
243 | 244 | | |
| 245 | + | |
244 | 246 | | |
245 | 247 | | |
246 | 248 | | |
| |||
249 | 251 | | |
250 | 252 | | |
251 | 253 | | |
252 | | - | |
| 254 | + | |
253 | 255 | | |
254 | 256 | | |
255 | 257 | | |
256 | | - | |
257 | | - | |
258 | | - | |
| 258 | + | |
259 | 259 | | |
260 | | - | |
| 260 | + | |
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | | - | |
| 274 | + | |
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
281 | | - | |
| 281 | + | |
| 282 | + | |
282 | 283 | | |
283 | 284 | | |
284 | | - | |
| 285 | + | |
285 | 286 | | |
286 | | - | |
287 | | - | |
| 287 | + | |
| 288 | + | |
288 | 289 | | |
289 | 290 | | |
290 | 291 | | |
291 | 292 | | |
292 | 293 | | |
293 | 294 | | |
294 | 295 | | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
295 | 299 | | |
296 | 300 | | |
297 | 301 | | |
298 | 302 | | |
299 | 303 | | |
300 | 304 | | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
310 | | - | |
| 310 | + | |
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| 151 | + | |
151 | 152 | | |
152 | 153 | | |
153 | 154 | | |
| |||
167 | 168 | | |
168 | 169 | | |
169 | 170 | | |
| 171 | + | |
170 | 172 | | |
171 | 173 | | |
172 | 174 | | |
| |||
190 | 192 | | |
191 | 193 | | |
192 | 194 | | |
| 195 | + | |
193 | 196 | | |
194 | 197 | | |
195 | 198 | | |
| |||
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| |||
603 | 602 | | |
604 | 603 | | |
605 | 604 | | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
606 | 609 | | |
607 | 610 | | |
608 | 611 | | |
| |||
612 | 615 | | |
613 | 616 | | |
614 | 617 | | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
615 | 627 | | |
Lines changed: 63 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
0 commit comments