MCPcopy Index your code
hub / github.com/codeaashu/claude-code / computeStickyPromptText

Function computeStickyPromptText

src/components/VirtualMessageList.tsx:145–160  ·  view source on GitHub ↗
(msg: RenderableMessage)

Source from the content-addressed store, hash-verified

143 return result;
144}
145function 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

Callers 1

stickyPromptTextFunction · 0.85

Calls 1

stripSystemRemindersFunction · 0.85

Tested by

no test coverage detected