cheogram-aapl

created pr with cheogram-aapl/jump-to-unread.1 on 2026-11-16T21:16:13Z · by d7025af3
commented on 2026-11-18T16:35:57Z · by 3c31bc8c
lgtm
cmds
checkout latest patchset:
ssh pr.pico.sh pull cheogram-aapl:jump-to-unread | git am -3
checkout specific patchset revision:
ssh pr.pico.sh pull cheogram-aapl:jump-to-unread [rev] | git am -3
add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh cheogram-aapl:jump-to-unread
add comment to patch request:
ssh pr.pico.sh comment cheogram-aapl:jump-to-unread "lgtm!"

Patchset cheogram-aapl/jump-to-unread.1 on 2026-11-16T21:16:13Z · commit 07db0bc

+7 -7 App.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved #
......@@ -6,8 +6,8 @@
66 "kind" : "remoteSourceControl",
77 "location" : "https://github.com/exyte/ActivityIndicatorView",
88 "state" : {
9- "revision" : "36140867802ae4a1d2b11490bcbbefe058001d14",
10- "version" : "1.2.1"
9+ "revision" : "41f89372c018decaf965e8dddeb6e5347741beb4",
10+ "version" : "2.0.2"
1111 }
1212 },
1313 {
......@@ -25,7 +25,7 @@
2525 "location" : "https://github.com/singpolyma/Chat.git",
2626 "state" : {
2727 "branch" : "main",
28- "revision" : "6db12b986ce3918427485552eaf25110f04c4b25"
28+ "revision" : "fdf59adca57ecb8a5085d7be3def1b3e8cb7d206"
2929 }
3030 },
3131 {
......@@ -33,8 +33,8 @@
3333 "kind" : "remoteSourceControl",
3434 "location" : "https://github.com/Giphy/giphy-ios-sdk",
3535 "state" : {
36- "revision" : "3ba672878445c53c8cb87d57c3ae5cc1f3166b5b",
37- "version" : "2.3.2"
36+ "revision" : "37f5b1ff6cf8bc4a78c0bc5eb1b814381bac9580",
37+ "version" : "2.2.16"
3838 }
3939 },
4040 {
......@@ -69,8 +69,8 @@
6969 "kind" : "remoteSourceControl",
7070 "location" : "https://github.com/exyte/MediaPicker.git",
7171 "state" : {
72- "revision" : "5c9a8df948602a9d61239b2dd8d5bbc9b38428d9",
73- "version" : "3.2.5"
72+ "revision" : "3d1db8d5b1f553d066d67a57590f211ab534a531",
73+ "version" : "3.4.7"
7474 }
7575 },
7676 {
+6 -7 App/App.swift #
......@@ -360,15 +360,15 @@ class ChatViewModel {
360360 attachment.mime.hasPrefix("audio/")
361361 }
362362
363- let (styledText, text) = if let moderationReason = message.moderationReason() {
364- ({
363+ let styledText = if let moderationReason = message.moderationReason() {
364+ {
365365 var s = AttributedString(moderationReason)
366366 s.font = Font.body.italic()
367367 s.foregroundColor = .gray
368- return (s, moderationReason)
369- })()
368+ return s
369+ }()
370370 } else {
371- (AttributedString(html: message.body()), message.body().toPlainText())
371+ AttributedString(html: message.body())
372372 }
373373
374374 let replyMessage: ReplyMessage? = if let replyTo = message.replyToMessage {
......@@ -382,8 +382,7 @@ class ChatViewModel {
382382 user: await user(chat, message.senderId, message.senderMemberStub()),
383383 status: Self.mapStatus(message.status),
384384 createdAt: parseDate(date: message.timeSent)!,
385- text: text,
386- styledText: styledText,
385+ attributedText: styledText,
387386 attachments: otherAttachments.map {
388387 Attachment(
389388 id: $0.hashes.first?.toUri() ?? UUID().uuidString,
+61 -57 App/ChatDetailView.swift #
......@@ -79,7 +79,7 @@ struct ChatDetailView: View {
7979 @State var moderationMessage: ChatMessage? = nil
8080 @ScaledMetric(relativeTo: .largeTitle) var profileAvatarSize: CGFloat = 160
8181
82- var body: some View {
82+ private var chatList: some View {
8383 ChatView(messages: viewModel.messages) { toSend in
8484 Task {
8585 let builder =
......@@ -148,48 +148,6 @@ struct ChatDetailView: View {
148148 }
149149 self.viewModel.chat?.sendMessage(message: builder)
150150 }
151- } lhsAccessoryViewBuilder: {
152- AnyView(
153- Button {
154- self.currentThread = UUID().uuidString
155- } label: {
156- if let currentThread {
157- WebImage(
158- url: URL(
159- string: Borogove.Identicon.svg(
160- source: currentThread
161- ).removingPercentEncoding!
162- )
163- )
164- .resizable()
165- .scaledToFit()
166- .frame(width: 20, height: 20)
167- .padding(
168- EdgeInsets(
169- top: 12,
170- leading: 6,
171- bottom: 14,
172- trailing: 12
173- )
174- )
175- } else {
176- Label("thread", systemImage: "number")
177- .scaledToFit()
178- .foregroundStyle(Color.primary)
179- .labelStyle(.iconOnly)
180- .frame(width: 24, height: 24)
181- .padding(
182- EdgeInsets(
183- top: 12,
184- leading: 0,
185- bottom: 12,
186- trailing: 12
187- )
188- )
189- }
190- }
191- .opacity(0.5)
192- )
193151 } messageMenuAction: {
194152 (
195153 selectedMenuAction: MessageMenuAction,
......@@ -235,14 +193,57 @@ struct ChatDetailView: View {
235193 requestModerationReason = true
236194 }
237195 }
238- } messageMenuActionFilter: { (action: MessageMenuAction, message: Message) in
196+ }
197+ .lhsAccessoryViewBuilder {
198+ Button {
199+ self.currentThread = UUID().uuidString
200+ } label: {
201+ if let currentThread {
202+ WebImage(
203+ url: URL(
204+ string: Borogove.Identicon.svg(
205+ source: currentThread
206+ ).removingPercentEncoding!
207+ )
208+ )
209+ .resizable()
210+ .scaledToFit()
211+ .frame(width: 20, height: 20)
212+ .padding(
213+ EdgeInsets(
214+ top: 12,
215+ leading: 6,
216+ bottom: 14,
217+ trailing: 12
218+ )
219+ )
220+ } else {
221+ Label("thread", systemImage: "number")
222+ .scaledToFit()
223+ .foregroundStyle(Color.primary)
224+ .labelStyle(.iconOnly)
225+ .frame(width: 24, height: 24)
226+ .padding(
227+ EdgeInsets(
228+ top: 12,
229+ leading: 0,
230+ bottom: 12,
231+ trailing: 12
232+ )
233+ )
234+ }
235+ }
236+ .opacity(0.5)
237+ }
238+ .messageMenuActionFilter { (action: MessageMenuAction, message: Message) in
239239 switch action {
240240 case .moderate:
241241 return viewModel.chat!.canModerate()
242242 default:
243243 return true;
244244 }
245- }.tapAvatarClosure { user, messageId in
245+ }
246+ .tapAvatarClosure { user, messageId in
246247 currentThread = viewModel.messageData[messageId]?.threadId
247248 Task {
248249 showProfile = await viewModel.chat!.getMemberDetails(memberIds: [user.id])[0]
......@@ -270,10 +271,8 @@ struct ChatDetailView: View {
270271 }
271272 }
272273 .linkPreviewsDisabled()
273- .enableLoadMore(pageSize: 10) { before in
274- Task {
275- await viewModel.loadMessagesBefore(message: before)
276- }
274+ .enableLoadMoreOlderMessages {
275+ viewModel.loadMessagesBefore(message: viewModel.messages.first)
277276 }.setRecorderSettings(
278277 RecorderSettings(
279278 audioFormatID: kAudioFormatOpus,
......@@ -400,14 +399,19 @@ struct ChatDetailView: View {
400399 }
401400 moderationMessage = nil
402401 }
403- }.onChange(of: viewModel.chat?.chatId) { _, chatId in
404- currentThread = nil
405- }.onChange(of: viewModel.messages) { _, _ in
406- if let lastM = viewModel.messages.last,
407- let last = viewModel.messageData[lastM.id]
408- {
409- viewModel.chat?.markReadUpTo(message: last)
410- }
411402 }
412403 }
404+
405+ var body: some View {
406+ chatList
407+ .onChange(of: viewModel.chat?.chatId) { _, chatId in
408+ currentThread = nil
409+ }.onChange(of: viewModel.messages) { _, _ in
410+ if let lastM = viewModel.messages.last,
411+ let last = viewModel.messageData[lastM.id]
412+ {
413+ viewModel.chat?.markReadUpTo(message: last)
414+ }
415+ }
416+ }
413417 }
Back to top