From 77b4d193b0db728f42752b47ad0c3fbcdfc8d766 Mon Sep 17 00:00:00 2001
From: techyminati
Date: Tue, 25 Aug 2026 21:30:54 +0530
Subject: [PATCH 1/8] volla-messages: add message forwarding
Add a Forward action to messages, letting users send an existing
message's text and attachments to another conversation.
Change-Id: I8e6c0c45736115d7e12f8dfae8ff85c5d63bfb6f
---
ui/src/routes/conversations/[id]/+page.svelte | 81 ++++++++++++++++++-
.../[id]/ConversationMessages.svelte | 1 +
.../conversations/[id]/ForwardDialog.svelte | 40 +++++++++
.../routes/conversations/[id]/Message.svelte | 2 +-
.../conversations/[id]/MessageActions.svelte | 12 +++
ui/src/translations/locales/en.json | 5 ++
ui/src/translations/locales/hi.json | 5 ++
7 files changed, 143 insertions(+), 3 deletions(-)
create mode 100644 ui/src/routes/conversations/[id]/ForwardDialog.svelte
diff --git a/ui/src/routes/conversations/[id]/+page.svelte b/ui/src/routes/conversations/[id]/+page.svelte
index 0811413c..551893ab 100644
--- a/ui/src/routes/conversations/[id]/+page.svelte
+++ b/ui/src/routes/conversations/[id]/+page.svelte
@@ -1,11 +1,21 @@
+
+
diff --git a/ui/src/routes/conversations/[id]/Message.svelte b/ui/src/routes/conversations/[id]/Message.svelte
index 177ff9c5..670f778e 100644
--- a/ui/src/routes/conversations/[id]/Message.svelte
+++ b/ui/src/routes/conversations/[id]/Message.svelte
@@ -116,7 +116,7 @@
{#if isSelected}
-
+
{/if}
diff --git a/ui/src/routes/conversations/[id]/MessageActions.svelte b/ui/src/routes/conversations/[id]/MessageActions.svelte
index 278dc494..bcb4f729 100644
--- a/ui/src/routes/conversations/[id]/MessageActions.svelte
+++ b/ui/src/routes/conversations/[id]/MessageActions.svelte
@@ -21,6 +21,7 @@
const dispatch = createEventDispatcher<{
delete: ActionHashB64;
+ forward: MessageExtended;
}>();
const myPubKeyB64 = getContext<{ getMyPubKeyB64: () => AgentPubKeyB64 }>(
@@ -107,6 +108,17 @@
{/if}
+ {#if hasText || message.message.images.length > 0}
+ dispatch("forward", message)}
+ icon="share"
+ moreClassesButton="bg-tertiary-600 dark:bg-secondary-700 dark:text-tertiary-400"
+ moreClasses="w-[30px]"
+ >
+ {$t("common.forward")}
+
+ {/if}
+
{#if iAmAuthor}
dispatch("delete", actionHashB64)}
diff --git a/ui/src/translations/locales/en.json b/ui/src/translations/locales/en.json
index 9efcde0a..e24c2901 100644
--- a/ui/src/translations/locales/en.json
+++ b/ui/src/translations/locales/en.json
@@ -51,7 +51,12 @@
"error_sending_message": "Failed to send message",
"first": "First",
"first_name": "First Name",
+ "forward": "Forward",
+ "forward_error": "Failed to forward message",
+ "forward_success": "Message forwarded",
+ "forward_to": "Forward to",
"group_name": "Group name",
+ "no_conversations_to_forward": "No other conversations to forward to",
"holochain_connect_error": "Error connecting to Holochain",
"images": "{{count}} {{count; 1:image; default:images;}}",
"files": "{{count}} {{count; 1:file; default:files;}}",
diff --git a/ui/src/translations/locales/hi.json b/ui/src/translations/locales/hi.json
index 9f5fd443..35172306 100644
--- a/ui/src/translations/locales/hi.json
+++ b/ui/src/translations/locales/hi.json
@@ -51,7 +51,12 @@
"error_sending_message": "संदेश भेजने में विफल",
"first": "पहला",
"first_name": "पहला नाम",
+ "forward": "अग्रेषित करें",
+ "forward_error": "संदेश अग्रेषित करने में विफल",
+ "forward_success": "संदेश अग्रेषित किया गया",
+ "forward_to": "इन्हें अग्रेषित करें",
"group_name": "समूह का नाम",
+ "no_conversations_to_forward": "अग्रेषित करने के लिए कोई अन्य बातचीत नहीं है",
"holochain_connect_error": "Holochain से कनेक्ट करने में त्रुटि",
"images": "{{count}} {{count; 1:छवि; default:छवियाँ;}}",
"files": "{{count}} {{count; 1:फ़ाइल; default:फ़ाइलें;}}",
From 15efd58e2853f305663cccb4f771739cb1da7acf Mon Sep 17 00:00:00 2001
From: techyminati
Date: Tue, 25 Aug 2026 21:49:35 +0530
Subject: [PATCH 2/8] volla-messages Star messages to bookmark them
Adds a star toggle to the message actions. Starred messages are
remembered locally by action hash and show a small star under the
bubble. Handy for pinning something important without sharing that
choice with anyone else.
Change-Id: I967cee4bbf1d0e56b19b5a0af91b0a13898a4bb5
Signed-off-by: techyminati
---
ui/src/lib/svgIcons.ts | 8 ++++++++
.../routes/conversations/[id]/Message.svelte | 8 ++++++++
.../conversations/[id]/MessageActions.svelte | 12 +++++++++++
ui/src/store/StarStore.ts | 20 +++++++++++++++++++
ui/src/translations/locales/en.json | 2 ++
ui/src/translations/locales/hi.json | 2 ++
6 files changed, 52 insertions(+)
create mode 100644 ui/src/store/StarStore.ts
diff --git a/ui/src/lib/svgIcons.ts b/ui/src/lib/svgIcons.ts
index ff2a3c0d..8a1bb450 100644
--- a/ui/src/lib/svgIcons.ts
+++ b/ui/src/lib/svgIcons.ts
@@ -18,6 +18,14 @@ export const svgIcons: { [key: string]: string } = {
'',
arrowRight:
'',
+ bell:
+ '',
+ bellOff:
+ '',
+ star:
+ '',
+ starFilled:
+ '',
betaTag:
'',
caretDown:
diff --git a/ui/src/routes/conversations/[id]/Message.svelte b/ui/src/routes/conversations/[id]/Message.svelte
index 670f778e..dd0231c3 100644
--- a/ui/src/routes/conversations/[id]/Message.svelte
+++ b/ui/src/routes/conversations/[id]/Message.svelte
@@ -11,6 +11,8 @@
import MessageFilePreview from "./MessageFilePreview.svelte";
import { encodeHashToBase64, type ActionHashB64, type AgentPubKeyB64 } from "@holochain/client";
import AgentNickname from "$lib/AgentNickname.svelte";
+ import SvgIcon from "$lib/SvgIcon.svelte";
+ import { starredMessages } from "$store/StarStore";
import { openUrl } from "@tauri-apps/plugin-opener";
import DeliveryStatusIndicator from "./DeliveryStatusIndicator.svelte";
import { computeDeliveryStatus } from "$lib/utils";
@@ -112,6 +114,12 @@
recipientCount={recipientPubKeyB64s.length}
/>{/if}
+
+ {#if $starredMessages[actionHashB64]}
+
+
+
+ {/if}
diff --git a/ui/src/routes/conversations/[id]/MessageActions.svelte b/ui/src/routes/conversations/[id]/MessageActions.svelte
index bcb4f729..63b3a254 100644
--- a/ui/src/routes/conversations/[id]/MessageActions.svelte
+++ b/ui/src/routes/conversations/[id]/MessageActions.svelte
@@ -11,6 +11,7 @@
import { createEventDispatcher, getContext } from "svelte";
import { page } from "$app/stores";
import { encodeHashToBase64, type ActionHashB64, type AgentPubKeyB64 } from "@holochain/client";
+ import { starredMessages, toggleStar } from "$store/StarStore";
const fileStore = getContext<{
getStore: () => FileStore;
}>("fileStore").getStore();
@@ -108,6 +109,17 @@
{/if}
+ toggleStar(actionHashB64)}
+ icon={$starredMessages[actionHashB64] ? "starFilled" : "star"}
+ moreClassesButton="bg-tertiary-600 dark:bg-secondary-700 dark:text-tertiary-400"
+ moreClasses="w-[30px]"
+ >
+ {$starredMessages[actionHashB64] ? $t("common.unstar") : $t("common.star")}
+
+
{#if hasText || message.message.images.length > 0}
dispatch("forward", message)}
diff --git a/ui/src/store/StarStore.ts b/ui/src/store/StarStore.ts
new file mode 100644
index 00000000..143bbddb
--- /dev/null
+++ b/ui/src/store/StarStore.ts
@@ -0,0 +1,20 @@
+import { persisted } from "./generic/GenericPersistedStore";
+import type { ActionHashB64 } from "@holochain/client";
+
+// Starred messages, kept locally and keyed by message action hash (which is
+// globally unique). Purely a personal bookmark; nothing is shared with peers.
+export const starredMessages = persisted<{ [actionHashB64: ActionHashB64]: boolean }>(
+ "MESSAGE.STARRED",
+ {},
+);
+
+export function toggleStar(actionHashB64: ActionHashB64): void {
+ starredMessages.update((s) => {
+ if (s[actionHashB64]) {
+ const next = { ...s };
+ delete next[actionHashB64];
+ return next;
+ }
+ return { ...s, [actionHashB64]: true };
+ });
+}
diff --git a/ui/src/translations/locales/en.json b/ui/src/translations/locales/en.json
index e24c2901..c4b64ac5 100644
--- a/ui/src/translations/locales/en.json
+++ b/ui/src/translations/locales/en.json
@@ -93,6 +93,8 @@
"share_invitation_code_msg": "Nobody else is here! Share your invite code to start the conversation.",
"share_invite_code": "Share invite code",
"share_your_contact_code": "Share your contact code",
+ "star": "Star",
+ "unstar": "Unstar",
"stores_setup": "Loading initial data...",
"stores_setup_error": "Error setting up data stores",
"tagline": "Peer-to-peer. Encrypted. Secure.",
diff --git a/ui/src/translations/locales/hi.json b/ui/src/translations/locales/hi.json
index 35172306..268edc45 100644
--- a/ui/src/translations/locales/hi.json
+++ b/ui/src/translations/locales/hi.json
@@ -93,6 +93,8 @@
"share_invitation_code_msg": "यहाँ और कोई नहीं है! बातचीत शुरू करने के लिए अपना आमंत्रण कोड साझा करें।",
"share_invite_code": "आमंत्रण कोड साझा करें",
"share_your_contact_code": "अपना संपर्क कोड साझा करें",
+ "star": "तारांकित करें",
+ "unstar": "तारांकन हटाएँ",
"stores_setup": "प्रारंभिक डेटा लोड हो रहा है...",
"stores_setup_error": "डेटा स्टोर सेट अप करने में त्रुटि",
"tagline": "पीयर-टू-पीयर। एन्क्रिप्टेड। सुरक्षित।",
From afc2a05fc0ea8bbc3d6871dc480b0cf005ee8a7e Mon Sep 17 00:00:00 2001
From: erascape
Date: Tue, 25 Aug 2026 21:55:18 +0530
Subject: [PATCH 3/8] volla-messages: Allow editing your own messages
Wires up the existing update_message zome call. The author picks Edit
from the message actions, changes the text, and the update is written
to the DHT and reflected locally with an "edited" marker. Edits follow
the update chain so a message can be changed more than once.
NOTE:- Peers pick up the new text when they refetch the message; there's no
live update signal yet, so this is deliberately author-side for now.
Change-Id: I8d407b03f684e0e9656e6867d1974a4f4c18e75d
Signed-off-by: techyminati
---
ui/src/lib/types.ts | 12 ++++++
ui/src/routes/conversations/[id]/+page.svelte | 43 +++++++++++++++++++
.../[id]/ConversationMessages.svelte | 1 +
.../routes/conversations/[id]/Message.svelte | 9 +++-
.../conversations/[id]/MessageActions.svelte | 12 ++++++
ui/src/store/ConversationMessageStore.ts | 38 ++++++++++++++++
ui/src/store/RelayClient.ts | 10 +++++
ui/src/translations/locales/en.json | 4 ++
ui/src/translations/locales/hi.json | 4 ++
9 files changed, 132 insertions(+), 1 deletion(-)
diff --git a/ui/src/lib/types.ts b/ui/src/lib/types.ts
index 81b3c9f1..2454f48c 100644
--- a/ui/src/lib/types.ts
+++ b/ui/src/lib/types.ts
@@ -1,5 +1,6 @@
import type {
ActionHash,
+ ActionHashB64,
AgentPubKeyB64,
CellId,
EntryHash,
@@ -105,6 +106,11 @@ export interface MessageExtended {
authorAgentPubKeyB64: AgentPubKeyB64;
timestamp: number;
deliveredTo: AgentPubKeyB64[];
+
+ // Set once the author has edited the message. latestUpdateActionHashB64 is the
+ // head of the update chain, needed as the previous hash for any further edit.
+ edited?: boolean;
+ latestUpdateActionHashB64?: ActionHashB64;
}
export enum DeliveryStatus {
@@ -135,6 +141,12 @@ export interface DeleteMessageInput {
agents: AgentPubKey[];
}
+export interface UpdateMessageInput {
+ original_message_hash: ActionHash;
+ previous_message_hash: ActionHash;
+ updated_message: Message;
+}
+
/**
* Conversation
*/
diff --git a/ui/src/routes/conversations/[id]/+page.svelte b/ui/src/routes/conversations/[id]/+page.svelte
index 551893ab..f6280774 100644
--- a/ui/src/routes/conversations/[id]/+page.svelte
+++ b/ui/src/routes/conversations/[id]/+page.svelte
@@ -114,6 +114,11 @@
let deleteMessageActionHashB64: ActionHashB64 | undefined = undefined;
let isDeletingMessage = false;
+ let showEditDialog = false;
+ let editActionHashB64: ActionHashB64 | undefined = undefined;
+ let editText = "";
+ let isEditingMessage = false;
+
let isFirstConfigLoad = true;
let isFirstProfilesLoad = true;
let isFirstLoadMessages = true;
@@ -147,6 +152,29 @@
showForwardDialog = true;
}
+ function openEdit(actionHashB64: ActionHashB64, content: string) {
+ editActionHashB64 = actionHashB64;
+ editText = content;
+ showEditDialog = true;
+ }
+
+ async function handleEditMessage() {
+ if (editActionHashB64 === undefined || isEditingMessage) return;
+ const content = editText.trim();
+ if (content.length === 0) return;
+
+ isEditingMessage = true;
+ try {
+ await messages.updateMessage(editActionHashB64, content);
+ showEditDialog = false;
+ editActionHashB64 = undefined;
+ } catch (err) {
+ console.error(err);
+ toast.error($t("common.edit_message_error"));
+ }
+ isEditingMessage = false;
+ }
+
async function handleForwardTo(targetCellIdB64: CellIdB64) {
const message = forwardMessage;
if (message === undefined || isForwarding) return;
@@ -390,6 +418,7 @@ async function loadMoreMessages() {
showDeleteDialog = true;
}}
on:forward={(e) => openForward(e.detail)}
+ on:edit={(e) => openEdit(e.detail.actionHashB64, e.detail.content)}
on:scrollAtTop={loadMoreMessages}
/>
@@ -415,6 +444,20 @@ async function loadMoreMessages() {
{$t("common.delete_message_dialog_message")}
+
+
+
+
{/if}
diff --git a/ui/src/routes/conversations/[id]/Message.svelte b/ui/src/routes/conversations/[id]/Message.svelte
index dd0231c3..7594d1ef 100644
--- a/ui/src/routes/conversations/[id]/Message.svelte
+++ b/ui/src/routes/conversations/[id]/Message.svelte
@@ -12,6 +12,7 @@
import { encodeHashToBase64, type ActionHashB64, type AgentPubKeyB64 } from "@holochain/client";
import AgentNickname from "$lib/AgentNickname.svelte";
import SvgIcon from "$lib/SvgIcon.svelte";
+ import { t } from "$translations";
import { starredMessages } from "$store/StarStore";
import { openUrl } from "@tauri-apps/plugin-opener";
import DeliveryStatusIndicator from "./DeliveryStatusIndicator.svelte";
@@ -115,6 +116,12 @@
/>{/if}
+ {#if message.edited}
+ {$t("common.edited")}
+ {/if}
+
{#if $starredMessages[actionHashB64]}
@@ -124,7 +131,7 @@
{#if isSelected}
-
+
{/if}
diff --git a/ui/src/routes/conversations/[id]/MessageActions.svelte b/ui/src/routes/conversations/[id]/MessageActions.svelte
index 63b3a254..7ce82451 100644
--- a/ui/src/routes/conversations/[id]/MessageActions.svelte
+++ b/ui/src/routes/conversations/[id]/MessageActions.svelte
@@ -23,6 +23,7 @@
const dispatch = createEventDispatcher<{
delete: ActionHashB64;
forward: MessageExtended;
+ edit: { actionHashB64: ActionHashB64; content: string };
}>();
const myPubKeyB64 = getContext<{ getMyPubKeyB64: () => AgentPubKeyB64 }>(
@@ -131,6 +132,17 @@
{/if}
+ {#if iAmAuthor && hasText}
+ dispatch("edit", { actionHashB64, content: message.message.content })}
+ icon="write"
+ moreClassesButton="bg-tertiary-600 dark:bg-secondary-700 dark:text-tertiary-400"
+ moreClasses="w-[30px]"
+ >
+ {$t("common.edit")}
+
+ {/if}
+
{#if iAmAuthor}
dispatch("delete", actionHashB64)}
diff --git a/ui/src/store/ConversationMessageStore.ts b/ui/src/store/ConversationMessageStore.ts
index ca72a189..81eea1bc 100644
--- a/ui/src/store/ConversationMessageStore.ts
+++ b/ui/src/store/ConversationMessageStore.ts
@@ -65,6 +65,7 @@ export interface ConversationMessageStore
sendMessage: (key1: CellIdB64, content: string, files: LocalFile[]) => Promise;
sendJoinNotice: (key1: CellIdB64) => Promise;
deleteMessage: (key1: CellIdB64, actionHashB64: ActionHashB64) => Promise;
+ updateMessage: (key1: CellIdB64, actionHashB64: ActionHashB64, content: string) => Promise;
handleMessageSignalReceived: (key1: CellIdB64, signal: MessageSignal) => Promise;
handleMessageDeletedSignalReceived: (
key1: CellIdB64,
@@ -989,6 +990,39 @@ const paginationState = writable>({});
_removeFromMemory(key1, actionHashB64);
}
+ async function updateMessage(
+ key1: CellIdB64,
+ actionHashB64: ActionHashB64,
+ content: string,
+ ): Promise {
+ const existing = get(messages).data[key1]?.[actionHashB64];
+ if (existing === undefined) throw new Error("Cannot edit a message that is not loaded");
+
+ // Holochain updates chain off the latest action, so edit from the head of
+ // the chain (a previous edit) rather than the original each time.
+ const previousActionHashB64 = existing.latestUpdateActionHashB64 ?? actionHashB64;
+ const updatedMessage = { ...existing.message, content };
+
+ const record = await client.updateMessage(decodeCellIdFromBase64(key1), {
+ original_message_hash: decodeHashFromBase64(actionHashB64),
+ previous_message_hash: decodeHashFromBase64(previousActionHashB64),
+ updated_message: updatedMessage,
+ });
+
+ const updated: MessageExtended = {
+ ...existing,
+ message: updatedMessage,
+ edited: true,
+ latestUpdateActionHashB64: encodeHashToBase64(record.signed_action.hashed.hash),
+ };
+
+ messages.update((m) => ({
+ ...m,
+ [key1]: { ...(m[key1] || {}), [actionHashB64]: updated },
+ }));
+ await messageDB.storeMessage(key1, actionHashB64, updated);
+ }
+
function _removeFromMemory(cellIdB64: CellIdB64, actionHashB64: ActionHashB64): void {
messages.update((m) => {
const copy = { ...(m[cellIdB64] || {}) };
@@ -1069,6 +1103,7 @@ const paginationState = writable>({});
handleMessageSignalReceived,
subscribe,
deleteMessage,
+ updateMessage,
handleMessageDeletedSignalReceived,
debugGetAllMessages,
};
@@ -1094,6 +1129,7 @@ export interface CellConversationMessageStore
sendJoinNotice: () => Promise;
handleMessageSignalReceived: (signal: MessageSignal) => Promise;
deleteMessage: (key1: CellIdB64, actionHashB64: ActionHashB64) => Promise;
+ updateMessage: (actionHashB64: ActionHashB64, content: string) => Promise;
debugGetAllMessages: () => Promise;
}
@@ -1149,6 +1185,8 @@ export function deriveCellConversationMessageStore(
conversationMessageStore.handleMessageSignalReceived(key, signal),
deleteMessage: (key1: CellIdB64, actionHashB64: ActionHashB64) =>
conversationMessageStore.deleteMessage(key1, actionHashB64),
+ updateMessage: (actionHashB64: ActionHashB64, content: string) =>
+ conversationMessageStore.updateMessage(key, actionHashB64, content),
debugGetAllMessages: () => conversationMessageStore.debugGetAllMessages(key),
};
}
\ No newline at end of file
diff --git a/ui/src/store/RelayClient.ts b/ui/src/store/RelayClient.ts
index 9f0265ee..0a0d3899 100644
--- a/ui/src/store/RelayClient.ts
+++ b/ui/src/store/RelayClient.ts
@@ -29,6 +29,7 @@ import type {
CreateConversationInput,
SendMessageInput,
DeleteMessageInput,
+ UpdateMessageInput,
NotifyMessageDeliveryInput,
} from "$lib/types";
import { ZOME_NAME, ROLE_NAME } from "$config";
@@ -278,6 +279,15 @@ export class RelayClient {
});
}
+ public async updateMessage(cell_id: CellId, payload: UpdateMessageInput): Promise {
+ return this.client.callZome({
+ cell_id,
+ zome_name: ZOME_NAME,
+ fn_name: "update_message",
+ payload,
+ });
+ }
+
public async notifyMessageDelivery(
cell_id: CellId,
payload: NotifyMessageDeliveryInput,
diff --git a/ui/src/translations/locales/en.json b/ui/src/translations/locales/en.json
index c4b64ac5..a484c4de 100644
--- a/ui/src/translations/locales/en.json
+++ b/ui/src/translations/locales/en.json
@@ -39,7 +39,11 @@
"download": "Download",
"download_file_error": "Failed to download file",
"download_file_success": "File downloaded successfully",
+ "edit": "Edit",
"edit_contact": "Edit Contact",
+ "edit_message": "Edit Message",
+ "edit_message_error": "Failed to edit message",
+ "edited": "edited",
"enter_contact_code": "Enter contact code",
"enter_first_name": "Enter first name",
"enter_invite_code": "Enter invite code",
diff --git a/ui/src/translations/locales/hi.json b/ui/src/translations/locales/hi.json
index 268edc45..79f01afb 100644
--- a/ui/src/translations/locales/hi.json
+++ b/ui/src/translations/locales/hi.json
@@ -39,7 +39,11 @@
"download": "डाउनलोड करें",
"download_file_error": "फ़ाइल डाउनलोड करने में विफल",
"download_file_success": "फ़ाइल सफलतापूर्वक डाउनलोड की गई",
+ "edit": "संपादित करें",
"edit_contact": "संपर्क संपादित करें",
+ "edit_message": "संदेश संपादित करें",
+ "edit_message_error": "संदेश संपादित करने में विफल",
+ "edited": "संपादित",
"enter_contact_code": "संपर्क कोड दर्ज करें",
"enter_first_name": "पहला नाम दर्ज करें",
"enter_invite_code": "आमंत्रण कोड दर्ज करें",
From ff09637599c6dc53c363e9cdb90d9b56bac1610a Mon Sep 17 00:00:00 2001
From: techyminati
Date: Tue, 25 Aug 2026 22:01:58 +0530
Subject: [PATCH 4/8] volla-messages: Add an optional group description
Change-Id: I04cf59b897511ca58d1a336d201fdcab725a6da2
Signed-off-by: techyminati
---
.../relay/zomes/integrity/relay/src/config.rs | 3 ++
ui/src/lib/types.ts | 1 +
.../conversations/[id]/details/+page.svelte | 51 ++++++++++++++++++-
ui/src/translations/locales/en.json | 1 +
ui/src/translations/locales/hi.json | 1 +
5 files changed, 56 insertions(+), 1 deletion(-)
diff --git a/dnas/relay/zomes/integrity/relay/src/config.rs b/dnas/relay/zomes/integrity/relay/src/config.rs
index 54e86cc0..8c61f5af 100644
--- a/dnas/relay/zomes/integrity/relay/src/config.rs
+++ b/dnas/relay/zomes/integrity/relay/src/config.rs
@@ -4,6 +4,9 @@ use hdi::prelude::*;
pub struct Config {
pub title: String,
pub image: String,
+ // Optional so configs written before this field existed still deserialize.
+ #[serde(default)]
+ pub description: Option,
}
pub fn validate_create_config(
_action: TypedAction,
diff --git a/ui/src/lib/types.ts b/ui/src/lib/types.ts
index 2454f48c..f3ebbf74 100644
--- a/ui/src/lib/types.ts
+++ b/ui/src/lib/types.ts
@@ -154,6 +154,7 @@ export interface UpdateMessageInput {
export interface Config {
title: string;
image: string;
+ description?: string;
}
export enum Privacy {
diff --git a/ui/src/routes/conversations/[id]/details/+page.svelte b/ui/src/routes/conversations/[id]/details/+page.svelte
index 92631329..14a8aec6 100644
--- a/ui/src/routes/conversations/[id]/details/+page.svelte
+++ b/ui/src/routes/conversations/[id]/details/+page.svelte
@@ -83,7 +83,9 @@
// used for editing Group conversation details
let image = $conversation.config?.image || "";
let title = $conversationTitle || "";
+ let description = $conversation.config?.description || "";
let editingTitle = false;
+ let editingDescription = false;
$: iAmProgenitor = myPubKeyB64 === $conversation.dnaProperties.progenitor;
@@ -111,15 +113,22 @@
});
const saveTitle = async (newTitle: string) => {
- conversation.updateConfig({ title: newTitle.trim(), image });
+ conversation.updateConfig({ title: newTitle.trim(), image, description });
title = newTitle.trim();
editingTitle = false;
};
+ const saveDescription = async () => {
+ description = description.trim();
+ conversation.updateConfig({ title: $conversationTitle || "", image, description });
+ editingDescription = false;
+ };
+
const saveImage = async (newImage: string) => {
conversation.updateConfig({
title: $conversationTitle || "",
image: newImage,
+ description,
});
image = newImage;
};
@@ -179,6 +188,46 @@
{$t("common.num_members", { count: $joined.count })}
+ {#if $conversation.dnaProperties.privacy === Privacy.Public}
+
+ {#if editingDescription}
+
+
+
+
+
+ {:else}
+
+
+ {description || $t("common.group_description_placeholder")}
+
+ {#if $conversation.config !== undefined}
+
(editingDescription = true)}
+ icon="write"
+ moreClasses="text-gray-500 shrink-0"
+ />
+ {/if}
+
+ {/if}
+
+ {/if}
+
{#if $conversation.dnaProperties.privacy === Privacy.Public && $conversation.publicInviteCode !== undefined}
diff --git a/ui/src/translations/locales/en.json b/ui/src/translations/locales/en.json
index a484c4de..5e932869 100644
--- a/ui/src/translations/locales/en.json
+++ b/ui/src/translations/locales/en.json
@@ -59,6 +59,7 @@
"forward_error": "Failed to forward message",
"forward_success": "Message forwarded",
"forward_to": "Forward to",
+ "group_description_placeholder": "Add a group description",
"group_name": "Group name",
"no_conversations_to_forward": "No other conversations to forward to",
"holochain_connect_error": "Error connecting to Holochain",
diff --git a/ui/src/translations/locales/hi.json b/ui/src/translations/locales/hi.json
index 79f01afb..24b77a04 100644
--- a/ui/src/translations/locales/hi.json
+++ b/ui/src/translations/locales/hi.json
@@ -59,6 +59,7 @@
"forward_error": "संदेश अग्रेषित करने में विफल",
"forward_success": "संदेश अग्रेषित किया गया",
"forward_to": "इन्हें अग्रेषित करें",
+ "group_description_placeholder": "समूह विवरण जोड़ें",
"group_name": "समूह का नाम",
"no_conversations_to_forward": "अग्रेषित करने के लिए कोई अन्य बातचीत नहीं है",
"holochain_connect_error": "Holochain से कनेक्ट करने में त्रुटि",
From cfe01d0d6f065aed92a4f95fe501774643990ed2 Mon Sep 17 00:00:00 2001
From: erascape
Date: Wed, 26 Aug 2026 10:43:49 +0530
Subject: [PATCH 5/8] volla-messages: Sync message edits to other clients
update_message only wrote the edit to the local chain, so peers never
saw it. It now broadcasts the edit the same way create_message does,
keyed by the original message hash, and the receiving client swaps the
new content into the message it already has instead of treating it as a
new one. The edit carries the participant list so the signal reaches
everyone in the conversation.
Change-Id: I4e283a23820ebd12635f2cbe558c287a4722f599
Signed-off-by: techyminati
---
dnas/relay/zomes/coordinator/relay/src/lib.rs | 22 +++++++++++
.../zomes/coordinator/relay/src/message.rs | 20 ++++++++++
ui/src/lib/types.ts | 10 +++++
ui/src/store/ConversationMessageStore.ts | 38 +++++++++++++++++++
ui/src/store/SignalHandler.ts | 15 +++++++-
5 files changed, 103 insertions(+), 2 deletions(-)
diff --git a/dnas/relay/zomes/coordinator/relay/src/lib.rs b/dnas/relay/zomes/coordinator/relay/src/lib.rs
index 551d9abd..f2405daf 100644
--- a/dnas/relay/zomes/coordinator/relay/src/lib.rs
+++ b/dnas/relay/zomes/coordinator/relay/src/lib.rs
@@ -10,6 +10,7 @@ use relay_integrity::*;
#[serde(tag = "signal_type")]
pub enum RemoteSignalPayload {
Message(MessageRecord),
+ MessageUpdated(MessageRecord),
PeerPing { from_agent: AgentPubKey },
PeerPong { from_agent: AgentPubKey },
}
@@ -46,6 +47,21 @@ fn recv_remote_signal(payload: RemoteSignalPayload) -> ExternResult<()> {
)))
}
}
+ RemoteSignalPayload::MessageUpdated(message_record) => {
+ let info: CallInfo = call_info()?;
+ if let Some(message) = message_record.message {
+ emit_signal(Signal::MessageUpdated {
+ action: message_record.signed_action.clone(),
+ original_action: message_record.original_action.clone(),
+ message,
+ from: info.provenance,
+ })
+ } else {
+ Err(wasm_error!(WasmErrorInner::Guest(
+ "Invalid message record".to_string()
+ )))
+ }
+ }
RemoteSignalPayload::PeerPing { from_agent } => {
ping::handle_peer_ping(from_agent)
}
@@ -81,6 +97,12 @@ pub enum Signal {
original_action: ActionHash,
from: AgentPubKey,
},
+ MessageUpdated {
+ action: SignedActionHashed,
+ original_action: ActionHash,
+ message: Message,
+ from: AgentPubKey,
+ },
PeerPing {
from_agent: AgentPubKey,
},
diff --git a/dnas/relay/zomes/coordinator/relay/src/message.rs b/dnas/relay/zomes/coordinator/relay/src/message.rs
index 7fc42074..8b063096 100644
--- a/dnas/relay/zomes/coordinator/relay/src/message.rs
+++ b/dnas/relay/zomes/coordinator/relay/src/message.rs
@@ -253,6 +253,8 @@ pub struct UpdateMessageInput {
pub original_message_hash: ActionHash,
pub previous_message_hash: ActionHash,
pub updated_message: Message,
+ // Agents to notify of the edit so they update their copy in real time.
+ pub agents: Vec,
}
#[hdk_extern]
pub fn update_message(input: UpdateMessageInput) -> ExternResult {
@@ -267,6 +269,24 @@ pub fn update_message(input: UpdateMessageInput) -> ExternResult {
let record = get(updated_message_hash.clone(), GetOptions::local())?.ok_or(wasm_error!(
WasmErrorInner::Guest("Could not find the newly updated Message".to_string())
))?;
+
+ // Broadcast the edit, keyed by the original message so peers can replace the
+ // message they already have rather than treat it as a new one.
+ let my_pub_key = agent_info()?.agent_initial_pubkey;
+ let agents: Vec = input
+ .agents
+ .into_iter()
+ .filter(|a| a != &my_pub_key)
+ .collect();
+ let _ = send_remote_signal(
+ crate::RemoteSignalPayload::MessageUpdated(MessageRecord {
+ message: Some(input.updated_message),
+ original_action: input.original_message_hash,
+ signed_action: record.signed_action().clone(),
+ }),
+ agents,
+ );
+
Ok(record)
}
diff --git a/ui/src/lib/types.ts b/ui/src/lib/types.ts
index f3ebbf74..abb910e8 100644
--- a/ui/src/lib/types.ts
+++ b/ui/src/lib/types.ts
@@ -30,6 +30,14 @@ export interface MessageDeleted {
from: AgentPubKey;
}
+export interface MessageUpdatedSignal {
+ type: "MessageUpdated";
+ action: SignedActionHashed;
+ original_action: ActionHash;
+ message: Message;
+ from: AgentPubKey;
+}
+
export interface PeerPingSignal {
type: "PeerPing";
from_agent: AgentPubKey;
@@ -43,6 +51,7 @@ export interface PeerPongSignal {
export type RelaySignal =
| MessageSignal
| MessageDeleted
+ | MessageUpdatedSignal
| PeerPingSignal
| PeerPongSignal
| {
@@ -145,6 +154,7 @@ export interface UpdateMessageInput {
original_message_hash: ActionHash;
previous_message_hash: ActionHash;
updated_message: Message;
+ agents: AgentPubKey[];
}
/**
diff --git a/ui/src/store/ConversationMessageStore.ts b/ui/src/store/ConversationMessageStore.ts
index 81eea1bc..9c2472b9 100644
--- a/ui/src/store/ConversationMessageStore.ts
+++ b/ui/src/store/ConversationMessageStore.ts
@@ -67,6 +67,12 @@ export interface ConversationMessageStore
deleteMessage: (key1: CellIdB64, actionHashB64: ActionHashB64) => Promise;
updateMessage: (key1: CellIdB64, actionHashB64: ActionHashB64, content: string) => Promise;
handleMessageSignalReceived: (key1: CellIdB64, signal: MessageSignal) => Promise;
+ handleMessageUpdatedSignalReceived: (
+ key1: CellIdB64,
+ originalActionHashB64: ActionHashB64,
+ message: Message,
+ latestUpdateActionHashB64: ActionHashB64,
+ ) => Promise;
handleMessageDeletedSignalReceived: (
key1: CellIdB64,
actionHashB64: ActionHashB64,
@@ -990,6 +996,29 @@ const paginationState = writable>({});
_removeFromMemory(key1, actionHashB64);
}
+ async function handleMessageUpdatedSignalReceived(
+ key1: CellIdB64,
+ originalActionHashB64: ActionHashB64,
+ message: Message,
+ latestUpdateActionHashB64: ActionHashB64,
+ ): Promise {
+ const existing = get(messages).data[key1]?.[originalActionHashB64];
+ if (existing === undefined) return;
+
+ const updated: MessageExtended = {
+ ...existing,
+ message,
+ edited: true,
+ latestUpdateActionHashB64,
+ };
+
+ messages.update((m) => ({
+ ...m,
+ [key1]: { ...(m[key1] || {}), [originalActionHashB64]: updated },
+ }));
+ await messageDB.storeMessage(key1, originalActionHashB64, updated);
+ }
+
async function updateMessage(
key1: CellIdB64,
actionHashB64: ActionHashB64,
@@ -1003,10 +1032,18 @@ const paginationState = writable>({});
const previousActionHashB64 = existing.latestUpdateActionHashB64 ?? actionHashB64;
const updatedMessage = { ...existing.message, content };
+ const mergedProfileContact = deriveCellMergedProfileContactInviteStore(
+ mergedProfileContactInviteStore,
+ key1,
+ encodeHashToBase64(client.client.myPubKey),
+ );
+ const agents = get(mergedProfileContact).list.map(([a]) => decodeHashFromBase64(a));
+
const record = await client.updateMessage(decodeCellIdFromBase64(key1), {
original_message_hash: decodeHashFromBase64(actionHashB64),
previous_message_hash: decodeHashFromBase64(previousActionHashB64),
updated_message: updatedMessage,
+ agents,
});
const updated: MessageExtended = {
@@ -1105,6 +1142,7 @@ const paginationState = writable>({});
deleteMessage,
updateMessage,
handleMessageDeletedSignalReceived,
+ handleMessageUpdatedSignalReceived,
debugGetAllMessages,
};
}
diff --git a/ui/src/store/SignalHandler.ts b/ui/src/store/SignalHandler.ts
index 2f6e451a..c352c4ca 100644
--- a/ui/src/store/SignalHandler.ts
+++ b/ui/src/store/SignalHandler.ts
@@ -1,6 +1,6 @@
import { encodeHashToBase64, type Signal, SignalType, type AgentPubKeyB64 } from "@holochain/client";
import { RelayClient } from "$store/RelayClient";
-import { type RelaySignal, type MessageSignal } from "$lib/types";
+import { MessageType, type RelaySignal, type MessageSignal } from "$lib/types";
import { encodeCellIdToBase64 } from "$lib/utils";
import { type ConversationStore } from "./ConversationStore";
import type { ConversationMessageStore } from "./ConversationMessageStore";
@@ -36,14 +36,25 @@ export function createSignalHandler(
cellIdB64,
signal.value.payload as MessageSignal,
);
+ // Reactions travel as messages but shouldn't mark the conversation unread.
const $page = get(page);
- if ($page.params.id !== cellIdB64 || $page.route.id !== "/conversations/[id]") {
+ if (
+ payload.message.message_type !== MessageType.Reaction &&
+ ($page.params.id !== cellIdB64 || $page.route.id !== "/conversations/[id]")
+ ) {
await conversationStore.updateUnread(cellIdB64, true);
}
} else if (payload.type === "MessageDeleted") {
const originalActionHash = payload.original_action;
const originalActionHashB64 = encodeHashToBase64(originalActionHash);
conversationMessageStore.handleMessageDeletedSignalReceived(cellIdB64, originalActionHashB64);
+ } else if (payload.type === "MessageUpdated") {
+ await conversationMessageStore.handleMessageUpdatedSignalReceived(
+ cellIdB64,
+ encodeHashToBase64(payload.original_action),
+ payload.message,
+ encodeHashToBase64(payload.action.hashed.hash),
+ );
}
};
From 903b24873d9b20d02ec0faf19190c20e09ea21e3 Mon Sep 17 00:00:00 2001
From: techyminati
Date: Wed, 26 Aug 2026 13:24:19 +0530
Subject: [PATCH 6/8] volla-messages: Add a starred messages view
Add "Starred Messages" entry in conversation list which opens starred messages just like whatsapp.
Change-Id: I82b2def7c84ceb6e8301d37150c0ea5dfbe9fab5
Signed-off-by: techyminati
---
ui/src/routes/conversations/+page.svelte | 10 +++
.../routes/conversations/starred/+page.svelte | 71 +++++++++++++++++++
ui/src/translations/locales/en.json | 2 +
ui/src/translations/locales/hi.json | 2 +
4 files changed, 85 insertions(+)
create mode 100644 ui/src/routes/conversations/starred/+page.svelte
diff --git a/ui/src/routes/conversations/+page.svelte b/ui/src/routes/conversations/+page.svelte
index 4ed7abc9..1d875299 100644
--- a/ui/src/routes/conversations/+page.svelte
+++ b/ui/src/routes/conversations/+page.svelte
@@ -67,6 +67,16 @@
{/if}
+ -
+
+
+
{#if hasArchivedConversations}
-