Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

fix(ui): icon buttons fall back to their aria-label as a hover title

cyh81187dcde0db
diff --git a/ui/src/components/ui/button.tsx b/ui/src/components/ui/button.tsx
index 7773fa8bf..7e0bebcba 100644
--- a/ui/src/components/ui/button.tsx
+++ b/ui/src/components/ui/button.tsx
@@ -69,9 +69,17 @@ export type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> &
VariantProps<typeof buttonVariants> & { asChild?: boolean };
export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
- ({ className, variant, size, asChild = false, ...props }, ref) => {
+ ({ className, variant, size, asChild = false, title, ...props }, ref) => {
const Comp = asChild ? Slot : 'button';
- return <Comp ref={ref} className={cn(buttonVariants({ variant, size }), className)} {...props} />;
+ // Icon-only buttons carry their label in `aria-label` (there's no visible
+ // text). Mirror it into `title` so hovering shows that label as a native
+ // tooltip — unless the caller passed an explicit title. Gives every
+ // icon-sized button a hover hint for free.
+ const ariaLabel = props['aria-label'];
+ const resolvedTitle = title ?? (size === 'icon' && typeof ariaLabel === 'string' ? ariaLabel : undefined);
+ return (
+ <Comp ref={ref} title={resolvedTitle} className={cn(buttonVariants({ variant, size }), className)} {...props} />
+ );
}
);
Button.displayName = 'Button';