mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
fix(frontend): reveal transcript actions on focus and bound the shell preview
- expose the user message action buttons to keyboard focus, not just hover - compute the shell preview tail once per output change and clamp very long lines
This commit is contained in:
1 parent
d8495df811
commit
c4bb104cc0
2 files changed
+8
-4
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import { useState, type ReactNode } from 'react'
|
||||
import { useMemo, useState, type ReactNode } from 'react'
|
||||
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog'
|
||||
import { useMobile } from '@/hooks/useMobile'
|
||||
import { tailLines } from '@/lib/clampDisplayText'
|
||||
import { clampDisplayText, tailLines } from '@/lib/clampDisplayText'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { TRANSCRIPT_DETAIL_CLASS } from './transcriptStyles'
|
||||
|
||||
@@ -58,7 +58,11 @@ export function ShellPreview({
|
||||
status?: ReactNode
|
||||
}) {
|
||||
const isMobile = useMobile()
|
||||
const tail = tailLines(output, isMobile ? MOBILE_SHELL_PREVIEW_LINES : SHELL_PREVIEW_LINES)
|
||||
const lineLimit = isMobile ? MOBILE_SHELL_PREVIEW_LINES : SHELL_PREVIEW_LINES
|
||||
const tail = useMemo(() => {
|
||||
const result = tailLines(output, lineLimit)
|
||||
return { ...result, text: clampDisplayText(result.text) }
|
||||
}, [output, lineLimit])
|
||||
|
||||
return (
|
||||
<button
|
||||
|
||||
@@ -34,7 +34,7 @@ export const UserMessageActionButtons = memo(function UserMessageActionButtons({
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={`flex items-center gap-1 ${isMobile ? 'opacity-100' : 'opacity-0 group-hover:opacity-100'} transition-opacity`}>
|
||||
<div className={`flex items-center gap-1 ${isMobile ? 'opacity-100' : 'opacity-0 group-hover:opacity-100 group-focus-within:opacity-100'} transition-opacity`}>
|
||||
<button
|
||||
onClick={handleUndo}
|
||||
disabled={undoMessage.isPending}
|
||||
|
||||
Reference in new issue
Block a user