From 9ae9453a52b0646088cc23ecb407015704dfd72c Mon Sep 17 00:00:00 2001 From: Alexander Onnikov Date: Mon, 22 Sep 2025 23:18:22 +0700 Subject: [PATCH] fix: refactor presence and typing to use svelte actions (#9908) Signed-off-by: Alexander Onnikov --- .../src/components/ChannelTypingInfo.svelte | 41 ++----- .../src/components/TypingPresenter.svelte | 41 ++----- .../src/components/PresenceAvatars.svelte | 107 ++++++++---------- plugins/presence-resources/src/presence.ts | 60 +++++++++- plugins/presence-resources/src/typing.ts | 55 +++++++++ 5 files changed, 182 insertions(+), 122 deletions(-) diff --git a/plugins/chunter-resources/src/components/ChannelTypingInfo.svelte b/plugins/chunter-resources/src/components/ChannelTypingInfo.svelte index ec0064ed1b..bb48155ef1 100644 --- a/plugins/chunter-resources/src/components/ChannelTypingInfo.svelte +++ b/plugins/chunter-resources/src/components/ChannelTypingInfo.svelte @@ -13,13 +13,12 @@ // limitations under the License. --> - + {#if typingPersonsLabel !== ''} {typingPersonsLabel} diff --git a/plugins/communication-resources/src/components/TypingPresenter.svelte b/plugins/communication-resources/src/components/TypingPresenter.svelte index cbf8f74c49..8a804078ef 100644 --- a/plugins/communication-resources/src/components/TypingPresenter.svelte +++ b/plugins/communication-resources/src/components/TypingPresenter.svelte @@ -11,13 +11,12 @@ - + {#if typingPersonsLabel !== ''} {typingPersonsLabel} diff --git a/plugins/presence-resources/src/components/PresenceAvatars.svelte b/plugins/presence-resources/src/components/PresenceAvatars.svelte index 5a8fa2e7a6..f920f1c790 100644 --- a/plugins/presence-resources/src/components/PresenceAvatars.svelte +++ b/plugins/presence-resources/src/components/PresenceAvatars.svelte @@ -14,15 +14,14 @@ --> -{#if persons.length > 0} - {#if adaptive} -
- {#each persons.slice(0, limit) as person, i} -
- -
- {/each} -
- {:else} -
- {#each persons as person} - - -
{ - toggleFollowee(person._id) - }} - > - -
- {/each} -
+
+ {#if persons.length > 0} + {#if adaptive} +
+ {#each persons.slice(0, limit) as person, i} +
+ +
+ {/each} +
+ {:else} +
+ {#each persons as person} + + +
{ + toggleFollowee(person._id) + }} + > + +
+ {/each} +
+ {/if} {/if} -{/if} +