(messages: readonly Message[], dividerIndex: number | null)
| 237 | * until Claude's text response lands. |
| 238 | */ |
| 239 | export 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 |
no test coverage detected