Commit d75373b
msglist: Make mark-as-read button listen to the Unreads model
Instead of just listening to PerAccountStore and (via an ancestor
widget) a MessageListView.
Issue zulip#370 is relevant here -- "Maintain total unread counts
efficiently". The button causes linear scans through Unreads each
time it rebuilds, and ideally we'd avoid that, especially since now
it'll rebuild in more cases than it was before. I think the
additional cases aren't very many, though: I've thought of just one
kind of Zulip event that would cause Unreads but not PerAccountStore
and MessageListView to notify listeners, and I added a test
exercising that.1 parent ab1bb45 commit d75373b
File tree
2 files changed
+66
-3
lines changed- lib/widgets
- test/widgets
2 files changed
+66
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
1499 | 1500 | | |
1500 | 1501 | | |
1501 | 1502 | | |
1502 | | - | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
1503 | 1506 | | |
1504 | 1507 | | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
1505 | 1527 | | |
1506 | 1528 | | |
1507 | 1529 | | |
| |||
1512 | 1534 | | |
1513 | 1535 | | |
1514 | 1536 | | |
1515 | | - | |
1516 | | - | |
| 1537 | + | |
1517 | 1538 | | |
1518 | 1539 | | |
1519 | 1540 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1211 | 1211 | | |
1212 | 1212 | | |
1213 | 1213 | | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
1214 | 1256 | | |
1215 | 1257 | | |
1216 | 1258 | | |
| |||
0 commit comments