Skip to content

Commit d2440ea

Browse files
committed
fix(ui): keep typing presence dependencies private
1 parent 5a0cdfc commit d2440ea

2 files changed

Lines changed: 9 additions & 18 deletions

File tree

‎ui/src/pages/chat/chat-pane-sharing.ts‎

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -692,21 +692,11 @@ export abstract class ChatPaneSharing extends ChatPaneBase {
692692
return;
693693
}
694694
if (
695-
clearTypingActorForSessionMessage(
696-
payload,
697-
this.typingActors,
698-
this.typingTimers,
699-
(key, agentId) =>
700-
uiSessionEventMatches(
701-
{
702-
agentsList: this.context.agents.state.agentsList,
703-
hello: this.context.gateway.snapshot.hello,
704-
sessionKey: state.sessionKey,
705-
},
706-
key,
707-
agentId,
708-
),
709-
)
695+
clearTypingActorForSessionMessage(payload, this.typingActors, this.typingTimers, {
696+
agentsList: this.context.agents.state.agentsList,
697+
hello: this.context.gateway.snapshot.hello,
698+
sessionKey: state.sessionKey,
699+
})
710700
) {
711701
this.requestUpdate();
712702
}

‎ui/src/pages/chat/chat-typing-presence.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
import { asNullableRecord as recordOrNull } from "@openclaw/normalization-core/record-coerce";
22
import { normalizeOptionalString as stringValue } from "@openclaw/normalization-core/string-coerce";
33
import { readSessionChangedEvent } from "../../lib/sessions/reconcile.ts";
4+
import { uiSessionEventMatches } from "../../lib/sessions/session-key.ts";
45

56
export function clearTypingActorForSessionMessage(
67
payload: unknown,
78
actors: Map<string, unknown>,
89
timers: Map<string, number>,
9-
matchesSession: (key: string, agentId?: string) => boolean,
10+
sessionHost: Parameters<typeof uiSessionEventMatches>[0],
1011
): boolean {
1112
const event = readSessionChangedEvent(payload);
12-
if (!event || !matchesSession(event.key, event.agentId ?? undefined)) {
13+
if (!event || !uiSessionEventMatches(sessionHost, event.key, event.agentId ?? undefined)) {
1314
return false;
1415
}
1516
return clearTypingActorForUserMessage(payload, actors, timers);
1617
}
1718

18-
export function clearTypingActorForUserMessage(
19+
function clearTypingActorForUserMessage(
1920
payload: unknown,
2021
actors: Map<string, unknown>,
2122
timers: Map<string, number>,

0 commit comments

Comments
 (0)