Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
feat: Basic welcome screen (before permissions flow) (#161)
Richie McIlroy2b0d7f1fbacb
diff --git a/apps/desktop/src-tauri/capabilities/default.json b/apps/desktop/src-tauri/capabilities/default.jsonindex 46a5d0706..f1b132a13 100644--- a/apps/desktop/src-tauri/capabilities/default.json+++ b/apps/desktop/src-tauri/capabilities/default.json@@ -23,6 +23,10 @@"shell:default","fs:default","fs:read-files",+ "fs:allow-picture-read",+ "fs:allow-font-meta",+ "core:image:default",+ "fs:allow-audio-read","dialog:default","store:default","process:default",diff --git a/apps/desktop/src-tauri/src/general_settings.rs b/apps/desktop/src-tauri/src/general_settings.rsindex 986b239c0..0f941d712 100644--- a/apps/desktop/src-tauri/src/general_settings.rs+++ b/apps/desktop/src-tauri/src/general_settings.rs@@ -6,6 +6,7 @@ use tauri::{AppHandle, Manager, Wry};use tauri_plugin_store::StoreExt;#[derive(Serialize, Deserialize, Type, Default)]+#[serde(rename_all = "camelCase")]pub struct GeneralSettingsStore {#[serde(default)]pub upload_individual_files: bool,@@ -15,13 +16,15 @@ pub struct GeneralSettingsStore {pub hide_dock_icon: bool,#[serde(default)]pub auto_create_shareable_link: bool,- #[serde(default = "default_enable_notifications")]+ #[serde(default = "true_b")]pub enable_notifications: bool,#[serde(default)]pub disable_auto_open_links: bool,+ #[serde(default)]+ pub has_completed_startup: bool,}-fn default_enable_notifications() -> bool {+fn true_b() -> bool {true}@@ -39,11 +42,14 @@ impl GeneralSettingsStore {}}- pub fn set(app: &AppHandle, settings: Self) -> Result<(), String> {+ // i don't trust anyone to not overwrite the whole store lols+ pub fn update(app: &AppHandle, update: impl FnOnce(&mut Self)) -> Result<(), String> {let Some(store) = app.get_store("store") else {return Err("Store not found".to_string());};+ let mut settings = Self::get(app)?.unwrap_or_default();+ update(&mut settings);store.set("general_settings", json!(settings));store.save().map_err(|e| e.to_string())}diff --git a/apps/desktop/src-tauri/src/lib.rs b/apps/desktop/src-tauri/src/lib.rsindex 43ea2036e..752c57df4 100644--- a/apps/desktop/src-tauri/src/lib.rs+++ b/apps/desktop/src-tauri/src/lib.rs@@ -21,7 +21,7 @@ use cap_editor::{EditorInstance, FRAMES_WS_PATH};use cap_editor::{EditorState, ProjectRecordings};use cap_media::sources::CaptureScreen;use cap_media::{- feeds::{AudioData, AudioFrameBuffer, CameraFeed, CameraFrameSender},+ feeds::{AudioFrameBuffer, CameraFeed, CameraFrameSender},platform::Bounds,sources::{AudioInputSource, ScreenCaptureTarget},};@@ -34,7 +34,6 @@ use cap_rendering::{ProjectUniforms, ZOOM_DURATION};use general_settings::GeneralSettingsStore;use image::{ImageBuffer, Rgba};use mp4::Mp4Reader;-use num_traits::ToBytes;use png::{ColorType, Encoder};use recording::{list_cameras, list_capture_screens, list_capture_windows, InProgressRecording, FPS,@@ -2278,25 +2277,16 @@ fn open_external_link(app: tauri::AppHandle, url: String) -> Result<(), String>Ok(())}-#[tauri::command]-#[specta::specta]-async fn set_general_settings(- app: AppHandle,- settings: GeneralSettingsStore,-) -> Result<(), String> {- GeneralSettingsStore::set(&app, settings)-}-#[tauri::command]#[specta::specta]async fn delete_auth_open_signin(app: AppHandle) -> Result<(), String> {AuthStore::set(&app, None).map_err(|e| e.to_string())?;- if let Some(window) = (CapWindowId::Settings).get(&app) {+ if let Some(window) = CapWindowId::Settings.get(&app) {window.close().ok();}- if let Some(window) = (CapWindowId::Camera).get(&app) {+ if let Some(window) = CapWindowId::Camera.get(&app) {window.close().ok();}@@ -2383,10 +2373,10 @@ async fn check_notification_permissions(app: &AppHandle) {println!("Notification permission granted");}Ok(_) | Err(_) => {- if let Ok(Some(mut s)) = GeneralSettingsStore::get(app) {+ GeneralSettingsStore::update(app, |s| {s.enable_notifications = false;- GeneralSettingsStore::set(app, s).ok();- }+ })+ .ok();}}}@@ -2451,7 +2441,6 @@ pub async fn run() {check_upgraded_and_update,open_external_link,hotkeys::set_hotkey,- set_general_settings,delete_auth_open_signin,reset_camera_permissions,reset_microphone_permissions,@@ -2525,16 +2514,23 @@ pub async fn run() {let app_handle = app.handle().clone();// Add this line to check notification permissions on startup- // Fix: Clone the app_handle and move it into the spawned tasklet notification_handle = app_handle.clone();tauri::async_runtime::spawn(async move {check_notification_permissions(¬ification_handle).await;});- if permissions::do_permissions_check(true).necessary_granted() {- open_main_window(app_handle.clone());+ println!("Checking startup completion and permissions...");+ let permissions = permissions::do_permissions_check(false);+ println!("Permissions check result: {:?}", permissions);++ CapWindow::Setup.show(&app_handle).ok();+ if !permissions.screen_recording.permitted() || !permissions.accessibility.permitted() {+ println!("Required permissions not granted, showing permissions window");+ CapWindow::Setup.show(&app_handle).ok();} else {- permissions::open_permissions_window(app_handle.clone());+ println!("Permissions granted, showing main window");++ CapWindow::Main.show(&app_handle).ok();}app.manage(Arc::new(RwLock::new(App {diff --git a/apps/desktop/src-tauri/src/permissions.rs b/apps/desktop/src-tauri/src/permissions.rsindex 2633e36ce..76f5587f9 100644--- a/apps/desktop/src-tauri/src/permissions.rs+++ b/apps/desktop/src-tauri/src/permissions.rs@@ -1,5 +1,4 @@use serde::{Deserialize, Serialize};-use tauri::AppHandle;#[cfg(target_os = "macos")]use cap_media::platform::{AVAuthorizationStatus, AVMediaType};@@ -10,7 +9,6 @@ use core_foundation::dictionary::{CFDictionary, CFDictionaryRef}; // Import CFDi#[cfg(target_os = "macos")]use core_foundation::string::CFString;-use crate::windows::CapWindow;#[cfg(target_os = "macos")]#[link(name = "ApplicationServices", kind = "framework")]@@ -208,9 +206,3 @@ pub fn request_accessibility_permission() {}}}--#[tauri::command]-#[specta::specta]-pub fn open_permissions_window(app: AppHandle) {- CapWindow::Permissions.show(&app).ok();-}diff --git a/apps/desktop/src-tauri/src/recording.rs b/apps/desktop/src-tauri/src/recording.rsindex b613e1f21..35d627774 100644--- a/apps/desktop/src-tauri/src/recording.rs+++ b/apps/desktop/src-tauri/src/recording.rs@@ -11,7 +11,6 @@ use std::sync::Arc;use std::time::{SystemTime, UNIX_EPOCH};use tokio::sync::oneshot;-use crate::cursor::spawn_cursor_recorder;use crate::RecordingOptions;// TODO: Hacky, please fixdiff --git a/apps/desktop/src-tauri/src/windows.rs b/apps/desktop/src-tauri/src/windows.rsindex 6445ecd1c..6fda8a9ed 100644--- a/apps/desktop/src-tauri/src/windows.rs+++ b/apps/desktop/src-tauri/src/windows.rs@@ -7,10 +7,10 @@ use tauri::{#[derive(Clone)]pub enum CapWindow {+ Setup,Main,Settings { page: Option<String> },Editor { project_id: String },- Permissions,PrevRecordings,WindowCaptureOccluder,Camera { ws_port: u16 },@@ -20,10 +20,11 @@ pub enum CapWindow {#[derive(Clone)]pub enum CapWindowId {+ // Contains onboarding + permissions+ Setup,Main,Settings,Editor { project_id: String },- Permissions,PrevRecordings,WindowCaptureOccluder,Camera,@@ -34,13 +35,13 @@ pub enum CapWindowId {impl CapWindowId {pub fn from_label(label: &str) -> Self {match label {+ "setup" => Self::Setup,"main" => Self::Main,"settings" => Self::Settings,"camera" => Self::Camera,"window-capture-occluder" => Self::WindowCaptureOccluder,"in-progress-recording" => Self::InProgressRecording,"prev-recordings" => Self::PrevRecordings,- "permissions" => Self::Permissions,"upgrade" => Self::Upgrade,s if s.starts_with("editor-") => Self::Editor {project_id: s.replace("editor-", ""),@@ -51,38 +52,34 @@ impl CapWindowId {pub fn label(&self) -> String {match self {+ Self::Setup => "setup".to_string(),Self::Main => "main".to_string(),Self::Settings => "settings".to_string(),Self::Camera => "camera".to_string(),Self::WindowCaptureOccluder => "window-capture-occluder".to_string(),Self::InProgressRecording => "in-progress-recording".to_string(),Self::PrevRecordings => "prev-recordings".to_string(),- Self::Editor { project_id } => format!("editor-{}", project_id),- Self::Permissions => "permissions".to_string(),Self::Upgrade => "upgrade".to_string(),+ Self::Editor { project_id } => format!("editor-{}", project_id),}}pub fn title(&self) -> String {match self {+ Self::Setup => "Cap Setup".to_string(),Self::Settings => "Cap Settings".to_string(),Self::WindowCaptureOccluder => "Cap Window Capture Occluder".to_string(),Self::InProgressRecording => "Cap In Progress Recording".to_string(),Self::Editor { .. } => "Cap Editor".to_string(),- Self::Permissions => "Cap Permissions".to_string(),_ => "Cap".to_string(),}}pub fn activates_dock(&self) -> bool {- match self {- Self::Main- | Self::Editor { .. }- | Self::Settings- | Self::Permissions- | Self::Upgrade => true,- _ => false,- }+ matches!(+ self,+ Self::Setup | Self::Main | Self::Editor { .. } | Self::Settings | Self::Upgrade+ )}pub fn get(&self, app: &AppHandle<Wry>) -> Option<WebviewWindow> {@@ -121,12 +118,36 @@ impl CapWindow {let monitor = app.primary_monitor()?.unwrap();let window = match self {+ Self::Setup => {+ let mut window_builder = self+ .window_builder(app, "/setup")+ .inner_size(600.0, 600.0)+ .resizable(false)+ .maximized(false)+ .center()+ .focused(true)+ .maximizable(false)+ .transparent(true)+ .theme(Some(tauri::Theme::Light))+ .visible(true)+ .shadow(true);++ #[cfg(target_os = "windows")]+ {+ window_builder = window_builder.decorations(false).shadow(false);+ }++ let window = window_builder.build()?;+ window.set_focus().ok();+ window+ }Self::Main => {let mut window_builder = self.window_builder(app, "/").inner_size(300.0, 375.0).resizable(false).maximized(false)+ .maximizable(false).transparent(true).theme(Some(tauri::Theme::Light)).shadow(true);@@ -175,22 +196,6 @@ impl CapWindow {window_builder.build()?}- Self::Permissions => {- let mut window_builder = self- .window_builder(app, "/permissions")- .inner_size(500.0, 425.0)- .resizable(false)- .maximized(false)- .shadow(true)- .transparent(true);-- #[cfg(target_os = "windows")]- {- window_builder = window_builder.decorations(false);- }-- window_builder.build()?- }Self::Upgrade => {let mut window_builder = self.window_builder(app, "/upgrade")@@ -377,12 +382,12 @@ impl CapWindow {pub fn id(&self) -> CapWindowId {match self {+ CapWindow::Setup => CapWindowId::Setup,CapWindow::Main => CapWindowId::Main,CapWindow::Settings { .. } => CapWindowId::Settings,CapWindow::Editor { project_id } => CapWindowId::Editor {project_id: project_id.clone(),},- CapWindow::Permissions => CapWindowId::Permissions,CapWindow::PrevRecordings => CapWindowId::PrevRecordings,CapWindow::WindowCaptureOccluder => CapWindowId::WindowCaptureOccluder,CapWindow::Camera { .. } => CapWindowId::Camera,diff --git a/apps/desktop/src/assets/illustrations/cloud-1.png b/apps/desktop/src/assets/illustrations/cloud-1.pngnew file mode 100644index 000000000..93f7d351fBinary files /dev/null and b/apps/desktop/src/assets/illustrations/cloud-1.png differdiff --git a/apps/desktop/src/assets/illustrations/cloud-2.png b/apps/desktop/src/assets/illustrations/cloud-2.pngnew file mode 100644index 000000000..67acef077Binary files /dev/null and b/apps/desktop/src/assets/illustrations/cloud-2.png differdiff --git a/apps/desktop/src/assets/illustrations/cloud-3.png b/apps/desktop/src/assets/illustrations/cloud-3.pngnew file mode 100644index 000000000..7c04c73cdBinary files /dev/null and b/apps/desktop/src/assets/illustrations/cloud-3.png differdiff --git a/apps/desktop/src/assets/tears-and-fireflies-adi-goldstein.mp3 b/apps/desktop/src/assets/tears-and-fireflies-adi-goldstein.mp3new file mode 100644index 000000000..f4930c226Binary files /dev/null and b/apps/desktop/src/assets/tears-and-fireflies-adi-goldstein.mp3 differdiff --git a/apps/desktop/src/auto-imports.d.ts b/apps/desktop/src/auto-imports.d.tsdeleted file mode 100644index 984e9de67..000000000--- a/apps/desktop/src/auto-imports.d.ts+++ /dev/null@@ -1,54 +0,0 @@-/* eslint-disable */-/* prettier-ignore */-// @ts-nocheck-// noinspection JSUnusedGlobalSymbols-// Generated by unplugin-auto-import-export {}-declare global {- const IconHugeiconsDashedLine02: typeof import("~icons/hugeicons/dashed-line02.jsx")["default"];- const IconIcRoundBlurOn: typeof import("~icons/ic/round-blur-on.jsx")["default"];- const IconLucideCamera: typeof import("~icons/lucide/camera.jsx")["default"];- const IconLucideCheck: typeof import("~icons/lucide/check.jsx")["default"];- const IconLucideCheckIcon: typeof import("~icons/lucide/check-icon.jsx")["default"];- const IconLucideChevronDown: typeof import("~icons/lucide/chevron-down.jsx")["default"];- const IconLucideCircle: typeof import("~icons/lucide/circle.jsx")["default"];- const IconLucideCircleCheck: typeof import("~icons/lucide/circle-check.jsx")["default"];- const IconLucideCircleDashed: typeof import("~icons/lucide/circle-dashed.jsx")["default"];- const IconLucideCircleFastForward: typeof import("~icons/lucide/circle-fast-forward.jsx")["default"];- const IconLucideCircleForward: typeof import("~icons/lucide/circle-forward.jsx")["default"];- const IconLucideCirclePlus: typeof import("~icons/lucide/circle-plus.jsx")["default"];- const IconLucideCircleStop: typeof import("~icons/lucide/circle-stop.jsx")["default"];- const IconLucideCommand: typeof import("~icons/lucide/command.jsx")["default"];- const IconLucideCopy: typeof import("~icons/lucide/copy.jsx")["default"];- const IconLucideCrop: typeof import("~icons/lucide/crop.jsx")["default"];- const IconLucideEye: typeof import("~icons/lucide/eye.jsx")["default"];- const IconLucideFaceTime: typeof import("~icons/lucide/face-time.jsx")["default"];- const IconLucideFastForward: typeof import("~icons/lucide/fast-forward.jsx")["default"];- const IconLucideImage: typeof import("~icons/lucide/image.jsx")["default"];- const IconLucideLayoutDashboard: typeof import("~icons/lucide/layout-dashboard.jsx")["default"];- const IconLucideLoaderCircle: typeof import("~icons/lucide/loader-circle.jsx")["default"];- const IconLucideMessageSquareMore: typeof import("~icons/lucide/message-square-more.jsx")["default"];- const IconLucideMousePointer2: typeof import("~icons/lucide/mouse-pointer2.jsx")["default"];- const IconLucidePencil: typeof import("~icons/lucide/pencil.jsx")["default"];- const IconLucidePenicl: typeof import("~icons/lucide/penicl.jsx")["default"];- const IconLucidePlay: typeof import("~icons/lucide/play.jsx")["default"];- const IconLucidePlus: typeof import("~icons/lucide/plus.jsx")["default"];- const IconLucideRedo: typeof import("~icons/lucide/redo.jsx")["default"];- const IconLucideRedo2: typeof import("~icons/lucide/redo2.jsx")["default"];- const IconLucideRewind: typeof import("~icons/lucide/rewind.jsx")["default"];- const IconLucideScissors: typeof import("~icons/lucide/scissors.jsx")["default"];- const IconLucideSettings: typeof import("~icons/lucide/settings.jsx")["default"];- const IconLucideShare: typeof import("~icons/lucide/share.jsx")["default"];- const IconLucideSquare: typeof import("~icons/lucide/square.jsx")["default"];- const IconLucideStop: typeof import("~icons/lucide/stop.jsx")["default"];- const IconLucideUndo: typeof import("~icons/lucide/undo.jsx")["default"];- const IconLucideUndo2: typeof import("~icons/lucide/undo2.jsx")["default"];- const IconLucideVideo: typeof import("~icons/lucide/video.jsx")["default"];- const IconLucideVolume1: typeof import("~icons/lucide/volume1.jsx")["default"];- const IconLucideWandSparkles: typeof import("~icons/lucide/wand-sparkles.jsx")["default"];- const IconLucideWbecam: typeof import("~icons/lucide/wbecam.jsx")["default"];- const IconLucideWebcam: typeof import("~icons/lucide/webcam.jsx")["default"];- const IconMdiBlur: typeof import("~icons/mdi/blur.jsx")["default"];- const IconMiExpand: typeof import("~icons/mi/expand.jsx")["default"];- const IconTablerShadow: typeof import("~icons/tabler/shadow.jsx")["default"];-}diff --git a/apps/desktop/src/components/Loader.tsx b/apps/desktop/src/components/Loader.tsxnew file mode 100644index 000000000..046020e29--- /dev/null+++ b/apps/desktop/src/components/Loader.tsx@@ -0,0 +1,9 @@+export function AbsoluteInsetLoader() {+ return (+ <div class="w-full h-full flex items-center justify-center bg-gray-100">+ <div class="animate-spin">+ <IconCapLogo class="size-[4rem]" />+ </div>+ </div>+ );+}diff --git a/apps/desktop/src/routes/(window-chrome).tsx b/apps/desktop/src/routes/(window-chrome).tsxindex c8f446223..954737e55 100644--- a/apps/desktop/src/routes/(window-chrome).tsx+++ b/apps/desktop/src/routes/(window-chrome).tsx@@ -2,8 +2,10 @@ import type { RouteSectionProps } from "@solidjs/router";import { onMount, ParentProps, Suspense } from "solid-js";import { getCurrentWindow } from "@tauri-apps/api/window";import { Transition } from "solid-transition-group";+import { Show } from "solid-js";import Header from "../components/Header";+import { AbsoluteInsetLoader } from "~/components/Loader";export const route = {info: {@@ -17,8 +19,9 @@ export default function (props: RouteSectionProps) {});return (- <div class="rounded-[1.5rem] bg-gray-100 border border-gray-200 w-screen h-screen flex flex-col overflow-hidden">+ <div class="bg-gray-100 border border-gray-200 w-screen h-screen flex flex-col overflow-hidden relative"><Header />+ {/* breaks sometimes */}{/* <Transitionmode="outin"enterActiveClass="transition-opacity duration-100"@@ -26,15 +29,7 @@ export default function (props: RouteSectionProps) {enterClass="opacity-0"exitToClass="opacity-0"> */}- <Suspense- fallback={- <div class="w-full h-full flex items-center justify-center bg-gray-100">- <div class="animate-spin">- <IconCapLogo class="size-[4rem]" />- </div>- </div>- }- >+ <Suspense fallback={<AbsoluteInsetLoader />}><Inner>{props.children}</Inner></Suspense>{/* </Transition> */}@@ -47,5 +42,9 @@ function Inner(props: ParentProps) {if (location.pathname !== "/") getCurrentWindow().show();});- return <>{props.children}</>;+ return (+ <div class="animate-in fade-in w-full h-full flex flex-col">+ {props.children}+ </div>+ );}diff --git a/apps/desktop/src/routes/(window-chrome)/(main).tsx b/apps/desktop/src/routes/(window-chrome)/(main).tsxindex 05ef38fe4..9a91bcb0a 100644--- a/apps/desktop/src/routes/(window-chrome)/(main).tsx+++ b/apps/desktop/src/routes/(window-chrome)/(main).tsx@@ -102,7 +102,7 @@ export default function () {});return (- <div class="flex justify-center flex-col p-[1rem] gap-[0.75rem] text-[0.875rem] font-[400] bg-gray-50 h-full">+ <><div class="absolute top-3 right-3"><div class="flex items-center gap-[0.25rem]"><Button@@ -119,46 +119,49 @@ export default function () {</div></div></div>- <div class="flex items-center justify-between pb-[0.25rem]">- <IconCapLogoFull class="w-[90px] h-auto" />- <button- type="button"- onClick={() => commands.openSettingsWindow("general")}- >- <IconCapSettings class="w-[1.25rem] h-[1.25rem] text-gray-400 hover:text-gray-500" />- </button>- </div>- <TargetSelects options={options.data} />- <CameraSelect options={options.data} setOptions={setOptions} />- <MicrophoneSelect options={options.data} setOptions={setOptions} />- <div class="w-full flex items-center space-x-1">- <Button- disabled={toggleRecording.isPending}- variant={isRecording() ? "destructive" : "primary"}- size="md"- onClick={() => toggleRecording.mutate()}- class="flex-grow"- >- {isRecording() ? "Stop Recording" : "Start Recording"}- </Button>- <Button- disabled={isRecording()}- variant="secondary"- size="md"- onClick={() => commands.takeScreenshot()}++ <div class="flex justify-center flex-col p-[1rem] gap-[0.75rem] text-[0.875rem] font-[400] bg-gray-50 h-full">+ <div class="flex items-center justify-between pb-[0.25rem]">+ <IconCapLogoFull class="w-[90px] h-auto" />+ <button+ type="button"+ onClick={() => commands.openSettingsWindow("general")}+ >+ <IconCapSettings class="w-[1.25rem] h-[1.25rem] text-gray-400 hover:text-gray-500" />+ </button>+ </div>+ <TargetSelects options={options.data} />+ <CameraSelect options={options.data} setOptions={setOptions} />+ <MicrophoneSelect options={options.data} setOptions={setOptions} />+ <div class="w-full flex items-center space-x-1">+ <Button+ disabled={toggleRecording.isPending}+ variant={isRecording() ? "destructive" : "primary"}+ size="md"+ onClick={() => toggleRecording.mutate()}+ class="flex-grow"+ >+ {isRecording() ? "Stop Recording" : "Start Recording"}+ </Button>+ <Button+ disabled={isRecording()}+ variant="secondary"+ size="md"+ onClick={() => commands.takeScreenshot()}+ >+ <IconLucideCamera class="w-[1rem] h-[1rem]" />+ </Button>+ </div>+ <a+ href={`${import.meta.env.VITE_SERVER_URL}/dashboard`}+ target="_blank"+ rel="noreferrer"+ class="text-gray-400 text-[0.875rem] mx-auto hover:text-gray-500 hover:underline">- <IconLucideCamera class="w-[1rem] h-[1rem]" />- </Button>+ Open Cap on Web+ </a></div>- <a- href={`${import.meta.env.VITE_SERVER_URL}/dashboard`}- target="_blank"- rel="noreferrer"- class="text-gray-400 text-[0.875rem] mx-auto hover:text-gray-500 hover:underline"- >- Open Cap on Web- </a>- </div>+ </>);}diff --git a/apps/desktop/src/routes/(window-chrome)/permissions.tsx b/apps/desktop/src/routes/(window-chrome)/permissions.tsxdeleted file mode 100644index e95c73ef5..000000000--- a/apps/desktop/src/routes/(window-chrome)/permissions.tsx+++ /dev/null@@ -1,124 +0,0 @@-import { Button } from "@cap/ui-solid";-import {- createEffect,- createResource,- createSignal,- Show,- For,- startTransition,-} from "solid-js";-import { createTimer } from "@solid-primitives/timer";-import { getCurrentWindow } from "@tauri-apps/api/window";--import { commands, OSPermission, type OSPermissionStatus } from "~/utils/tauri";--function isPermitted(status?: OSPermissionStatus): boolean {- return status === "granted" || status === "notNeeded";-}--const permissions = [- {- name: "Screen Recording",- key: "screenRecording" as const,- description: "Cap needs access to record your screen",- },- {- name: "Accessibility",- key: "accessibility" as const,- description:- "Cap records your mouse and keyboard activity to be used in your Caps",- },-] as const;--export default function () {- const [initialCheck, setInitialCheck] = createSignal(true);- const [check, checkActions] = createResource(() =>- commands.doPermissionsCheck(initialCheck())- );-- createEffect(() => {- if (!initialCheck()) {- createTimer(- () => startTransition(() => checkActions.refetch()),- 250,- setInterval- );- }- });-- const requestPermission = (permission: OSPermission) => {- console.log({ permission });- try {- commands.requestPermission(permission);- } catch (err) {- console.error(`Error occurred while requesting permission: ${err}`);- }- setInitialCheck(false);- };-- const openSettings = (permission: OSPermission) => {- commands.openPermissionSettings(permission);- setInitialCheck(false);- };-- return (- <div class="flex flex-col p-[1rem] text-[0.875rem] font-[400] flex-1 bg-gray-100 justify-between items-center">- <div class="flex flex-col items-center">- <IconCapLogo class="size-16 mb-1" />- <h1 class="text-[1rem] font-[700] mb-0.5">Permissions Required</h1>- <p class="text-gray-400">Cap needs permissions to run properly.</p>- </div>-- <ul class="flex flex-col gap-4">- <For each={permissions}>- {(permission) => {- const permissionCheck = () => check()?.[permission.key];-- return (- <Show when={permissionCheck() !== "notNeeded"}>- <li class="flex flex-row items-center gap-4">- <div class="flex flex-col flex-[2]">- <span class="font-[500] text-[0.875rem]">- {permission.name} Permission- </span>- <span class="text-gray-400">{permission.description}</span>- </div>- <Button- class="flex-1 shrink-0"- onClick={() =>- permissionCheck() !== "denied"- ? requestPermission(permission.key)- : openSettings(permission.key)- }- disabled={isPermitted(permissionCheck())}- >- {permissionCheck() === "granted"- ? "Granted"- : permissionCheck() !== "denied"- ? "Grant Permission"- : "Request Permission"}- </Button>- </li>- </Show>- );- }}- </For>- </ul>-- <Button- class="px-12"- size="lg"- disabled={- permissions.find((p) => !isPermitted(check()?.[p.key])) !== undefined- }- onClick={() => {- commands.openMainWindow().then(() => {- getCurrentWindow().close();- });- }}- >- Continue to Cap- </Button>- </div>- );-}diff --git a/apps/desktop/src/routes/(window-chrome)/settings.tsx b/apps/desktop/src/routes/(window-chrome)/settings.tsxindex 00673340b..df5eb1693 100644--- a/apps/desktop/src/routes/(window-chrome)/settings.tsx+++ b/apps/desktop/src/routes/(window-chrome)/settings.tsx@@ -1,49 +1,16 @@-import { A, type RouteSectionProps, useLocation } from "@solidjs/router";-import { cx } from "cva";-import { createResource, For } from "solid-js";+import { A, type RouteSectionProps } from "@solidjs/router";+import { createResource, For, Show, Suspense } from "solid-js";import { Button } from "@cap/ui-solid";import { getVersion } from "@tauri-apps/api/app";-import { lazy } from "solid-js";import { commands } from "~/utils/tauri";-// Lazy load the tab components-const FeedbackTab = lazy(() => import("./settings/feedback"));-const GeneralTab = lazy(() => import("./settings/general"));-const HotkeysTab = lazy(() => import("./settings/hotkeys"));-const RecordingsTab = lazy(() => import("./settings/recordings"));-const ScreenshotsTab = lazy(() => import("./settings/screenshots"));-const ChangelogTab = lazy(() => import("./settings/changelog"));-export default function Settings(props: RouteSectionProps) {- const location = useLocation();- const currentPath = () => location.pathname.split("/").pop();-const handleSignOut = async () => {await commands.deleteAuthOpenSignin();};- const [version] = createResource(async () => getVersion());- const versionString = () => version() ?? "0";-- const renderTab = () => {- switch (currentPath()) {- case "feedback":- return <FeedbackTab />;- case "general":- return <GeneralTab />;- case "hotkeys":- return <HotkeysTab />;- case "recordings":- return <RecordingsTab />;- case "screenshots":- return <ScreenshotsTab />;- case "changelog":- return <ChangelogTab />;- default:- return <GeneralTab />;- }- };+ const [version] = createResource(() => getVersion());return (<div class="h-[calc(100vh-3rem)] flex flex-row divide-x divide-gray-200 text-[0.875rem] leading-[1.25rem]">@@ -75,37 +42,33 @@ export default function Settings(props: RouteSectionProps) {},]}>- {(item) => {- const isActive = () => currentPath() === item.href;- return (- <li>- <A- href={item.href}- class={cx(- "rounded-lg h-[2rem] px-[0.375rem] flex flex-row items-center gap-[0.375rem] transition-colors border",- isActive()- ? "bg-blue-50 border-blue-200 text-blue-700"- : "hover:bg-gray-100 border-transparent"- )}- >- <item.icon class="size-[1.25rem]" />- <span>{item.name}</span>- </A>- </li>- );- }}+ {(item) => (+ <li>+ <A+ href={item.href}+ activeClass="bg-blue-50 border-blue-200 text-blue-700"+ inactiveClass="hover:bg-gray-100 border-transparent"+ class="rounded-lg h-[2rem] px-[0.375rem] flex flex-row items-center gap-[0.375rem] transition-colors border"+ >+ <item.icon class="size-[1.25rem]" />+ <span>{item.name}</span>+ </A>+ </li>+ )}</For></ul><div class="p-[0.625rem]">- {versionString() !== "0" && (- <p class="text-xs text-gray-400 mb-1">v{versionString()}</p>- )}+ <Show when={version()}>+ {(v) => <p class="text-xs text-gray-400 mb-1">v{v()}</p>}+ </Show><Button onClick={handleSignOut} variant="secondary" class="w-full">Sign Out</Button></div></div>- <div class="flex-1 bg-gray-50 overflow-y-auto">{renderTab()}</div>+ <div class="flex-1 bg-gray-50 overflow-y-auto animate-in">+ <Suspense>{props.children}</Suspense>+ </div></div>);}diff --git a/apps/desktop/src/routes/(window-chrome)/settings/changelog.tsx b/apps/desktop/src/routes/(window-chrome)/settings/changelog.tsxindex 877a8ef93..eed8bc32a 100644--- a/apps/desktop/src/routes/(window-chrome)/settings/changelog.tsx+++ b/apps/desktop/src/routes/(window-chrome)/settings/changelog.tsx@@ -1,6 +1,9 @@-import { For, Show, createResource, ErrorBoundary } from "solid-js";+import { For, Show, createResource, ErrorBoundary, Suspense } from "solid-js";import { clientEnv } from "~/utils/env";import { SolidMarkdown } from "solid-markdown";+import { createQuery } from "@tanstack/solid-query";+import { AbsoluteInsetLoader } from "~/components/Loader";+import { cx } from "cva";interface ChangelogEntry {title: string;@@ -11,53 +14,65 @@ interface ChangelogEntry {}export default function Page() {- const [changelog] = createResource<Array<ChangelogEntry>>(async () => {- const response = await fetch(- `${clientEnv.VITE_SERVER_URL}/api/changelog?origin=${window.location.origin}`- );- if (!response.ok) throw new Error("Failed to fetch changelog");+ const changelog = createQuery(() => ({+ queryKey: ["changelog"],+ queryFn: async () => {+ const response = await fetch(+ `${clientEnv.VITE_SERVER_URL}/api/changelog?origin=${window.location.origin}`+ );+ if (!response.ok) throw new Error("Failed to fetch changelog");- return await response.json();- });+ return (await response.json()) as Array<ChangelogEntry>;+ },+ }));++ let fadeIn = changelog.isLoading;return (<div class="h-full flex flex-col">- <div class="flex-1 overflow-y-auto">- <div class="flex flex-col p-6 gap-6 text-sm font-normal">- <ErrorBoundary- fallback={(e) => (- <div class="text-red-500 font-medium">{e.toString()}</div>+ <div class="flex-1 overflow-y-auto relative">+ <Suspense fallback={<AbsoluteInsetLoader />}>+ <div+ class={cx(+ "flex flex-col p-6 gap-6 text-sm font-normal",+ fadeIn && "animate-in fade-in")}>- <ul class="space-y-8">- <For each={changelog()}>- {(entry, i) => (- <li class="border-b-2 border-gray-200 pb-8 last:border-b-0">- <div class="flex mb-2">- <Show when={i() === 0}>- <div class="bg-blue-400 text-white px-2 py-1 rounded-md uppercase font-bold">- <span style="color: #fff" class="text-xs">- New- </span>- </div>- </Show>- </div>- <h3 class="font-semibold text-gray-800 mb-2">- {entry.title}- </h3>- <div class="text-gray-500 text-sm mb-4">- Version {entry.version} -{" "}- {new Date(entry.publishedAt).toLocaleDateString()}- </div>- <SolidMarkdown class="prose prose-sm max-w-none">- {entry.content}- </SolidMarkdown>- </li>- )}- </For>- </ul>- </ErrorBoundary>- </div>+ <ErrorBoundary+ fallback={(e) => (+ <div class="text-red-500 font-medium">{e.toString()}</div>+ )}+ >+ <ul class="space-y-8">+ <For each={changelog.data}>+ {(entry, i) => (+ <li class="border-b-2 border-gray-200 pb-8 last:border-b-0">+ <div class="flex mb-2">+ <Show when={i() === 0}>+ <div class="bg-blue-400 text-white px-2 py-1 rounded-md uppercase font-bold">+ <span style="color: #fff" class="text-xs">+ New+ </span>+ </div>+ </Show>+ </div>+ <h3 class="font-semibold text-gray-800 mb-2">+ {entry.title}+ </h3>+ <div class="text-gray-500 text-sm mb-4">+ Version {entry.version} -{" "}+ {new Date(entry.publishedAt).toLocaleDateString()}+ </div>+ <SolidMarkdown class="prose prose-sm max-w-none">+ {entry.content}+ </SolidMarkdown>+ </li>+ )}+ </For>+ </ul>+ </ErrorBoundary>+ </div>+ </Suspense></div></div>);diff --git a/apps/desktop/src/routes/(window-chrome)/settings/general.tsx b/apps/desktop/src/routes/(window-chrome)/settings/general.tsxindex f5f28d9ce..4b912133c 100644--- a/apps/desktop/src/routes/(window-chrome)/settings/general.tsx+++ b/apps/desktop/src/routes/(window-chrome)/settings/general.tsx@@ -9,43 +9,48 @@ import {const settingsList = [{- key: "upload_individual_files",+ key: "uploadIndividualFiles",label: "Upload individual recording files when creating shareable link",description:'Warning: this will cause shareable link uploads to become significantly slower, since all individual recording files will be uploaded. Shows "Download Assets" button in Share page.',},{- key: "open_editor_after_recording",+ key: "openEditorAfterRecording",label: "Open editor automatically after recording stops",description:"The editor will be shown immediately after you finish recording.",},{- key: "hide_dock_icon",+ key: "hideDockIcon",label: "Hide dock icon",description:"The dock icon will be hidden when there are no windows available to close.",},{- key: "auto_create_shareable_link",+ key: "autoCreateShareableLink",label: "Cap Pro: Automatically create shareable link after recording",description:"When enabled, a shareable link will be created automatically after stopping the recording. You'll be redirected to the URL while the upload continues in the background.",},{- key: "disable_auto_open_links",+ key: "disableAutoOpenLinks",label: "Cap Pro: Disable automatic link opening",description:"When enabled, Cap will not automatically open links in your browser (e.g. after creating a shareable link).",},{- key: "enable_notifications",+ key: "enableNotifications",label: "Enable System Notifications",description:"Show system notifications for events like copying to clipboard, saving files, and more. You may need to manually allow Cap access via your system's notification settings.",requiresPermission: true,},-];+] satisfies Array<{+ key: keyof GeneralSettingsStore;+ label: string;+ description: string;+ requiresPermission?: boolean;+}>;export default function GeneralSettings() {const [store] = createResource(() => generalSettingsStore.get());@@ -60,11 +65,11 @@ export default function GeneralSettings() {function Inner(props: { initialStore: GeneralSettingsStore | null }) {const [settings, setSettings] = createStore<GeneralSettingsStore>(props.initialStore ?? {- upload_individual_files: false,- open_editor_after_recording: false,- hide_dock_icon: false,- auto_create_shareable_link: false,- enable_notifications: true,+ uploadIndividualFiles: false,+ openEditorAfterRecording: false,+ hideDockIcon: false,+ autoCreateShareableLink: false,+ enableNotifications: true,});@@ -93,10 +98,7 @@ function Inner(props: { initialStore: GeneralSettingsStore | null }) {}setSettings(key as keyof GeneralSettingsStore, value);- await commands.setGeneralSettings({- ...settings,- [key]: value,- });+ generalSettingsStore.set({ [key]: value });};return (diff --git a/apps/desktop/src/routes/(window-chrome)/settings/recordings.tsx b/apps/desktop/src/routes/(window-chrome)/settings/recordings.tsxindex 26590084e..01794b9dd 100644--- a/apps/desktop/src/routes/(window-chrome)/settings/recordings.tsx+++ b/apps/desktop/src/routes/(window-chrome)/settings/recordings.tsx@@ -1,5 +1,5 @@import { createQuery } from "@tanstack/solid-query";-import { For, Show, createSignal } from "solid-js";+import { For, Show, Suspense, createSignal } from "solid-js";import { convertFileSrc } from "@tauri-apps/api/core";import { commands, events } from "~/utils/tauri";@@ -62,32 +62,25 @@ export default function Recordings() {return (<div class="flex flex-col w-full h-full divide-y divide-gray-200 pt-1 pb-12"><div class="flex-1 overflow-y-auto">- <Show- when={!fetchRecordings.isLoading}- fallback={- <p class="text-center text-gray-500">Loading recordings...</p>- }- >- <ul class="p-[0.625rem] flex flex-col gap-[0.5rem] w-full">- <Show- when={fetchRecordings.data && fetchRecordings.data.length > 0}- fallback={- <p class="text-center text-gray-500">No recordings found</p>- }- >- <For each={fetchRecordings.data}>- {(recording) => (- <RecordingItem- recording={recording}- onClick={() => handleRecordingClick(recording)}- onOpenFolder={() => handleOpenFolder(recording.path)}- onOpenEditor={() => handleOpenEditor(recording.path)}- />- )}- </For>- </Show>- </ul>- </Show>+ <ul class="p-[0.625rem] flex flex-col gap-[0.5rem] w-full">+ <Show+ when={fetchRecordings.data && fetchRecordings.data.length > 0}+ fallback={+ <p class="text-center text-gray-500">No recordings found</p>+ }+ >+ <For each={fetchRecordings.data}>+ {(recording) => (+ <RecordingItem+ recording={recording}+ onClick={() => handleRecordingClick(recording)}+ onOpenFolder={() => handleOpenFolder(recording.path)}+ onOpenEditor={() => handleOpenEditor(recording.path)}+ />+ )}+ </For>+ </Show>+ </ul></div></div>);diff --git a/apps/desktop/src/routes/(window-chrome)/settings/screenshots.tsx b/apps/desktop/src/routes/(window-chrome)/settings/screenshots.tsxindex edaf8376d..e21f104dd 100644--- a/apps/desktop/src/routes/(window-chrome)/settings/screenshots.tsx+++ b/apps/desktop/src/routes/(window-chrome)/settings/screenshots.tsx@@ -49,31 +49,24 @@ export default function Screenshots() {return (<div class="flex flex-col w-full h-full divide-y divide-gray-200 pt-1 pb-12"><div class="flex-1 overflow-y-auto">- <Show- when={!fetchScreenshots.isLoading}- fallback={- <p class="text-center text-gray-500">Loading screenshots...</p>- }- >- <ul class="p-[0.625rem] flex flex-col gap-[0.5rem] w-full">- <Show- when={fetchScreenshots.data && fetchScreenshots.data.length > 0}- fallback={- <p class="text-center text-gray-500">No screenshots found</p>- }- >- <For each={fetchScreenshots.data}>- {(screenshot) => (- <ScreenshotItem- screenshot={screenshot}- onClick={() => handleScreenshotClick(screenshot)}- onOpenFolder={() => handleOpenFolder(screenshot.path)}- />- )}- </For>- </Show>- </ul>- </Show>+ <ul class="p-[0.625rem] flex flex-col gap-[0.5rem] w-full">+ <Show+ when={fetchScreenshots.data && fetchScreenshots.data.length > 0}+ fallback={+ <p class="text-center text-gray-500">No screenshots found</p>+ }+ >+ <For each={fetchScreenshots.data}>+ {(screenshot) => (+ <ScreenshotItem+ screenshot={screenshot}+ onClick={() => handleScreenshotClick(screenshot)}+ onOpenFolder={() => handleOpenFolder(screenshot.path)}+ />+ )}+ </For>+ </Show>+ </ul></div></div>);diff --git a/apps/desktop/src/routes/(window-chrome)/setup.tsx b/apps/desktop/src/routes/(window-chrome)/setup.tsxnew file mode 100644index 000000000..2852caa0d--- /dev/null+++ b/apps/desktop/src/routes/(window-chrome)/setup.tsx@@ -0,0 +1,446 @@+import { Button } from "@cap/ui-solid";+import {+ createEffect,+ createResource,+ createSignal,+ Show,+ For,+ startTransition,+ onCleanup,+ onMount,+} from "solid-js";+import { createTimer } from "@solid-primitives/timer";+import { getCurrentWindow } from "@tauri-apps/api/window";++import { commands, OSPermission, type OSPermissionStatus } from "~/utils/tauri";+import { makePersisted } from "@solid-primitives/storage";+import { createStore } from "solid-js/store";++function isPermitted(status?: OSPermissionStatus): boolean {+ return status === "granted" || status === "notNeeded";+}++const permissions = [+ {+ name: "Screen Recording",+ key: "screenRecording" as const,+ description: "This permission is required to record your screen.",+ },+ {+ name: "Accessibility",+ key: "accessibility" as const,+ description:+ "During recording, Cap collects mouse activity locally to generate automatic zoom in segments.",+ },+] as const;++export default function () {+ const [initialCheck, setInitialCheck] = createSignal(true);+ const [check, checkActions] = createResource(() =>+ commands.doPermissionsCheck(initialCheck())+ );++ createEffect(() => {+ if (!initialCheck()) {+ createTimer(+ () => startTransition(() => checkActions.refetch()),+ 250,+ setInterval+ );+ }+ });++ const requestPermission = (permission: OSPermission) => {+ console.log({ permission });+ try {+ commands.requestPermission(permission);+ } catch (err) {+ console.error(`Error occurred while requesting permission: ${err}`);+ }+ setInitialCheck(false);+ };++ const openSettings = (permission: OSPermission) => {+ commands.openPermissionSettings(permission);+ setInitialCheck(false);+ };++ const [showStartup, showStartupActions] = createResource(+ () => true+ // generalSettingsStore.get().then((s) => !s?.hasCompletedStartup)+ );++ return (+ <div class="flex flex-col px-[2rem] text-[0.875rem] font-[400] flex-1 bg-gray-100 justify-evenly items-center">+ {showStartup() && (+ <Startup+ onClose={() => {+ showStartupActions.mutate(false);+ }}+ />+ )}+ <div class="flex flex-col items-center">+ <IconCapLogo class="size-18 mb-3" />+ <h1 class="text-[1.2rem] font-[700] mb-1">Permissions Required</h1>+ <p class="text-gray-400">Cap needs permissions to run properly.</p>+ </div>++ <ul class="flex flex-col gap-4 py-8">+ <For each={permissions}>+ {(permission) => {+ const permissionCheck = () => check()?.[permission.key];++ return (+ <Show when={permissionCheck() !== "notNeeded"}>+ <li class="flex flex-row items-center gap-4">+ <div class="flex flex-col flex-[2]">+ <span class="font-[500] text-[0.875rem]">+ {permission.name} Permission+ </span>+ <span class="text-gray-400">{permission.description}</span>+ </div>+ <Button+ class="flex-1 shrink-0"+ onClick={() =>+ permissionCheck() !== "denied"+ ? requestPermission(permission.key)+ : openSettings(permission.key)+ }+ disabled={isPermitted(permissionCheck())}+ >+ {permissionCheck() === "granted"+ ? "Granted"+ : permissionCheck() !== "denied"+ ? "Grant Permission"+ : "Request Permission"}+ </Button>+ </li>+ </Show>+ );+ }}+ </For>+ </ul>++ <Button+ class="px-12"+ size="lg"+ disabled={+ permissions.find((p) => !isPermitted(check()?.[p.key])) !== undefined+ }+ onClick={() => {+ commands.openMainWindow().then(() => {+ getCurrentWindow().close();+ });+ }}+ >+ Continue to Cap+ </Button>+ </div>+ );+}++import cloud1 from "../../assets/illustrations/cloud-1.png";+import cloud2 from "../../assets/illustrations/cloud-2.png";+import cloud3 from "../../assets/illustrations/cloud-3.png";++import startupAudio from "../../assets/tears-and-fireflies-adi-goldstein.mp3";+import { generalSettingsStore } from "~/store";+import { Portal } from "solid-js/web";+import { cx } from "cva";++function Startup(props: { onClose: () => void }) {+ const [audioState, setAudioState] = makePersisted(+ createStore({ isMuted: false }),+ { name: "audioSettings" }+ );++ const [isExiting, setIsExiting] = createSignal(false);++ const audio = new Audio(startupAudio);+ if (!audioState.isMuted) audio.play();++ // Add refs to store animation objects+ let cloud1Animation: Animation | undefined;+ let cloud2Animation: Animation | undefined;+ let cloud3Animation: Animation | undefined;++ const [isLogoAnimating, setIsLogoAnimating] = createSignal(false);++ const handleLogoClick = () => {+ if (!isLogoAnimating()) {+ setIsLogoAnimating(true);+ setTimeout(() => setIsLogoAnimating(false), 1000);+ }+ };++ const handleGetStarted = async () => {+ setIsExiting(true);+ const currentWindow = getCurrentWindow();++ // Cancel ongoing cloud animations+ cloud1Animation?.cancel();+ cloud2Animation?.cancel();+ cloud3Animation?.cancel();++ await generalSettingsStore.set({+ hasCompletedStartup: true,+ });++ // Wait for animation to complete before showing new window and closing+ setTimeout(async () => {+ props.onClose();+ }, 600);+ };++ onCleanup(() => audio.pause());++ onMount(() => {+ const cloud1El = document.getElementById("cloud-1");+ const cloud2El = document.getElementById("cloud-2");+ const cloud3El = document.getElementById("cloud-3");++ // Top right cloud - gentle diagonal movement+ cloud1Animation = cloud1El?.animate(+ [+ { transform: "translate(0, 0)" },+ { transform: "translate(-20px, 10px)" },+ { transform: "translate(0, 0)" },+ ],+ {+ duration: 30000,+ iterations: Infinity,+ easing: "linear",+ }+ );++ // Top left cloud - gentle diagonal movement+ cloud2Animation = cloud2El?.animate(+ [+ { transform: "translate(0, 0)" },+ { transform: "translate(20px, 10px)" },+ { transform: "translate(0, 0)" },+ ],+ {+ duration: 35000,+ iterations: Infinity,+ easing: "linear",+ }+ );++ // Bottom cloud - slow rise up with subtle horizontal movement+ cloud3Animation = cloud3El?.animate(+ [+ { transform: "translate(-50%, 20px)" },+ { transform: "translate(-48%, 0)" },+ { transform: "translate(-50%, 0)" },+ ],+ {+ duration: 60000,+ iterations: 1,+ easing: "cubic-bezier(0.4, 0, 0.2, 1)",+ fill: "forwards",+ }+ );+ });++ const toggleMute = async () => {+ setAudioState("isMuted", (m) => !m);++ audio.muted = audioState.isMuted;+ };++ return (+ <Portal>+ <div class="absolute inset-0 z-50">+ <style>+ {`+ body {+ background: transparent !important;+ }++ .content-container {+ transition: all 600ms cubic-bezier(0.4, 0, 0.2, 1);+ }++ .content-container.exiting {+ opacity: 0;+ transform: scale(1.1);+ }++ .custom-bg {+ transition: all 600ms cubic-bezier(0.4, 0, 0.2, 1);+ }++ .cloud-1.exiting {+ transform: translate(-200px, -150px) !important;+ opacity: 0 !important;+ }++ .cloud-2.exiting {+ transform: translate(200px, -150px) !important;+ opacity: 0 !important;+ }++ .cloud-3.exiting {+ transform: translate(-50%, 200px) !important;+ opacity: 0 !important;+ }++ .cloud-transition {+ transition: transform 600ms cubic-bezier(0.4, 0, 0.2, 1),+ opacity 600ms cubic-bezier(0.4, 0, 0.2, 1) !important;+ }++ .cloud-image {+ max-width: 100vw;+ height: auto;+ }++ .grain {+ position: fixed;+ top: -150%;+ left: -50%;+ right: -50%;+ bottom: -150%;+ width: 200%;+ height: 400%;+ background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.5' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");+ pointer-events: none;+ opacity: 0.5;+ z-index: 200;+ mix-blend-mode: overlay;+ }++ /* Overlay for fade to black */+ .fade-overlay {+ position: fixed;+ top: 0;+ left: 0;+ right: 0;+ bottom: 0;+ background: transparent;+ opacity: 0;+ pointer-events: none;+ transition: opacity 600ms cubic-bezier(0.4, 0, 0.2, 1);+ z-index: 1000;+ }++ .fade-overlay.exiting {+ opacity: 1;+ }++ @keyframes bounce {+ 0%, 100% {+ transform: translateY(0);+ }+ 50% {+ transform: translateY(-20px);+ }+ }++ .logo-bounce {+ animation: bounce 1s cubic-bezier(0.36, 0, 0.66, -0.56) forwards;+ }+ `}+ </style>+ {/* Add the fade overlay */}+ <div class={`fade-overlay ${isExiting() ? "exiting" : ""}`} />+ <div+ style={{ "transition-duration": "600ms" }}+ class={cx(+ "flex flex-col h-screen custom-bg relative overflow-hidden transition-opacity",+ isExiting() && "exiting opacity-0"+ )}+ >+ <div class="grain" />++ <button+ onClick={toggleMute}+ class={`absolute top-5 right-5 z-20 text-gray-50 hover:text-gray-200 transition-colors ${+ isExiting() ? "opacity-0" : ""+ }`}+ >+ {audioState.isMuted ? (+ <IconLucideVolumeX class="w-7 h-7" />+ ) : (+ <IconLucideVolume2 class="w-7 h-7" />+ )}+ </button>++ {/* Floating clouds */}+ <div+ id="cloud-1"+ class={`absolute top-0 right-0 opacity-70 pointer-events-none cloud-transition cloud-1 ${+ isExiting() ? "exiting" : ""+ }`}+ >+ <img+ class="cloud-image w-[100vw] md:w-[80vw] -mr-40"+ src={cloud1}+ alt="Cloud One"+ />+ </div>+ <div+ id="cloud-2"+ class={`absolute top-0 left-0 opacity-70 pointer-events-none cloud-transition cloud-2 ${+ isExiting() ? "exiting" : ""+ }`}+ >+ <img+ class="cloud-image w-[100vw] md:w-[80vw] -ml-40"+ src={cloud2}+ alt="Cloud Two"+ />+ </div>+ <div+ id="cloud-3"+ class={`absolute -bottom-[15%] left-1/2 -translate-x-1/2 opacity-70 pointer-events-none cloud-transition cloud-3 ${+ isExiting() ? "exiting" : ""+ }`}+ >+ <img+ class="cloud-image w-[180vw] md:w-[180vw]"+ src={cloud3}+ alt="Cloud Three"+ />+ </div>++ {/* Main content */}+ <div+ class={`content-container flex flex-col items-center justify-center flex-1 relative z-10 px-4 ${+ isExiting() ? "exiting" : ""+ }`}+ >+ <div class="text-center mb-8">+ <div+ onClick={handleLogoClick}+ class="cursor-pointer inline-block"+ >+ <IconCapLogo+ class={`w-20 h-24 mx-auto drop-shadow-[0_0_100px_rgba(0,0,0,0.2)]+ ${isLogoAnimating() ? "logo-bounce" : ""}`}+ />+ </div>+ <h1 class="text-5xl md:text-5xl font-bold font-medium text-gray-50 mb-4 drop-shadow-[0_0_20px_rgba(0,0,0,0.2)]">+ Welcome to Cap+ </h1>+ <p class="text-2xl text-gray-50/70 max-w-md mx-auto drop-shadow-[0_0_20px_rgba(0,0,0,0.2)]">+ Beautiful, shareable screen recordings.+ </p>+ </div>++ <Button+ class="px-12 text-lg shadow-[0_0_30px_rgba(0,0,0,0.1)]"+ variant="secondary"+ size="lg"+ onClick={handleGetStarted}+ >+ Get Started+ </Button>+ </div>+ </div>+ props.onClose()+ </div>+ </Portal>+ );+}diff --git a/apps/desktop/src/routes/(window-chrome)/signin.tsx b/apps/desktop/src/routes/(window-chrome)/signin.tsxindex 0c6d4d1a5..5f447f453 100644--- a/apps/desktop/src/routes/(window-chrome)/signin.tsx+++ b/apps/desktop/src/routes/(window-chrome)/signin.tsx@@ -51,8 +51,6 @@ const signInAction = action(async () => {throw new Error("Invalid token or expires");}- await authStore.set(null);-await authStore.set({token,expires,@@ -66,7 +64,7 @@ const signInAction = action(async () => {return redirect("/");} catch (error) {console.error("Sign in failed:", error);- await authStore.set(null);+ await authStore.set();throw error;}});diff --git a/apps/desktop/src/routes/editor/Header.tsx b/apps/desktop/src/routes/editor/Header.tsxindex d9500479e..14fbc274e 100644--- a/apps/desktop/src/routes/editor/Header.tsx+++ b/apps/desktop/src/routes/editor/Header.tsx@@ -150,7 +150,10 @@ function ShareButton() {mutationFn: async () => {const res = await commands.uploadRenderedVideo(videoId,- project ? project : presets.getDefaultConfig() ?? DEFAULT_PROJECT_CONFIG+ project+ ? project+ : presets.getDefaultConfig() ?? DEFAULT_PROJECT_CONFIG,+ null);if (res.status !== "ok") throw new Error(res.error);},diff --git a/apps/desktop/src/store.ts b/apps/desktop/src/store.tsindex ce3c2d40d..02b673f75 100644--- a/apps/desktop/src/store.ts+++ b/apps/desktop/src/store.ts@@ -31,18 +31,18 @@ export const presetsStore = {await s.set("presets", value);await s.save();},- listen: (fn: (data: PresetsStore | undefined) => void) =>+ listen: (fn: (data?: PresetsStore | undefined) => void) =>store().then((s) => s.onKeyChange<PresetsStore>("presets", fn)),};export const authStore = {get: () => store().then((s) => s.get<AuthStore>("auth")),- set: async (value: AuthStore | undefined) => {+ set: async (value?: AuthStore | undefined) => {const s = await store();await s.set("auth", value);await s.save();},- listen: (fn: (data: AuthStore | undefined) => void) =>+ listen: (fn: (data?: AuthStore | undefined) => void) =>store().then((s) => s.onKeyChange<AuthStore>("presets", fn)),};@@ -58,9 +58,14 @@ export const hotkeysStore = {export const generalSettingsStore = {get: () =>store().then((s) => s.get<GeneralSettingsStore>("general_settings")),- set: async (value: GeneralSettingsStore) => {+ set: async (value: Partial<GeneralSettingsStore>) => {const s = await store();- await s.set("general_settings", value);+ const current =+ (await s.get<GeneralSettingsStore>("general_settings")) || {};+ await s.set("general_settings", {+ ...current,+ ...value,+ });await s.save();},};diff --git a/apps/desktop/src/utils/tauri.ts b/apps/desktop/src/utils/tauri.tsindex 86c7dbd3f..38c18266d 100644--- a/apps/desktop/src/utils/tauri.ts+++ b/apps/desktop/src/utils/tauri.ts@@ -273,14 +273,6 @@ async setHotkey(action: HotkeyAction, hotkey: Hotkey | null) : Promise<Result<nuelse return { status: "error", error: e as any };}},-async setGeneralSettings(settings: GeneralSettingsStore) : Promise<Result<null, string>> {- try {- return { status: "ok", data: await TAURI_INVOKE("set_general_settings", { settings }) };-} catch (e) {- if(e instanceof Error) throw e;- else return { status: "error", error: e as any };-}-},async deleteAuthOpenSignin() : Promise<Result<null, string>> {try {return { status: "ok", data: await TAURI_INVOKE("delete_auth_open_signin") };@@ -392,7 +384,7 @@ export type CursorType = "pointer" | "circle"export type Display = { path: string }export type EditorStateChanged = { playhead_position: number }export type Flags = { recordMouse: boolean; split: boolean; pauseResume: boolean; zoom: boolean }-export type GeneralSettingsStore = { upload_individual_files?: boolean; open_editor_after_recording?: boolean; hide_dock_icon?: boolean; auto_create_shareable_link?: boolean; enable_notifications?: boolean; disable_auto_open_links?: boolean }+export type GeneralSettingsStore = { uploadIndividualFiles?: boolean; openEditorAfterRecording?: boolean; hideDockIcon?: boolean; autoCreateShareableLink?: boolean; enableNotifications?: boolean; disableAutoOpenLinks?: boolean; hasCompletedStartup?: boolean }export type Hotkey = { code: string; meta: boolean; ctrl: boolean; alt: boolean; shift: boolean }export type HotkeyAction = "startRecording" | "stopRecording" | "restartRecording" | "takeScreenshot"export type HotkeysConfiguration = { show: boolean }diff --git a/crates/gpu-converters/src/uyvy_rgba/mod.rs b/crates/gpu-converters/src/uyvy_rgba/mod.rsindex 49bfcf05a..449246e58 100644--- a/crates/gpu-converters/src/uyvy_rgba/mod.rs+++ b/crates/gpu-converters/src/uyvy_rgba/mod.rs@@ -1,4 +1,4 @@-use wgpu::{self, util::DeviceExt};+use wgpu::{self};use crate::{util::{copy_texture_to_buffer_command, read_buffer_to_vec},diff --git a/crates/media/src/encoders/h264.rs b/crates/media/src/encoders/h264.rsindex fc4c355cf..659645725 100644--- a/crates/media/src/encoders/h264.rs+++ b/crates/media/src/encoders/h264.rs@@ -6,7 +6,6 @@ use crate::{use ffmpeg::{codec::{codec::Codec, context, encoder},format::{self},- software,threading::Config,Dictionary,};diff --git a/crates/media/src/encoders/h264_avassetwriter.rs b/crates/media/src/encoders/h264_avassetwriter.rsindex c9f91b394..3ac3916b6 100644--- a/crates/media/src/encoders/h264_avassetwriter.rs+++ b/crates/media/src/encoders/h264_avassetwriter.rs@@ -19,7 +19,7 @@ impl H264AVAssetWriterEncoder {let Output::File(destination) = output;let mut asset_writer = av::AssetWriter::with_url_and_file_type(- cf::Url::with_path(&destination.as_path(), false)+ cf::Url::with_path(destination.as_path(), false).unwrap().as_ns(),av::FileType::mp4(),diff --git a/crates/media/src/feeds/audio.rs b/crates/media/src/feeds/audio.rsindex 9c0d87b84..66f490625 100644--- a/crates/media/src/feeds/audio.rs+++ b/crates/media/src/feeds/audio.rs@@ -37,7 +37,7 @@ impl AudioData {decoder.set_packet_time_base(input_stream.time_base());let input_info = AudioInfo::from_decoder(&decoder);- let mut output_info = input_info.clone();+ let mut output_info = input_info;output_info.sample_format = Self::FORMAT;let resampler = AudioResampler::new(input_info, output_info)?;@@ -102,7 +102,7 @@ impl AudioFrameBuffer {};let cursor_diff = new_cursor as isize - self.cursor as isize;- if cursor_diff.abs() as usize > (self.data.info.sample_rate as usize) / 5 {+ if cursor_diff.unsigned_abs() > (self.data.info.sample_rate as usize) / 5 {self.cursor = new_cursor;}}@@ -181,7 +181,7 @@ impl<T: FromSampleBytes> AudioPlaybackBuffer<T> {// Up to 1 second of pre-rendered audiolet capacity = (output_info.sample_rate as usize)- * (output_info.channels as usize)+ * output_info.channels* output_info.sample_format.bytes();let resampled_buffer = HeapRb::new(capacity);@@ -205,7 +205,7 @@ impl<T: FromSampleBytes> AudioPlaybackBuffer<T> {pub fn buffer_reaching_limit(&self) -> bool {self.resampled_buffer.vacant_len()<= 2 * (Self::PROCESSING_SAMPLES_COUNT as usize)- * (self.resampler.output.channels as usize)+ * self.resampler.output.channels* self.resampler.output.sample_format.bytes()}@@ -337,7 +337,7 @@ impl AudioResampler {*self = Self::new(self.input, self.output).unwrap();}- fn current_frame_data<'a>(&'a self) -> &'a [u8] {+ fn current_frame_data(&self) -> &[u8] {let end = self.output_frame.samples() * self.output.channels * self.output.sample_size();&self.output_frame.data(0)[0..end]}@@ -349,10 +349,8 @@ impl AudioResampler {self.current_frame_data()}- pub fn flush_frame<'a>(&'a mut self) -> Option<&'a [u8]> {- if self.delay.is_none() {- return None;- };+ pub fn flush_frame(&mut self) -> Option<&[u8]> {+ self.delay?;;self.delay = self.context.flush(&mut self.output_frame).unwrap();diff --git a/crates/media/src/feeds/camera.rs b/crates/media/src/feeds/camera.rsindex 10122efe6..12c3baf2b 100644--- a/crates/media/src/feeds/camera.rs+++ b/crates/media/src/feeds/camera.rs@@ -1,4 +1,4 @@-use cap_gpu_converters::{NV12Input, NV12ToRGBA, UYVYToNV12, UYVYToRGBA};+use cap_gpu_converters::{NV12Input, NV12ToRGBA, UYVYToRGBA};use ffmpeg::software::scaling;use flume::{Receiver, Sender, TryRecvError};use nokhwa::{utils::*, Camera};diff --git a/crates/media/src/sources/audio_input.rs b/crates/media/src/sources/audio_input.rsindex 94f6f91e3..e29b4b457 100644--- a/crates/media/src/sources/audio_input.rs+++ b/crates/media/src/sources/audio_input.rs@@ -2,7 +2,7 @@ use std::sync::{Arc, Mutex};use cpal::traits::{DeviceTrait, HostTrait, StreamTrait};use cpal::{- BufferSize, Device, SampleFormat, Stream, StreamConfig, StreamInstant, SupportedBufferSize,+ BufferSize, Device, Stream, StreamConfig, StreamInstant,SupportedStreamConfig,};use flume::Sender;diff --git a/crates/media/src/sources/screen_capture.rs b/crates/media/src/sources/screen_capture.rsindex 03034291c..ec0b6812d 100644--- a/crates/media/src/sources/screen_capture.rs+++ b/crates/media/src/sources/screen_capture.rs@@ -1,6 +1,4 @@use cap_flags::FLAGS;-use cidre::cm;-use core_foundation::base::{kCFAllocatorDefault, CFAllocatorRef};use flume::Sender;use scap::{capturer::{get_output_frame_size, Area, Capturer, Options, Point, Resolution, Size},@@ -9,12 +7,7 @@ use scap::{};use serde::{Deserialize, Serialize};use specta::Type;-use std::{- collections::HashMap,- ffi::c_void,- path::PathBuf,- ptr::{null, null_mut},-};+use std::collections::HashMap;use crate::{data::{FFVideo, RawVideoFormat, VideoInfo},@@ -337,7 +330,7 @@ impl PipelineSourceTask for ScreenCaptureSource<CMSampleBufferCapture> {mut control_signal: crate::pipeline::control::PipelineControlSignal,output: Sender<Self::Output>,) {- use cidre::*;+println!("Preparing screen capture source thread...");diff --git a/crates/rendering/src/lib.rs b/crates/rendering/src/lib.rsindex 981ca5040..bca08b72f 100644--- a/crates/rendering/src/lib.rs+++ b/crates/rendering/src/lib.rs@@ -1796,7 +1796,7 @@ impl CursorPipeline {Self {bind_group_layout,- render_pipeline: render_pipeline,+ render_pipeline,}}}diff --git a/packages/ui-solid/src/auto-imports.d.ts b/packages/ui-solid/src/auto-imports.d.tsindex e0e49bf43..d71ef69e0 100644--- a/packages/ui-solid/src/auto-imports.d.ts+++ b/packages/ui-solid/src/auto-imports.d.ts@@ -8,11 +8,9 @@ export {}declare global {const IconCapArrows: typeof import('~icons/cap/arrows.jsx')['default']const IconCapAudioOn: typeof import('~icons/cap/audio-on.jsx')['default']- const IconCapBell: typeof import("~icons/cap/bell.jsx")["default"]const IconCapBlur: typeof import('~icons/cap/blur.jsx')['default']const IconCapCamera: typeof import('~icons/cap/camera.jsx')['default']const IconCapChevronDown: typeof import('~icons/cap/chevron-down.jsx')['default']- const IconCapCircle: typeof import('~icons/cap/circle.jsx')['default']const IconCapCircleCheck: typeof import('~icons/cap/circle-check.jsx')['default']const IconCapCirclePlus: typeof import('~icons/cap/circle-plus.jsx')['default']const IconCapCircleX: typeof import('~icons/cap/circle-x.jsx')['default']@@ -22,7 +20,6 @@ declare global {const IconCapCursor: typeof import('~icons/cap/cursor.jsx')['default']const IconCapEditor: typeof import('~icons/cap/editor.jsx')['default']const IconCapEnlarge: typeof import('~icons/cap/enlarge.jsx')['default']- const IconCapEye: typeof import("~icons/cap/eye.jsx")["default"]const IconCapFrameFirst: typeof import('~icons/cap/frame-first.jsx')['default']const IconCapFrameLast: typeof import('~icons/cap/frame-last.jsx')['default']const IconCapHotkeys: typeof import('~icons/cap/hotkeys.jsx')['default']@@ -41,7 +38,6 @@ declare global {const IconCapRedo: typeof import('~icons/cap/redo.jsx')['default']const IconCapRestart: typeof import('~icons/cap/restart.jsx')['default']const IconCapScissors: typeof import('~icons/cap/scissors.jsx')['default']- const IconCapSearch: typeof import('~icons/cap/search.jsx')['default']const IconCapSettings: typeof import('~icons/cap/settings.jsx')['default']const IconCapShadow: typeof import('~icons/cap/shadow.jsx')['default']const IconCapSquare: typeof import('~icons/cap/square.jsx')['default']@@ -52,18 +48,14 @@ declare global {const IconLucideBell: typeof import('~icons/lucide/bell.jsx')['default']const IconLucideCamera: typeof import('~icons/lucide/camera.jsx')['default']const IconLucideCheck: typeof import('~icons/lucide/check.jsx')['default']- const IconLucideCheckIcon: typeof import('~icons/lucide/check-icon.jsx')['default']const IconLucideEdit: typeof import('~icons/lucide/edit.jsx')['default']const IconLucideEye: typeof import('~icons/lucide/eye.jsx')['default']const IconLucideFolder: typeof import('~icons/lucide/folder.jsx')['default']- const IconLucideFoler: typeof import("~icons/lucide/foler.jsx")["default"]const IconLucideLoaderCircle: typeof import('~icons/lucide/loader-circle.jsx')['default']const IconLucideMessageSquarePlus: typeof import('~icons/lucide/message-square-plus.jsx')['default']const IconLucideRabbit: typeof import('~icons/lucide/rabbit.jsx')['default']- const IconLucideRewind: typeof import("~icons/lucide/rewind.jsx")["default"]const IconLucideSearch: typeof import('~icons/lucide/search.jsx')['default']- const IconLucideSettings: typeof import("~icons/lucide/settings.jsx")["default"]- const IconLucideSmile: typeof import('~icons/lucide/smile.jsx')['default']const IconLucideVideo: typeof import('~icons/lucide/video.jsx')['default']- const IconLucideZoom: typeof import('~icons/lucide/zoom.jsx')['default']+ const IconLucideVolume2: typeof import('~icons/lucide/volume2.jsx')['default']+ const IconLucideVolumeX: typeof import('~icons/lucide/volume-x.jsx')['default']}diff --git a/packages/ui-solid/src/main.css b/packages/ui-solid/src/main.cssindex 6cd8e2cb7..cb5ad3388 100644--- a/packages/ui-solid/src/main.css+++ b/packages/ui-solid/src/main.css@@ -5,3 +5,7 @@body {font-family: "Geist Sans", sans-serif;}++.custom-bg {+ background: linear-gradient(180deg, #3B82F6 0%, #2563EB 100%);+}\ No newline at end of file