fix: update settings and skills handling with assistant redirect (#220)

* fix: enable swipe-back suspension on more drawer and remove unused variable

* refactor(frontend): improve dialog component and settings navigation

* fix: disable route swipe suspension in MoreDrawer to prevent unintended navigation

* fix(frontend): enable swipe-back suspension on more drawer route

* refactor(frontend): improve mobile navigation drawer and tab bar

* feat: add schedules service and workspace hook with navigation updates

* chore: add workspace hook, schedules library, and tests

* fix: prevent MoreDrawer sentinel from undoing navigation

* feat: per-agent model selection and UI refinements (#217)

* feat: per-agent model selection and UI refinements

- Add agentModels store with setAgentModel/getAgentModel
- PromptInput uses session model priority and stores agent model on change
- useContextUsage derives model from assistant message instead of global
- Migrate sub-agent/subtask badges from purple to blue with refined styling
- Fix MoreDrawer sentinel to skip history-back on navigation

* refactor: improve per-agent model selection and task tool call status indicators

* feat: add repo management skill and internal repos API

* fix: improve assistant session launcher and UI components

* fix: update atomic-json test assertions

* refactor: split Assistant Mode instructions between AGENTS.md and assistant.md

* loop: todo-header-mobile completed after 3 iterations (#218)

* loop: stt-perf-1 completed after 5 iterations

* fix: load audio worklet per recording context

* fix: canonicalize assistant navigation routes

* fix: adjust scroll-up threshold for header visibility

* fix: update settings and skills handling with assistant redirect

* refactor: simplify context usage indicator and extract token sum helper

* feat: add currently selected model row to popover and fix responsive truncate
This commit is contained in:
Chris Scott authored and GitHub committed 2026-05-07 18:36:03 -04:00
1 parent c7291518c8
commit 74cdeb3926
73 files changed
+4073 -632

No files matched your search

@@ -2,6 +2,7 @@ import { useState, useRef, useEffect } from 'react'
import type { components } from '@/api/opencode-types'
import { useSettings } from '@/hooks/useSettings'
import { useUserBash } from '@/stores/userBashStore'
import { useSessionStatusForSession } from '@/stores/sessionStatusStore'
import { usePermissions, useQuestions } from '@/contexts/EventContext'
import { detectFileReferences } from '@/lib/fileReferences'
import { ExternalLink, Loader2 } from 'lucide-react'
@@ -68,6 +69,8 @@ function ClickableJson({ json, onFileClick }: { json: unknown; onFileClick?: (fi
export function ToolCallPart({ part, onFileClick, onChildSessionClick }: ToolCallPartProps) {
const { preferences } = useSettings()
const { userBashCommands } = useUserBash()
const taskSessionId = part.tool === 'task' ? getTaskSessionId(part) : undefined
const taskSessionStatus = useSessionStatusForSession(taskSessionId)
const { getForCallID: getPermissionForCallID } = usePermissions()
const { getForCallID: getQuestionForCallID } = useQuestions()
const outputRef = useRef<HTMLDivElement>(null)
@@ -152,17 +155,36 @@ export function ToolCallPart({ part, onFileClick, onChildSessionClick }: ToolCal
const isFileTool = ['read', 'write', 'edit'].includes(part.tool)
if (part.tool === 'task') {
const sessionId = getTaskSessionId(part)
const sessionId = taskSessionId
const description = previewText || 'Sub-agent task'
const isRunning = part.state.status === 'running' || part.state.status === 'pending'
const status = part.state.status
const isPending = status === 'pending'
const isRunning = status === 'running' && taskSessionStatus.type !== 'idle'
const isCompleted = status === 'completed' || (status === 'running' && !!sessionId && taskSessionStatus.type === 'idle')
const isError = status === 'error'
const content = (
<div className="flex items-center gap-2 min-w-0">
{isRunning ? (
<Loader2 className="w-3.5 h-3.5 animate-spin text-purple-600 dark:text-purple-400" />
) : null}
{isPending && (
<div className="flex gap-1">
<span className="w-2 h-2 rounded-full bg-muted-foreground" />
<span className="w-2 h-2 rounded-full bg-muted-foreground" />
<span className="w-2 h-2 rounded-full bg-muted-foreground" />
</div>
)}
{isRunning && (
<div className="flex gap-1">
<span className="w-2.5 h-2.5 rounded-full bg-blue-500 animate-bounce" style={{ animationDelay: '0ms' }} />
<span className="w-2.5 h-2.5 rounded-full bg-blue-500 animate-bounce" style={{ animationDelay: '150ms' }} />
<span className="w-2.5 h-2.5 rounded-full bg-blue-500 animate-bounce" style={{ animationDelay: '300ms' }} />
</div>
)}
{isCompleted && <span className="text-green-600 text-sm font-medium">✓</span>}
{isError && <span className="text-red-600 text-sm font-medium">✗</span>}
<span className="font-medium text-foreground truncate">{description}</span>
<span className="text-[11px] text-muted-foreground ml-auto shrink-0">sub-agent</span>
{sessionId && <ExternalLink className="w-3 h-3 shrink-0 text-purple-600 dark:text-purple-400" />}
<span className="text-[11px] font-medium text-orange-600 dark:text-orange-400 shrink-0">sub-agent</span>
{sessionId && <ExternalLink className="w-3 h-3 shrink-0 text-blue-600 dark:text-blue-400" />}
</div>
)
@@ -170,7 +192,7 @@ export function ToolCallPart({ part, onFileClick, onChildSessionClick }: ToolCal
return (
<button
onClick={() => onChildSessionClick?.(sessionId)}
className="my-1 w-full rounded border border-purple-500/20 bg-purple-500/5 px-2 py-1 text-left text-xs text-muted-foreground hover:bg-purple-500/10 transition-colors"
className="my-1 w-full rounded-lg border border-blue-500/20 bg-blue-500/5 px-3 py-1.5 text-left text-xs text-muted-foreground hover:bg-blue-500/10 hover:border-blue-500/30 transition-all duration-200 shadow-sm shadow-blue-500/5"
title="View subagent session"
>
{content}
@@ -179,7 +201,7 @@ export function ToolCallPart({ part, onFileClick, onChildSessionClick }: ToolCal
}
return (
<div className="my-1 rounded border border-purple-500/20 bg-purple-500/5 px-2 py-1 text-xs text-muted-foreground">
<div className="my-1 rounded-lg border border-blue-500/20 bg-blue-500/5 px-3 py-1.5 text-xs text-muted-foreground shadow-sm shadow-blue-500/5">
{content}
</div>
)
@@ -278,7 +300,7 @@ export function ToolCallPart({ part, onFileClick, onChildSessionClick }: ToolCal
e.stopPropagation()
onChildSessionClick?.(sessionId)
}}
className="text-purple-600 dark:text-purple-400 text-xs hover:text-purple-700 dark:hover:text-purple-300 cursor-pointer underline decoration-dotted flex items-center gap-1"
className="text-blue-600 dark:text-blue-400 text-xs hover:text-blue-700 dark:hover:text-blue-300 cursor-pointer underline decoration-dotted flex items-center gap-1"
title="View subagent session"
>
<ExternalLink className="w-3 h-3" />