Skip to content

Faza 3: Agent UI - ModelSelector and StatusBar improvements - #5

Open
Finfinder wants to merge 3 commits into
0.0.1from
feat/0.0.1/Issue/3
Open

Faza 3: Agent UI - ModelSelector and StatusBar improvements#5
Finfinder wants to merge 3 commits into
0.0.1from
feat/0.0.1/Issue/3

Conversation

@Finfinder

Copy link
Copy Markdown
Owner

Implements:

  • ModelSelector component with provider grouping and search
  • AgentSelector position prop for upward dropdown opening
  • Integration of AgentSelector/ModelSelector in ChatInput footer
  • SSE error debounce (4s) in StatusBar to avoid flashing during reconnects
  • Working state display during generation

Related to Issue #3 - Phase 3 Agent UI implementation

Copilot AI review requested due to automatic review settings July 27, 2026 22:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR advances the Phase 3 “Agent UI” work by moving agent/model controls into the chat input footer, introducing a new ModelSelector, and improving connection status UX to be less noisy during SSE reconnects.

Changes:

  • Added ModelSelector (grouped by provider + search) and integrated it into ChatInput next to AgentSelector.
  • Added upward-opening dropdown support (position="top") for selectors used in the bottom footer.
  • Debounced SSE error display in StatusBar and added a “Working…” status during generation.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/lib/opencode/config.ts Adds sessionModelToConfig helper to convert API session model into ModelConfig.
src/components/StatusBar/StatusBar.tsx Debounces SSE error display and shows “Working…” during generation.
src/components/StatusBar/StatusBar.test.tsx Updates/extends tests for debounced error and working state.
src/components/StatusBar/StatusBar.module.css Adds styling for the new sse_working state.
src/components/ModelSelector/ModelSelector.tsx Introduces new model dropdown UI with provider grouping and search.
src/components/ModelSelector/ModelSelector.module.css Styles for ModelSelector dropdown/search/grouped list.
src/components/ModelSelector/index.ts Exports the new ModelSelector component/types.
src/components/Chat/ChatPanel.tsx Extends props to pass agent/model change handlers to ChatInput.
src/components/Chat/ChatInput.tsx Renders AgentSelector/ModelSelector in the footer instead of static labels.
src/components/Chat/ChatInput.module.css Allows footer dropdowns to overflow outside the input box.
src/components/AgentSelector/AgentSelector.tsx Adds position prop and adjusts dropdown rendering for upward opening.
src/components/AgentSelector/AgentSelector.module.css Adds .dropdownTop positioning style.
src/App.tsx Wires agent change handler into chat footer; adds model conversion + (currently stubbed) model change handler.
.github/Issue/agent-first-ide-faza-3-agent-ui.plan.md Updates Phase 3 implementation log/notes.
Comments suppressed due to low confidence (3)

src/components/ModelSelector/ModelSelector.tsx:27

  • PREDEFINED_AGENTS currently has no global entry and (in this repo) no agents define model, so allModels ends up empty and the dropdown shows “No models found.”. Seed the map with the default + currently selected model so the selector always has options.
    // Add global default model
    const globalModel = PREDEFINED_AGENTS.find(a => a.name === 'global')?.model || {
      model: 'gpt-4',
      provider: 'openai',
    };

src/components/ModelSelector/ModelSelector.tsx:50

  • allModels now depends on the currently selected value (to ensure it’s included in the list). With an empty dependency array, switching sessions/models won’t update the available options.
  }, []);

src/components/ModelSelector/ModelSelector.tsx:104

  • Selection state should include provider as well as model; otherwise the wrong option can appear selected if two providers expose the same model ID.
                        aria-selected={model.model === value.model}
                        className={`${styles.option} ${model.model === value.model ? styles.selected : ''}`}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// ─── OpenCode Configuration ─────────────────────────────────────────────────
// Configuration types for compaction, model selection, and agent settings.

import { Session } from './types';
@@ -0,0 +1,123 @@
import { useMemo, useState } from 'react';
import { PREDEFINED_AGENTS, getEffectiveModel, type ModelConfig } from '@/lib/opencode/config';
Comment thread src/App.tsx
Comment on lines +113 to +118
<ChatPanel
agentName={agent}
onAgentChange={setAgent}
model={activeModel}
onModelChange={() => { /* Handle model change - would update session */ }}
/>
Comment on lines +76 to +86
it("shows 'Error' when SSE is in error state after debounce", () => {
vi.useFakeTimers();
mockUseAgent.mockReturnValue(
mockAgentState({ state: { sseStatus: "error" } }),
);
render(<StatusBar />);
// Fast-forward past the 4s debounce
act(() => vi.advanceTimersByTime(4000));
expect(screen.getByText(/Error/)).toBeInTheDocument();
vi.useRealTimers();
});
@Finfinder
Finfinder force-pushed the feat/0.0.1/Issue/3 branch 3 times, most recently from b6f6839 to 93011c3 Compare July 27, 2026 22:59
… in chat footer; implement SSE error debounce in StatusBar
@Finfinder
Finfinder force-pushed the feat/0.0.1/Issue/3 branch from 93011c3 to 675ec6a Compare July 27, 2026 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants