SmartX: Updated command labels to /smartx in filtered list

This commit is contained in:
Gemini AI
2025-12-14 12:40:00 +04:00
Unverified
parent 956b177200
commit 0a84b8a4c5

View File

@@ -737,10 +737,10 @@ const loadRecentProjects = () => {
};
// ═══════════════════════════════════════════════════════════════
// POWER FEATURE 1: TODO TRACKER
// Parses TODO/FIXME comments from project files
// ═══════════════════════════════════════════════════════════════
const parseTodos = (projectPath) => {
// 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 = /(?:\/\/|#|<!--)\s*(TODO|FIXME|HACK|XXX):?\s*(.+)/gi;
@@ -779,14 +779,14 @@ const loadRecentProjects = () => {
scanDir(projectPath);
}
return todos.slice(0, 20); // Limit to 20 TODOs
};
};
// POWER FEATURE 2: MANAGED TODO LIST
// Personal task list that users can add/maintain
// ═══════════════════════════════════════════════════════════════
const TODO_FILE = '.opencode/todos.json';
// POWER FEATURE 2: MANAGED TODO LIST
// Personal task list that users can add/maintain
// ═══════════════════════════════════════════════════════════════
const TODO_FILE = '.opencode/todos.json';
const loadTodoList = (projectPath) => {
const loadTodoList = (projectPath) => {
try {
const todoFilePath = path.join(projectPath || process.cwd(), TODO_FILE);
if (fs.existsSync(todoFilePath)) {
@@ -795,9 +795,9 @@ const loadRecentProjects = () => {
}
} catch (e) { /* ignore */ }
return [];
};
};
const saveTodoList = (projectPath, todos) => {
const saveTodoList = (projectPath, todos) => {
try {
const todoDir = path.join(projectPath || process.cwd(), '.opencode');
if (!fs.existsSync(todoDir)) {
@@ -806,7 +806,7 @@ const loadRecentProjects = () => {
const todoFilePath = path.join(projectPath || process.cwd(), TODO_FILE);
fs.writeFileSync(todoFilePath, JSON.stringify(todos, null, 2));
} catch (e) { /* ignore */ }
};
};
// ═══════════════════════════════════════════════════════════════
// POWER FEATURE 2: THEME SYSTEM
@@ -1050,8 +1050,8 @@ const SmoothCounter = ({ value }) => {
return h(Text, { color: 'white' }, displayValue.toLocaleString());
};
// Component: TypewriterText - Clean text reveal for streaming (Opencode style)
const TypewriterText = ({ children, speed = 25 }) => {
// Component: TypewriterText - Clean text reveal for streaming (Opencode style)
const TypewriterText = ({ children, speed = 25 }) => {
const fullText = String(children || '');
const [displayText, setDisplayText] = useState('');
const positionRef = useRef(0);
@@ -1096,7 +1096,7 @@ const SmoothCounter = ({ value }) => {
const displayWithCursor = displayText + (Math.floor(Date.now() / 500) % 2 ? '|' : ' ');
return h(Text, { wrap: 'wrap' }, displayWithCursor);
};
};
// Component: FadeInBox - Animated fade-in wrapper (simulates fade with opacity chars)
const FadeInBox = ({ children, delay = 0 }) => {
@@ -1405,7 +1405,7 @@ const ArtifactBlock = ({ content, isStreaming }) => {
// DISCORD-STYLE CODE CARD
// Code blocks with header bar, language label, and distinct styling
// ═══════════════════════════════════════════════════════════════
const CodeCard = ({ language, filename, content, width, isStreaming }) => {
const CodeCard = ({ language, filename, content, width, isStreaming }) => {
const lineCount = content.split('\n').length;
const [isExpanded, setIsExpanded] = useState(false);
@@ -1467,7 +1467,7 @@ const ArtifactBlock = ({ content, isStreaming }) => {
h(Text, { color: 'cyan', dimColor: true }, isExpanded ? '▼ collapse' : '▶ expand ')
) : null
);
};
};
// ═══════════════════════════════════════════════════════════════
@@ -1520,9 +1520,9 @@ const UserCard = ({ content, width }) => {
);
};
// AGENT CARD - Opencode-style clean streaming
// Text-focused with minimal styling, clean left gutter
const AgentCard = ({ content, isStreaming, width }) => {
// AGENT CARD - Opencode-style clean streaming
// Text-focused with minimal styling, clean left gutter
const AgentCard = ({ content, isStreaming, width }) => {
const contentWidth = width ? width - 4 : undefined; // Account for left gutter and spacing
return h(Box, {
@@ -1560,7 +1560,7 @@ const UserCard = ({ content, width }) => {
)
)
);
};
};
// ERROR CARD - Red gutter, no border
const ErrorCard = ({ content, width }) => {
@@ -1600,9 +1600,9 @@ const MessageCard = ({ role, content, meta, isStreaming, width }) => {
// UI COMPONENTS
// ═══════════════════════════════════════════════════════════════
// HELPER: Flatten messages into atomic blocks for granular scrolling
// This enables the "3-4 line portion" look and prevents cutoff of long messages
const flattenMessagesToBlocks = (messages) => {
// HELPER: Flatten messages into atomic blocks for granular scrolling
// This enables the "3-4 line portion" look and prevents cutoff of long messages
const flattenMessagesToBlocks = (messages) => {
const blocks = [];
let globalId = 0; // Global counter to ensure unique keys
@@ -1683,7 +1683,7 @@ const MessageCard = ({ role, content, meta, isStreaming, width }) => {
});
return blocks;
};
};
// ═══════════════════════════════════════════════════════════════
// SCROLLABLE CHAT - Virtual Viewport Engine
@@ -1776,7 +1776,7 @@ const LegacyScrollableChat = ({ messages, viewHeight, width, isActive = true, is
);
};
const ScrollableChat = ({ messages, viewHeight, width, isActive = true, isStreaming = false }) => {
const ScrollableChat = ({ messages, viewHeight, width, isActive = true, isStreaming = false }) => {
// Flatten messages into scrollable blocks
// Memoize to prevent expensive re-parsing on every cursor blink
const blocks = useMemo(() => flattenMessagesToBlocks(messages), [messages]);
@@ -1863,7 +1863,7 @@ const LegacyScrollableChat = ({ messages, viewHeight, width, isActive = true, is
h(Text, { color: 'yellow' }, `⚠ PAUSED - Press ↓ to resume`)
)
);
};
};
// Message Item Component
const MessageItem = ({ role, content, blocks = [], index }) => {
@@ -2131,15 +2131,15 @@ const ModelSelector = ({
);
};
// ═══════════════════════════════════════════════════════════════
// VIEWPORT MESSAGE - Unified Message Protocol Renderer (Alt)
// Supports meta field for consistent styling
// ═══════════════════════════════════════════════════════════════
// ═══════════════════════════════════════════════════════════════
// VIEWPORT MESSAGE - Unified Message Protocol Renderer (Alt)
// Supports meta field for consistent styling
// ═══════════════════════════════════════════════════════════════
const ViewportMessage = ({ role, content, meta, width = 80, isFirst = true, isLast = true, type = 'text', blocks = [], isStreaming = false }) => {
// ═══════════════════════════════════════════════════════════════
// VIEWPORT MESSAGE - Unified Message Protocol Renderer (Alt)
// Supports meta field for consistent styling
// ═══════════════════════════════════════════════════════════════
// ═══════════════════════════════════════════════════════════════
// VIEWPORT MESSAGE - Unified Message Protocol Renderer (Alt)
// Supports meta field for consistent styling
// ═══════════════════════════════════════════════════════════════
const ViewportMessage = ({ role, content, meta, width = 80, isFirst = true, isLast = true, type = 'text', blocks = [], isStreaming = false }) => {
// PRO API: Use ChatBubble for everything
// For Assistant, we handle code blocks separately if they exist?
@@ -3956,8 +3956,8 @@ This gives the user a chance to refine requirements before implementation.
{ label: '/clear Clear Session', value: '/clear' },
// SmartX Engine toggle
soloMode
? { label: '/solo off SmartX Engine → OFF', value: '/smartx off' }
: { label: '/solo on SmartX Engine → ON', value: '/smartx on' },
? { label: '/smartx off SmartX → OFF', value: '/smartx off' }
: { label: '/smartx on SmartX → ON', value: '/smartx on' },
// Auto-Approve toggle
autoApprove
? { label: '/auto Auto-Approve → OFF', value: '/auto' }