frontend: tooltips on some buttons

Massimo Melina committed Apr 14, 2022 at 22:13 UTC d9d5ad708011f0fd86770fa78f0b2bbb6f2cbc6a
1 file changed +6 -3
frontend/src/menu.ts
+6 -3
@@ -35,6 +35,7 @@ export function MenuPanel() {
35 h(MenuButton, {
36 icon: 'filter',
37 label: "Filter list",
38 + tooltip: "Show only elements matching text you type. Works on list already got from the server. Also enables selection of files, for selective \"Download zip\".",
39 toggled: showFilter,
40 onClick() {
41 state.showFilter = !showFilter
@@ -48,7 +49,8 @@ export function MenuPanel() {
49 }),
50 h(MenuLink, {
51 icon: 'archive',
51 - label: 'Download zip',
52 + label: "Download zip",
53 + tooltip: "Download whole list (unfiltered) as a single zip file. If you select some elements, only those will be downloaded.",
54 href: '?'+String(new URLSearchParams(_.pickBy({
55 get: 'zip',
56 search: remoteSearch,
@@ -123,13 +125,14 @@ export function MenuPanel() {
125 interface MenuButtonProps {
126 icon: string,
127 label: string,
128 + tooltip?: string,
129 toggled?: boolean,
130 className?: string,
131 onClick?: () => void
132 }
133
131 -export function MenuButton({ icon, label, toggled, onClick, className = '' }: MenuButtonProps) {
132 - return h('button', { title: label, onClick, className: className + ' ' + (toggled ? 'toggled' : '') },
134 +export function MenuButton({ icon, label, tooltip, toggled, onClick, className = '' }: MenuButtonProps) {
135 + return h('button', { title: tooltip || label, onClick, className: className + ' ' + (toggled ? 'toggled' : '') },
136 hIcon(icon),
137 h('label', {}, label))
138 }