Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(launch_bar): faster tooltips
Elian Doran57b8bc26458a
diff --git a/apps/client/src/widgets/launch_bar/launch_bar_widgets.tsx b/apps/client/src/widgets/launch_bar/launch_bar_widgets.tsxindex e627a1d57a..68c68868f0 100644--- a/apps/client/src/widgets/launch_bar/launch_bar_widgets.tsx+++ b/apps/client/src/widgets/launch_bar/launch_bar_widgets.tsx@@ -36,6 +36,7 @@ export function LaunchBarDropdownButton({ children, icon, ...props }: Pick<DropdhideToggleArrowtext={<Icon icon={icon} />}titlePosition={isHorizontalLayout ? "bottom" : "right"}+ titleOptions={{ animation: false }}{...props}>{children}</Dropdown>)diff --git a/apps/client/src/widgets/react/ActionButton.tsx b/apps/client/src/widgets/react/ActionButton.tsxindex a37f34514a..ba5430f381 100644--- a/apps/client/src/widgets/react/ActionButton.tsx+++ b/apps/client/src/widgets/react/ActionButton.tsx@@ -23,7 +23,8 @@ export default function ActionButton({ text, icon, className, triggerCommand, tiuseStaticTooltip(buttonRef, {title: keyboardShortcut?.length ? `${text} (${keyboardShortcut?.join(",")})` : text,placement: titlePosition ?? "bottom",- fallbackPlacements: [ titlePosition ?? "bottom" ]+ fallbackPlacements: [ titlePosition ?? "bottom" ],+ animation: false});useEffect(() => {diff --git a/apps/client/src/widgets/react/Dropdown.tsx b/apps/client/src/widgets/react/Dropdown.tsxindex bbf757a21b..2888856818 100644--- a/apps/client/src/widgets/react/Dropdown.tsx+++ b/apps/client/src/widgets/react/Dropdown.tsx@@ -1,4 +1,4 @@-import { Dropdown as BootstrapDropdown } from "bootstrap";+import { Dropdown as BootstrapDropdown, Tooltip } from "bootstrap";import { ComponentChildren, HTMLAttributes } from "preact";import { CSSProperties, HTMLProps } from "preact/compat";import { MutableRef, useCallback, useEffect, useRef, useState } from "preact/hooks";@@ -29,14 +29,16 @@ export interface DropdownProps extends Pick<HTMLProps<HTMLDivElement>, "id" | "cdropdownOptions?: Partial<BootstrapDropdown.Options>;dropdownRef?: MutableRef<BootstrapDropdown | null>;titlePosition?: "top" | "right" | "bottom" | "left";+ titleOptions?: Partial<Tooltip.Options>;}-export default function Dropdown({ id, className, buttonClassName, isStatic, children, title, text, dropdownContainerStyle, dropdownContainerClassName, hideToggleArrow, iconAction, disabled, noSelectButtonStyle, noDropdownListStyle, forceShown, onShown: externalOnShown, onHidden: externalOnHidden, dropdownOptions, buttonProps, dropdownRef, titlePosition }: DropdownProps) {+export default function Dropdown({ id, className, buttonClassName, isStatic, children, title, text, dropdownContainerStyle, dropdownContainerClassName, hideToggleArrow, iconAction, disabled, noSelectButtonStyle, noDropdownListStyle, forceShown, onShown: externalOnShown, onHidden: externalOnHidden, dropdownOptions, buttonProps, dropdownRef, titlePosition, titleOptions }: DropdownProps) {const containerRef = useRef<HTMLDivElement | null>(null);const triggerRef = useRef<HTMLButtonElement | null>(null);useStaticTooltip(triggerRef, {+ ...titleOptions,placement: titlePosition ?? "bottom",- fallbackPlacements: [ titlePosition ?? "bottom" ]+ fallbackPlacements: [ titlePosition ?? "bottom" ],});const [ shown, setShown ] = useState(false);