chore(ui-chat): document local keyed sources

This commit is contained in:
imccyu 2026-09-01 21:46:08 +08:00
parent a718d1f0a1
commit de07b4c05b
2 changed files with 7 additions and 1 deletions

View file

@ -38,6 +38,7 @@ function cachedSource<Key, Source>(
return source
}
/* jscpd:ignore-start -- Chat Node sources keep publication state inside the keyed Chat store. */
class MutableChatSource<Value> {
private readonly listeners = new Set<() => void>()
private published: Value
@ -63,6 +64,7 @@ class MutableChatSource<Value> {
notifySubscribers(this.listeners, this.label)
}
}
/* jscpd:ignore-end */
class MutableChatNodeStore implements ChatNodeStore {
private readonly byKey = new Map<string, ChatConversationViewNode>()

View file

@ -74,7 +74,11 @@ function derivePresentation(
export class ChatTurnProcessProjector {
private presentations = new Map<number, ChatTurnProcessPresentation>()
/** @param node - current Chat Node. @returns its Turn's process presentation, when present. */
/**
* Read the retained process presentation for a Node's Turn.
* @param node - Current Chat Node.
* @returns The Turn's process presentation, when present.
*/
get(node: ChatNode | undefined): ChatTurnProcessPresentation | undefined {
const turn = nodeTurn(node)
return turn === undefined ? undefined : this.presentations.get(turn)