diff --git a/bin/opencode-ink.mjs b/bin/opencode-ink.mjs index 4a83cb6..c5768fd 100644 --- a/bin/opencode-ink.mjs +++ b/bin/opencode-ink.mjs @@ -83,7 +83,7 @@ const MultiLineInput = ({ value, onChange, onSubmit, placeholder, isActive = tru // Calculate input width accounting for margins and borders const safeWidth = Math.max(20, columns - 10); // Leave margin for borders setInputWidth(safeWidth); - + // Calculate height based on content but cap it to avoid taking too much space const lines = value.split('\n'); const newHeight = Math.min(Math.max(3, lines.length + 1), 10); // Min 3 lines, max 10 @@ -185,15 +185,15 @@ const MultiLineInput = ({ value, onChange, onSubmit, placeholder, isActive = tru }, h(Text, { color: 'yellow', bold: true }, indicator) ), - h(Box, { - borderStyle: 'single', - borderColor: 'cyan', - paddingX: 1, + h(Box, { + borderStyle: 'single', + borderColor: 'cyan', + paddingX: 1, minHeight: inputHeight, maxHeight: 10 }, - lines.map((line, i) => - h(Text, { key: i, color: 'white', wrap: 'truncate' }, + lines.map((line, i) => + h(Text, { key: i, color: 'white', wrap: 'truncate' }, i === lines.length - 1 && isActive && cursorVisible ? `${line}█` : line ) ) @@ -203,32 +203,32 @@ const MultiLineInput = ({ value, onChange, onSubmit, placeholder, isActive = tru // Multi-line input - render with proper height and scrolling if (lineCount > 1 || value.length > 50) { // Show as multi-line if more than 1 line or long text - return h(Box, { - flexDirection: 'column', + return h(Box, { + flexDirection: 'column', width: inputWidth, minHeight: inputHeight, maxHeight: 10 }, - h(Box, { - borderStyle: lineCount > 1 ? 'round' : 'single', - borderColor: 'cyan', + h(Box, { + borderStyle: lineCount > 1 ? 'round' : 'single', + borderColor: 'cyan', paddingX: 1, flexGrow: 1, maxHeight: inputHeight }, - lines.map((line, i) => - h(Text, { - key: i, - color: 'white', + lines.map((line, i) => + h(Text, { + key: i, + color: 'white', wrap: 'truncate', maxWidth: inputWidth - 4 // Account for borders and padding - }, + }, i === lines.length - 1 && isActive && cursorVisible ? `${line}█` : line ) ) ), h(Box, { marginTop: 0.5 }, - h(Text, { color: 'gray', dimColor: true, fontSize: 0.8 }, + h(Text, { color: 'gray', dimColor: true, fontSize: 0.8 }, `${lineCount} line${lineCount > 1 ? 's' : ''} | ${value.length} chars | Shift+Enter: new line, Enter: submit`) ) ); @@ -237,7 +237,7 @@ const MultiLineInput = ({ value, onChange, onSubmit, placeholder, isActive = tru // Normal single-line input - show inline with proper truncation return h(Box, { flexDirection: 'row', width: inputWidth }, h(Box, { borderStyle: 'single', borderColor: 'cyan', paddingX: 1, flexGrow: 1 }, - h(Text, { color: 'white', wrap: 'truncate' }, + h(Text, { color: 'white', wrap: 'truncate' }, displayValue + (isActive && cursorVisible && displayValue.length > 0 ? '█' : '') ), !displayValue && placeholder ? h(Text, { dimColor: true }, placeholder) : null, @@ -737,76 +737,76 @@ const loadRecentProjects = () => { }; // ═══════════════════════════════════════════════════════════════ - // POWER FEATURE 1: TODO TRACKER - // Parses TODO/FIXME comments from project files - // ═══════════════════════════════════════════════════════════════ - const parseTodos = (projectPath) => { - const todos = []; - const extensions = ['.js', '.ts', '.jsx', '.tsx', '.py', '.md', '.mjs']; - const todoPattern = /(?:\/\/|#|