cheogram-aapl
created pr with
cheogram-aapl/jump-to-unread.1
commented
lgtm
cmds
checkout latest patchset:
ssh pr.pico.sh pull cheogram-aapl:jump-to-unread | git am -3checkout specific patchset revision:
ssh pr.pico.sh pull cheogram-aapl:jump-to-unread [rev] | git am -3add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh cheogram-aapl:jump-to-unreadadd comment to patch request:
ssh pr.pico.sh comment cheogram-aapl:jump-to-unread "lgtm!"
Patchset
cheogram-aapl/jump-to-unread.1
Update to the latest ExyteChat (fork)
Stephen Paul Weber
Open at the first unread message and mark read only what is visible
2026-11-16T20:04:24ZStephen Paul Weber
→ Use canReplace
2026-11-16T20:05:22ZStephen Paul Weber
Add temporary XYZZY probes around newer-page fetches
2026-11-16T20:05:22ZStephen Paul Weber
2026-11-16T20:05:22Z
Use canReplace
Stephen Paul Weber
2026-11-16T20:05:22ZSemantic diff summary
0 added,
0 modified,
0 signature changed,
0 removed
across 0 analyzed files
(1 file skipped: unsupported file type)
+6
-22
App/App.swift
#
| ... | ... | @@ -424,13 +424,11 @@ class ChatViewModel { | |
| 424 | 424 | ||
| 425 | 425 | func messageIndex(for message: Borogove.ChatMessage) -> Int? { | |
| 426 | 426 | messages.firstIndex { m in | |
| 427 | - | let dta = messageData[m.id] | |
| 428 | - | return | |
| 429 | - | (dta?.serverId != nil | |
| 430 | - | && dta?.serverId == message.serverId) | |
| 431 | - | || (dta?.localId == message.localId | |
| 432 | - | && (!message.isIncoming() | |
| 433 | - | || message.versions.count > 0)) | |
| 427 | + | if let data = messageData[m.id] { | |
| 428 | + | message.canReplace(other: data) | |
| 429 | + | } else { | |
| 430 | + | false | |
| 431 | + | } | |
| 434 | 432 | } | |
| 435 | 433 | } | |
| 436 | 434 |
| ... | ... | @@ -487,20 +485,6 @@ class ChatViewModel { | |
| 487 | 485 | return built | |
| 488 | 486 | } | |
| 489 | 487 | ||
| 490 | - | private func isNewest( | |
| 491 | - | _ message: Borogove.ChatMessage, | |
| 492 | - | in chat: Borogove.Chat | |
| 493 | - | ) -> Bool { | |
| 494 | - | guard let last = chat.lastMessage else { return true } | |
| 495 | - | if let serverID = message.serverId, let lastServerID = last.serverId { | |
| 496 | - | return serverID == lastServerID | |
| 497 | - | } | |
| 498 | - | if let localID = message.localId, let lastLocalID = last.localId { | |
| 499 | - | return localID == lastLocalID | |
| 500 | - | } | |
| 501 | - | return false | |
| 502 | - | } | |
| 503 | - | ||
| 504 | 488 | func markRead(upTo message: Message) { | |
| 505 | 489 | guard let chat, messageData[message.id] != nil else { return } | |
| 506 | 490 | // Debounce |
| ... | ... | @@ -556,7 +540,7 @@ class ChatViewModel { | |
| 556 | 540 | isCaughtUpToNewest = exhausted | |
| 557 | 541 | || messages.last | |
| 558 | 542 | .flatMap { messageData[$0.id] } | |
| 559 | - | .map { isNewest($0, in: chat) } ?? true | |
| 543 | + | .map { chat.lastMessage?.canReplace(other: $0) ?? true } ?? true | |
| 560 | 544 | } | |
| 561 | 545 | ||
| 562 | 546 | func jumpToNewest() async { |