UI Tweak: Fade buttons on history preview (homescreen) if no interaction in progress. (#3523)

Fade buttons on history preview unless mouseover.
This commit is contained in:
Sacha Sayan 2025-06-08 10:27:42 -04:00 committed by GitHub
parent 3f54efca2d
commit 360b0e7336
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 4 deletions

View file

@ -7,9 +7,10 @@ import { useAppTranslation } from "@/i18n/TranslationContext"
type CopyButtonProps = {
itemTask: string
className?: string
}
export const CopyButton = ({ itemTask }: CopyButtonProps) => {
export const CopyButton = ({ itemTask, className }: CopyButtonProps) => {
const { isCopied, copy } = useClipboard()
const { t } = useAppTranslation()
@ -34,7 +35,7 @@ export const CopyButton = ({ itemTask }: CopyButtonProps) => {
title={t("history:copyPrompt")}
onClick={onCopy}
data-testid="copy-prompt-button"
className="opacity-50 hover:opacity-100">
className={cn("opacity-50 hover:opacity-100", className)}>
<span className={cn("codicon scale-80", { "codicon-check": isCopied, "codicon-copy": !isCopied })} />
</Button>
)

View file

@ -50,7 +50,7 @@ const TaskItem = ({
"cursor-pointer",
{
// Compact variant styling
"bg-vscode-editor-background rounded relative overflow-hidden border border-vscode-toolbar-hoverBackground/30 hover:border-vscode-toolbar-hoverBackground/60":
"group bg-vscode-editor-background rounded relative overflow-hidden border border-vscode-toolbar-hoverBackground/30 hover:border-vscode-toolbar-hoverBackground/60":
isCompact,
// Full variant styling
"bg-vscode-list-activeSelectionBackground": !isCompact && isSelectionMode && isSelected,

View file

@ -43,7 +43,7 @@ const TaskItemHeader: React.FC<TaskItemHeaderProps> = ({ item, variant, isSelect
{/* Action Buttons */}
{!isSelectionMode && (
<div className="flex flex-row gap-0 items-center opacity-50 hover:opacity-100">
<div className="flex flex-row gap-0 items-center opacity-20 group-hover:opacity-50 hover:opacity-100">
{isCompact ? (
<CopyButton itemTask={item.task} />
) : (