refactor(ui): improve tooltip and task header responsiveness (#7186)
Refine TaskHeader controls so actions wrap naturally and the cost label scales down on narrow viewports. Update tooltip content to wrap flexibly, tweak padding, add collision padding, and cap width on small screens. Introduce xs and xxs breakpoint variables to support responsive styles.
This commit is contained in:
3 files changed
+7
-4
No files matched your search
@@ -138,7 +138,7 @@ const TaskHeader: React.FC<TaskHeaderProps> = ({
|
||||
<div className="flex justify-between items-center">
|
||||
{isTaskExpanded ? <ChevronDownIcon size="16" /> : <ChevronRightIcon size="16" />}
|
||||
{isTaskExpanded && (
|
||||
<div className="mt-1 max-h-3 flex justify-end flex-wrap cursor-pointer opacity-80 gap-2 mx-2">
|
||||
<div className="mt-1 flex justify-end cursor-pointer opacity-80 gap-2 mx-2">
|
||||
<CopyTaskButton className={BUTTON_CLASS} taskText={task.text} />
|
||||
<DeleteTaskButton
|
||||
className={BUTTON_CLASS}
|
||||
@@ -164,7 +164,7 @@ const TaskHeader: React.FC<TaskHeaderProps> = ({
|
||||
<div
|
||||
className="mx-1 px-1 py-0.25 rounded-full inline-flex shrink-0 text-badge-background bg-badge-foreground/80 items-center"
|
||||
id="price-tag">
|
||||
<span className="text-sm">${totalCost?.toFixed(4)}</span>
|
||||
<span className="text-xs sm:text-sm">${totalCost?.toFixed(4)}</span>
|
||||
</div>
|
||||
)}
|
||||
<NewTaskButton className={BUTTON_CLASS} onClick={onClose} />
|
||||
|
||||
@@ -32,13 +32,14 @@ function TooltipContent({
|
||||
<TooltipPrimitive.Portal>
|
||||
<TooltipPrimitive.Content
|
||||
className={cn(
|
||||
"bg-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 origin-(--radix-tooltip-content-transform-origin) rounded-xs px-1 py-1.5 text-xs border border-muted-foreground/30 shadow-2xs mx-1 wrap-break-word max-w-md p-2 overflow-visible text-wrap",
|
||||
"flex flex-wrap bg-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 origin-(--radix-tooltip-content-transform-origin) rounded-xs text-xs border border-muted-foreground/30 mx-1 max-w-[calc(100vw-2rem)] xs:max-w-md text-wrap shadow-md",
|
||||
className,
|
||||
)}
|
||||
collisionPadding={8}
|
||||
data-slot="tooltip-content"
|
||||
sideOffset={sideOffset}
|
||||
{...props}>
|
||||
<span className="text-xs leading-tight">{children}</span>
|
||||
<span className="leading-tight text-ellipsis p-2">{children}</span>
|
||||
{showArrow && (
|
||||
<TooltipPrimitive.Arrow
|
||||
className={cn(
|
||||
|
||||
@@ -57,6 +57,8 @@
|
||||
--text-sm: calc(0.95 * var(--vscode-font-size));
|
||||
--text-xs: calc(0.85 * var(--vscode-font-size));
|
||||
--text-xxs: calc(0.5 * var(--vscode-font-size));
|
||||
--breakpoint-xs: 400px;
|
||||
--breakpoint-xxs: 180px;
|
||||
}
|
||||
|
||||
@theme inline {
|
||||
|
||||
Reference in new issue
Block a user