Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
coming soon tooltips
Brendan Allan4ddd2689d294
diff --git a/apps/desktop/src/routes/editor/ConfigSidebar.tsx b/apps/desktop/src/routes/editor/ConfigSidebar.tsxindex 38f9bf6c8..67e6a7d07 100644--- a/apps/desktop/src/routes/editor/ConfigSidebar.tsx+++ b/apps/desktop/src/routes/editor/ConfigSidebar.tsx@@ -3,14 +3,15 @@ import {RadioGroup,} from "@kobalte/core/radio-group";import { Tabs as KTabs } from "@kobalte/core/tabs";+import { Tooltip as KTooltip } from "@kobalte/core/tooltip";import { cx } from "cva";-import { type Component, For, Show } from "solid-js";+import { type Component, For, ParentProps, Show } from "solid-js";import { Dynamic } from "solid-js/web";import { createWritableMemo } from "@solid-primitives/memo";import type { BackgroundSource, CursorType } from "../../utils/tauri";import { useEditorContext } from "./context";-import { Field, Slider, Subfield, Toggle } from "./ui";+import { ComingSoonTooltip, Field, Slider, Subfield, Toggle } from "./ui";import { DEFAULT_GRADIENT_FROM, DEFAULT_GRADIENT_TO } from "./projectConfig";const BACKGROUND_SOURCES = {@@ -103,28 +104,24 @@ export function ConfigSidebar() {switch (tab) {case "wallpaper": {setProject("background", "source", {- type: "wallpaper",...backgrounds.wallpaper,});return;}case "image": {setProject("background", "source", {- type: "image",...backgrounds.image,});return;}case "color": {setProject("background", "source", {- type: "color",...backgrounds.color,});return;}case "gradient": {setProject("background", "source", {- type: "gradient",...backgrounds.gradient,});return;@@ -159,15 +156,24 @@ export function ConfigSidebar() {</For></div><For each={BACKGROUND_SOURCES_LIST}>- {(item, i) => (- <KTabs.Trigger- class="flex-1 text-gray-400 py-1 z-10 ui-selected:text-gray-500 peer outline-none transition-colors duration-100"- value={item}- disabled={item === "wallpaper" || item === "image"}- >- {BACKGROUND_SOURCES[item]}- </KTabs.Trigger>- )}+ {(item) => {+ const comingSoon = item === "wallpaper" || item === "image";++ const el = (props?: object) => (+ <KTabs.Trigger+ class="flex-1 text-gray-400 py-1 z-10 ui-selected:text-gray-500 peer outline-none transition-colors duration-100"+ value={item}+ disabled={comingSoon}+ {...props}+ >+ {BACKGROUND_SOURCES[item]}+ </KTabs.Trigger>+ );++ if (comingSoon) return <ComingSoonTooltip as={el} />;++ return el({});+ }}</For><KTabs.Indicator class="absolute flex p-px inset-0 transition-transform peer-focus-visible:outline outline-2 outline-blue-300 outline-offset-2 rounded-[0.6rem] overflow-hidden"><div class="bg-gray-100 flex-1" />@@ -271,15 +277,17 @@ export function ConfigSidebar() {</KTabs></Field>- <Field name="Background Blur" icon={<IconCapBlur />}>- <Slider- disabled- value={[project.background.blur]}- onChange={(v) => setProject("background", "blur", v[0])}- minValue={0}- maxValue={100}- />- </Field>+ <ComingSoonTooltip>+ <Field name="Background Blur" icon={<IconCapBlur />}>+ <Slider+ disabled+ value={[project.background.blur]}+ onChange={(v) => setProject("background", "blur", v[0])}+ minValue={0}+ maxValue={100}+ />+ </Field>+ </ComingSoonTooltip><Field name="Padding" icon={<IconCapPadding />}><Slidervalue={[project.background.padding]}@@ -298,15 +306,17 @@ export function ConfigSidebar() {step={0.1}/></Field>- <Field name="Inset" icon={<IconCapInset />}>- <Slider- disabled- value={[project.background.inset]}- onChange={(v) => setProject("background", "inset", v[0])}- minValue={0}- maxValue={100}- />- </Field>+ <ComingSoonTooltip>+ <Field name="Inset" icon={<IconCapInset />}>+ <Slider+ disabled+ value={[project.background.inset]}+ onChange={(v) => setProject("background", "inset", v[0])}+ minValue={0}+ maxValue={100}+ />+ </Field>+ </ComingSoonTooltip></KTabs.Content><KTabs.Content value="camera" class="flex flex-col gap-[1.5rem]"><Field name="Camera" icon={<IconCapCamera />}>@@ -376,14 +386,17 @@ export function ConfigSidebar() {step={0.1}/></Field>- <Field name="Shadow" icon={<IconCapShadow />}>- <Slider- value={[project.camera.shadow]}- onChange={(v) => setProject("camera", "shadow", v[0])}- minValue={0}- maxValue={100}- />- </Field>+ <ComingSoonTooltip>+ <Field name="Shadow" icon={<IconCapShadow />}>+ <Slider+ disabled+ value={[project.camera.shadow]}+ onChange={(v) => setProject("camera", "shadow", v[0])}+ minValue={0}+ maxValue={100}+ />+ </Field>+ </ComingSoonTooltip></KTabs.Content><KTabs.Content value="transcript" class="flex flex-col gap-6"><Field name="Transcript" icon={<IconCapMessageBubble />}>@@ -403,68 +416,80 @@ export function ConfigSidebar() {<KTabs.Content value="audio" class="flex flex-col gap-6"><Field name="Audio" icon={<IconCapAudioOn />}><div class="flex flex-col gap-3 ">- <Subfield name="Mute Audio">- <Toggle disabled />- </Subfield>- <Subfield name="Improve Mic Quality">- <Toggle disabled />- </Subfield>+ <ComingSoonTooltip>+ <Subfield name="Mute Audio">+ <Toggle disabled />+ </Subfield>+ </ComingSoonTooltip>+ <ComingSoonTooltip>+ <Subfield name="Improve Mic Quality">+ <Toggle disabled />+ </Subfield>+ </ComingSoonTooltip></div></Field></KTabs.Content><KTabs.Content value="cursor" class="flex flex-col gap-6"><Field name="Cursor" icon={<IconCapCursor />}>- <Subfield name="Hide cursor when not moving">- <Toggle disabled />- </Subfield>- </Field>- <Field name="Size" icon={<IconCapEnlarge />}>- <Slider- disabled- value={[project.cursor.size]}- onChange={(v) => setProject("cursor", "size", v[0])}- minValue={0}- maxValue={100}- />- </Field>- <Field name="Type" icon={<IconCapCursor />}>- <ul class="flex flex-row gap-2 text-gray-400">- <For- each={- [- { type: "pointer", icon: IconCapCursor },- { type: "circle", icon: IconCapCircle },- ] satisfies Array<{- icon: Component;- type: CursorType;- }>- }- >- {(item) => (- <li>- <button- disabled- type="button"- onClick={() => setProject("cursor", "type", item.type)}- data-selected={project.cursor.type === item.type}- class="border border-black-transparent-5 bg-gray-100 rounded-lg p-[0.625rem] text-gray-400 data-[selected='true']:text-gray-500 disabled:text-gray-300 focus-visible:outline-blue-300 focus-visible:outline outline-1 outline-offset-1"- >- <Dynamic- component={item.icon}- class="size-[1.75rem] mx-auto"- />- </button>- </li>- )}- </For>- </ul>+ <ComingSoonTooltip>+ <Subfield name="Hide cursor when not moving">+ <Toggle disabled />+ </Subfield>+ </ComingSoonTooltip></Field>+ <ComingSoonTooltip>+ <Field name="Size" icon={<IconCapEnlarge />}>+ <Slider+ disabled+ value={[project.cursor.size]}+ onChange={(v) => setProject("cursor", "size", v[0])}+ minValue={0}+ maxValue={100}+ />+ </Field>+ </ComingSoonTooltip>+ <ComingSoonTooltip>+ <Field name="Type" icon={<IconCapCursor />}>+ <ul class="flex flex-row gap-2 text-gray-400">+ <For+ each={+ [+ { type: "pointer", icon: IconCapCursor },+ { type: "circle", icon: IconCapCircle },+ ] satisfies Array<{+ icon: Component;+ type: CursorType;+ }>+ }+ >+ {(item) => (+ <li>+ <button+ disabled+ type="button"+ onClick={() => setProject("cursor", "type", item.type)}+ data-selected={project.cursor.type === item.type}+ class="border border-black-transparent-5 bg-gray-100 rounded-lg p-[0.625rem] text-gray-400 data-[selected='true']:text-gray-500 disabled:text-gray-300 focus-visible:outline-blue-300 focus-visible:outline outline-1 outline-offset-1"+ >+ <Dynamic+ component={item.icon}+ class="size-[1.75rem] mx-auto"+ />+ </button>+ </li>+ )}+ </For>+ </ul>+ </Field>+ </ComingSoonTooltip></KTabs.Content><KTabs.Content value="hotkeys"><Field name="Hotkeys" icon={<IconCapHotkeys />}>- <Subfield name="Show hotkeys">- <Toggle disabled />- </Subfield>+ <ComingSoonTooltip>+ <Subfield name="Show hotkeys">+ <Toggle disabled />+ </Subfield>+ </ComingSoonTooltip></Field></KTabs.Content></div>diff --git a/apps/desktop/src/routes/editor/Editor.tsx b/apps/desktop/src/routes/editor/Editor.tsxindex b637dfead..365f01e4a 100644--- a/apps/desktop/src/routes/editor/Editor.tsx+++ b/apps/desktop/src/routes/editor/Editor.tsx@@ -624,7 +624,7 @@ function Dialogs() {<><Dialog.Header><div class="flex flex-row space-x-[0.75rem]">- <AspectRatioSelect />+ {/*<AspectRatioSelect />*/}<div class="flex flex-row items-center space-x-[0.5rem] text-gray-400"><span>Size</span><div class="w-[3.25rem]">diff --git a/apps/desktop/src/routes/editor/Player.tsx b/apps/desktop/src/routes/editor/Player.tsxindex 23b2133bf..5cd098a27 100644--- a/apps/desktop/src/routes/editor/Player.tsx+++ b/apps/desktop/src/routes/editor/Player.tsx@@ -8,6 +8,7 @@ import { reconcile } from "solid-js/store";import { type AspectRatio, commands } from "../../utils/tauri";import { useEditorContext } from "./context";import {+ ComingSoonTooltip,DropdownItem,EditorButton,MenuItem,@@ -133,14 +134,16 @@ export function Player() {<span>{formatTime(editorInstance.recordingDuration)}</span></div><div class="flex-1 flex flex-row justify-end">- <EditorButton<typeof KToggleButton>- disabled- as={KToggleButton}- variant="danger"- leftIcon={<IconCapScissors />}- >- Split- </EditorButton>+ <ComingSoonTooltip>+ <EditorButton<typeof KToggleButton>+ disabled+ as={KToggleButton}+ variant="danger"+ leftIcon={<IconCapScissors />}+ >+ Split+ </EditorButton>+ </ComingSoonTooltip></div></div></div>@@ -151,78 +154,80 @@ function AspectRatioSelect() {const { project, setProject } = useEditorContext();return (- <KSelect<AspectRatio | "auto">- disabled- value={project.aspectRatio ?? "auto"}- onChange={(v) => {- if (v === null) return;- setProject("aspectRatio", v === "auto" ? null : v);- }}- defaultValue="auto"- options={- ["auto", "wide", "vertical", "square", "classic", "tall"] as const- }- multiple={false}- itemComponent={(props) => {- const item = () =>- ASPECT_RATIOS[- props.item.rawValue === "auto" ? "wide" : props.item.rawValue- ];-- return (- <MenuItem<typeof KSelect.Item> as={KSelect.Item} item={props.item}>- <KSelect.ItemLabel class="flex-1">- {props.item.rawValue === "auto"- ? "Auto"- : ASPECT_RATIOS[props.item.rawValue].name}- <Show when={item()}>- {(item) => (- <span class="text-gray-400">- {"⋅"}- {item().ratio[0]}:{item().ratio[1]}- </span>- )}- </Show>- </KSelect.ItemLabel>- <KSelect.ItemIndicator class="ml-auto">- <IconCapCircleCheck />- </KSelect.ItemIndicator>- </MenuItem>- );- }}- placement="top-start"- >- <EditorButton<typeof KSelect.Trigger>- as={KSelect.Trigger}- leftIcon={<IconCapLayout />}- rightIcon={- <KSelect.Icon>- <IconCapChevronDown />- </KSelect.Icon>+ <ComingSoonTooltip>+ <KSelect<AspectRatio | "auto">+ disabled+ value={project.aspectRatio ?? "auto"}+ onChange={(v) => {+ if (v === null) return;+ setProject("aspectRatio", v === "auto" ? null : v);+ }}+ defaultValue="auto"+ options={+ ["auto", "wide", "vertical", "square", "classic", "tall"] as const}+ multiple={false}+ itemComponent={(props) => {+ const item = () =>+ ASPECT_RATIOS[+ props.item.rawValue === "auto" ? "wide" : props.item.rawValue+ ];++ return (+ <MenuItem<typeof KSelect.Item> as={KSelect.Item} item={props.item}>+ <KSelect.ItemLabel class="flex-1">+ {props.item.rawValue === "auto"+ ? "Auto"+ : ASPECT_RATIOS[props.item.rawValue].name}+ <Show when={item()}>+ {(item) => (+ <span class="text-gray-400">+ {"⋅"}+ {item().ratio[0]}:{item().ratio[1]}+ </span>+ )}+ </Show>+ </KSelect.ItemLabel>+ <KSelect.ItemIndicator class="ml-auto">+ <IconCapCircleCheck />+ </KSelect.ItemIndicator>+ </MenuItem>+ );+ }}+ placement="top-start">- <KSelect.Value<AspectRatio | "auto">>- {(state) => {- const text = () => {- const option = state.selectedOption();- return option === "auto" ? "Auto" : ASPECT_RATIOS[option].name;- };- return <>{text()}</>;- }}- </KSelect.Value>- </EditorButton>- <KSelect.Portal>- <PopperContent<typeof KSelect.Content>- as={KSelect.Content}- class={topLeftAnimateClasses}+ <EditorButton<typeof KSelect.Trigger>+ as={KSelect.Trigger}+ leftIcon={<IconCapLayout />}+ rightIcon={+ <KSelect.Icon>+ <IconCapChevronDown />+ </KSelect.Icon>+ }>- <MenuItemList<typeof KSelect.Listbox>- as={KSelect.Listbox}- class="w-[12.5rem]"- />- </PopperContent>- </KSelect.Portal>- </KSelect>+ <KSelect.Value<AspectRatio | "auto">>+ {(state) => {+ const text = () => {+ const option = state.selectedOption();+ return option === "auto" ? "Auto" : ASPECT_RATIOS[option].name;+ };+ return <>{text()}</>;+ }}+ </KSelect.Value>+ </EditorButton>+ <KSelect.Portal>+ <PopperContent<typeof KSelect.Content>+ as={KSelect.Content}+ class={topLeftAnimateClasses}+ >+ <MenuItemList<typeof KSelect.Listbox>+ as={KSelect.Listbox}+ class="w-[12.5rem]"+ />+ </PopperContent>+ </KSelect.Portal>+ </KSelect>+ </ComingSoonTooltip>);}diff --git a/apps/desktop/src/routes/editor/ui.tsx b/apps/desktop/src/routes/editor/ui.tsxindex d17b5f3ef..3ecb37180 100644--- a/apps/desktop/src/routes/editor/ui.tsx+++ b/apps/desktop/src/routes/editor/ui.tsx@@ -4,6 +4,7 @@ import { DropdownMenu } from "@kobalte/core/dropdown-menu";import { Polymorphic, type PolymorphicProps } from "@kobalte/core/polymorphic";import { Slider as KSlider } from "@kobalte/core/slider";import { Switch as KSwitch } from "@kobalte/core/switch";+import { Tooltip as KTooltip } from "@kobalte/core/tooltip";import { cva, cx, type VariantProps } from "cva";import {type ComponentProps,@@ -296,3 +297,29 @@ export const topLeftAnimateClasses =export const topRightAnimateClasses ="ui-expanded:animate-in ui-expanded:fade-in ui-expanded:zoom-in-95 ui-closed:animate-out ui-closed:fade-out ui-closed:zoom-out-95 origin-top-right";++export function ComingSoonTooltip(+ props: ComponentProps<typeof KTooltip> & any+) {+ const [trigger, root] = splitProps(props, ["children", "as"]);+ return (+ <KTooltip placement="top" openDelay={0} closeDelay={0} {...root}>+ <KTooltip.Trigger as={trigger.as ?? "div"}>+ {trigger.children}+ </KTooltip.Trigger>+ <KTooltip.Portal>+ <KTooltip.Content+ class="p-2 font-medium bg-gray-500 text-white ui-expanded:animate-in ui-expanded:slide-in-from-bottom-1 ui-expanded:fade-in ui-closed:animate-out ui-closed:slide-out-to-bottom-1 ui-closed:fade-out"+ style={{+ color: "white",+ "border-radius": "8px",+ "font-size": "12px",+ "z-index": "1000",+ }}+ >+ Coming Soon+ </KTooltip.Content>+ </KTooltip.Portal>+ </KTooltip>+ );+}diff --git a/apps/desktop/src/routes/prev-recordings.tsx b/apps/desktop/src/routes/prev-recordings.tsxindex 6d519031b..0809ff29e 100644--- a/apps/desktop/src/routes/prev-recordings.tsx+++ b/apps/desktop/src/routes/prev-recordings.tsx@@ -26,7 +26,6 @@ import { makePersisted } from "@solid-primitives/storage";import { commands, events } from "../utils/tauri";import { DEFAULT_PROJECT_CONFIG } from "./editor/projectConfig";import { createPresets } from "./createPresets";-import { createQueryInvalidate } from "../utils/events";type RecordingEntry = {path: string;