on master help sign in
Fix ackedIds eviction and domain validation bugs; refactor delivery animation
commit0d03f1bdd33b9baa676eedaa02322245f79c2c0d authoriko <mail@iko.soy> dateWed 22 Apr 2026, 11:01 (6 months ago) parent71b07d1
2 files changed+8−12
client/ViewChat.fs+6−9 server.knot+2−3
client/ViewChat.fs+6−9
@@ -55,8 +55,8 @@ module ViewChat =
5555 | None -> ()
5656 , Avalonia.Threading.DispatcherPriority.Background) |> ignore
5757
58− let private opacityTransition =
59− DoubleTransition(Avalonia.Visual.OpacityProperty, System.TimeSpan.FromMilliseconds 500.)
58+ let private strokeTransition =
59+ DoubleTransition(Avalonia.Controls.Shapes.Shape.StrokeThicknessProperty, System.TimeSpan.FromMilliseconds 800.)
6060
6161 let private messageItem m =
6262 let align, cols, col =
@@ -82,18 +82,15 @@ module ViewChat =
8282 Rectangle()
8383 .stroke(Avalonia.Media.Colors.Black)
8484 .strokeThickness(4.)
85+ .strokeDashArray([ 4.; 2. ])
8586 .isHitTestVisible(false)
86− .opacity(if isSent then 0. else 1.)
87− .transition (opacityTransition)
87+ .classes("marching")
8888
8989 Rectangle()
9090 .stroke(Avalonia.Media.Colors.Black)
91− .strokeThickness(4.)
92− .strokeDashArray([ 4.; 2. ])
91+ .strokeThickness(if isSent then 0. else 4.)
9392 .isHitTestVisible(false)
94− .opacity(if isSent then 1. else 0.)
95− .classes("marching")
96− .transition (opacityTransition)
93+ .transition (strokeTransition)
9794 | Incoming ->
9895 Rectangle()
9996 .stroke(Avalonia.Media.Colors.Black)
server.knot+2−3
@@ -350,6 +350,7 @@ isHighOctetPrefix = \sn ->
350350 && let d2 = take 1 (drop 1 sn) in
351351 let d3 = take 1 (drop 2 sn) in
352352 take 1 (drop 3 sn) == "."
353+ && isDigitChar (take 1 (drop 4 sn))
353354 && ((d2 == "2" && contains d3 "456789")
354355 || (contains d2 "34" && isDigitChar d3)
355356 || (d2 == "5" && contains d3 "012345"))
@@ -447,9 +448,7 @@ dedupMessageIds = \messageIds ->
447448
448449evictOldestAckedIds = \items n ->
449450 if n <= 0 then items
450− else do
451− ii <- items
452− diff items (takeRelation n ( sortBy (\a -> a.ackedAt) items))
451+ else diff items (takeRelation n (sortBy (\a -> a.ackedAt) items))
453452
454453safeCompareLoop : Text -> Text -> Int -> Int -> Int
455454safeCompareLoop = \s1 s2 n result ->