Skip to content

Commit f8984ca

Browse files
fix: advance delivery indicator past Sent and add distinct double-tick
The notify_message_delivery zome input uses serde rename_all=camelCase, so it expects messageRecord, but the client sent message_record. The payload failed to deserialize, the call threw, delivery acks were never recorded, and the indicator was stuck on a single tick. Send messageRecord to match. Also render a dedicated double-check glyph for delivered messages instead of overlapping two single checks.
1 parent 6a28ce4 commit f8984ca

4 files changed

Lines changed: 14 additions & 12 deletions

File tree

ui/src/lib/svgIcons.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ export const svgIcons: { [key: string]: string } = {
2828
'<svg width="100%" height="100%" fill="currentColor" viewBox="0 0 19 34" xmlns="http://www.w3.org/2000/svg"><path d="M13.5399 16.6671L0.647818 29.5588C0.247376 29.9764 0.0265009 30.5342 0.0325567 31.1128C0.0386144 31.6913 0.271122 32.2444 0.68022 32.6535C1.08932 33.0626 1.64243 33.2951 2.22095 33.3011C2.79947 33.3072 3.35733 33.0863 3.7749 32.6859L17.7453 18.7151C17.9495 18.6117 18.1441 18.4851 18.3145 18.3146C18.5294 18.0992 18.6972 17.8415 18.8074 17.5578C18.9176 17.2742 18.9676 16.9707 18.9545 16.6667C18.9676 16.3627 18.9176 16.0593 18.8074 15.7756C18.6972 15.492 18.5294 15.2342 18.3145 15.0188C18.1441 14.8488 17.9495 14.7217 17.7453 14.6188L3.7749 0.647555C3.56955 0.442229 3.32576 0.27936 3.05747 0.16825C2.78917 0.0571351 2.50161 -4.34002e-05 2.21122 -2.43521e-05C1.92082 -5.30401e-06 1.63327 0.0572113 1.36499 0.16836C1.0967 0.279509 0.852941 0.442408 0.647613 0.647761C0.442286 0.853117 0.279414 1.0969 0.168303 1.3652C0.0571908 1.6335 1.41874e-05 1.92106 3.32355e-05 2.21145C5.22836e-05 2.50185 0.0572689 2.7894 0.168418 3.05768C0.279565 3.32596 0.442466 3.56973 0.64782 3.77505L13.5399 16.6671Z" /></svg>',
2929
checkMark:
3030
'<svg width="100%" height="100%" fill="currentColor" viewBox="0 0 30 22" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M29.4509 0.568609C30.1831 1.32673 30.183 2.55586 29.4508 3.31395L11.9508 21.4314C11.2186 22.1895 10.0315 22.1895 9.29923 21.4315L0.549234 12.3731C-0.183032 11.6151 -0.183085 10.3859 0.549116 9.6278C1.28132 8.86966 2.4685 8.8696 3.20077 9.62767L10.625 17.3135L26.7992 0.568548C27.5315 -0.18954 28.7186 -0.189512 29.4509 0.568609Z" /></svg>',
31+
doubleCheck:
32+
'<svg width="100%" height="100%" fill="currentColor" viewBox="0 0 41 22" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M29.4509 0.568609C30.1831 1.32673 30.183 2.55586 29.4508 3.31395L11.9508 21.4314C11.2186 22.1895 10.0315 22.1895 9.29923 21.4315L0.549234 12.3731C-0.183032 11.6151 -0.183085 10.3859 0.549116 9.6278C1.28132 8.86966 2.4685 8.8696 3.20077 9.62767L10.625 17.3135L26.7992 0.568548C27.5315 -0.18954 28.7186 -0.189512 29.4509 0.568609Z" /><path transform="translate(11 0)" fill-rule="evenodd" clip-rule="evenodd" d="M29.4509 0.568609C30.1831 1.32673 30.183 2.55586 29.4508 3.31395L11.9508 21.4314C11.2186 22.1895 10.0315 22.1895 9.29923 21.4315L0.549234 12.3731C-0.183032 11.6151 -0.183085 10.3859 0.549116 9.6278C1.28132 8.86966 2.4685 8.8696 3.20077 9.62767L10.625 17.3135L26.7992 0.568548C27.5315 -0.18954 28.7186 -0.189512 29.4509 0.568609Z" /></svg>',
3133
cancel:
3234
'<svg width="100%" height="100%" fill="currentColor" viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"><path d="M15 0.75C7.13004 0.75 0.75 7.13004 0.75 15C0.75 22.87 7.13004 29.25 15 29.25C22.87 29.25 29.25 22.87 29.25 15C29.25 7.13004 22.87 0.75 15 0.75ZM15 4.50013C17.1842 4.50013 19.2117 5.16829 20.8924 6.30908L6.30988 20.8916C5.16829 19.2117 4.50092 17.1834 4.50092 14.9992C4.50012 9.20104 9.20104 4.50013 15 4.50013ZM15 25.4999C12.8158 25.4999 10.7883 24.8317 9.10763 23.6909L23.6901 9.10842C24.8317 10.7883 25.4991 12.8166 25.4991 15.0008C25.4999 20.799 20.799 25.4999 15 25.4999Z" /></svg>',
3335
copy: '<svg width="100%" height="100%" fill="currentColor" viewBox="0 0 29 33" xmlns="http://www.w3.org/2000/svg"><path d="M21 0H3C1.3425 0 0 1.3425 0 3V24H3V3H21V0ZM25.5 6H9C7.3425 6 6 7.3425 6 9V30C6 31.6575 7.3425 33 9 33H25.5C27.1575 33 28.5 31.6575 28.5 30V9C28.5 7.3425 27.1575 6 25.5 6ZM25.5 30H9V9H25.5V30Z" /></svg>',

ui/src/lib/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export interface SendMessageInput {
132132

133133
export interface NotifyMessageDeliveryInput {
134134
agent: AgentPubKey;
135-
message_record: MessageRecord;
135+
messageRecord: MessageRecord;
136136
}
137137

138138
export interface DeleteMessageInput {

ui/src/routes/conversations/[id]/DeliveryStatusIndicator.svelte

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@
66
export let deliveredCount: number = 0;
77
export let recipientCount: number = 0;
88
9-
$: showDouble =
10-
status === DeliveryStatus.DeliveredPartial || status === DeliveryStatus.DeliveredAll;
9+
$: icon =
10+
status === DeliveryStatus.DeliveredPartial || status === DeliveryStatus.DeliveredAll
11+
? "doubleCheck"
12+
: "checkMark";
13+
1114
$: colorClass =
1215
status === DeliveryStatus.DeliveredAll
1316
? "text-primary-500"
1417
: "text-secondary-400 dark:text-secondary-300";
15-
$: showCount =
16-
status === DeliveryStatus.DeliveredPartial && recipientCount > 1;
18+
19+
$: showCount = status === DeliveryStatus.DeliveredPartial && recipientCount > 1;
1720
</script>
1821

1922
<span
20-
class="inline-flex items-center gap-0.5 text-xxs {colorClass}"
23+
class="inline-flex items-center gap-0.5 leading-none {colorClass}"
2124
aria-label="delivery status {status}"
2225
>
23-
<SvgIcon icon="checkMark" size="h-2.5 w-2.5" />
24-
{#if showDouble}
25-
<SvgIcon icon="checkMark" size="h-2.5 w-2.5" moreClasses="-ml-1" />
26-
{/if}
26+
<SvgIcon {icon} size="h-3 w-3" />
2727
{#if showCount}
28-
<span class="ml-0.5 text-xxs leading-none">{deliveredCount}/{recipientCount}</span>
28+
<span class="text-xxs leading-none">{deliveredCount}/{recipientCount}</span>
2929
{/if}
3030
</span>

ui/src/store/ConversationMessageStore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ const paginationState = writable<Record<string, PaginationState>>({});
840840
try {
841841
const delivered = await client.notifyMessageDelivery(cellId, {
842842
agent,
843-
message_record: messageRecord,
843+
messageRecord,
844844
});
845845
return { agentB64: encodeHashToBase64(agent), delivered };
846846
} catch (err) {

0 commit comments

Comments
 (0)