MCPcopy Create free account
hub / github.com/codeaashu/claude-code / computeUnseenDivider

Function computeUnseenDivider

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

Source from the content-addressed store, hash-verified

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