Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

feat(ui): model picker + Docs/Plugins/Tools into the composer, Memory stands alone (web parity)

purple3dbd549a55e0
diff --git a/src/components/chat/ChatInput.tsx b/src/components/chat/ChatInput.tsx
index 9106be3e..353dced5 100644
--- a/src/components/chat/ChatInput.tsx
+++ b/src/components/chat/ChatInput.tsx
@@ -1,4 +1,4 @@
-import { useState, useRef, useEffect, useCallback } from 'react'
+import { useState, useRef, useEffect, useCallback, type ReactNode } from 'react'
import { motion } from 'framer-motion'
import { Send, Square, Paperclip, X, Brain, Terminal } from 'lucide-react'
import { matchAgentCommands, type AgentCommand } from '../../lib/agent-commands'
@@ -30,6 +30,17 @@ interface Props {
* receive attachments).
*/
onAttachDocs?: () => void
+ /**
+ * The model picker, rendered on the right of the action bar (before Send).
+ * The header no longer carries it — each surface passes an upward-opening
+ * ModelSelector so the prompt window owns the model choice (web parity).
+ */
+ composerModel?: ReactNode
+ /**
+ * View-specific action buttons (Docs · Plugins · Tools) shown in the action
+ * bar between Think and the model picker. Chat and Code pass different sets.
+ */
+ composerActions?: ReactNode
}
function fileToImageAttachment(file: File): Promise<ImageAttachment> {
@@ -45,7 +56,7 @@ function fileToImageAttachment(file: File): Promise<ImageAttachment> {
})
}
-export function ChatInput({ onSend, onStop, isGenerating, pendingApproval, onApprove, onReject, disabled, slashCommands, onAttachDocs }: Props) {
+export function ChatInput({ onSend, onStop, isGenerating, pendingApproval, onApprove, onReject, disabled, slashCommands, onAttachDocs, composerModel, composerActions }: Props) {
const [input, setInput] = useState('')
const [images, setImages] = useState<ImageAttachment[]>([])
const [isDragOver, setIsDragOver] = useState(false)
@@ -237,10 +248,10 @@ export function ChatInput({ onSend, onStop, isGenerating, pendingApproval, onApp
they belong to. ChatView owns the Enter/Esc keyboard layer. */}
<div
- className={`relative flex flex-col rounded-lg border px-2.5 py-1 transition-colors ${
+ className={`relative flex flex-col rounded-lg border transition-colors ${
isDragOver
? 'bg-blue-500/5 border-blue-500/30'
- : 'bg-gray-50 dark:bg-white/[0.03] border-gray-200 dark:border-white/[0.06]'
+ : 'bg-gray-50 dark:bg-white/[0.03] border-gray-200 dark:border-white/[0.06] focus-within:border-gray-400 dark:focus-within:border-white/15'
}`}
onDragOver={handleDragOver}
onDragLeave={handleDragLeave}
@@ -269,65 +280,84 @@ export function ChatInput({ onSend, onStop, isGenerating, pendingApproval, onApp
</div>
)}
- {/* Non-image attach hint (GH #69) — the clip is images-only; PDFs, Word,
- and text files go through the Documents panel so the model can read them. */}
- {docHint && (
- <div className="flex items-center gap-2 mb-1.5 px-2 py-1 rounded-md bg-amber-500/10 border border-amber-500/20 text-[0.62rem] text-amber-700 dark:text-amber-300">
- <span className="flex-1">The clip attaches images. To ask about a PDF, Word, or text file, add it in the Documents panel.</span>
- {onAttachDocs && (
+ {/* Prompt area — hints, image previews, then the textarea (buttons live
+ in the action bar below, web-parity two-row composer). */}
+ <div className="px-3 pt-2.5">
+ {/* Non-image attach hint (GH #69) — the clip is images-only; PDFs, Word,
+ and text files go through the Documents panel so the model can read them. */}
+ {docHint && (
+ <div className="flex items-center gap-2 mb-1.5 px-2 py-1 rounded-md bg-amber-500/10 border border-amber-500/20 text-[0.62rem] text-amber-700 dark:text-amber-300">
+ <span className="flex-1">The clip attaches images. To ask about a PDF, Word, or text file, add it in the Documents panel.</span>
+ {onAttachDocs && (
+ <button
+ onMouseDown={(e) => { e.preventDefault(); setDocHint(false); onAttachDocs() }}
+ className="shrink-0 px-1.5 py-0.5 rounded bg-amber-500/20 hover:bg-amber-500/30 text-amber-800 dark:text-amber-200 font-medium transition-colors"
+ >
+ Open Documents
+ </button>
+ )}
<button
- onMouseDown={(e) => { e.preventDefault(); setDocHint(false); onAttachDocs() }}
- className="shrink-0 px-1.5 py-0.5 rounded bg-amber-500/20 hover:bg-amber-500/30 text-amber-800 dark:text-amber-200 font-medium transition-colors"
+ onMouseDown={(e) => { e.preventDefault(); setDocHint(false) }}
+ className="shrink-0 text-amber-600/70 hover:text-amber-700 dark:text-amber-400/70 dark:hover:text-amber-300"
+ aria-label="Dismiss"
>
- Open Documents
+ <X size={11} />
</button>
- )}
- <button
- onMouseDown={(e) => { e.preventDefault(); setDocHint(false) }}
- className="shrink-0 text-amber-600/70 hover:text-amber-700 dark:text-amber-400/70 dark:hover:text-amber-300"
- aria-label="Dismiss"
- >
- <X size={11} />
- </button>
- </div>
- )}
+ </div>
+ )}
- {/* Image previews */}
- {images.length > 0 && (
- <div className="flex gap-1.5 mb-1.5 flex-wrap">
- {images.map((img, i) => (
- <div key={i} className="relative group">
- <img
- src={`data:${img.mimeType};base64,${img.data}`}
- alt={img.name}
- className="w-14 h-14 object-cover rounded-lg border border-white/10"
- />
- <button
- onClick={() => removeImage(i)}
- className="absolute -top-1 -right-1 w-4 h-4 rounded-full bg-red-500 text-white flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity"
- >
- <X size={8} />
- </button>
- <span className="absolute bottom-0 left-0 right-0 bg-black/60 text-[0.4rem] text-gray-300 text-center rounded-b-lg truncate px-0.5">
- {img.name}
- </span>
- </div>
- ))}
- </div>
- )}
+ {/* Image previews */}
+ {images.length > 0 && (
+ <div className="flex gap-1.5 mb-1.5 flex-wrap">
+ {images.map((img, i) => (
+ <div key={i} className="relative group">
+ <img
+ src={`data:${img.mimeType};base64,${img.data}`}
+ alt={img.name}
+ className="w-14 h-14 object-cover rounded-lg border border-white/10"
+ />
+ <button
+ onClick={() => removeImage(i)}
+ className="absolute -top-1 -right-1 w-4 h-4 rounded-full bg-red-500 text-white flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity"
+ >
+ <X size={8} />
+ </button>
+ <span className="absolute bottom-0 left-0 right-0 bg-black/60 text-[0.4rem] text-gray-300 text-center rounded-b-lg truncate px-0.5">
+ {img.name}
+ </span>
+ </div>
+ ))}
+ </div>
+ )}
- {/* Vision hint — a text-only model can't read the attached image.
- Non-blocking (send still works); the runtime error is also mapped
- to friendly copy. gthvidsten, GH Discussion #67. */}
- {images.length > 0 && activeModel && !canSeeImages && (
- <div className="flex items-start gap-1.5 mb-1.5 px-1 text-[0.55rem] leading-relaxed text-amber-600 dark:text-amber-400">
- <span className="shrink-0">⚠</span>
- <span>This model can't read images. Switch to a vision model (Gemma 4, LLaVA, Qwen-VL) to use the attachment.</span>
- </div>
- )}
+ {/* Vision hint — a text-only model can't read the attached image.
+ Non-blocking (send still works); the runtime error is also mapped
+ to friendly copy. gthvidsten, GH Discussion #67. */}
+ {images.length > 0 && activeModel && !canSeeImages && (
+ <div className="flex items-start gap-1.5 mb-1.5 px-1 text-[0.55rem] leading-relaxed text-amber-600 dark:text-amber-400">
+ <span className="shrink-0">⚠</span>
+ <span>This model can't read images. Switch to a vision model (Gemma 4, LLaVA, Qwen-VL) to use the attachment.</span>
+ </div>
+ )}
+
+ <textarea
+ ref={textareaRef}
+ value={input}
+ onChange={(e) => updateInput(e.target.value)}
+ onKeyDown={handleKeyDown}
+ onBlur={() => setTimeout(() => setCmdMenu([]), 120)}
+ onPaste={handlePaste}
+ placeholder={disabled ? "Unavailable" : isDragOver ? "Drop images here..." : isTranscribing ? "Transcribing..." : isVoiceRecording ? "Recording..." : "Message..."}
+ disabled={disabled}
+ rows={1}
+ className="w-full bg-transparent resize-none text-gray-800 dark:text-gray-200 placeholder-gray-400 dark:placeholder-gray-600 focus:outline-none text-[0.75rem] leading-relaxed max-h-[200px] disabled:opacity-50 scrollbar-thin"
+ />
+ </div>
- {/* Input row */}
- <div className="flex items-end gap-2">
+ {/* Action bar — attach · voice · think · view actions · model · send.
+ Same in Chat, Code and Remote; each surface passes its own
+ composerActions + composerModel (David 2026-07-11, web parity). */}
+ <div className="flex items-center gap-1 px-2 py-1.5 border-t border-gray-200 dark:border-white/[0.05] flex-wrap">
{/* Clip button */}
<button
onClick={() => fileInputRef.current?.click()}
@@ -359,19 +389,6 @@ export function ChatInput({ onSend, onStop, isGenerating, pendingApproval, onApp
disabled={isGenerating}
/>
- <textarea
- ref={textareaRef}
- value={input}
- onChange={(e) => updateInput(e.target.value)}
- onKeyDown={handleKeyDown}
- onBlur={() => setTimeout(() => setCmdMenu([]), 120)}
- onPaste={handlePaste}
- placeholder={disabled ? "Unavailable" : isDragOver ? "Drop images here..." : isTranscribing ? "Transcribing..." : isVoiceRecording ? "Recording..." : "Message..."}
- disabled={disabled}
- rows={1}
- className="flex-1 bg-transparent resize-none text-gray-800 dark:text-gray-200 placeholder-gray-400 dark:placeholder-gray-600 focus:outline-none text-[0.75rem] leading-relaxed max-h-[200px] disabled:opacity-50 scrollbar-thin"
- />
-
{/* Think toggle ('always'-models render it locked on) */}
<button
onClick={() => {
@@ -396,6 +413,14 @@ export function ChatInput({ onSend, onStop, isGenerating, pendingApproval, onApp
<span>Think</span>
</button>
+ {/* View-specific actions (Docs · Plugins · Tools) */}
+ {composerActions}
+
+ <div className="flex-1" />
+
+ {/* Model picker — opens upward from the composer */}
+ {composerModel}
+
{isGenerating ? (
<motion.button
onClick={onStop}
diff --git a/src/components/chat/ChatView.tsx b/src/components/chat/ChatView.tsx
index 2bcdc931..44e74c02 100644
--- a/src/components/chat/ChatView.tsx
+++ b/src/components/chat/ChatView.tsx
@@ -14,6 +14,8 @@ import { ErrorBoundary } from '../ui/ErrorBoundary'
import { useSettingsStore } from '../../stores/settingsStore'
import { FileText, ChevronDown, Download, Wrench, Radio, RefreshCw, X } from 'lucide-react'
import { PluginsDropdown } from './PluginsDropdown'
+import { ModelSelector } from '../models/ModelSelector'
+import { MemoryDebugToggle } from './MemoryDebugPanel'
import { TokenCounter } from './TokenCounter'
import { ContextDropdown } from './ContextDropdown'
import { SmallModelModeToggle } from './SmallModelModeToggle'
@@ -170,41 +172,10 @@ export function ChatView() {
{chatMode === 'codex' ? (
<CodexView />
) : (<>
- {/* Top bar — compact (LU mode) */}
+ {/* Top bar — slim: session/meta controls only. Docs · Plugins ·
+ Tools + the model picker moved into the composer action bar
+ (web parity, David 2026-07-11); Memory stands alone top-right. */}
<div className="flex items-center gap-1.5 px-2 pt-0.5">
- {/* Left: Tools Active dropdown (only when agent is active) */}
- {isAgentActive && (
- <div className="relative">
- <button
- onClick={() => setToolsDropdownOpen(!toolsDropdownOpen)}
- className="flex items-center gap-1 px-2 py-0.5 rounded border border-gray-200 dark:border-white/[0.06] text-gray-500 hover:border-gray-400 dark:hover:border-white/15 transition-colors text-[0.55rem]"
- >
- <Wrench size={9} className="text-green-400" />
- <span>Tools</span>
- <ChevronDown size={8} className={`transition-transform ${toolsDropdownOpen ? 'rotate-180' : ''}`} />
- </button>
- {/* Image-tool discovery noti dot — signals "open Tools" on
- image-gen-capable hardware; clears with the dropdown "1"
- (same seen flag). Purely visual. */}
- {imageToolNoti && (
- <span className="absolute -top-1 -right-1 w-2 h-2 rounded-full bg-purple-500 ring-2 ring-gray-100 dark:ring-[#141414] pointer-events-none" />
- )}
- {toolsDropdownOpen && (
- <>
- <div className="fixed inset-0 z-40" onClick={() => setToolsDropdownOpen(false)} />
- <div className="absolute left-0 top-full mt-0.5 z-50 w-28 rounded-md bg-white dark:bg-[#1a1a1a] border border-gray-200 dark:border-white/10 shadow-xl py-0.5 px-0.5">
- <PermissionOverrideBar />
- </div>
- </>
- )}
- </div>
- )}
-
- {/* Agent Mode — sits directly to the right of the Tools toggle.
- Tools only shows when agent is active, so when agent is OFF
- this Agent button occupies the Tools spot; when ON, Tools
- appears and Agent is immediately to its right. The button
- (in AgentModeToggle) is styled the same size as Tools. */}
<AgentModeToggle />
<AgentWorkspaceBadge />
@@ -221,6 +192,9 @@ export function ChatView() {
is active; plain chat has no tool calls to lean out. */}
{isAgentActive && <SmallModelModeToggle />}
+ {/* Memory — standalone, top-right (moved out of the header model
+ picker; David 2026-07-11). View / add / delete injected context. */}
+ <MemoryDebugToggle />
{/* Export */}
<div className="relative">
@@ -259,34 +233,6 @@ export function ChatView() {
</>
)}
</div>
-
- {/* Plugins dropdown (Caveman + Personas) */}
- <PluginsDropdown />
-
- {/* Documents (RAG) */}
- <button
- onClick={() => setRagPanelOpen(!ragPanelOpen)}
- className={
- 'flex items-center gap-1 px-2 py-0.5 rounded border transition-colors text-[0.55rem] ' +
- (ragPanelOpen || ragEnabled
- ? 'border-green-500/30 text-green-400'
- : 'border-gray-200 dark:border-white/[0.06] hover:border-gray-400 dark:hover:border-white/15 text-gray-500')
- }
- title="Document Chat (RAG)"
- >
- <FileText size={10} />
- <span>Docs</span>
- {docCount > 0 && (
- <span className={
- 'min-w-[12px] h-[12px] flex items-center justify-center rounded-full text-[0.45rem] font-bold ' +
- (ragEnabled ? 'bg-green-500 text-white' : 'bg-white/15 text-gray-300')
- }>
- {docCount}
- </span>
- )}
- </button>
-
- {/* (Agent Mode toggle relocated above, next to the Tools toggle.) */}
</div>
<MessageList
@@ -387,6 +333,62 @@ export function ChatView() {
onApprove={approveToolCall}
onReject={rejectToolCall}
onAttachDocs={() => setRagPanelOpen(true)}
+ composerModel={<ModelSelector openUpward />}
+ composerActions={
+ <>
+ {/* Documents (RAG) */}
+ <button
+ onClick={() => setRagPanelOpen(!ragPanelOpen)}
+ className={
+ 'flex items-center gap-1 px-2 py-1.5 rounded-md transition-all shrink-0 text-[0.6rem] font-medium ' +
+ (ragPanelOpen || ragEnabled
+ ? 'bg-green-500/15 text-green-400 border border-green-500/30'
+ : 'text-gray-500 hover:text-gray-300 hover:bg-white/5')
+ }
+ title="Document Chat (RAG)"
+ >
+ <FileText size={11} />
+ <span>Docs</span>
+ {docCount > 0 && (
+ <span className={
+ 'min-w-[12px] h-[12px] flex items-center justify-center rounded-full text-[0.45rem] font-bold ' +
+ (ragEnabled ? 'bg-green-500 text-white' : 'bg-white/15 text-gray-300')
+ }>
+ {docCount}
+ </span>
+ )}
+ </button>
+
+ {/* Plugins (Chat Tools + Caveman + Personas) */}
+ <PluginsDropdown openUpward />
+
+ {/* Tools — agent permission overrides (only when agent active) */}
+ {isAgentActive && (
+ <div className="relative">
+ <button
+ onClick={() => setToolsDropdownOpen(!toolsDropdownOpen)}
+ className="flex items-center gap-1 px-2 py-1.5 rounded-md text-gray-500 hover:text-gray-300 hover:bg-white/5 transition-all shrink-0 text-[0.6rem] font-medium"
+ >
+ <Wrench size={11} className="text-green-400" />
+ <span>Tools</span>
+ <ChevronDown size={9} className={`transition-transform ${toolsDropdownOpen ? 'rotate-180' : ''}`} />
+ </button>
+ {/* Image-tool discovery noti dot — purely visual. */}
+ {imageToolNoti && (
+ <span className="absolute -top-1 -right-1 w-2 h-2 rounded-full bg-purple-500 ring-2 ring-gray-100 dark:ring-[#141414] pointer-events-none" />
+ )}
+ {toolsDropdownOpen && (
+ <>
+ <div className="fixed inset-0 z-40" onClick={() => setToolsDropdownOpen(false)} />
+ <div className="absolute left-0 bottom-full mb-0.5 z-50 w-28 rounded-md bg-white dark:bg-[#1a1a1a] border border-gray-200 dark:border-white/10 shadow-xl py-0.5 px-0.5">
+ <PermissionOverrideBar />
+ </div>
+ </>
+ )}
+ </div>
+ )}
+ </>
+ }
/>
</>)}
</div>
diff --git a/src/components/chat/CodexView.tsx b/src/components/chat/CodexView.tsx
index 08df68b5..5d1a751e 100644
--- a/src/components/chat/CodexView.tsx
+++ b/src/components/chat/CodexView.tsx
@@ -11,6 +11,7 @@ import { ContextDropdown } from './ContextDropdown'
import { SmallModelModeToggle } from './SmallModelModeToggle'
import { RealtimeCounter } from './RealtimeCounter'
import { PluginsDropdown } from './PluginsDropdown'
+import { ModelSelector } from '../models/ModelSelector'
import { TypingIndicator } from './TypingIndicator'
import { useSettingsStore } from '../../stores/settingsStore'
import { useModelStore } from '../../stores/modelStore'
@@ -229,7 +230,6 @@ export function CodexView() {
<TokenCounter />
<ContextDropdown />
<SmallModelModeToggle />
- <PluginsDropdown />
</div>
{/* Git-missing banner (v2.5.0). Codex shells out to git for
@@ -517,6 +517,8 @@ export function CodexView() {
onStop={stopCodex}
isGenerating={isRunning}
slashCommands
+ composerModel={<ModelSelector openUpward />}
+ composerActions={<PluginsDropdown openUpward />}
/>
</div>
diff --git a/src/components/chat/PluginsDropdown.tsx b/src/components/chat/PluginsDropdown.tsx
index e6f068b9..2046547d 100644
--- a/src/components/chat/PluginsDropdown.tsx
+++ b/src/components/chat/PluginsDropdown.tsx
@@ -11,7 +11,9 @@ const CAVEMAN_MODES: { value: CavemanMode; label: string; desc: string }[] = [
{ value: 'ultra', label: 'Ultra', desc: 'Maximum brevity' },
]
-export function PluginsDropdown() {
+// `openUpward` opens the panel above the trigger — used when Plugins sits in
+// the composer action bar (bottom of the screen) instead of the top toolbar.
+export function PluginsDropdown({ openUpward = false }: { openUpward?: boolean } = {}) {
const [open, setOpen] = useState(false)
const [cavemanOpen, setCavemanOpen] = useState(false)
const [personaOpen, setPersonaOpen] = useState(false)
@@ -66,7 +68,7 @@ export function PluginsDropdown() {
{open && (
<>
<div className="fixed inset-0 z-40" onClick={() => setOpen(false)} />
- <div className="absolute right-0 top-full mt-1 z-50 w-56 rounded-lg bg-white dark:bg-[#262626] border border-gray-200 dark:border-white/10 shadow-xl py-1.5">
+ <div className={`absolute right-0 z-50 w-56 rounded-lg bg-white dark:bg-[#262626] border border-gray-200 dark:border-white/10 shadow-xl py-1.5 ${openUpward ? 'bottom-full mb-1' : 'top-full mt-1'}`}>
{/* ── Chat Tools toggle (v2.5.3) ──────────────── */}
<div className="px-2.5">
diff --git a/src/components/layout/Header.tsx b/src/components/layout/Header.tsx
index 7ef4fb95..ee995611 100644
--- a/src/components/layout/Header.tsx
+++ b/src/components/layout/Header.tsx
@@ -5,8 +5,7 @@ import { useSettingsStore } from '../../stores/settingsStore'
import { useChatStore } from '../../stores/chatStore'
import { useCompareStore } from '../../stores/compareStore'
import { useModelStore } from '../../stores/modelStore'
-import { ModelSelector } from '../models/ModelSelector'
-import { MemoryDebugToggle } from '../chat/MemoryDebugPanel'
+import { useProviderStore } from '../../stores/providerStore'
import { UpdateBadge } from './UpdateBadge'
import { DownloadBadge } from './DownloadBadge'
import { CloudSwitch } from '../cloud/CloudSwitch'
@@ -27,13 +26,31 @@ export function Header() {
// the model with "does not support (chat|completion|generate)". Offers a
// one-click refresh that re-pulls the model (progress tracked in DownloadBadge).
const [staleError, setStaleError] = useState<{ model: string; message: string } | null>(null)
- const { pullModel, isPullingModel } = useModels()
+ const { pullModel, isPullingModel, fetchModels } = useModels()
const healthStaleModels = useModelHealthStore((s) => s.staleModels)
const addStaleToHealth = useModelHealthStore((s) => s.setStaleModels)
const markHealthFresh = useModelHealthStore((s) => s.markFresh)
const [showMoreMenu, setShowMoreMenu] = useState(false)
const isCreateView = currentView === 'create'
+ // App-level model bootstrap. This used to ride on the header ModelSelector,
+ // which sat here always-mounted; the picker has moved into the composer
+ // (mounted only inside an active chat), so the header now owns the fetch.
+ // Without it a fresh start never populates the list — and setModels' auto-
+ // select of the first chat model never fires, so `activeModel` stays null and
+ // New Chat dead-ends on the "pick a model" page. Refetch on provider changes
+ // too (enable LM Studio / add a key in Settings), mirroring the old picker.
+ useEffect(() => { fetchModels() }, [fetchModels])
+ useEffect(() => {
+ const unsub = useProviderStore.subscribe((state, prev) => {
+ const changed = (Object.keys(state.providers) as Array<keyof typeof state.providers>)
+ .some((id) => state.providers[id]?.enabled !== prev.providers[id]?.enabled
+ || state.providers[id]?.baseUrl !== prev.providers[id]?.baseUrl)
+ if (changed) fetchModels()
+ })
+ return () => unsub()
+ }, [fetchModels])
+
// Check if active model is an Ollama model
const isOllamaModel = activeModel ? getProviderIdFromModel(activeModel) === 'ollama' : false
const modelToUse = activeModel?.includes('::') ? activeModel.split('::')[1] : activeModel
@@ -197,51 +214,39 @@ export function Header() {
live here has moved INTO the dropdown — each model row in
`ModelSelector` has its own load/unload toggle next to the name. */}
<div className="lg:absolute lg:left-1/2 lg:-translate-x-1/2 flex items-center justify-center gap-2 min-w-0 ">
- {/* The redesigned Create surface owns its own controls (IntentBar/
- Composer) — the header center stays empty there, like the chat
- model picker does not apply to Create. */}
- {currentView === 'create' ? null : (
- <>
- <ModelSelector />
- {/* Lichtschalter (load/unload into VRAM) now lives per-row inside the
- ModelSelector dropdown — the header center stays just the picker. */}
- {/* Memory — moved here from the chat/code/agent toolbars (David
- 2026-06-06). One brain icon next to the model picker → editable
- memory popover (view / add / delete the injected context). */}
- <MemoryDebugToggle />
-
- {isOllamaModel && staleError && (
- <div
- className="ml-1.5 flex items-center gap-1 px-1.5 py-[2px] rounded-md bg-amber-500/10 border border-amber-400/30 text-[0.6rem]"
- title={staleError.message}
- >
- <span className="text-amber-600 dark:text-amber-300 font-medium">
- stale — refresh?
- </span>
- <button
- onClick={handleRefreshStale}
- disabled={isRefreshing}
- className="flex items-center gap-0.5 px-1 py-[1px] rounded text-amber-700 dark:text-amber-200 hover:bg-amber-500/20 disabled:opacity-50 transition-colors"
- title={`Re-pull ${staleError.model}`}
- >
- {isRefreshing ? (
- <Loader2 size={9} className="animate-spin" />
- ) : (
- <RefreshCw size={9} />
- )}
- <span>Refresh</span>
- </button>
- <button
- onClick={() => setStaleError(null)}
- className="flex items-center p-[1px] rounded text-amber-600/70 hover:text-amber-800 hover:bg-amber-500/20 transition-colors"
- title="Dismiss"
- aria-label="Dismiss"
- >
- <X size={9} />
- </button>
- </div>
- )}
- </>
+ {/* Model picker + Memory moved out of the header into the composer /
+ top-right (web parity, David 2026-07-11). Only the stale-manifest
+ warning still surfaces here — chat/code only, never Create. */}
+ {currentView !== 'create' && isOllamaModel && staleError && (
+ <div
+ className="flex items-center gap-1 px-1.5 py-[2px] rounded-md bg-amber-500/10 border border-amber-400/30 text-[0.6rem]"
+ title={staleError.message}
+ >
+ <span className="text-amber-600 dark:text-amber-300 font-medium">
+ stale — refresh?
+ </span>
+ <button
+ onClick={handleRefreshStale}
+ disabled={isRefreshing}
+ className="flex items-center gap-0.5 px-1 py-[1px] rounded text-amber-700 dark:text-amber-200 hover:bg-amber-500/20 disabled:opacity-50 transition-colors"
+ title={`Re-pull ${staleError.model}`}
+ >
+ {isRefreshing ? (
+ <Loader2 size={9} className="animate-spin" />
+ ) : (
+ <RefreshCw size={9} />
+ )}
+ <span>Refresh</span>
+ </button>
+ <button
+ onClick={() => setStaleError(null)}
+ className="flex items-center p-[1px] rounded text-amber-600/70 hover:text-amber-800 hover:bg-amber-500/20 transition-colors"
+ title="Dismiss"
+ aria-label="Dismiss"
+ >
+ <X size={9} />
+ </button>
+ </div>
)}
</div>
diff --git a/src/components/models/ModelSelector.tsx b/src/components/models/ModelSelector.tsx
index 35fcaecc..b290b7f4 100644
--- a/src/components/models/ModelSelector.tsx
+++ b/src/components/models/ModelSelector.tsx
@@ -351,7 +351,10 @@ function LoadToggle({ loaded, busy, disabled, onClick }: {
// ── Component ─────────────────────────────────────────────────
-export function ModelSelector() {
+// `openUpward` flips the dropdown to open above the trigger, right-aligned —
+// used when the picker lives in the composer action bar (bottom of the screen)
+// instead of the header. Header usage keeps the default downward/centered menu.
+export function ModelSelector({ openUpward = false }: { openUpward?: boolean } = {}) {
const { models, activeModel, setActiveModel, fetchModels } = useModels()
const isModelLoading = useModelStore((s) => s.isModelLoading)
const [open, setOpen] = useState(false)
@@ -601,10 +604,12 @@ export function ModelSelector() {
<AnimatePresence>
{open && (
<motion.div
- className="absolute top-full mt-1.5 left-1/2 -translate-x-1/2 w-72 rounded-lg overflow-hidden z-50 bg-[#363636] border border-white/[0.08] shadow-2xl shadow-black/50"
- initial={{ opacity: 0, y: -6, scale: 0.98 }}
+ className={`absolute w-72 rounded-lg overflow-hidden z-50 bg-[#363636] border border-white/[0.08] shadow-2xl shadow-black/50 ${
+ openUpward ? 'bottom-full mb-1.5 right-0' : 'top-full mt-1.5 left-1/2 -translate-x-1/2'
+ }`}
+ initial={{ opacity: 0, y: openUpward ? 6 : -6, scale: 0.98 }}
animate={{ opacity: 1, y: 0, scale: 1 }}
- exit={{ opacity: 0, y: -6, scale: 0.98 }}
+ exit={{ opacity: 0, y: openUpward ? 6 : -6, scale: 0.98 }}
transition={{ duration: 0.12, ease: 'easeOut' }}
>
{/* Bug Q v2.4.7 — surface "Start LM Studio Server" inline when