feat: refactor by splitting up app and doing proper state

This commit is contained in:
Brooklyn Nicholson 2026-04-14 22:30:18 -05:00
parent 4cbf54fb33
commit 99d859ce4a
27 changed files with 4087 additions and 2939 deletions

View file

@ -74,9 +74,17 @@ export const pasteTokenLabel = (text: string, lineCount: number) => {
}
export const thinkingPreview = (reasoning: string, mode: ThinkingMode, max: number) => {
const text = reasoning.replace(/\n/g, ' ').trim()
const raw = reasoning.trim()
return !text || mode === 'collapsed' ? '' : mode === 'full' ? text : compactPreview(text, max)
if (!raw || mode === 'collapsed') {
return ''
}
if (mode === 'full') {
return raw
}
return compactPreview(raw.replace(/\s+/g, ' '), max)
}
export const stripTrailingPasteNewlines = (text: string) => (/[^\n]/.test(text) ? text.replace(/\n+$/, '') : text)