Просмотр исходного кода

chore(ui-chat): document local keyed sources

imccyu 1 месяц назад
Родитель
Сommit
de07b4c05b

+ 2 - 0
packages/client/ui-chat/src/client/conversation-nodes/chat-snapshot-builder.ts

@@ -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>()

+ 5 - 1
packages/client/ui-chat/src/client/conversation-nodes/turn-process-presentation.ts

@@ -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)