MCPcopy Create free account
hub / github.com/Noumena-Network/code / computeUnseenDivider

Function computeUnseenDivider

src/components/FullscreenLayout.tsx:240–257  ·  view source on GitHub ↗
(messages: readonly Message[], dividerIndex: number | null)

Source from the content-addressed store, hash-verified

238 * until NCode's text response lands.
239 */
240export function computeUnseenDivider(messages: readonly Message[], dividerIndex: number | null): UnseenDivider | undefined {
241 if (dividerIndex === null) return undefined;
242 // Skip progress and null-rendering attachments when picking the divider
243 // anchor — Messages.tsx filters these out of renderableMessages before the
244 // dividerBeforeIndex search, so their UUID wouldn't be found (CC-724).
245 // Hook attachments use randomUUID() so nothing shares their 24-char prefix.
246 let anchorIdx = dividerIndex;
247 while (anchorIdx < messages.length && (messages[anchorIdx]?.type === 'progress' || isNullRenderingAttachment(messages[anchorIdx]!))) {
248 anchorIdx++;
249 }
250 const uuid = messages[anchorIdx]?.uuid;
251 if (!uuid) return undefined;
252 const count = countUnseenAssistantTurns(messages, dividerIndex);
253 return {
254 firstUnseenUuid: uuid,
255 count: Math.max(1, count)
256 };
257}
258
259/**
260 * Layout wrapper for the REPL. In fullscreen mode, puts scrollable

Callers 1

REPLFunction · 0.85

Calls 3

maxMethod · 0.80

Tested by

no test coverage detected