-
Notifications
You must be signed in to change notification settings - Fork 985
improvement: update new recording flow with mode info #970
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,13 +1,14 @@ | ||||||||||||||||||||||||||||||||||||||||||||
| import { cx } from "cva"; | ||||||||||||||||||||||||||||||||||||||||||||
| import type { JSX } from "solid-js"; | ||||||||||||||||||||||||||||||||||||||||||||
| import { type JSX, Show } from "solid-js"; | ||||||||||||||||||||||||||||||||||||||||||||
| import { createOptionsQuery } from "~/utils/queries"; | ||||||||||||||||||||||||||||||||||||||||||||
| import type { RecordingMode } from "~/utils/tauri"; | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| interface ModeOptionProps { | ||||||||||||||||||||||||||||||||||||||||||||
| mode: RecordingMode; | ||||||||||||||||||||||||||||||||||||||||||||
| title: string; | ||||||||||||||||||||||||||||||||||||||||||||
| description: string; | ||||||||||||||||||||||||||||||||||||||||||||
| icon: (props: { class: string; style: JSX.CSSProperties }) => JSX.Element; | ||||||||||||||||||||||||||||||||||||||||||||
| standalone?: boolean; | ||||||||||||||||||||||||||||||||||||||||||||
| icon: (props: { class: string; style?: JSX.CSSProperties }) => JSX.Element; | ||||||||||||||||||||||||||||||||||||||||||||
| isSelected: boolean; | ||||||||||||||||||||||||||||||||||||||||||||
| onSelect: (mode: RecordingMode) => void; | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -17,26 +18,12 @@ const ModeOption = (props: ModeOptionProps) => { | |||||||||||||||||||||||||||||||||||||||||||
| <div | ||||||||||||||||||||||||||||||||||||||||||||
| onClick={() => props.onSelect(props.mode)} | ||||||||||||||||||||||||||||||||||||||||||||
| class={cx( | ||||||||||||||||||||||||||||||||||||||||||||
| `p-4 space-y-3 rounded-lg bg-gray-2 transition-all duration-200`, | ||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||
| "ring-2 ring-offset-2 hover:bg-gray-2 cursor-default ring-blue-9 ring-offset-gray-100": | ||||||||||||||||||||||||||||||||||||||||||||
| props.isSelected, | ||||||||||||||||||||||||||||||||||||||||||||
| "ring-2 ring-transparent ring-offset-transparent hover:bg-gray-3 cursor-pointer": | ||||||||||||||||||||||||||||||||||||||||||||
| !props.isSelected, | ||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||
| `p-5 space-y-3 rounded-lg border transition-all duration-200 border-gray-4 dark:border-gray-3 h-fit bg-gray-3 dark:bg-gray-2`, | ||||||||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||
| <div class="flex flex-col items-center mb-2 text-center"> | ||||||||||||||||||||||||||||||||||||||||||||
| {props.icon({ | ||||||||||||||||||||||||||||||||||||||||||||
| class: cx( | ||||||||||||||||||||||||||||||||||||||||||||
| "size-12 mb-3", | ||||||||||||||||||||||||||||||||||||||||||||
| props.isSelected ? "opacity-100" : "opacity-30", | ||||||||||||||||||||||||||||||||||||||||||||
| ), | ||||||||||||||||||||||||||||||||||||||||||||
| style: { | ||||||||||||||||||||||||||||||||||||||||||||
| filter: props.isSelected | ||||||||||||||||||||||||||||||||||||||||||||
| ? "drop-shadow(0 0 0.5rem rgba(255, 255, 255, 0.5))" | ||||||||||||||||||||||||||||||||||||||||||||
| : "none", | ||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||
| class: "size-12 mb-5 invert dark:invert-0", | ||||||||||||||||||||||||||||||||||||||||||||
| })} | ||||||||||||||||||||||||||||||||||||||||||||
| <h3 class="text-lg font-medium text-gray-12">{props.title}</h3> | ||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -48,7 +35,7 @@ const ModeOption = (props: ModeOptionProps) => { | |||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| const ModeSelect = () => { | ||||||||||||||||||||||||||||||||||||||||||||
| const ModeSelect = (props: { onClose?: () => void; standalone?: boolean }) => { | ||||||||||||||||||||||||||||||||||||||||||||
| const { rawOptions, setOptions } = createOptionsQuery(); | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| const handleModeChange = (mode: RecordingMode) => { | ||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -73,7 +60,28 @@ const ModeSelect = () => { | |||||||||||||||||||||||||||||||||||||||||||
| ]; | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||||||||||||
| <div class="grid grid-cols-2 gap-8 text-center"> | ||||||||||||||||||||||||||||||||||||||||||||
| <div | ||||||||||||||||||||||||||||||||||||||||||||
| class={cx( | ||||||||||||||||||||||||||||||||||||||||||||
| "grid grid-cols-2 gap-8 items-center text-center bg-gray-1", | ||||||||||||||||||||||||||||||||||||||||||||
| props.standalone | ||||||||||||||||||||||||||||||||||||||||||||
| ? "absolute z-10 border border-gray-3 p-16 rounded-xl" | ||||||||||||||||||||||||||||||||||||||||||||
| : "", | ||||||||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||||||||
| onClick={(e) => e.stopPropagation()} | ||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+63
to
+71
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Center and label the overlay (dialog semantics). - <div
- class={cx(
- "grid grid-cols-2 gap-8 items-center text-center bg-gray-1",
- props.standalone
- ? "absolute z-10 border border-gray-3 p-16 rounded-xl"
- : "",
- )}
- onClick={(e) => e.stopPropagation()}
- >
+ <div
+ role={props.standalone ? "dialog" : undefined}
+ aria-modal={props.standalone ? "true" : undefined}
+ aria-labelledby={props.standalone ? "mode-select-title" : undefined}
+ class={cx(
+ "grid grid-cols-2 gap-8 items-center text-center bg-gray-1",
+ props.standalone
+ ? "fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 z-20 border border-gray-3 p-16 rounded-xl shadow-2xl"
+ : ""
+ )}
+ onClick={(e) => e.stopPropagation()}
+ >📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||
| <Show when={props.onClose}> | ||||||||||||||||||||||||||||||||||||||||||||
| <div | ||||||||||||||||||||||||||||||||||||||||||||
| onClick={() => props.onClose?.()} | ||||||||||||||||||||||||||||||||||||||||||||
| class="absolute -top-2.5 -right-2.5 p-2 rounded-full border duration-200 bg-gray-2 border-gray-3 hover:bg-gray-3 transition-duration" | ||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||
| <IconCapX class="invert-1 size-2 dark:invert" /> | ||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||
| </Show> | ||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+72
to
+79
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Use a button for the close control and fix Tailwind classes. - <Show when={props.onClose}>
- <div
- onClick={() => props.onClose?.()}
- class="absolute -top-2.5 -right-2.5 p-2 rounded-full border duration-200 bg-gray-2 border-gray-3 hover:bg-gray-3 transition-duration"
- >
- <IconCapX class="invert-1 size-2 dark:invert" />
- </div>
- </Show>
+ <Show when={props.onClose}>
+ <button
+ type="button"
+ aria-label="Close"
+ onClick={() => props.onClose?.()}
+ class="absolute -top-2.5 -right-2.5 p-2 rounded-full border bg-gray-2 border-gray-3 hover:bg-gray-3 transition-colors duration-200"
+ >
+ <IconCapX class="invert size-2 dark:invert-0" />
+ </button>
+ </Show>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||
| {props.standalone && ( | ||||||||||||||||||||||||||||||||||||||||||||
| <h2 class="text-[24px] col-span-2 font-medium text-center text-gray-12"> | ||||||||||||||||||||||||||||||||||||||||||||
| Recording Modes | ||||||||||||||||||||||||||||||||||||||||||||
| </h2> | ||||||||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||||||||
| {modeOptions.map((option) => ( | ||||||||||||||||||||||||||||||||||||||||||||
| <ModeOption | ||||||||||||||||||||||||||||||||||||||||||||
| mode={option.mode} | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -21,6 +21,7 @@ import { | |||||||||||||||||||||||||||||||||||||
| Switch, | ||||||||||||||||||||||||||||||||||||||
| } from "solid-js"; | ||||||||||||||||||||||||||||||||||||||
| import { createStore, reconcile } from "solid-js/store"; | ||||||||||||||||||||||||||||||||||||||
| import ModeSelect from "~/components/ModeSelect"; | ||||||||||||||||||||||||||||||||||||||
| import { authStore, generalSettingsStore } from "~/store"; | ||||||||||||||||||||||||||||||||||||||
| import { createOptionsQuery } from "~/utils/queries"; | ||||||||||||||||||||||||||||||||||||||
| import { | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -31,9 +32,14 @@ import { | |||||||||||||||||||||||||||||||||||||
| type TargetUnderCursor, | ||||||||||||||||||||||||||||||||||||||
| } from "~/utils/tauri"; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| const capitalize = (str: string) => { | ||||||||||||||||||||||||||||||||||||||
| return str.charAt(0).toUpperCase() + str.slice(1); | ||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| export default function () { | ||||||||||||||||||||||||||||||||||||||
| const [params] = useSearchParams<{ displayId: DisplayId }>(); | ||||||||||||||||||||||||||||||||||||||
| const { rawOptions, setOptions } = createOptionsQuery(); | ||||||||||||||||||||||||||||||||||||||
| const [toggleModeSelect, setToggleModeSelect] = createSignal(false); | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| const [targetUnderCursor, setTargetUnderCursor] = | ||||||||||||||||||||||||||||||||||||||
| createStore<TargetUnderCursor>({ | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -125,15 +131,16 @@ export default function () { | |||||||||||||||||||||||||||||||||||||
| class="relative w-screen h-screen flex flex-col items-center justify-center data-[over='true']:bg-blue-600/40 transition-colors" | ||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||
| <div class="absolute inset-0 bg-black/50 -z-10" /> | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| <Show when={displayInformation.data} keyed> | ||||||||||||||||||||||||||||||||||||||
| {(display) => ( | ||||||||||||||||||||||||||||||||||||||
| <> | ||||||||||||||||||||||||||||||||||||||
| <span class="text-3xl font-semibold mb-2 text-white"> | ||||||||||||||||||||||||||||||||||||||
| <span class="mb-2 text-3xl font-semibold text-white"> | ||||||||||||||||||||||||||||||||||||||
| {display.name || "Monitor"} | ||||||||||||||||||||||||||||||||||||||
| </span> | ||||||||||||||||||||||||||||||||||||||
| <Show when={display.physical_size}> | ||||||||||||||||||||||||||||||||||||||
| {(size) => ( | ||||||||||||||||||||||||||||||||||||||
| <span class="text-xs mb-2 text-white"> | ||||||||||||||||||||||||||||||||||||||
| <span class="mb-2 text-xs text-white"> | ||||||||||||||||||||||||||||||||||||||
| {`${size().width}x${size().height} · ${display.refresh_rate}FPS`} | ||||||||||||||||||||||||||||||||||||||
| </span> | ||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -142,7 +149,20 @@ export default function () { | |||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||
| </Show> | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| <Show when={toggleModeSelect()}> | ||||||||||||||||||||||||||||||||||||||
| {/* Transparent overlay to capture outside clicks */} | ||||||||||||||||||||||||||||||||||||||
| <div | ||||||||||||||||||||||||||||||||||||||
| class="absolute inset-0 z-10" | ||||||||||||||||||||||||||||||||||||||
| onClick={() => setToggleModeSelect(false)} | ||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||
| <ModeSelect | ||||||||||||||||||||||||||||||||||||||
| standalone | ||||||||||||||||||||||||||||||||||||||
| onClose={() => setToggleModeSelect(false)} | ||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||
| </Show> | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+152
to
+163
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Overlay layering and dismissal UX.
<Show when={toggleModeSelect()}>
{/* Transparent overlay to capture outside clicks */}
<div
- class="absolute inset-0 z-10"
+ class="absolute inset-0 z-10"
onClick={() => setToggleModeSelect(false)}
/>
<ModeSelect
standalone
onClose={() => setToggleModeSelect(false)}
/>
</Show>Add this listener near your other listeners to close on Escape (outside the changed hunk, included here for completeness): createEventListener(document, "keydown", (e) => {
if (e.key === "Escape" && toggleModeSelect()) setToggleModeSelect(false);
});🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||
| <RecordingControls | ||||||||||||||||||||||||||||||||||||||
| setToggleModeSelect={setToggleModeSelect} | ||||||||||||||||||||||||||||||||||||||
| target={{ variant: "display", id: params.displayId! }} | ||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -191,14 +211,15 @@ export default function () { | |||||||||||||||||||||||||||||||||||||
| </span> | ||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||
| <RecordingControls | ||||||||||||||||||||||||||||||||||||||
| setToggleModeSelect={setToggleModeSelect} | ||||||||||||||||||||||||||||||||||||||
| target={{ | ||||||||||||||||||||||||||||||||||||||
| variant: "window", | ||||||||||||||||||||||||||||||||||||||
| id: windowUnderCursor.id, | ||||||||||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| <Button | ||||||||||||||||||||||||||||||||||||||
| variant="primary" | ||||||||||||||||||||||||||||||||||||||
| variant="dark" | ||||||||||||||||||||||||||||||||||||||
| size="sm" | ||||||||||||||||||||||||||||||||||||||
| onClick={() => { | ||||||||||||||||||||||||||||||||||||||
| setBounds(windowUnderCursor.bounds); | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -657,16 +678,15 @@ export default function () { | |||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| function RecordingControls(props: { target: ScreenCaptureTarget }) { | ||||||||||||||||||||||||||||||||||||||
| function RecordingControls(props: { | ||||||||||||||||||||||||||||||||||||||
| target: ScreenCaptureTarget; | ||||||||||||||||||||||||||||||||||||||
| setToggleModeSelect?: (value: boolean) => void; | ||||||||||||||||||||||||||||||||||||||
| }) { | ||||||||||||||||||||||||||||||||||||||
| const auth = authStore.createQuery(); | ||||||||||||||||||||||||||||||||||||||
| const { rawOptions, setOptions } = createOptionsQuery(); | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| const generalSetings = generalSettingsStore.createQuery(); | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| const capitalize = (str: string) => { | ||||||||||||||||||||||||||||||||||||||
| return str.charAt(0).toUpperCase() + str.slice(1); | ||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| const menuModes = async () => | ||||||||||||||||||||||||||||||||||||||
| await Menu.new({ | ||||||||||||||||||||||||||||||||||||||
| items: [ | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -721,66 +741,78 @@ function RecordingControls(props: { target: ScreenCaptureTarget }) { | |||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||||||
| <div class="flex gap-2.5 items-center p-2.5 my-2.5 rounded-xl border min-w-fit w-fit bg-gray-2 border-gray-4"> | ||||||||||||||||||||||||||||||||||||||
| <div | ||||||||||||||||||||||||||||||||||||||
| onClick={() => setOptions("targetMode", null)} | ||||||||||||||||||||||||||||||||||||||
| class="flex justify-center items-center bg-white rounded-full transition-opacity size-9 hover:opacity-80" | ||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||
| <IconCapX class="will-change-transform size-3" /> | ||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||
| <div | ||||||||||||||||||||||||||||||||||||||
| data-inactive={rawOptions.mode === "instant" && !auth.data} | ||||||||||||||||||||||||||||||||||||||
| class="flex flex-row rounded-full bg-blue-9 overflow-hidden group h-11" | ||||||||||||||||||||||||||||||||||||||
| onClick={() => { | ||||||||||||||||||||||||||||||||||||||
| if (rawOptions.mode === "instant" && !auth.data) { | ||||||||||||||||||||||||||||||||||||||
| emit("start-sign-in"); | ||||||||||||||||||||||||||||||||||||||
| return; | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| commands.startRecording({ | ||||||||||||||||||||||||||||||||||||||
| capture_target: props.target, | ||||||||||||||||||||||||||||||||||||||
| mode: rawOptions.mode, | ||||||||||||||||||||||||||||||||||||||
| capture_system_audio: rawOptions.captureSystemAudio, | ||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||
| <div class="flex items-center pl-4 py-1 hover:bg-blue-10 transition-colors"> | ||||||||||||||||||||||||||||||||||||||
| {rawOptions.mode === "studio" ? ( | ||||||||||||||||||||||||||||||||||||||
| <IconCapFilmCut class="size-4" /> | ||||||||||||||||||||||||||||||||||||||
| ) : ( | ||||||||||||||||||||||||||||||||||||||
| <IconCapInstant class="size-4" /> | ||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||
| <div class="flex flex-col ml-3 mr-2"> | ||||||||||||||||||||||||||||||||||||||
| <span class="text-sm text-white font-medium text-nowrap"> | ||||||||||||||||||||||||||||||||||||||
| {rawOptions.mode === "instant" && !auth.data | ||||||||||||||||||||||||||||||||||||||
| ? "Sign In To Use" | ||||||||||||||||||||||||||||||||||||||
| : "Start Recording"} | ||||||||||||||||||||||||||||||||||||||
| </span> | ||||||||||||||||||||||||||||||||||||||
| <span class="text-xs text-nowrap text-white font-light -mt-0.5 opacity-90"> | ||||||||||||||||||||||||||||||||||||||
| {`${capitalize(rawOptions.mode)} Mode`} | ||||||||||||||||||||||||||||||||||||||
| </span> | ||||||||||||||||||||||||||||||||||||||
| <> | ||||||||||||||||||||||||||||||||||||||
| <div class="flex gap-2.5 items-center p-2.5 my-2.5 rounded-xl border min-w-fit w-fit bg-gray-2 border-gray-4"> | ||||||||||||||||||||||||||||||||||||||
| <div | ||||||||||||||||||||||||||||||||||||||
| onClick={() => setOptions("targetMode", null)} | ||||||||||||||||||||||||||||||||||||||
| class="flex justify-center items-center rounded-full transition-opacity bg-gray-12 size-9 hover:opacity-80" | ||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||
| <IconCapX class="invert will-change-transform size-3 dark:invert-0" /> | ||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+744
to
+751
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Use a button for the close control. - <div class="flex gap-2.5 items-center p-2.5 my-2.5 rounded-xl border min-w-fit w-fit bg-gray-2 border-gray-4">
- <div
- onClick={() => setOptions("targetMode", null)}
- class="flex justify-center items-center rounded-full transition-opacity bg-gray-12 size-9 hover:opacity-80"
- >
- <IconCapX class="invert will-change-transform size-3 dark:invert-0" />
- </div>
+ <div class="flex gap-2.5 items-center p-2.5 my-2.5 rounded-xl border min-w-fit w-fit bg-gray-2 border-gray-4">
+ <button
+ type="button"
+ aria-label="Close target selection"
+ onClick={() => setOptions("targetMode", null)}
+ class="flex justify-center items-center rounded-full transition-opacity bg-gray-12 size-9 hover:opacity-80"
+ >
+ <IconCapX class="invert will-change-transform size-3 dark:invert-0" />
+ </button>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||
| <div | ||||||||||||||||||||||||||||||||||||||
| data-inactive={rawOptions.mode === "instant" && !auth.data} | ||||||||||||||||||||||||||||||||||||||
| class="flex overflow-hidden flex-row h-11 rounded-full bg-blue-9 group" | ||||||||||||||||||||||||||||||||||||||
| onClick={() => { | ||||||||||||||||||||||||||||||||||||||
| if (rawOptions.mode === "instant" && !auth.data) { | ||||||||||||||||||||||||||||||||||||||
| emit("start-sign-in"); | ||||||||||||||||||||||||||||||||||||||
| return; | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| commands.startRecording({ | ||||||||||||||||||||||||||||||||||||||
| capture_target: props.target, | ||||||||||||||||||||||||||||||||||||||
| mode: rawOptions.mode, | ||||||||||||||||||||||||||||||||||||||
| capture_system_audio: rawOptions.captureSystemAudio, | ||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||
| <div class="flex items-center py-1 pl-4 transition-colors hover:bg-blue-10"> | ||||||||||||||||||||||||||||||||||||||
| {rawOptions.mode === "studio" ? ( | ||||||||||||||||||||||||||||||||||||||
| <IconCapFilmCut class="size-4" /> | ||||||||||||||||||||||||||||||||||||||
| ) : ( | ||||||||||||||||||||||||||||||||||||||
| <IconCapInstant class="size-4" /> | ||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||
| <div class="flex flex-col mr-2 ml-3"> | ||||||||||||||||||||||||||||||||||||||
| <span class="text-sm font-medium text-white text-nowrap"> | ||||||||||||||||||||||||||||||||||||||
| {rawOptions.mode === "instant" && !auth.data | ||||||||||||||||||||||||||||||||||||||
| ? "Sign In To Use" | ||||||||||||||||||||||||||||||||||||||
| : "Start Recording"} | ||||||||||||||||||||||||||||||||||||||
| </span> | ||||||||||||||||||||||||||||||||||||||
| <span class="text-xs flex items-center text-nowrap gap-1 transition-opacity duration-200 text-white font-light -mt-0.5 opacity-90"> | ||||||||||||||||||||||||||||||||||||||
| {`${capitalize(rawOptions.mode)} Mode`} | ||||||||||||||||||||||||||||||||||||||
| </span> | ||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||
| <div | ||||||||||||||||||||||||||||||||||||||
| class="pl-2.5 group-hover:bg-blue-10 transition-colors pr-3 py-1.5 flex items-center" | ||||||||||||||||||||||||||||||||||||||
| onClick={(e) => { | ||||||||||||||||||||||||||||||||||||||
| e.stopPropagation(); | ||||||||||||||||||||||||||||||||||||||
| menuModes().then((menu) => menu.popup()); | ||||||||||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||
| <IconCapCaretDown class="focus:rotate-90" /> | ||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||
| <div | ||||||||||||||||||||||||||||||||||||||
| class="pl-2.5 group-hover:bg-blue-10 transition-colors pr-3 py-1.5 flex items-center" | ||||||||||||||||||||||||||||||||||||||
| onClick={(e) => { | ||||||||||||||||||||||||||||||||||||||
| e.stopPropagation(); | ||||||||||||||||||||||||||||||||||||||
| menuModes().then((menu) => menu.popup()); | ||||||||||||||||||||||||||||||||||||||
| preRecordingMenu().then((menu) => menu.popup()); | ||||||||||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||||||||||
| class="flex justify-center items-center rounded-full border transition-opacity bg-gray-6 text-gray-12 size-9 hover:opacity-80" | ||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||
| <IconCapCaretDown class="focus:rotate-90" /> | ||||||||||||||||||||||||||||||||||||||
| <IconCapGear class="will-change-transform size-5" /> | ||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||
| <div | ||||||||||||||||||||||||||||||||||||||
| onClick={(e) => { | ||||||||||||||||||||||||||||||||||||||
| e.stopPropagation(); | ||||||||||||||||||||||||||||||||||||||
| preRecordingMenu().then((menu) => menu.popup()); | ||||||||||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||||||||||
| class="flex justify-center items-center rounded-full border transition-opacity bg-gray-6 text-gray-12 size-9 hover:opacity-80" | ||||||||||||||||||||||||||||||||||||||
| onClick={() => props.setToggleModeSelect?.(true)} | ||||||||||||||||||||||||||||||||||||||
| class="flex gap-1 items-center mb-5 transition-opacity duration-200 hover:opacity-60" | ||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||
| <IconCapGear class="will-change-transform size-5" /> | ||||||||||||||||||||||||||||||||||||||
| <IconCapInfo class="opacity-70 will-change-transform size-3" /> | ||||||||||||||||||||||||||||||||||||||
| <p class="text-sm text-white"> | ||||||||||||||||||||||||||||||||||||||
| <span class="opacity-70">What is </span> | ||||||||||||||||||||||||||||||||||||||
| <span class="font-medium">{capitalize(rawOptions.mode)} Mode</span>? | ||||||||||||||||||||||||||||||||||||||
| </p> | ||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||
| </> | ||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Selected state no longer reflected; either style it or remove
isSelected.UX regression: current card styles don’t indicate selection. Add a selected style or drop the prop.
📝 Committable suggestion
🤖 Prompt for AI Agents