-
Notifications
You must be signed in to change notification settings - Fork 46
refactor(tui): migrate to OpenTUI/Solid.js framework #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
e528bdd
refactor(tui): migrate to OpenTUI/Solid.js framework
rohitg00 5e48352
fix(tui): address CodeRabbit review feedback
rohitg00 1a69960
fix(tui): address remaining CodeRabbit feedback
rohitg00 55bb249
fix(tui): add Solid.js OpenTUI type definitions
rohitg00 9f3da93
fix(tui): add stub services and fix type errors for CI
rohitg00 909a4fc
fix(tui): add missing component files for CI
rohitg00 4484aa6
fix(tui): resolve context import and duplicate export issues
rohitg00 a162da5
fix(tui): use export type for type-only re-exports
rohitg00 f53cc15
refactor(tui): simplify components and remove redundant exports
rohitg00 cbd4d4e
refactor(tui): remove unused imports and variables
rohitg00 38f6987
fix(tui): wire up interactive handlers and fix type definitions
rohitg00 e62371e
fix(tui): address Devin review issues
rohitg00 2d9badd
fix(tui): address Devin and CodeRabbit review issues
rohitg00 bb22aa4
fix(tui): implement list windowing to keep selection visible
rohitg00 368261b
fix(tui): add error handling and index clamping
rohitg00 3189ebc
fix(tui): add error handling to Plugins and Workflow screens
rohitg00 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
devin-ai-integration[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,68 +1,69 @@ | ||
| /** | ||
| * AgentGrid Component | ||
| * Displays monochromatic agent logos in a grid layout | ||
| */ | ||
| import { Show, For, createMemo } from 'solid-js'; | ||
| import { AGENT_LOGOS, type AgentLogo } from '../theme/symbols.js'; | ||
| import { terminalColors } from '../theme/colors.js'; | ||
|
|
||
| interface AgentGridProps { | ||
| /** Maximum number of agents to display */ | ||
| maxVisible?: number; | ||
| /** Show status indicators for detected agents */ | ||
| showStatus?: boolean; | ||
| /** Agent types that are detected/active */ | ||
| detectedAgents?: string[]; | ||
| /** Number of columns in the grid */ | ||
| columns?: number; | ||
| } | ||
|
|
||
| export function AgentGrid({ | ||
| maxVisible = 12, | ||
| showStatus = true, | ||
| detectedAgents = [], | ||
| columns = 4, | ||
| }: AgentGridProps) { | ||
| const safeColumns = Math.max(1, columns); | ||
| export function AgentGrid(props: AgentGridProps) { | ||
| const maxVisible = () => props.maxVisible ?? 12; | ||
| const showStatus = () => props.showStatus ?? true; | ||
| const detectedAgents = () => props.detectedAgents ?? []; | ||
| const columns = () => Math.max(1, props.columns ?? 4); | ||
|
|
||
| const allAgents = Object.entries(AGENT_LOGOS); | ||
| const visibleAgents = allAgents.slice(0, maxVisible); | ||
| const hiddenCount = allAgents.length - maxVisible; | ||
| const visibleAgents = () => allAgents.slice(0, maxVisible()); | ||
| const hiddenCount = () => allAgents.length - maxVisible(); | ||
|
|
||
| const rows: [string, AgentLogo][][] = []; | ||
| for (let i = 0; i < visibleAgents.length; i += safeColumns) { | ||
| rows.push(visibleAgents.slice(i, i + safeColumns)); | ||
| } | ||
| const rows = createMemo((): [string, AgentLogo][][] => { | ||
| const result: [string, AgentLogo][][] = []; | ||
| const visible = visibleAgents(); | ||
| for (let i = 0; i < visible.length; i += columns()) { | ||
| result.push(visible.slice(i, i + columns())); | ||
| } | ||
| return result; | ||
| }); | ||
|
|
||
| return ( | ||
| <box flexDirection="column"> | ||
| <text fg={terminalColors.text}> | ||
| <b>Works with</b> | ||
| </text> | ||
| <text> </text> | ||
| {rows.map((row, rowIndex) => ( | ||
| <box key={`row-${rowIndex}`} flexDirection="row"> | ||
| {row.map(([agentType, agent]) => { | ||
| const isDetected = detectedAgents.includes(agentType); | ||
| const statusIcon = showStatus ? (isDetected ? '●' : '○') : ''; | ||
| const fg = isDetected ? terminalColors.accent : terminalColors.text; | ||
| <For each={rows()}> | ||
| {(row, rowIndex) => ( | ||
| <box flexDirection="row"> | ||
| <For each={row}> | ||
| {([agentType, agent]) => { | ||
| const isDetected = () => detectedAgents().includes(agentType); | ||
| const statusIcon = () => (showStatus() ? (isDetected() ? '●' : '○') : ''); | ||
| const fg = () => (isDetected() ? terminalColors.accent : terminalColors.text); | ||
|
|
||
| return ( | ||
| <box key={agentType} width={18}> | ||
| <text fg={fg}> | ||
| {agent.icon} {agent.name} | ||
| {showStatus && ( | ||
| <span fg={isDetected ? terminalColors.success : terminalColors.textMuted}> | ||
| {' '}{statusIcon} | ||
| </span> | ||
| )} | ||
| </text> | ||
| </box> | ||
| ); | ||
| })} | ||
| </box> | ||
| ))} | ||
| {hiddenCount > 0 && ( | ||
| <text fg={terminalColors.textMuted}>+{hiddenCount} more agents</text> | ||
| )} | ||
| return ( | ||
| <box width={18}> | ||
| <text fg={fg()}> | ||
| {agent.icon} {agent.name} | ||
| <Show when={showStatus()}> | ||
| <span fg={isDetected() ? terminalColors.success : terminalColors.textMuted}> | ||
| {' '} | ||
| {statusIcon()} | ||
| </span> | ||
| </Show> | ||
| </text> | ||
| </box> | ||
| ); | ||
| }} | ||
| </For> | ||
| </box> | ||
| )} | ||
| </For> | ||
| <Show when={hiddenCount() > 0}> | ||
| <text fg={terminalColors.textMuted}>+{hiddenCount()} more agents</text> | ||
| </Show> | ||
| </box> | ||
| ); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.