Add tooltips

This commit is contained in:
Adria Navarro 2025-02-20 10:15:14 +01:00
parent d8fe96eb85
commit 8b3c2027f4
3 changed files with 17 additions and 11 deletions

View File

@ -32,7 +32,7 @@
import { capitalise } from "@/helpers" import { capitalise } from "@/helpers"
import { Utils, JsonFormatter } from "@budibase/frontend-core" import { Utils, JsonFormatter } from "@budibase/frontend-core"
import { licensing } from "@/stores/portal" import { licensing } from "@/stores/portal"
import { BindingMode, SidePanel } from "@budibase/types" import { BindingMode } from "@budibase/types"
import type { import type {
EnrichedBinding, EnrichedBinding,
Snippet, Snippet,
@ -71,6 +71,17 @@
let expressionError: string | undefined let expressionError: string | undefined
let evaluating = false let evaluating = false
const enum SidePanel {
Bindings = "Bindings",
Evaluation = "Evaluation",
Snippets = "Snippets",
}
const SidePanelIcons: Record<SidePanel, string> = {
Bindings: "FlashOn",
Evaluation: "Play",
Snippets: "Code",
}
$: useSnippets = allowSnippets && !$licensing.isFreePlan $: useSnippets = allowSnippets && !$licensing.isFreePlan
$: editorModeOptions = getModeOptions(allowHBS, allowJS) $: editorModeOptions = getModeOptions(allowHBS, allowJS)
$: sidePanelOptions = getSidePanelOptions( $: sidePanelOptions = getSidePanelOptions(
@ -342,14 +353,15 @@
{/each} {/each}
</div> </div>
<div class="side-tabs"> <div class="side-tabs">
{#each sidePanelOptions as panel} {#each sidePanelOptions as panelOption}
<ActionButton <ActionButton
size="M" size="M"
quiet quiet
selected={sidePanel === panel} selected={sidePanel === panelOption}
on:click={() => changeSidePanel(panel)} on:click={() => changeSidePanel(panelOption)}
tooltip={panelOption}
> >
<Icon name={panel} size="S" /> <Icon name={SidePanelIcons[panelOption]} size="S" />
</ActionButton> </ActionButton>
{/each} {/each}
</div> </div>

View File

@ -1,4 +1,3 @@
export * from "./sidepanel"
export * from "./codeEditor" export * from "./codeEditor"
export * from "./errors" export * from "./errors"

View File

@ -1,5 +0,0 @@
export enum SidePanel {
Bindings = "FlashOn",
Evaluation = "Play",
Snippets = "Code",
}