mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
feat(themes): apply OpenCode color themes app-wide with a settings picker (#364)
- Vendor the 36 OpenCode theme palettes into the shared package, synced from the pinned OpenCode release tag via pnpm themes:sync. - Add a colorTheme user preference across the settings schema, defaults, and the assistant internal API. - Extend palettes with success, warning, info, and diff colors, and add a resolver that maps palettes to CSS tokens and applies them to the DOM. - Apply the theme app-wide through a ThemeProvider context, adopting the tokens in message, repo, session, and settings components, agent colors, git status styles, and diff viewers. - Add a theme picker to General settings and make model quick-select follow the active theme (fixes #355).
This commit is contained in:
1 parent
702e3c4e13
commit
5bd688de4b
116 files changed
+2702
-760
No files matched your search
@@ -117,8 +117,8 @@ export function ContentDiffViewer({ before, after }: ContentDiffViewerProps) {
|
||||
key={index}
|
||||
className={cn(
|
||||
'flex font-mono text-xs',
|
||||
isAdd && 'bg-green-500/10',
|
||||
isRemove && 'bg-red-500/10',
|
||||
isAdd && 'bg-diff-add/10',
|
||||
isRemove && 'bg-diff-delete/10',
|
||||
)}
|
||||
>
|
||||
{!isMobile && (
|
||||
@@ -132,14 +132,14 @@ export function ContentDiffViewer({ before, after }: ContentDiffViewerProps) {
|
||||
</div>
|
||||
)}
|
||||
<div className="w-4 flex-shrink-0 flex items-center justify-center">
|
||||
{isAdd && <Plus className="w-2.5 h-2.5 text-green-500" />}
|
||||
{isRemove && <Minus className="w-2.5 h-2.5 text-red-500" />}
|
||||
{isAdd && <Plus className="w-2.5 h-2.5 text-diff-add" />}
|
||||
{isRemove && <Minus className="w-2.5 h-2.5 text-diff-delete" />}
|
||||
</div>
|
||||
<pre
|
||||
className={cn(
|
||||
'flex-1 px-1 py-0.5 whitespace-pre-wrap break-all',
|
||||
isAdd && 'text-green-600 dark:text-green-400',
|
||||
isRemove && 'text-red-600 dark:text-red-400',
|
||||
isAdd && 'text-diff-add',
|
||||
isRemove && 'text-diff-delete',
|
||||
)}
|
||||
>
|
||||
{truncateLine(line.content)}
|
||||
|
||||
@@ -14,7 +14,7 @@ export function DiffStats({ additions, deletions, variant = 'default' }: DiffSta
|
||||
return (
|
||||
<span className="flex items-center gap-1 text-xs font-mono">
|
||||
{additions > 0 && (
|
||||
<span className="text-green-600 dark:text-green-400">
|
||||
<span className="text-diff-add">
|
||||
{compact ? `+${additions}` : `+${additions}`}
|
||||
</span>
|
||||
)}
|
||||
@@ -22,7 +22,7 @@ export function DiffStats({ additions, deletions, variant = 'default' }: DiffSta
|
||||
<span className="text-muted-foreground">{compact ? '/' : ' '}</span>
|
||||
)}
|
||||
{deletions > 0 && (
|
||||
<span className="text-red-600 dark:text-red-400">
|
||||
<span className="text-diff-delete">
|
||||
{compact ? `-${deletions}` : `-${deletions}`}
|
||||
</span>
|
||||
)}
|
||||
|
||||
@@ -148,7 +148,7 @@ export const ClickableUserMessage = memo(function ClickableUserMessage({
|
||||
return (
|
||||
<button
|
||||
onClick={onClick}
|
||||
className="text-left text-sm whitespace-pre-wrap break-words w-full group/edit hover:bg-blue-600/10 rounded p-1 -m-1 transition-colors flex items-start gap-2"
|
||||
className="text-left text-sm whitespace-pre-wrap break-words w-full group/edit hover:bg-primary/10 rounded p-1 -m-1 transition-colors flex items-start gap-2"
|
||||
title="Click to edit and resend"
|
||||
>
|
||||
<span className="flex-1">{content}</span>
|
||||
|
||||
@@ -47,13 +47,13 @@ function PatchViewer({ patch }: { patch: string }) {
|
||||
<pre className="bg-accent p-2 text-xs overflow-x-auto">
|
||||
{lines.map((line, index) => {
|
||||
const tone = line.startsWith('@@')
|
||||
? 'text-blue-600 dark:text-blue-400'
|
||||
? 'text-info'
|
||||
: line.startsWith('+++') || line.startsWith('---')
|
||||
? 'text-muted-foreground'
|
||||
: line.startsWith('+')
|
||||
? 'text-green-600 dark:text-green-400'
|
||||
? 'text-diff-add'
|
||||
: line.startsWith('-')
|
||||
? 'text-red-600 dark:text-red-400'
|
||||
? 'text-diff-delete'
|
||||
: 'text-muted-foreground'
|
||||
return <div key={index} className={tone}>{line || ' '}</div>
|
||||
})}
|
||||
@@ -102,12 +102,12 @@ function FileToolRender({ part, filediff, filePath, content, toolName, onFileCli
|
||||
className="w-full px-3 py-1.5 bg-card hover:bg-card-hover text-left flex items-center justify-between text-sm gap-2"
|
||||
>
|
||||
<div className="flex items-center gap-2 min-w-0">
|
||||
<span className="text-green-600 dark:text-green-400 flex-shrink-0">✓</span>
|
||||
<span className="text-success flex-shrink-0">✓</span>
|
||||
<span className="font-medium flex-shrink-0">{toolName}</span>
|
||||
{filePath && (
|
||||
<span
|
||||
onClick={handleFileClick}
|
||||
className="text-blue-600 dark:text-blue-400 text-xs truncate hover:underline cursor-pointer"
|
||||
className="text-primary text-xs truncate hover:underline cursor-pointer"
|
||||
>
|
||||
{getRelativePath(filePath)}
|
||||
</span>
|
||||
|
||||
@@ -239,7 +239,7 @@ describe('FloatingTTSButton', () => {
|
||||
|
||||
const button = screen.getByRole('button', { name: /stop playback/i })
|
||||
|
||||
expect(button).toHaveClass('from-red-600')
|
||||
expect(button).toHaveClass('bg-destructive')
|
||||
expect(button).toHaveClass('rounded-lg')
|
||||
expect(button).not.toHaveClass('rounded-full')
|
||||
expect(button).not.toHaveClass('hidden')
|
||||
@@ -251,7 +251,7 @@ describe('FloatingTTSButton', () => {
|
||||
setup({ activeMessageId: TEST_MESSAGE_ID, isLoading: true })
|
||||
render(<FloatingTTSButton messageId={TEST_MESSAGE_ID} content={TEST_CONTENT} />)
|
||||
|
||||
expect(screen.getByRole('button', { name: /stop playback/i })).toHaveClass('from-red-600')
|
||||
expect(screen.getByRole('button', { name: /stop playback/i })).toHaveClass('bg-destructive')
|
||||
})
|
||||
|
||||
it('shows autoplay state with button color when autoPlay is enabled', () => {
|
||||
@@ -260,7 +260,7 @@ describe('FloatingTTSButton', () => {
|
||||
|
||||
const button = screen.getByRole('button', { name: /auto-play enabled/i })
|
||||
|
||||
expect(button).toHaveClass('from-blue-500')
|
||||
expect(button).toHaveClass('bg-primary')
|
||||
expect(button).toHaveClass('rounded-lg')
|
||||
expect(screen.queryByText('Play')).not.toBeInTheDocument()
|
||||
expect(screen.queryByText('Auto')).not.toBeInTheDocument()
|
||||
@@ -273,8 +273,8 @@ describe('FloatingTTSButton', () => {
|
||||
|
||||
const button = screen.getByRole('button', { name: /play latest reply/i })
|
||||
|
||||
expect(button).toHaveClass('from-amber-500')
|
||||
expect(button).not.toHaveClass('from-blue-500')
|
||||
expect(button).toHaveClass('from-warning')
|
||||
expect(button).not.toHaveClass('bg-primary')
|
||||
expect(screen.queryByText('Play')).not.toBeInTheDocument()
|
||||
})
|
||||
})
|
||||
@@ -82,10 +82,10 @@ export function FloatingTTSButton({ messageId, content }: FloatingTTSButtonProps
|
||||
: 'TTS controls'
|
||||
const pillAriaLabel = `${pillTitle}. ${autoPlay ? 'Auto-play enabled.' : 'Auto-play disabled.'} hold to toggle auto-play`
|
||||
const buttonToneClasses = showStop
|
||||
? 'justify-center px-3 py-1.5 rounded-lg bg-gradient-to-br from-red-600 to-red-700 border border-red-500/60 shadow-red-500/30 ring-red-500/20 hover:ring-red-500/40 text-white'
|
||||
? 'justify-center px-3 py-1.5 rounded-lg bg-destructive border border-destructive/60 shadow-destructive/30 ring-destructive/20 hover:ring-destructive/40 text-destructive-foreground'
|
||||
: autoPlay
|
||||
? 'justify-center px-3 py-1.5 rounded-lg bg-gradient-to-br from-blue-500 to-blue-600 border border-blue-400/60 shadow-blue-500/30 ring-blue-500/20 hover:ring-blue-500/40 text-white'
|
||||
: 'justify-center px-3 py-1.5 rounded-lg bg-gradient-to-br from-amber-500 to-orange-600 border border-amber-400/60 shadow-amber-500/30 ring-amber-500/20 hover:ring-amber-500/40 text-white'
|
||||
? 'justify-center px-3 py-1.5 rounded-lg bg-primary border border-primary/60 shadow-primary/30 ring-primary/20 hover:ring-primary/40 text-primary-foreground'
|
||||
: 'justify-center px-3 py-1.5 rounded-lg bg-gradient-to-br from-warning to-highlight border border-warning/60 shadow-warning/30 ring-warning/20 hover:ring-warning/40 text-warning-foreground'
|
||||
|
||||
return (
|
||||
<button
|
||||
|
||||
@@ -5,7 +5,7 @@ export function MessageSkeleton() {
|
||||
<div className="flex flex-col space-y-2 p-2 overflow-x-hidden">
|
||||
{/* User message skeleton */}
|
||||
<div className="flex flex-col">
|
||||
<div className="w-full rounded-lg p-1.5 bg-blue-600/20 border border-blue-600/30">
|
||||
<div className="w-full rounded-lg p-1.5 bg-primary/20 border border-primary/30">
|
||||
<div className="flex items-center gap-2 mb-1">
|
||||
<div className="h-3 w-12 bg-muted animate-pulse rounded" />
|
||||
<div className="h-3 w-16 bg-muted animate-pulse rounded" />
|
||||
@@ -24,7 +24,7 @@ export function MessageSkeleton() {
|
||||
<div className="h-3 w-16 bg-muted animate-pulse rounded" />
|
||||
<div className="h-3 w-16 bg-muted animate-pulse rounded" />
|
||||
<div className="flex items-center gap-1">
|
||||
<div className="h-3 w-20 bg-blue-600/20 animate-pulse rounded" />
|
||||
<div className="h-3 w-20 bg-primary/20 animate-pulse rounded" />
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
@@ -36,7 +36,7 @@ export function MessageSkeleton() {
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-col">
|
||||
<div className="w-full rounded-lg p-1.5 bg-blue-600/20 border border-blue-600/30">
|
||||
<div className="w-full rounded-lg p-1.5 bg-primary/20 border border-primary/30">
|
||||
<div className="flex items-center gap-2 mb-1">
|
||||
<div className="h-3 w-12 bg-muted animate-pulse rounded" />
|
||||
<div className="h-3 w-16 bg-muted animate-pulse rounded" />
|
||||
@@ -55,7 +55,7 @@ export function MessageSkeleton() {
|
||||
<div className="h-3 w-16 bg-muted animate-pulse rounded" />
|
||||
<div className="h-3 w-16 bg-muted animate-pulse rounded" />
|
||||
<div className="flex items-center gap-1">
|
||||
<div className="h-3 w-20 bg-blue-600/20 animate-pulse rounded" />
|
||||
<div className="h-3 w-20 bg-primary/20 animate-pulse rounded" />
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
@@ -69,7 +69,7 @@ export function MessageSkeleton() {
|
||||
|
||||
{/* Second user message skeleton */}
|
||||
<div className="flex flex-col">
|
||||
<div className="w-full rounded-lg p-1.5 bg-blue-600/20 border border-blue-600/30">
|
||||
<div className="w-full rounded-lg p-1.5 bg-primary/20 border border-primary/30">
|
||||
<div className="flex items-center gap-2 mb-1">
|
||||
<div className="h-3 w-12 bg-muted animate-pulse rounded" />
|
||||
<div className="h-3 w-16 bg-muted animate-pulse rounded" />
|
||||
@@ -88,7 +88,7 @@ export function MessageSkeleton() {
|
||||
<div className="h-3 w-16 bg-muted animate-pulse rounded" />
|
||||
<div className="flex items-center gap-1">
|
||||
<span className="animate-pulse">●</span>
|
||||
<div className="h-3 w-24 bg-blue-600/20 animate-pulse rounded" />
|
||||
<div className="h-3 w-24 bg-primary/20 animate-pulse rounded" />
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-2 text-muted-foreground">
|
||||
|
||||
@@ -122,14 +122,14 @@ function UserAttachments({ files: attachedFiles, agents: attachedAgents, skills:
|
||||
key={`file-${index}`}
|
||||
className="inline-flex items-center gap-1 px-2 py-1 rounded bg-muted border border-border text-sm text-foreground"
|
||||
>
|
||||
<span className="text-blue-600 dark:text-blue-400">@</span>
|
||||
<span className="text-primary">@</span>
|
||||
<span className="font-medium">{attachmentLabel(file)}</span>
|
||||
</span>
|
||||
))}
|
||||
{agents.map((agent, index) => (
|
||||
<span
|
||||
key={`agent-${index}`}
|
||||
className="inline-flex items-center px-2 py-1 rounded bg-purple-500/10 border border-purple-500/30 text-xs text-purple-600 dark:text-purple-400"
|
||||
className="inline-flex items-center px-2 py-1 rounded bg-primary/10 border border-primary/30 text-xs text-primary"
|
||||
>
|
||||
agent: {agent.name}
|
||||
</span>
|
||||
@@ -137,7 +137,7 @@ function UserAttachments({ files: attachedFiles, agents: attachedAgents, skills:
|
||||
{skills.map((skill, index) => (
|
||||
<span
|
||||
key={`skill-${index}`}
|
||||
className="inline-flex items-center px-2 py-1 rounded bg-blue-500/10 border border-blue-500/30 text-xs text-blue-600 dark:text-blue-400"
|
||||
className="inline-flex items-center px-2 py-1 rounded bg-info/10 border border-info/30 text-xs text-info"
|
||||
>
|
||||
skill: {skill.name}
|
||||
</span>
|
||||
@@ -171,7 +171,7 @@ function TTSButton({ messageId, content }: TTSButtonProps) {
|
||||
return (
|
||||
<button
|
||||
onClick={handleClick}
|
||||
className={`p-1.5 rounded ${isThisPlaying ? 'bg-red-500/20 text-red-500 hover:bg-red-500/30' : 'bg-card hover:bg-card-hover text-muted-foreground hover:text-foreground'}`}
|
||||
className={`p-1.5 rounded ${isThisPlaying ? 'bg-destructive/20 text-destructive hover:bg-destructive/30' : 'bg-card hover:bg-card-hover text-muted-foreground hover:text-foreground'}`}
|
||||
title={isThisPlaying ? 'Stop playback' : 'Read aloud'}
|
||||
disabled={isLoading && !isThisPlaying}
|
||||
>
|
||||
@@ -249,8 +249,8 @@ function SessionNotice({
|
||||
const tone = completion.state === 'error'
|
||||
? 'text-destructive'
|
||||
: completion.state === 'cancelled'
|
||||
? 'text-amber-600 dark:text-amber-400'
|
||||
: 'text-blue-600 dark:text-blue-400'
|
||||
? 'text-warning'
|
||||
: 'text-info'
|
||||
const content = (
|
||||
<>
|
||||
<span className={tone}>{completion.heading}</span>
|
||||
@@ -286,7 +286,7 @@ function ShellMessage({ message }: { message: SessionMessageShell }) {
|
||||
return (
|
||||
<div className="rounded-lg border border-border bg-card/50 p-2 my-1">
|
||||
<div className="flex items-center gap-2 text-sm min-w-0">
|
||||
<span className="text-green-600 dark:text-green-400 shrink-0">$</span>
|
||||
<span className="text-success shrink-0">$</span>
|
||||
<span className="text-foreground truncate">{message.command}</span>
|
||||
<span className="text-muted-foreground text-xs ml-auto shrink-0">{statusLabel}</span>
|
||||
</div>
|
||||
@@ -312,7 +312,7 @@ function CompactionBanner({ message }: { message: SessionMessageCompaction }) {
|
||||
|
||||
if (message.status === 'failed') {
|
||||
return (
|
||||
<div className="my-1 rounded-lg border border-red-500/30 bg-red-500/10 px-3 py-1.5 text-xs text-red-600 dark:text-red-400">
|
||||
<div className="my-1 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-1.5 text-xs text-destructive">
|
||||
Compaction failed: {message.error.message}
|
||||
</div>
|
||||
)
|
||||
@@ -328,13 +328,13 @@ function CompactionBanner({ message }: { message: SessionMessageCompaction }) {
|
||||
|
||||
function QueuedPromptRow({ item }: { item: SessionInboxUser }) {
|
||||
return (
|
||||
<div className="w-full rounded-lg p-1.5 bg-amber-500/10 border border-amber-500/30">
|
||||
<div className="w-full rounded-lg p-1.5 bg-warning/10 border border-warning/30">
|
||||
<div className="flex items-center gap-2 mb-1">
|
||||
<span className="text-xs font-medium text-muted-foreground">You</span>
|
||||
<span className="text-xs text-muted-foreground">
|
||||
{new Date(item.time.created).toLocaleTimeString()}
|
||||
</span>
|
||||
<span className="text-xs font-semibold bg-amber-500 text-amber-950 px-1.5 py-0.5 rounded">
|
||||
<span className="text-xs font-semibold bg-warning text-warning-foreground px-1.5 py-0.5 rounded">
|
||||
{item.delivery === 'queue' ? 'QUEUED' : 'STEERING'}
|
||||
</span>
|
||||
</div>
|
||||
@@ -397,8 +397,8 @@ const MessageRow = memo(function MessageRow({
|
||||
<div
|
||||
className={`w-full rounded-lg p-1.5 ${
|
||||
isEditingThisMessage
|
||||
? 'bg-blue-600/30 border border-blue-600/50'
|
||||
: 'bg-blue-600/20 border border-blue-600/30'
|
||||
? 'bg-primary/30 border border-primary/50'
|
||||
: 'bg-primary/20 border border-primary/30'
|
||||
}`}
|
||||
>
|
||||
<div className="flex items-center justify-between gap-2 mb-1">
|
||||
@@ -564,7 +564,7 @@ const MessageRow = memo(function MessageRow({
|
||||
|
||||
if (message.type === 'skill') {
|
||||
return (
|
||||
<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">
|
||||
<div className="my-1 rounded-lg border border-info/20 bg-info/5 px-3 py-1.5 text-xs text-muted-foreground">
|
||||
Skill loaded: <span className="font-medium text-foreground">{message.name}</span>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -1147,7 +1147,7 @@ if (isIOS && isSecureContext && navigator.clipboard && navigator.clipboard.read)
|
||||
const renderVoiceButton = (variant: VoiceButtonVariant) => {
|
||||
const isDesktop = variant === 'desktop'
|
||||
const isBusy = isRecording || isTogglingRecording || (isProcessing && !isRecording)
|
||||
const spinnerClassName = `w-5 h-5 animate-spin rounded-full border-2 ${isDesktop ? 'border-muted-foreground' : 'border-white'} border-t-transparent`
|
||||
const spinnerClassName = `w-5 h-5 animate-spin rounded-full border-2 ${isDesktop ? 'border-muted-foreground' : 'border-foreground'} border-t-transparent`
|
||||
const voiceGestureHandlers = isDesktop ? {} : {
|
||||
onPointerDown: handleVoicePointerDown,
|
||||
onPointerMove: handleVoicePointerMove,
|
||||
@@ -1157,12 +1157,12 @@ if (isIOS && isSecureContext && navigator.clipboard && navigator.clipboard.read)
|
||||
const buttonClassName = isDesktop
|
||||
? `hidden md:flex p-2 rounded-lg transition-all duration-200 active:scale-95 hover:scale-105 shadow-md border items-center justify-center touch-none select-none ${
|
||||
isBusy
|
||||
? 'bg-gradient-to-br from-red-600 to-red-700 hover:from-red-500 hover:to-red-600 text-destructive-foreground border-red-500/60 animate-pulse'
|
||||
? 'bg-destructive hover:bg-destructive/90 text-destructive-foreground border-destructive/60 animate-pulse'
|
||||
: 'bg-muted hover:bg-muted-foreground/20 text-muted-foreground hover:text-foreground border-border'
|
||||
}`
|
||||
: `px-4 py-2 rounded-lg transition-all duration-150 flex items-center justify-center min-w-[52px] border touch-none select-none ${
|
||||
isBusy
|
||||
? 'bg-gradient-to-t from-green-700 via-green-500 to-emerald-400 text-white border-green-300/70 shadow-lg shadow-green-500/40'
|
||||
? 'bg-success text-success-foreground border-success/70 shadow-lg shadow-success/40'
|
||||
: 'bg-muted hover:bg-muted-foreground/20 text-muted-foreground hover:text-foreground border-border active:bg-muted-foreground/30 active:scale-95'
|
||||
}`
|
||||
|
||||
@@ -1226,11 +1226,11 @@ if (isIOS && isSecureContext && navigator.clipboard && navigator.clipboard.read)
|
||||
|
||||
|
||||
return (
|
||||
<div className={`relative backdrop-blur-md bg-background opacity-95 border border-border dark:border-white/30 rounded-xl p-2 md:p-3 mb-4 md:mb-1 w-full transition-all ${hasPendingPermissionForSession ? 'border-orange-500/50 ring-1 ring-orange-500/30' : ''}`}>
|
||||
<div className={`relative backdrop-blur-md bg-background opacity-95 border border-border dark:border-border/30 rounded-xl p-2 md:p-3 mb-4 md:mb-1 w-full transition-all ${hasPendingPermissionForSession ? 'border-highlight/50 ring-1 ring-highlight/30' : ''}`}>
|
||||
{showStopButton && (
|
||||
<button
|
||||
onClick={handleStop}
|
||||
className="absolute bottom-full right-0 mb-2 md:hidden z-50 p-3 rounded-xl transition-all duration-200 active:scale-95 hover:scale-105 bg-gradient-to-br from-red-600 to-red-700 hover:from-red-500 hover:to-red-600 text-destructive-foreground border border-red-500/60 shadow-lg shadow-red-500/30"
|
||||
className="absolute bottom-full right-0 mb-2 md:hidden z-50 p-3 rounded-xl transition-all duration-200 active:scale-95 hover:scale-105 bg-destructive hover:bg-destructive/90 text-destructive-foreground border border-destructive/60 shadow-lg shadow-destructive/30"
|
||||
title="Stop"
|
||||
>
|
||||
<SquareFill className="w-5 h-5" />
|
||||
@@ -1253,8 +1253,8 @@ return (
|
||||
}
|
||||
className={`w-full bg-muted/50 pl-2 md:pl-3 pr-3 py-2 text-[16px] text-foreground placeholder-muted-foreground focus:outline-none focus:bg-muted/70 resize-none min-h-[40px] max-h-[120px] disabled:opacity-50 disabled:cursor-not-allowed md:text-sm rounded-lg [field-sizing:content] ${
|
||||
isBashMode
|
||||
? 'border-purple-500/50 bg-purple-500/5 focus:bg-purple-500/10'
|
||||
: isDragging ? 'border-blue-500/50 border-dashed bg-blue-500/5' : ''
|
||||
? 'border-primary/50 bg-primary/5 focus:bg-primary/10'
|
||||
: isDragging ? 'border-info/50 border-dashed bg-info/5' : ''
|
||||
}`}
|
||||
rows={1}
|
||||
/>
|
||||
@@ -1286,7 +1286,7 @@ return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={onScrollToBottom}
|
||||
className="flex items-center gap-1.5 px-3 min-h-[36px] rounded-lg text-xs font-medium border bg-zinc-950/80 hover:bg-zinc-900/90 text-blue-300 hover:text-blue-200 border-blue-400/20 shadow-md backdrop-blur-md transition-all duration-200 active:scale-95 ring-1 ring-blue-400/15"
|
||||
className="flex items-center gap-1.5 px-3 min-h-[36px] rounded-lg text-xs font-medium border bg-background/80 hover:bg-accent/90 text-primary hover:text-primary-hover border-primary/20 shadow-md backdrop-blur-md transition-all duration-200 active:scale-95 ring-1 ring-primary/15"
|
||||
title="Scroll to bottom"
|
||||
aria-label="Scroll to bottom"
|
||||
>
|
||||
@@ -1317,11 +1317,11 @@ return (
|
||||
directory={directory}
|
||||
>
|
||||
<button
|
||||
className="px-2.5 py-0.5 md:px-3 min-h-[36px] min-w-0 rounded-lg text-xs md:text-sm font-medium border bg-muted border-border text-muted-foreground hover:bg-muted-foreground/10 hover:border-foreground/30 transition-colors cursor-pointer flex-1 md:flex-initial md:w-auto max-w-[110px] md:max-w-[220px] dark:border-white/30 flex flex-col items-start justify-center overflow-hidden"
|
||||
className="px-2.5 py-0.5 md:px-3 min-h-[36px] min-w-0 rounded-lg text-xs md:text-sm font-medium border bg-muted border-border text-muted-foreground hover:bg-muted-foreground/10 hover:border-foreground/30 transition-colors cursor-pointer flex-1 md:flex-initial md:w-auto max-w-[110px] md:max-w-[220px] dark:border-border/30 flex flex-col items-start justify-center overflow-hidden"
|
||||
>
|
||||
<span className="truncate w-full text-left">{displayModelName || 'Select model'}</span>
|
||||
{hasVariants && currentVariant && (
|
||||
<span className="text-[10px] text-orange-500 truncate w-full text-center capitalize">{currentVariant}</span>
|
||||
<span className="text-[10px] text-highlight truncate w-full text-center capitalize">{currentVariant}</span>
|
||||
)}
|
||||
</button>
|
||||
</ModelQuickSelect>
|
||||
@@ -1334,7 +1334,7 @@ return (
|
||||
{!isMobile && (
|
||||
<button
|
||||
onClick={onScrollToBottom}
|
||||
className={`p-2 rounded-lg bg-zinc-950/80 hover:bg-zinc-900/90 text-blue-300 hover:text-blue-200 transition-all duration-200 active:scale-95 hover:scale-105 shadow-md border border-blue-400/20 backdrop-blur-md ring-1 ring-blue-400/15 ${showScrollButton ? 'visible' : 'invisible'}`}
|
||||
className={`p-2 rounded-lg bg-background/80 hover:bg-accent/90 text-primary hover:text-primary-hover transition-all duration-200 active:scale-95 hover:scale-105 shadow-md border border-primary/20 backdrop-blur-md ring-1 ring-primary/15 ${showScrollButton ? 'visible' : 'invisible'}`}
|
||||
title="Scroll to bottom"
|
||||
>
|
||||
<ArrowDown className="w-6 h-6" />
|
||||
@@ -1343,7 +1343,7 @@ return (
|
||||
{showStopButton && (
|
||||
<button
|
||||
onClick={handleStop}
|
||||
className="hidden md:block p-1.5 px-5 md:p-2 md:px-6 rounded-lg transition-all duration-200 active:scale-95 hover:scale-105 bg-gradient-to-br from-red-600 to-red-700 hover:from-red-500 hover:to-red-600 text-destructive-foreground border border-red-500/60 hover:border-red-400 shadow-md shadow-red-500/30 hover:shadow-red-500/40 ring-1 ring-red-500/20 hover:ring-red-500/30"
|
||||
className="hidden md:block p-1.5 px-5 md:p-2 md:px-6 rounded-lg transition-all duration-200 active:scale-95 hover:scale-105 bg-destructive hover:bg-destructive/90 text-destructive-foreground border border-destructive/60 hover:border-destructive shadow-md shadow-destructive/30 hover:shadow-destructive/40 ring-1 ring-destructive/20 hover:ring-destructive/30"
|
||||
title="Stop"
|
||||
>
|
||||
<SquareFill className="w-4 h-4 md:w-5 md:h-5" />
|
||||
@@ -1376,8 +1376,8 @@ return (
|
||||
disabled={hasPendingPermissionForSession ? false : ((!prompt.trim() && imageAttachments.length === 0) || (isPromptSubmitPending && !isStreamingResponse))}
|
||||
className={`px-4 md:px-5 py-1.5 md:py-2 rounded-lg text-sm font-medium transition-colors dark:border flex-shrink-0 min-w-[52px] ${
|
||||
hasPendingPermissionForSession
|
||||
? 'bg-orange-500 hover:bg-orange-600 border-orange-400 text-primary-foreground ring-orange-500/20'
|
||||
: 'bg-primary hover:bg-primary/90 disabled:bg-muted disabled:text-muted-foreground disabled:cursor-not-allowed text-primary-foreground border-white/30'
|
||||
? 'bg-highlight hover:bg-highlight/90 border-highlight text-highlight-foreground ring-highlight/20'
|
||||
: 'bg-primary hover:bg-primary/90 disabled:bg-muted disabled:text-muted-foreground disabled:cursor-not-allowed text-primary-foreground border-border/30'
|
||||
}`}
|
||||
title={hasPendingPermissionForSession ? 'View pending permission' : (isStreamingResponse ? 'Queue message' : 'Send')}
|
||||
>
|
||||
|
||||
@@ -31,24 +31,24 @@ export const RetryPart = memo(function RetryPart({ retry }: RetryPartProps) {
|
||||
}, [nextTimestamp])
|
||||
|
||||
return (
|
||||
<div className="flex items-center gap-3 p-3 my-2 rounded-lg bg-amber-500/10 border border-amber-500/30">
|
||||
<div className="flex items-center gap-3 p-3 my-2 rounded-lg bg-warning/10 border border-warning/30">
|
||||
<div className="flex-shrink-0">
|
||||
<div className="relative">
|
||||
<RefreshCw className="w-5 h-5 text-amber-500 animate-spin" style={{ animationDuration: '2s' }} />
|
||||
<AlertTriangle className="w-3 h-3 text-amber-600 absolute -bottom-0.5 -right-0.5" />
|
||||
<RefreshCw className="w-5 h-5 text-warning animate-spin" style={{ animationDuration: '2s' }} />
|
||||
<AlertTriangle className="w-3 h-3 text-warning absolute -bottom-0.5 -right-0.5" />
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex-1 min-w-0">
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="text-sm font-medium text-amber-600 dark:text-amber-400">
|
||||
<span className="text-sm font-medium text-warning">
|
||||
Retry attempt {retry.attempt}
|
||||
</span>
|
||||
{countdown > 0 ? (
|
||||
<span className="text-xs text-amber-500/80">
|
||||
<span className="text-xs text-warning/80">
|
||||
(retrying in {countdown}s)
|
||||
</span>
|
||||
) : (
|
||||
<span className="text-xs text-amber-500/80">
|
||||
<span className="text-xs text-warning/80">
|
||||
(retrying...)
|
||||
</span>
|
||||
)}
|
||||
|
||||
@@ -46,7 +46,7 @@ export function StepFileChanges({ files, snapshot, onFileClick }: StepFileChange
|
||||
type="button"
|
||||
title={file}
|
||||
onClick={() => onFileClick?.(file)}
|
||||
className="block max-w-full truncate text-left text-xs font-mono text-blue-600 dark:text-blue-400 hover:underline cursor-pointer"
|
||||
className="block max-w-full truncate text-left text-xs font-mono text-primary hover:underline cursor-pointer"
|
||||
>
|
||||
{getRelativePath(file)}
|
||||
</button>
|
||||
|
||||
@@ -71,12 +71,12 @@ function MermaidBlock({ code }: MermaidBlockProps) {
|
||||
if (error) {
|
||||
return (
|
||||
<div className="relative my-4">
|
||||
<div className="bg-red-500/10 border border-red-500/30 rounded-lg p-4">
|
||||
<div className="flex items-center gap-2 text-red-500 mb-2">
|
||||
<div className="bg-destructive/10 border border-destructive/30 rounded-lg p-4">
|
||||
<div className="flex items-center gap-2 text-destructive mb-2">
|
||||
<AlertCircle className="w-4 h-4" />
|
||||
<span className="text-sm font-medium">Mermaid Error</span>
|
||||
</div>
|
||||
<pre className="text-xs text-red-400 mb-3 whitespace-pre-wrap">{error}</pre>
|
||||
<pre className="text-xs text-destructive mb-3 whitespace-pre-wrap">{error}</pre>
|
||||
<pre className="bg-accent p-3 rounded-lg overflow-x-auto text-sm border border-border">
|
||||
<code>{code}</code>
|
||||
</pre>
|
||||
|
||||
@@ -88,7 +88,7 @@ function ClickableJson({ json, onFileClick }: { json: unknown; onFileClick?: (fi
|
||||
e.stopPropagation()
|
||||
onFileClick?.(ref.filePath)
|
||||
}}
|
||||
className="text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 cursor-pointer underline decoration-dotted"
|
||||
className="text-primary hover:text-primary-hover cursor-pointer underline decoration-dotted"
|
||||
title={`Click to open ${ref.filePath}`}
|
||||
>
|
||||
{ref.fullMatch}
|
||||
@@ -140,12 +140,12 @@ export const ToolCallPart = memo(function ToolCallPart({ part, messageID, onFile
|
||||
const getStatusColor = () => {
|
||||
switch (part.state.status) {
|
||||
case 'completed':
|
||||
return 'text-green-600 dark:text-green-400'
|
||||
return 'text-success'
|
||||
case 'error':
|
||||
return 'text-red-600 dark:text-red-400'
|
||||
return 'text-destructive'
|
||||
case 'running':
|
||||
if (isWaitingPermission) return 'text-orange-600 dark:text-orange-400'
|
||||
return 'text-yellow-600 dark:text-yellow-400'
|
||||
if (isWaitingPermission) return 'text-highlight'
|
||||
return 'text-warning'
|
||||
default:
|
||||
return 'text-muted-foreground'
|
||||
}
|
||||
@@ -197,7 +197,7 @@ export const ToolCallPart = memo(function ToolCallPart({ part, messageID, onFile
|
||||
const backgroundIndicator = isBackgrounded ? (
|
||||
<Badge
|
||||
variant="outline"
|
||||
className="shrink-0 border-yellow-600/40 bg-yellow-500/10 text-yellow-700 dark:text-yellow-400"
|
||||
className="shrink-0 border-warning/40 bg-warning/10 text-warning"
|
||||
title="Continues running in the background; the session is notified when it finishes"
|
||||
>
|
||||
background
|
||||
@@ -206,7 +206,7 @@ export const ToolCallPart = memo(function ToolCallPart({ part, messageID, onFile
|
||||
const sandboxIndicator = isSandboxedCommand ? (
|
||||
<Badge
|
||||
variant="outline"
|
||||
className="shrink-0 gap-1 border-green-600/40 bg-green-500/15 text-green-700 dark:text-green-400"
|
||||
className="shrink-0 gap-1 border-success/40 bg-success/15 text-success"
|
||||
title="Executed inside the sandbox microVM"
|
||||
>
|
||||
<Shield className="w-3 h-3" />
|
||||
@@ -232,17 +232,17 @@ export const ToolCallPart = memo(function ToolCallPart({ part, messageID, onFile
|
||||
)}
|
||||
{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' }} />
|
||||
<span className="w-2.5 h-2.5 rounded-full bg-primary animate-bounce" style={{ animationDelay: '0ms' }} />
|
||||
<span className="w-2.5 h-2.5 rounded-full bg-primary animate-bounce" style={{ animationDelay: '150ms' }} />
|
||||
<span className="w-2.5 h-2.5 rounded-full bg-primary 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>}
|
||||
{isCompleted && <span className="text-success text-sm font-medium">✓</span>}
|
||||
{isError && <span className="text-destructive text-sm font-medium">✗</span>}
|
||||
<span className="font-medium text-foreground truncate">{description}</span>
|
||||
<span className="text-[11px] font-medium text-orange-600 dark:text-orange-400 shrink-0">sub-agent</span>
|
||||
<span className="text-[11px] font-medium text-highlight shrink-0">sub-agent</span>
|
||||
{backgroundIndicator}
|
||||
{subagentSessionId && <ExternalLink className="w-3 h-3 shrink-0 text-blue-600 dark:text-blue-400" />}
|
||||
{subagentSessionId && <ExternalLink className="w-3 h-3 shrink-0 text-primary" />}
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -250,7 +250,7 @@ export const ToolCallPart = memo(function ToolCallPart({ part, messageID, onFile
|
||||
return (
|
||||
<button
|
||||
onClick={() => onChildSessionClick?.(subagentSessionId)}
|
||||
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"
|
||||
className="my-1 w-full rounded-lg border border-info/20 bg-info/5 px-3 py-1.5 text-left text-xs text-muted-foreground hover:bg-info/10 hover:border-info/30 transition-all duration-200 shadow-sm shadow-info/5"
|
||||
title="View subagent session"
|
||||
>
|
||||
{content}
|
||||
@@ -259,7 +259,7 @@ export const ToolCallPart = memo(function ToolCallPart({ part, messageID, onFile
|
||||
}
|
||||
|
||||
return (
|
||||
<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">
|
||||
<div className="my-1 rounded-lg border border-info/20 bg-info/5 px-3 py-1.5 text-xs text-muted-foreground shadow-sm shadow-info/5">
|
||||
{content}
|
||||
</div>
|
||||
)
|
||||
@@ -279,9 +279,9 @@ export const ToolCallPart = memo(function ToolCallPart({ part, messageID, onFile
|
||||
<div className="my-2">
|
||||
<div className="flex items-center gap-2 text-sm mb-2">
|
||||
{isBackgrounded ? (
|
||||
<Loader2 className="w-3.5 h-3.5 animate-spin text-yellow-600 dark:text-yellow-400" />
|
||||
<Loader2 className="w-3.5 h-3.5 animate-spin text-warning" />
|
||||
) : (
|
||||
<span className="text-green-600 dark:text-green-400">✓</span>
|
||||
<span className="text-success">✓</span>
|
||||
)}
|
||||
<span className="font-medium">$</span>
|
||||
<span className="text-foreground">{command}</span>
|
||||
@@ -304,12 +304,12 @@ export const ToolCallPart = memo(function ToolCallPart({ part, messageID, onFile
|
||||
const getBorderStyle = () => {
|
||||
switch (part.state.status) {
|
||||
case 'running':
|
||||
if (isWaitingPermission) return 'border-orange-500/50 shadow-sm shadow-orange-500/20'
|
||||
return 'border-yellow-500/50 shadow-sm shadow-yellow-500/10'
|
||||
if (isWaitingPermission) return 'border-highlight/50 shadow-sm shadow-highlight/20'
|
||||
return 'border-warning/50 shadow-sm shadow-warning/10'
|
||||
case 'streaming':
|
||||
return 'border-blue-500/30'
|
||||
return 'border-primary/30'
|
||||
case 'error':
|
||||
return 'border-red-500/30'
|
||||
return 'border-destructive/30'
|
||||
case 'completed':
|
||||
return 'border-border'
|
||||
default:
|
||||
@@ -338,7 +338,7 @@ export const ToolCallPart = memo(function ToolCallPart({ part, messageID, onFile
|
||||
onFileClick(previewText)
|
||||
}
|
||||
}}
|
||||
className="text-blue-600 dark:text-blue-400 text-xs truncate hover:text-blue-700 dark:hover:text-blue-300 cursor-pointer underline decoration-dotted"
|
||||
className="text-primary text-xs truncate hover:text-primary-hover cursor-pointer underline decoration-dotted"
|
||||
title={`Click to open ${previewText}`}
|
||||
>
|
||||
{previewText}
|
||||
@@ -355,9 +355,9 @@ export const ToolCallPart = memo(function ToolCallPart({ part, messageID, onFile
|
||||
{part.state.status === 'streaming' && (
|
||||
<div className="flex items-center gap-2 text-sm text-muted-foreground">
|
||||
<div className="flex gap-0.5">
|
||||
<span className="w-1.5 h-1.5 rounded-full bg-blue-500 animate-bounce" style={{ animationDelay: '0ms' }} />
|
||||
<span className="w-1.5 h-1.5 rounded-full bg-blue-500 animate-bounce" style={{ animationDelay: '150ms' }} />
|
||||
<span className="w-1.5 h-1.5 rounded-full bg-blue-500 animate-bounce" style={{ animationDelay: '300ms' }} />
|
||||
<span className="w-1.5 h-1.5 rounded-full bg-primary animate-bounce" style={{ animationDelay: '0ms' }} />
|
||||
<span className="w-1.5 h-1.5 rounded-full bg-primary animate-bounce" style={{ animationDelay: '150ms' }} />
|
||||
<span className="w-1.5 h-1.5 rounded-full bg-primary animate-bounce" style={{ animationDelay: '300ms' }} />
|
||||
</div>
|
||||
<span>Preparing tool call...</span>
|
||||
</div>
|
||||
@@ -371,9 +371,9 @@ export const ToolCallPart = memo(function ToolCallPart({ part, messageID, onFile
|
||||
<CopyButton content={displayCommand ?? ''} title="Copy command" />
|
||||
</div>
|
||||
<div className="bg-accent p-2 rounded text-xs overflow-x-auto whitespace-pre-wrap break-words">
|
||||
<span className="text-green-600 dark:text-green-400">$</span> {displayCommand ?? ''}
|
||||
<span className="text-success">$</span> {displayCommand ?? ''}
|
||||
</div>
|
||||
<div className={`flex items-center gap-2 mt-2 text-xs ${isWaitingPermission ? 'text-orange-600 dark:text-orange-400' : 'text-yellow-600 dark:text-yellow-400'}`}>
|
||||
<div className={`flex items-center gap-2 mt-2 text-xs ${isWaitingPermission ? 'text-highlight' : 'text-warning'}`}>
|
||||
<Loader2 className="w-3 h-3 animate-spin" />
|
||||
<span>{isWaitingPermission ? 'Waiting for permission...' : 'Running...'}</span>
|
||||
</div>
|
||||
@@ -382,7 +382,7 @@ export const ToolCallPart = memo(function ToolCallPart({ part, messageID, onFile
|
||||
<div className="text-sm">
|
||||
<div className="text-muted-foreground mb-1">Input:</div>
|
||||
<ClickableJson json={part.state.input} onFileClick={onFileClick} />
|
||||
<div className={`flex items-center gap-2 mt-2 text-xs ${isWaitingPermission ? 'text-orange-600 dark:text-orange-400' : 'text-yellow-600 dark:text-yellow-400'}`}>
|
||||
<div className={`flex items-center gap-2 mt-2 text-xs ${isWaitingPermission ? 'text-highlight' : 'text-warning'}`}>
|
||||
<Loader2 className="w-3 h-3 animate-spin" />
|
||||
<span>{isWaitingPermission ? 'Waiting for permission...' : 'Running...'}</span>
|
||||
</div>
|
||||
@@ -399,7 +399,7 @@ export const ToolCallPart = memo(function ToolCallPart({ part, messageID, onFile
|
||||
<CopyButton content={displayCommand ?? ''} title="Copy command" />
|
||||
</div>
|
||||
<div className="bg-accent p-2 rounded text-xs overflow-x-auto whitespace-pre-wrap break-words">
|
||||
<span className="text-green-600 dark:text-green-400">$</span> {displayCommand ?? ''}
|
||||
<span className="text-success">$</span> {displayCommand ?? ''}
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
@@ -430,10 +430,10 @@ export const ToolCallPart = memo(function ToolCallPart({ part, messageID, onFile
|
||||
|
||||
{part.state.status === 'error' && (
|
||||
<div className="text-sm">
|
||||
<div className="text-red-600 dark:text-red-400 mb-1">Error:</div>
|
||||
<div className="text-destructive mb-1">Error:</div>
|
||||
<BoundedPre
|
||||
content={part.state.error.message}
|
||||
className="bg-accent p-2 rounded text-xs overflow-x-auto whitespace-pre-wrap break-words text-red-600 dark:text-red-300"
|
||||
className="bg-accent p-2 rounded text-xs overflow-x-auto whitespace-pre-wrap break-words text-destructive"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -14,7 +14,7 @@ function WaveformBars() {
|
||||
{[0, 1, 2, 3, 4].map((i) => (
|
||||
<div
|
||||
key={i}
|
||||
className="w-1.5 rounded-full bg-white"
|
||||
className="w-1.5 rounded-full bg-success-foreground"
|
||||
style={{
|
||||
height: '100%',
|
||||
animation: `waveBar 0.9s ease-in-out infinite`,
|
||||
@@ -48,8 +48,8 @@ export function VoiceStatusOverlay({ show, label, state }: VoiceStatusOverlayPro
|
||||
className="pointer-events-none absolute inset-x-0 bottom-0 z-10"
|
||||
>
|
||||
<span className="sr-only">{label}</span>
|
||||
<div className="animate-voice-overlay-in relative flex h-44 w-full flex-col items-center justify-between overflow-hidden rounded-xl border border-green-300/70 bg-gradient-to-t from-green-700 via-green-500 to-emerald-400 px-1 py-4 text-white shadow-lg shadow-green-500/40">
|
||||
<div className="absolute inset-x-1 top-1 h-10 rounded-full bg-white/20 blur-sm" />
|
||||
<div className="animate-voice-overlay-in relative flex h-44 w-full flex-col items-center justify-between overflow-hidden rounded-xl border border-success/70 bg-success px-1 py-4 text-success-foreground shadow-lg shadow-success/40">
|
||||
<div className="absolute inset-x-1 top-1 h-10 rounded-full bg-success-foreground/20 blur-sm" />
|
||||
<div className="relative flex flex-1 flex-col items-center justify-center gap-1">
|
||||
{isLoading ? (
|
||||
state === 'processing' ? (
|
||||
|
||||
Reference in new issue
Block a user