(msg: RenderableMessage)
| 143 | return result; |
| 144 | } |
| 145 | function computeStickyPromptText(msg: RenderableMessage): string | null { |
| 146 | let raw: string | null = null; |
| 147 | if (msg.type === 'user') { |
| 148 | if (msg.isMeta || msg.isVisibleInTranscriptOnly) return null; |
| 149 | const block = msg.message.content[0]; |
| 150 | if (block?.type !== 'text') return null; |
| 151 | raw = block.text; |
| 152 | } else if (msg.type === 'attachment' && msg.attachment.type === 'queued_command' && msg.attachment.commandMode !== 'task-notification' && !msg.attachment.isMeta) { |
| 153 | const p = msg.attachment.prompt; |
| 154 | raw = typeof p === 'string' ? p : p.flatMap(b => b.type === 'text' ? [b.text] : []).join('\n'); |
| 155 | } |
| 156 | if (raw === null) return null; |
| 157 | const t = stripSystemReminders(raw); |
| 158 | if (t.startsWith('<') || t === '') return null; |
| 159 | return t; |
| 160 | } |
| 161 | |
| 162 | /** |
| 163 | * Virtualized message list for fullscreen mode. Split from Messages.tsx so |
no test coverage detected