fix(ribbon): tooltip for expand button

This commit is contained in:
Elian Doran 2025-11-26 11:59:46 +02:00
parent c65b03db41
commit dc572c3815
No known key found for this signature in database
4 changed files with 6 additions and 4 deletions

View File

@ -764,7 +764,7 @@
"grid": "Grid", "grid": "Grid",
"list": "List", "list": "List",
"collapse_all_notes": "Collapse all notes", "collapse_all_notes": "Collapse all notes",
"expand_all_children": "Expand all children", "expand_tooltip": "Expands the direct children of this collection (one level deep). For more options, press the arrow on the right.",
"collapse": "Collapse", "collapse": "Collapse",
"expand": "Expand", "expand": "Expand",
"expand_first_level": "Expand direct children", "expand_first_level": "Expand direct children",

View File

@ -81,9 +81,10 @@ export function ButtonGroup({ children }: { children: ComponentChildren }) {
) )
} }
export function SplitButton({ text, icon, children, onClick }: { export function SplitButton({ text, icon, children, ...restProps }: {
text: string; text: string;
icon?: string; icon?: string;
title?: string;
/** Click handler for the main button component (not the split). */ /** Click handler for the main button component (not the split). */
onClick?: () => void; onClick?: () => void;
/** The children inside the dropdown of the split. */ /** The children inside the dropdown of the split. */
@ -91,7 +92,7 @@ export function SplitButton({ text, icon, children, onClick }: {
}) { }) {
return ( return (
<ButtonGroup> <ButtonGroup>
<button type="button" class="btn btn-secondary" onClick={onClick}> <button type="button" class="btn btn-secondary" {...restProps}>
{icon && <Icon icon={`bx ${icon}`} />} {icon && <Icon icon={`bx ${icon}`} />}
{text} {text}
</button> </button>

View File

@ -120,6 +120,7 @@ function SplitButtonPropertyView({ note, property }: { note: FNote, property: Sp
return <SplitButton return <SplitButton
text={property.label} text={property.label}
icon={property.icon} icon={property.icon}
title={property.title}
onClick={() => clickContext && property.onClick(clickContext)} onClick={() => clickContext && property.onClick(clickContext)}
> >
{parentComponent && <ItemsComponent note={note} parentComponent={parentComponent} />} {parentComponent && <ItemsComponent note={note} parentComponent={parentComponent} />}

View File

@ -95,7 +95,7 @@ export const bookPropertiesConfig: Record<ViewTypeOptions, BookConfig> = {
}, },
{ {
label: t("book_properties.expand"), label: t("book_properties.expand"),
title: t("book_properties.expand_all_children"), title: t("book_properties.expand_tooltip"),
type: "split-button", type: "split-button",
icon: "bx bx-move-vertical", icon: "bx bx-move-vertical",
onClick: buildExpandListHandler(1), onClick: buildExpandListHandler(1),