Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

clippy bruv

Richie McIlroy10ae2a217f7f
diff --git a/apps/desktop/scripts/prepare.js b/apps/desktop/scripts/prepare.js
index bd1c88666..c1fb07ada 100644
--- a/apps/desktop/scripts/prepare.js
+++ b/apps/desktop/scripts/prepare.js
@@ -31,7 +31,7 @@ async function semverToWIXCompatibleVersion(cargoFilePath) {
let build = 0;
if (buildOrPrerelease) {
const numMatch = buildOrPrerelease.match(/\d+$/);
- build = numMatch ? parseInt(numMatch[0]) : 0;
+ build = numMatch ? parseInt(numMatch[0], 10) : 0;
}
const wixVersion = `${major}.${minor}.${patch}${
build === 0 ? "" : `.${build}`
diff --git a/apps/desktop/src-tauri/src/captions.rs b/apps/desktop/src-tauri/src/captions.rs
index 148097146..f07dfdcb4 100644
--- a/apps/desktop/src-tauri/src/captions.rs
+++ b/apps/desktop/src-tauri/src/captions.rs
@@ -1064,6 +1064,14 @@ fn start_whisperx_server(
})
}
+fn is_server_communication_error(error: &str) -> bool {
+ error.contains("Failed to send request to server")
+ || error.contains("Failed to flush request")
+ || error.contains("Failed to read response from server")
+ || error.contains("Failed to parse server response")
+ || error.contains("Server not available")
+}
+
fn transcribe_with_server(
server: &mut WhisperXServer,
audio_path: &std::path::Path,
@@ -1553,7 +1561,7 @@ pub async fn transcribe_audio(
log::info!("Reusing existing WhisperX server (models already loaded!)");
}
- if let Some(server) = server_guard.as_mut() {
+ let result = if let Some(server) = server_guard.as_mut() {
transcribe_with_server(
server,
&audio_path_clone,
@@ -1562,7 +1570,19 @@ pub async fn transcribe_audio(
)
} else {
Err("Server not available".to_string())
+ };
+
+ if let Err(ref e) = result {
+ if is_server_communication_error(e) {
+ log::warn!(
+ "Server communication error detected, clearing dead server: {}",
+ e
+ );
+ *server_guard = None;
+ }
}
+
+ result
})
.await
.map_err(|e| format!("WhisperX task panicked: {e}"));
diff --git a/apps/desktop/src/App.tsx b/apps/desktop/src/App.tsx
index b9896e095..251a08d25 100644
--- a/apps/desktop/src/App.tsx
+++ b/apps/desktop/src/App.tsx
@@ -6,13 +6,7 @@ import {
type WebviewWindow,
} from "@tauri-apps/api/webviewWindow";
import { message } from "@tauri-apps/plugin-dialog";
-import {
- createEffect,
- ErrorBoundary,
- onCleanup,
- onMount,
- Suspense,
-} from "solid-js";
+import { createEffect, onCleanup, onMount, Suspense } from "solid-js";
import { Toaster } from "solid-toast";
import "@cap/ui-solid/main.css";
diff --git a/apps/desktop/src/components/titlebar/controls/CaptionControlsWindows11.tsx b/apps/desktop/src/components/titlebar/controls/CaptionControlsWindows11.tsx
index 85ec943c8..1025b41d3 100644
--- a/apps/desktop/src/components/titlebar/controls/CaptionControlsWindows11.tsx
+++ b/apps/desktop/src/components/titlebar/controls/CaptionControlsWindows11.tsx
@@ -19,7 +19,7 @@ export default function (
const currentWindow = getCurrentWindow();
const [focused, setFocus] = createSignal(true);
- let unlisten: () => void | undefined;
+ let unlisten: () => undefined | undefined;
onMount(async () => {
unlisten = await currentWindow.onFocusChanged(({ payload: focused }) =>
setFocus(focused),
diff --git a/apps/desktop/src/routes/(window-chrome)/(main).tsx b/apps/desktop/src/routes/(window-chrome)/(main).tsx
index c1e51068b..3f1be7516 100644
--- a/apps/desktop/src/routes/(window-chrome)/(main).tsx
+++ b/apps/desktop/src/routes/(window-chrome)/(main).tsx
@@ -334,7 +334,7 @@ function Page() {
<IconCapLogoFullDark class="hidden dark:block" />
<IconCapLogoFull class="block dark:hidden" />
</a>
- <ErrorBoundary fallback={<></>}>
+ <ErrorBoundary fallback={null}>
<Suspense>
<span
onClick={async () => {
diff --git a/apps/desktop/src/routes/(window-chrome)/new-main/index.tsx b/apps/desktop/src/routes/(window-chrome)/new-main/index.tsx
index cb9c5e475..82e0200fe 100644
--- a/apps/desktop/src/routes/(window-chrome)/new-main/index.tsx
+++ b/apps/desktop/src/routes/(window-chrome)/new-main/index.tsx
@@ -444,13 +444,16 @@ function Page() {
);
createTauriEventListener(events.uploadProgressEvent, (e) => {
- setUploadProgress(e.video_id, (Number(e.uploaded) / Number(e.total)) * 100);
if (e.uploaded === e.total) {
setUploadProgress(
produce((s) => {
delete s[e.video_id];
}),
);
+ } else {
+ const total = Number(e.total);
+ const progress = total > 0 ? (Number(e.uploaded) / total) * 100 : 0;
+ setUploadProgress(e.video_id, progress);
}
});
@@ -1036,7 +1039,7 @@ function Page() {
<IconCapLogoFullDark class="hidden dark:block" />
<IconCapLogoFull class="block dark:hidden" />
</a>
- <ErrorBoundary fallback={<></>}>
+ <ErrorBoundary fallback={null}>
<Suspense>
<span
onClick={async () => {
diff --git a/apps/desktop/src/routes/(window-chrome)/settings/license.tsx b/apps/desktop/src/routes/(window-chrome)/settings/license.tsx
index b10212cfd..5b4a6144b 100644
--- a/apps/desktop/src/routes/(window-chrome)/settings/license.tsx
+++ b/apps/desktop/src/routes/(window-chrome)/settings/license.tsx
@@ -177,7 +177,7 @@ type CommercialLicenseType = "yearly" | "lifetime";
function CommercialLicensePurchase() {
const queryClient = useQueryClient();
- const [type, setType] = createSignal<CommercialLicenseType>("yearly");
+ const [_type, _setType] = createSignal<CommercialLicenseType>("yearly");
const [isCommercialAnnual, setIsCommercialAnnual] = createSignal(true);
diff --git a/apps/desktop/src/routes/(window-chrome)/settings/recordings.tsx b/apps/desktop/src/routes/(window-chrome)/settings/recordings.tsx
index 5713e85cf..3c694f45d 100644
--- a/apps/desktop/src/routes/(window-chrome)/settings/recordings.tsx
+++ b/apps/desktop/src/routes/(window-chrome)/settings/recordings.tsx
@@ -90,13 +90,17 @@ export default function Recordings() {
const recordings = createQuery(() => recordingsQuery);
createTauriEventListener(events.uploadProgressEvent, (e) => {
- setUploadProgress(e.video_id, (Number(e.uploaded) / Number(e.total)) * 100);
- if (e.uploaded === e.total)
+ if (e.uploaded === e.total) {
setUploadProgress(
produce((s) => {
delete s[e.video_id];
}),
);
+ } else {
+ const total = Number(e.total);
+ const progress = total > 0 ? (Number(e.uploaded) / total) * 100 : 0;
+ setUploadProgress(e.video_id, progress);
+ }
});
createTauriEventListener(events.recordingDeleted, () => recordings.refetch());
@@ -349,7 +353,7 @@ function RecordingItem(props: {
commands.uploadExportedVideo(
props.recording.path,
"Reupload",
- new Channel<UploadProgress>((progress) => {}),
+ new Channel<UploadProgress>((_progress) => {}),
null,
),
}));
diff --git a/apps/desktop/src/routes/(window-chrome)/upgrade.tsx b/apps/desktop/src/routes/(window-chrome)/upgrade.tsx
index 499323e32..bf160cde3 100644
--- a/apps/desktop/src/routes/(window-chrome)/upgrade.tsx
+++ b/apps/desktop/src/routes/(window-chrome)/upgrade.tsx
@@ -33,7 +33,7 @@ RuntimeLoader.setWasmUrl(riveWASMResource);
export default function Page() {
const [isProAnnual, setIsProAnnual] = createSignal(true);
const [isCommercialAnnual, setIsCommercialAnnual] = createSignal(true);
- const [upgradeComplete, setUpgradeComplete] = createSignal(false);
+ const [upgradeComplete, _setUpgradeComplete] = createSignal(false);
const [loading, setLoading] = createSignal(false);
const signIn = createSignInMutation();
const license = createLicenseQuery();
diff --git a/apps/desktop/src/routes/camera.tsx b/apps/desktop/src/routes/camera.tsx
index b8e692544..5b5fcf6df 100644
--- a/apps/desktop/src/routes/camera.tsx
+++ b/apps/desktop/src/routes/camera.tsx
@@ -119,7 +119,7 @@ function NativeCameraPreviewPage(props: { disconnected: Accessor<boolean> }) {
commands.awaitCameraPreviewReady(),
);
- const setCamera = createCameraMutation();
+ const _setCamera = createCameraMutation();
const scale = () => {
const normalized =
@@ -345,7 +345,7 @@ function LegacyCameraPreviewPage(props: { disconnected: Accessor<boolean> }) {
}
const { cameraWsPort } = window.__CAP__;
- const [isConnected, setIsConnected] = createSignal(false);
+ const [_isConnected, setIsConnected] = createSignal(false);
let ws: WebSocket | undefined;
const createSocket = () => {
@@ -507,7 +507,7 @@ function LegacyCameraPreviewPage(props: { disconnected: Accessor<boolean> }) {
}
});
- const [windowSize] = createResource(
+ const [_windowSize] = createResource(
() =>
[
state.size,
diff --git a/apps/desktop/src/routes/editor/CaptionsTab.tsx b/apps/desktop/src/routes/editor/CaptionsTab.tsx
index 610a7ded0..3f584f249 100644
--- a/apps/desktop/src/routes/editor/CaptionsTab.tsx
+++ b/apps/desktop/src/routes/editor/CaptionsTab.tsx
@@ -378,7 +378,7 @@ export function CaptionsTab() {
"Failed to load the caption model. Try downloading it again";
}
- toast.error("Failed to generate captions: " + errorMessage);
+ toast.error(`Failed to generate captions: ${errorMessage}`);
} finally {
setIsGenerating(false);
}
diff --git a/apps/desktop/src/routes/editor/ConfigSidebar.tsx b/apps/desktop/src/routes/editor/ConfigSidebar.tsx
index e2e24332f..655651929 100644
--- a/apps/desktop/src/routes/editor/ConfigSidebar.tsx
+++ b/apps/desktop/src/routes/editor/ConfigSidebar.tsx
@@ -57,10 +57,8 @@ import IconLucideGauge from "~icons/lucide/gauge";
import IconLucideGrid from "~icons/lucide/grid";
import IconLucideMonitor from "~icons/lucide/monitor";
import IconLucideMoon from "~icons/lucide/moon";
-import IconLucideMove from "~icons/lucide/move";
import IconLucidePalette from "~icons/lucide/palette";
import IconLucideRabbit from "~icons/lucide/rabbit";
-import IconLucideScan from "~icons/lucide/scan";
import IconLucideSparkles from "~icons/lucide/sparkles";
import IconLucideTimer from "~icons/lucide/timer";
import IconLucideType from "~icons/lucide/type";
@@ -1165,7 +1163,7 @@ function BackgroundConfig(props: { scrollRef: HTMLDivElement }) {
try {
const path = await resolveResource(`assets/backgrounds/${id}.jpg`);
return { id, path };
- } catch (err) {
+ } catch (_err) {
return { id, path: null };
}
});
@@ -1222,7 +1220,7 @@ function BackgroundConfig(props: { scrollRef: HTMLDivElement }) {
);
debouncedSetProject(rawPath);
- } catch (err) {
+ } catch (_err) {
toast.error("Failed to set wallpaper");
}
};
@@ -1234,7 +1232,7 @@ function BackgroundConfig(props: { scrollRef: HTMLDivElement }) {
try {
const convertedPath = convertFileSrc(path);
await fetch(convertedPath, { method: "HEAD" });
- } catch (err) {
+ } catch (_err) {
setProject("background", "source", {
type: "image",
path: null,
@@ -1562,7 +1560,7 @@ function BackgroundConfig(props: { scrollRef: HTMLDivElement }) {
debouncedSetProject(wallpaper.rawPath);
ensurePaddingForBackground();
- } catch (err) {
+ } catch (_err) {
toast.error("Failed to set wallpaper");
}
}}
@@ -1709,7 +1707,7 @@ function BackgroundConfig(props: { scrollRef: HTMLDivElement }) {
type: "image",
path: fullPath,
});
- } catch (err) {
+ } catch (_err) {
toast.error("Failed to save image");
}
}}
@@ -1838,7 +1836,7 @@ function BackgroundConfig(props: { scrollRef: HTMLDivElement }) {
style={{ transform: `rotate(${angle()}deg)` }}
onMouseDown={(downEvent) => {
const start = angle();
- const resumeHistory = projectHistory.pause();
+ const _resumeHistory = projectHistory.pause();
createRoot((dispose) =>
createEventListenerMap(window, {
@@ -2799,7 +2797,7 @@ function MaskSegmentConfig(props: {
const currentAbsoluteTime = () =>
editorState.previewTime ?? editorState.playbackTime ?? props.segment.start;
- const maskState = () => evaluateMask(props.segment, currentAbsoluteTime());
+ const _maskState = () => evaluateMask(props.segment, currentAbsoluteTime());
const clearKeyframes = (segment: MaskSegment) => {
segment.keyframes.position = [];
@@ -2807,13 +2805,13 @@ function MaskSegmentConfig(props: {
segment.keyframes.intensity = [];
};
- const setPosition = (value: { x: number; y: number }) =>
+ const _setPosition = (value: { x: number; y: number }) =>
updateSegment((segment) => {
segment.center = value;
clearKeyframes(segment);
});
- const setSize = (value: { x: number; y: number }) =>
+ const _setSize = (value: { x: number; y: number }) =>
updateSegment((segment) => {
segment.size = value;
clearKeyframes(segment);
diff --git a/apps/desktop/src/routes/editor/Editor.tsx b/apps/desktop/src/routes/editor/Editor.tsx
index b2aaac83e..4f9444228 100644
--- a/apps/desktop/src/routes/editor/Editor.tsx
+++ b/apps/desktop/src/routes/editor/Editor.tsx
@@ -14,7 +14,6 @@ import {
createSignal,
Match,
on,
- onCleanup,
Show,
Switch,
} from "solid-js";
diff --git a/apps/desktop/src/routes/editor/Header.tsx b/apps/desktop/src/routes/editor/Header.tsx
index af14a57b9..86f7ecba7 100644
--- a/apps/desktop/src/routes/editor/Header.tsx
+++ b/apps/desktop/src/routes/editor/Header.tsx
@@ -1,8 +1,6 @@
import { Button } from "@cap/ui-solid";
import type { UnlistenFn } from "@tauri-apps/api/event";
-import { getCurrentWindow } from "@tauri-apps/api/window";
import { ask } from "@tauri-apps/plugin-dialog";
-import { remove } from "@tauri-apps/plugin-fs";
import { revealItemInDir } from "@tauri-apps/plugin-opener";
import { type as ostype } from "@tauri-apps/plugin-os";
import { cx } from "cva";
@@ -17,7 +15,7 @@ import {
import Tooltip from "~/components/Tooltip";
import CaptionControlsWindows11 from "~/components/titlebar/controls/CaptionControlsWindows11";
import { trackEvent } from "~/utils/analytics";
-import { commands, events } from "~/utils/tauri";
+import { commands } from "~/utils/tauri";
import { initializeTitlebar } from "~/utils/titlebar-state";
import { useEditorContext } from "./context";
import PresetsDropdown from "./PresetsDropdown";
diff --git a/apps/desktop/src/routes/editor/Player.tsx b/apps/desktop/src/routes/editor/Player.tsx
index d60352b93..6f263354a 100644
--- a/apps/desktop/src/routes/editor/Player.tsx
+++ b/apps/desktop/src/routes/editor/Player.tsx
@@ -50,7 +50,7 @@ export function PlayerContent() {
// Load captions on mount
onMount(async () => {
- if (editorInstance && editorInstance.path) {
+ if (editorInstance?.path) {
// Still load captions into the store since they will be used by the GPU renderer
await captionsStore.loadCaptions(editorInstance.path);
diff --git a/apps/desktop/src/routes/editor/ShareButton.tsx b/apps/desktop/src/routes/editor/ShareButton.tsx
index 03793ff3a..4bae8cc45 100644
--- a/apps/desktop/src/routes/editor/ShareButton.tsx
+++ b/apps/desktop/src/routes/editor/ShareButton.tsx
@@ -8,7 +8,7 @@ import Tooltip from "~/components/Tooltip";
import { createProgressBar } from "~/routes/editor/utils";
import { authStore } from "~/store";
import { exportVideo } from "~/utils/export";
-import { commands, events, type UploadProgress } from "~/utils/tauri";
+import { commands, type UploadProgress } from "~/utils/tauri";
import { useEditorContext } from "./context";
import { RESOLUTION_OPTIONS } from "./Header";
import {
@@ -159,7 +159,7 @@ function ShareButton() {
const customUrl = () =>
customDomain.data?.custom_domain
? new URL(
- customDomain.data?.custom_domain + `/s/${meta().sharing?.id}`,
+ `${customDomain.data?.custom_domain}/s/${meta().sharing?.id}`,
)
: null;
diff --git a/apps/desktop/src/routes/editor/TextOverlay.tsx b/apps/desktop/src/routes/editor/TextOverlay.tsx
index d0560003c..71e9c3661 100644
--- a/apps/desktop/src/routes/editor/TextOverlay.tsx
+++ b/apps/desktop/src/routes/editor/TextOverlay.tsx
@@ -115,7 +115,7 @@ export function TextOverlay(props: TextOverlayProps) {
const normalizedWidth = naturalWidth / deps.containerWidth;
const normalizedHeight = naturalHeight / deps.containerHeight;
- const newFontSize = deps.fontSize;
+ const _newFontSize = deps.fontSize;
const newSizeX = normalizedWidth;
const newSizeY = normalizedHeight;
@@ -223,10 +223,10 @@ export function TextOverlay(props: TextOverlayProps) {
);
} else if (isCorner) {
// Scale uniformly
- const currentWidthPx = startSize.x * props.size.width;
+ const _currentWidthPx = startSize.x * props.size.width;
const currentHeightPx = startSize.y * props.size.height;
- const deltaPxX = dx * props.size.width * dirX;
+ const _deltaPxX = dx * props.size.width * dirX;
const deltaPxY = dy * props.size.height * dirY;
const scaleY = (currentHeightPx + deltaPxY) / currentHeightPx;
diff --git a/apps/desktop/src/routes/editor/Timeline/ZoomTrack.tsx b/apps/desktop/src/routes/editor/Timeline/ZoomTrack.tsx
index d3238d646..eb8f223a8 100644
--- a/apps/desktop/src/routes/editor/Timeline/ZoomTrack.tsx
+++ b/apps/desktop/src/routes/editor/Timeline/ZoomTrack.tsx
@@ -7,7 +7,6 @@ import {
createMemo,
createRoot,
createSignal,
- For,
Index,
Match,
Show,
diff --git a/apps/desktop/src/routes/editor/context.ts b/apps/desktop/src/routes/editor/context.ts
index 01f70479b..502760f16 100644
--- a/apps/desktop/src/routes/editor/context.ts
+++ b/apps/desktop/src/routes/editor/context.ts
@@ -15,7 +15,6 @@ import {
createSignal,
on,
onCleanup,
- untrack,
} from "solid-js";
import { createStore, produce, reconcile, unwrap } from "solid-js/store";
@@ -33,9 +32,7 @@ import {
type SerializedEditorInstance,
type SingleSegment,
type TimelineConfiguration,
- type TimelineSegment,
type XY,
- type ZoomSegment,
} from "~/utils/tauri";
import type { MaskSegment } from "./masks";
import type { TextSegment } from "./text";
@@ -203,12 +200,12 @@ export const [EditorContextProvider, useEditorContext] = createContextProvider(
"segments",
produce((segments) => {
let searchTime = time;
- let prevDuration = 0;
+ let _prevDuration = 0;
const currentSegmentIndex = segments.findIndex((segment) => {
const duration = segment.end - segment.start;
if (searchTime > duration) {
searchTime -= duration;
- prevDuration += duration;
+ _prevDuration += duration;
return false;
}
diff --git a/apps/desktop/src/routes/notifications.tsx b/apps/desktop/src/routes/notifications.tsx
index 7eb7e1d44..178be5cd9 100644
--- a/apps/desktop/src/routes/notifications.tsx
+++ b/apps/desktop/src/routes/notifications.tsx
@@ -1,10 +1,9 @@
-import { onCleanup, onMount } from "solid-js";
import toast, { Toaster } from "solid-toast";
import { createTauriEventListener } from "~/utils/createEventListener";
import { events } from "~/utils/tauri";
export default function Page() {
- let unlisten: (() => void) | undefined;
+ let _unlisten: (() => void) | undefined;
const SuccessIcon = () => (
<svg
diff --git a/apps/desktop/src/store/captions.ts b/apps/desktop/src/store/captions.ts
index f3854a92d..c6d850474 100644
--- a/apps/desktop/src/store/captions.ts
+++ b/apps/desktop/src/store/captions.ts
@@ -1,4 +1,4 @@
-import { createEffect, createRoot } from "solid-js";
+import { createRoot } from "solid-js";
import { createStore } from "solid-js/store";
import {
type CaptionSegment,
@@ -27,6 +27,8 @@ export const defaultCaptionSettings: CaptionSettings = {
exportWithSubtitles: false,
highlightColor: "#FFFFFF",
fadeDuration: 0.2,
+ lingerDuration: 0.4,
+ wordTransitionDuration: 0.25,
};
function createCaptionsStore() {
@@ -141,6 +143,8 @@ function createCaptionsStore() {
exportWithSubtitles: state.settings.exportWithSubtitles,
highlightColor: state.settings.highlightColor,
fadeDuration: state.settings.fadeDuration,
+ lingerDuration: state.settings.lingerDuration,
+ wordTransitionDuration: state.settings.wordTransitionDuration,
},
};
diff --git a/apps/desktop/src/styles/theme.css b/apps/desktop/src/styles/theme.css
index b104e8af0..e5152122a 100644
--- a/apps/desktop/src/styles/theme.css
+++ b/apps/desktop/src/styles/theme.css
@@ -173,11 +173,11 @@
}
[data-transparent-window] {
- background: transparent !important;
+ background: transparent;
}
[data-transparent-window] body {
- background: transparent !important;
+ background: transparent;
}
/* Custom scrollbar */
@@ -201,7 +201,7 @@
/* Ensure transparent windows stay transparent in dark mode */
.dark [data-transparent-window],
.dark [data-transparent-window] body {
- background: transparent !important;
+ background: transparent;
}
.custom-scroll::-webkit-scrollbar {
diff --git a/apps/desktop/src/utils/analytics.ts b/apps/desktop/src/utils/analytics.ts
index 1cc7533bb..3c1b092bb 100644
--- a/apps/desktop/src/utils/analytics.ts
+++ b/apps/desktop/src/utils/analytics.ts
@@ -11,7 +11,7 @@ if (key && host) {
posthog.init(key, {
api_host: host,
capture_pageview: false,
- loaded: (posthogInstance) => {
+ loaded: (_posthogInstance) => {
isPostHogInitialized = true;
},
});
diff --git a/apps/desktop/src/utils/auth.ts b/apps/desktop/src/utils/auth.ts
index 85001ed61..5f1d8f034 100644
--- a/apps/desktop/src/utils/auth.ts
+++ b/apps/desktop/src/utils/auth.ts
@@ -85,7 +85,7 @@ async function createLocalServerSession(signal: AbortSignal) {
},
);
- signal.onabort = (e: Event) => {
+ signal.onabort = (_e: Event) => {
res(null);
};
diff --git a/apps/desktop/src/utils/createPresets.ts b/apps/desktop/src/utils/createPresets.ts
index 9ba9943d3..1da847669 100644
--- a/apps/desktop/src/utils/createPresets.ts
+++ b/apps/desktop/src/utils/createPresets.ts
@@ -1,4 +1,4 @@
-import { produce, unwrap } from "solid-js/store";
+import { produce } from "solid-js/store";
import { presetsStore } from "~/store";
import type { PresetsStore, ProjectConfiguration } from "~/utils/tauri";
diff --git a/apps/desktop/src/utils/plans.ts b/apps/desktop/src/utils/plans.ts
index 55c67b5f6..e8be40518 100644
--- a/apps/desktop/src/utils/plans.ts
+++ b/apps/desktop/src/utils/plans.ts
@@ -1,5 +1,3 @@
-import { commands } from "./tauri";
-
const planIds = {
development: {
yearly: "price_1Q3esrFJxA1XpeSsFwp486RN",
diff --git a/apps/desktop/src/utils/queries.ts b/apps/desktop/src/utils/queries.ts
index 8eb3d8370..fafc9cb35 100644
--- a/apps/desktop/src/utils/queries.ts
+++ b/apps/desktop/src/utils/queries.ts
@@ -23,7 +23,7 @@ import {
type RecordingMode,
type ScreenCaptureTarget,
} from "./tauri";
-import { apiClient, orgCustomDomainClient, protectedHeaders } from "./web-api";
+import { orgCustomDomainClient, protectedHeaders } from "./web-api";
export const listWindows = queryOptions({
queryKey: ["capture", "windows"] as const,
diff --git a/apps/web-cluster/src/runner/health-server.ts b/apps/web-cluster/src/runner/health-server.ts
index 4b4d07be2..6c3395878 100644
--- a/apps/web-cluster/src/runner/health-server.ts
+++ b/apps/web-cluster/src/runner/health-server.ts
@@ -13,7 +13,7 @@ const app = router.pipe(HttpServer.serve());
// Specify the port
const port = process.env.HEALTH_CHECK_PORT
- ? parseInt(process.env.HEALTH_CHECK_PORT)
+ ? parseInt(process.env.HEALTH_CHECK_PORT, 10)
: 3000;
// Create a server layer with the specified port
diff --git a/apps/web-cluster/src/runner/index.ts b/apps/web-cluster/src/runner/index.ts
index 7f0a77ab1..76c980a2d 100644
--- a/apps/web-cluster/src/runner/index.ts
+++ b/apps/web-cluster/src/runner/index.ts
@@ -5,8 +5,6 @@ import * as NodeSdk from "@effect/opentelemetry/NodeSdk";
import {
FetchHttpClient,
Headers,
- HttpApiBuilder,
- HttpMiddleware,
HttpRouter,
HttpServer,
} from "@effect/platform";
diff --git a/apps/web/actions/organization/domain-utils.ts b/apps/web/actions/organization/domain-utils.ts
index f7f5b2ddd..4a8fcb11e 100644
--- a/apps/web/actions/organization/domain-utils.ts
+++ b/apps/web/actions/organization/domain-utils.ts
@@ -97,7 +97,7 @@ export const getRequiredConfig = async (domain: string) => {
};
}
}
- } catch (error) {
+ } catch (_error) {
// Continue to fallback
}
@@ -159,7 +159,7 @@ export const checkDomainStatus = async (domain: string) => {
verified = true;
} else {
const verificationJson = await verifyDomain(domain);
- verified = verificationJson && verificationJson.verified;
+ verified = verificationJson?.verified;
}
// Get the current and required A records
@@ -176,7 +176,7 @@ export const checkDomainStatus = async (domain: string) => {
},
status: domainJson,
};
- } catch (error) {
+ } catch (_error) {
return {
verified: false,
error: "Failed to check domain status",
diff --git a/apps/web/actions/video/upload.ts b/apps/web/actions/video/upload.ts
index 2e5c66cc2..f620699ac 100644
--- a/apps/web/actions/video/upload.ts
+++ b/apps/web/actions/video/upload.ts
@@ -73,7 +73,7 @@ async function getVideoUploadPresignedUrl({
),
});
- const pathToInvalidate = "/" + fileKey;
+ const pathToInvalidate = `/${fileKey}`;
try {
await cloudfront.send(
diff --git a/apps/web/actions/videos/edit-transcript.ts b/apps/web/actions/videos/edit-transcript.ts
index 4cd630a2b..c6dcb9465 100644
--- a/apps/web/actions/videos/edit-transcript.ts
+++ b/apps/web/actions/videos/edit-transcript.ts
@@ -6,7 +6,7 @@ import { s3Buckets, videos } from "@cap/database/schema";
import { S3Buckets } from "@cap/web-backend";
import type { Video } from "@cap/web-domain";
import { eq } from "drizzle-orm";
-import { Effect, Option } from "effect";
+import { Option } from "effect";
import { revalidatePath } from "next/cache";
import { runPromise } from "@/lib/server";
diff --git a/apps/web/actions/videos/generate-ai-metadata.ts b/apps/web/actions/videos/generate-ai-metadata.ts
index ec2f4910d..d7d2097cd 100644
--- a/apps/web/actions/videos/generate-ai-metadata.ts
+++ b/apps/web/actions/videos/generate-ai-metadata.ts
@@ -39,7 +39,7 @@ export async function generateAiMetadata(
if (metadata.aiProcessing === true) {
const updatedAtTime = new Date(videoData.updatedAt).getTime();
- const currentTime = new Date().getTime();
+ const currentTime = Date.now();
const tenMinutesInMs = 10 * 60 * 1000;
if (currentTime - updatedAtTime > tenMinutesInMs) {
diff --git a/apps/web/actions/videos/get-status.ts b/apps/web/actions/videos/get-status.ts
index 0124d1190..9cb951b36 100644
--- a/apps/web/actions/videos/get-status.ts
+++ b/apps/web/actions/videos/get-status.ts
@@ -97,7 +97,7 @@ export async function getVideoStatus(
if (metadata.aiProcessing) {
const updatedAtTime = new Date(video.updatedAt).getTime();
- const currentTime = new Date().getTime();
+ const currentTime = Date.now();
if (currentTime - updatedAtTime > MAX_AI_PROCESSING_TIME) {
console.log(
diff --git a/apps/web/app/(org)/dashboard/Contexts.tsx b/apps/web/app/(org)/dashboard/Contexts.tsx
index a21098c08..495fb42b6 100644
--- a/apps/web/app/(org)/dashboard/Contexts.tsx
+++ b/apps/web/app/(org)/dashboard/Contexts.tsx
@@ -138,7 +138,7 @@ export function DashboardContexts({
return () => {
document.body.className = "light";
};
- }, [theme]);
+ }, []);
const toggleSidebarCollapsed = () => {
setSidebarCollapsed(!sidebarCollapsed);
diff --git a/apps/web/app/(org)/dashboard/_components/MobileTab.tsx b/apps/web/app/(org)/dashboard/_components/MobileTab.tsx
index 706433a21..eaf58e5e5 100644
--- a/apps/web/app/(org)/dashboard/_components/MobileTab.tsx
+++ b/apps/web/app/(org)/dashboard/_components/MobileTab.tsx
@@ -128,7 +128,7 @@ const OrgsMenu = ({
? "pointer-events-none"
: "text-gray-10 hover:text-gray-12 hover:bg-gray-6",
)}
- key={organization.organization.name + "-organization"}
+ key={`${organization.organization.name}-organization`}
onClick={async () => {
await updateActiveOrganization(organization.organization.id);
setOpen(false);
diff --git a/apps/web/app/(org)/dashboard/_components/Navbar/Items.tsx b/apps/web/app/(org)/dashboard/_components/Navbar/Items.tsx
index 5ec0a76eb..286797545 100644
--- a/apps/web/app/(org)/dashboard/_components/Navbar/Items.tsx
+++ b/apps/web/app/(org)/dashboard/_components/Navbar/Items.tsx
@@ -1,7 +1,6 @@
"use client";
import { buildEnv } from "@cap/env";
import {
- Avatar,
Button,
Command,
CommandEmpty,
@@ -26,7 +25,7 @@ import {
} from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import clsx from "clsx";
-import { AnimatePresence, motion } from "framer-motion";
+import { motion } from "framer-motion";
import { Check, ChevronDown, Plus } from "lucide-react";
import Link from "next/link";
import { usePathname, useRouter } from "next/navigation";
@@ -38,7 +37,6 @@ import { UsageButton } from "@/components/UsageButton";
import { useDashboardContext } from "../../Contexts";
import { CapIcon, ChartLineIcon, CogIcon, RecordIcon } from "../AnimatedIcons";
import type { CogIconHandle } from "../AnimatedIcons/Cog";
-import CapAIBox from "./CapAIBox";
import SpacesList from "./SpacesList";
import { updateActiveOrganization } from "./server";
@@ -88,7 +86,7 @@ const AdminNavItems = ({ toggleMobileNav }: Props) => {
const [createLoading, setCreateLoading] = useState(false);
const [organizationName, setOrganizationName] = useState("");
const isOwner = activeOrg?.organization.ownerId === user.id;
- const [openAIDialog, setOpenAIDialog] = useState(false);
+ const [_openAIDialog, _setOpenAIDialog] = useState(false);
const router = useRouter();
const isPathActive = (path: string, matchChildren: boolean = false) => {
diff --git a/apps/web/app/(org)/dashboard/_components/Navbar/Top.tsx b/apps/web/app/(org)/dashboard/_components/Navbar/Top.tsx
index 5bace9d36..6af7c64f0 100644
--- a/apps/web/app/(org)/dashboard/_components/Navbar/Top.tsx
+++ b/apps/web/app/(org)/dashboard/_components/Navbar/Top.tsx
@@ -243,7 +243,7 @@ const User = () => {
showCondition: true,
},
],
- [],
+ [user.isPro],
);
return (
diff --git a/apps/web/app/(org)/dashboard/analytics/components/ChartArea.tsx b/apps/web/app/(org)/dashboard/analytics/components/ChartArea.tsx
index 003a64c9d..666461a6e 100644
--- a/apps/web/app/(org)/dashboard/analytics/components/ChartArea.tsx
+++ b/apps/web/app/(org)/dashboard/analytics/components/ChartArea.tsx
@@ -53,8 +53,8 @@ function ChartArea({ selectedMetrics, data, isLoading }: ChartAreaProps) {
if (!data || data.length === 0) return [];
const bucketDuration =
data.length > 1
- ? new Date(data[1]!.bucket).getTime() -
- new Date(data[0]!.bucket).getTime()
+ ? new Date(data[1]?.bucket).getTime() -
+ new Date(data[0]?.bucket).getTime()
: 0;
const hourly = bucketDuration > 0 && bucketDuration <= 60 * 60 * 1000;
return data.map((point) => ({
diff --git a/apps/web/app/(org)/dashboard/analytics/components/StatsChart.tsx b/apps/web/app/(org)/dashboard/analytics/components/StatsChart.tsx
index c0dc3c17f..0301e9ec2 100644
--- a/apps/web/app/(org)/dashboard/analytics/components/StatsChart.tsx
+++ b/apps/web/app/(org)/dashboard/analytics/components/StatsChart.tsx
@@ -75,11 +75,9 @@ export default function StatsBox({
<div className="flex flex-col gap-4 px-8 pt-8 w-full rounded-xl border bg-gray-2 border-gray-3">
<div className="flex flex-wrap gap-4">
{isLoading ? (
- <>
- {Array.from({ length: capId ? 3 : 4 }, (_, index) => (
- <StatBoxSkeleton key={`skeleton-${capId ? 3 : 4}-${index}`} />
- ))}
- </>
+ Array.from({ length: capId ? 3 : 4 }, (_, index) => (
+ <StatBoxSkeleton key={`skeleton-${capId ? 3 : 4}-${index}`} />
+ ))
) : (
<>
<StatBox
diff --git a/apps/web/app/(org)/dashboard/caps/components/CapCard/CapCardContent.tsx b/apps/web/app/(org)/dashboard/caps/components/CapCard/CapCardContent.tsx
index 10ec18b25..34e7c2ca4 100644
--- a/apps/web/app/(org)/dashboard/caps/components/CapCard/CapCardContent.tsx
+++ b/apps/web/app/(org)/dashboard/caps/components/CapCard/CapCardContent.tsx
@@ -179,7 +179,6 @@ export const CapCardContent: React.FC<CapContentProps> = ({
onChange={(e) => setTitle(e.target.value)}
onBlur={() => handleTitleBlur(cap.name)}
onKeyDown={(e) => handleTitleKeyDown(e)}
- autoFocus
className="text-md resize-none bg-transparent truncate w-full border-0 outline-0 text-gray-12 font-medium p-0 m-0 h-[1.25rem] overflow-hidden leading-[1.25rem] tracking-normal font-[inherit]"
/>
) : (
@@ -209,7 +208,6 @@ export const CapCardContent: React.FC<CapContentProps> = ({
onChange={handleDateChange}
onBlur={handleDateBlur}
onKeyDown={handleDateKeyDown}
- autoFocus
className="text-sm w-full truncate text-gray-10 bg-transparent focus:outline-none h-full leading-[1.5rem]"
placeholder="YYYY-MM-DD HH:mm:ss"
/>
diff --git a/apps/web/app/(org)/dashboard/caps/components/EmptyCapState.tsx b/apps/web/app/(org)/dashboard/caps/components/EmptyCapState.tsx
index 5911c8b6b..063980fd0 100644
--- a/apps/web/app/(org)/dashboard/caps/components/EmptyCapState.tsx
+++ b/apps/web/app/(org)/dashboard/caps/components/EmptyCapState.tsx
@@ -21,7 +21,7 @@ export const EmptyCapState: React.FC<EmptyCapStateProps> = ({ userName }) => {
<div className="flex flex-col flex-1 justify-center items-center w-full h-full">
<div className="flex flex-col gap-3 justify-center items-center h-full text-center">
<div className="mx-auto w-full mb-10 max-w-[450px] flex justify-center items-center">
- <EmptyCap key={theme + "empty-cap"} className="h-[150px] w-[400px]" />
+ <EmptyCap key={`${theme}empty-cap`} className="h-[150px] w-[400px]" />
</div>
<div className="flex flex-col items-center px-5">
<p className="mb-1 text-xl font-semibold text-gray-12">
diff --git a/apps/web/app/(org)/dashboard/caps/components/Folder.tsx b/apps/web/app/(org)/dashboard/caps/components/Folder.tsx
index becf3f852..6bc22a260 100644
--- a/apps/web/app/(org)/dashboard/caps/components/Folder.tsx
+++ b/apps/web/app/(org)/dashboard/caps/components/Folder.tsx
@@ -184,7 +184,14 @@ const FolderCard = ({
unregister();
document.removeEventListener("dragend", handleDragEnd);
};
- }, [id, name, rive, isDragOver]);
+ }, [
+ id,
+ name,
+ rive,
+ isDragOver,
+ activeOrganization?.organization.id,
+ spaceId,
+ ]);
const handleDragOver = (e: React.DragEvent<HTMLDivElement>) => {
e.preventDefault();
@@ -325,7 +332,7 @@ const FolderCard = ({
>
<div className="flex flex-1 gap-3 items-center">
<FolderRive
- key={theme + "folder" + id}
+ key={`${theme}folder${id}`}
className="w-[50px] h-[50px]"
/>
<div
diff --git a/apps/web/app/(org)/dashboard/caps/components/Folders.tsx b/apps/web/app/(org)/dashboard/caps/components/Folders.tsx
index 4c10c0944..549910916 100644
--- a/apps/web/app/(org)/dashboard/caps/components/Folders.tsx
+++ b/apps/web/app/(org)/dashboard/caps/components/Folders.tsx
@@ -41,7 +41,7 @@ export const NormalFolder = React.forwardRef<
return (
<NormalFolderRive
- key={theme + "folder-normal"}
+ key={`${theme}folder-normal`}
className="w-[50px] h-[50px]"
/>
);
diff --git a/apps/web/app/(org)/dashboard/caps/components/SettingsDialog.tsx b/apps/web/app/(org)/dashboard/caps/components/SettingsDialog.tsx
index 14372dac8..80715a66f 100644
--- a/apps/web/app/(org)/dashboard/caps/components/SettingsDialog.tsx
+++ b/apps/web/app/(org)/dashboard/caps/components/SettingsDialog.tsx
@@ -7,7 +7,6 @@ import {
DialogTitle,
Switch,
} from "@cap/ui";
-import { userIsPro } from "@cap/utils";
import type { Video } from "@cap/web-domain";
import { faGear } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
diff --git a/apps/web/app/(org)/dashboard/caps/components/SharingDialog.tsx b/apps/web/app/(org)/dashboard/caps/components/SharingDialog.tsx
index c51f34826..1bf8ebd97 100644
--- a/apps/web/app/(org)/dashboard/caps/components/SharingDialog.tsx
+++ b/apps/web/app/(org)/dashboard/caps/components/SharingDialog.tsx
@@ -1,5 +1,4 @@
import {
- Avatar,
Button,
Dialog,
DialogContent,
@@ -160,7 +159,7 @@ export const SharingDialog: React.FC<SharingDialogProps> = ({
setSearchTerm("");
setActiveTab(tabs[0]);
}
- }, [isOpen, sharedSpaces, isPublic]);
+ }, [isOpen, sharedSpaces, isPublic, tabs[0]]);
const isSpaceSharedViaOrganization = useCallback(
(spaceId: string) => {
@@ -189,7 +188,7 @@ export const SharingDialog: React.FC<SharingDialogProps> = ({
try {
await navigator.clipboard.writeText(embedCode);
toast.success("Embed code copied to clipboard");
- } catch (error) {
+ } catch (_error) {
toast.error("Failed to copy embed code");
}
};
diff --git a/apps/web/app/(org)/dashboard/caps/components/UploadCapButton.tsx b/apps/web/app/(org)/dashboard/caps/components/UploadCapButton.tsx
index 7be95c89d..4044c1416 100644
--- a/apps/web/app/(org)/dashboard/caps/components/UploadCapButton.tsx
+++ b/apps/web/app/(org)/dashboard/caps/components/UploadCapButton.tsx
@@ -1,7 +1,6 @@
"use client";
import { Button } from "@cap/ui";
-import { userIsPro } from "@cap/utils";
import type { Folder, Organisation } from "@cap/web-domain";
import { faUpload } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
@@ -205,8 +204,8 @@ async function legacyUploadCap(
const hasValidDuration =
testVideo.duration > 0 &&
- !isNaN(testVideo.duration) &&
- isFinite(testVideo.duration);
+ !Number.isNaN(testVideo.duration) &&
+ Number.isFinite(testVideo.duration);
const hasValidDimensions =
(testVideo.videoWidth > 0 && testVideo.videoHeight > 0) ||
diff --git a/apps/web/app/(org)/dashboard/caps/components/web-recorder-dialog/useDevicePreferences.ts b/apps/web/app/(org)/dashboard/caps/components/web-recorder-dialog/useDevicePreferences.ts
index c22175ffb..4cc643aa1 100644
--- a/apps/web/app/(org)/dashboard/caps/components/web-recorder-dialog/useDevicePreferences.ts
+++ b/apps/web/app/(org)/dashboard/caps/components/web-recorder-dialog/useDevicePreferences.ts
@@ -62,7 +62,14 @@ export const useDevicePreferences = ({
console.error("Failed to restore recorder device selection", error);
}
// eslint-disable-next-line react-hooks/exhaustive-deps -- effect restores saved device IDs and intentionally updates them
- }, [open, rememberDevices, availableCameras, availableMics]);
+ }, [
+ open,
+ rememberDevices,
+ availableCameras,
+ availableMics,
+ selectedCameraId,
+ selectedMicId,
+ ]);
const handleCameraChange = (cameraId: string | null) => {
setSelectedCameraId(cameraId);
diff --git a/apps/web/app/(org)/dashboard/caps/components/web-recorder-dialog/useMediaPermission.ts b/apps/web/app/(org)/dashboard/caps/components/web-recorder-dialog/useMediaPermission.ts
index bdb8c006f..fec88a786 100644
--- a/apps/web/app/(org)/dashboard/caps/components/web-recorder-dialog/useMediaPermission.ts
+++ b/apps/web/app/(org)/dashboard/caps/components/web-recorder-dialog/useMediaPermission.ts
@@ -57,7 +57,7 @@ export const useMediaPermission = (
permissionStatus.onchange = () => {
updateState(permissionStatus.state);
};
- } catch (error) {
+ } catch (_error) {
updateState("unsupported");
}
}, [enabled, kind, updateState]);
diff --git a/apps/web/app/(org)/dashboard/caps/components/web-recorder-dialog/web-recorder-utils.ts b/apps/web/app/(org)/dashboard/caps/components/web-recorder-dialog/web-recorder-utils.ts
index 7074c9370..d1e84e946 100644
--- a/apps/web/app/(org)/dashboard/caps/components/web-recorder-dialog/web-recorder-utils.ts
+++ b/apps/web/app/(org)/dashboard/caps/components/web-recorder-dialog/web-recorder-utils.ts
@@ -1,4 +1,3 @@
-import type { RecordingMode } from "./RecordingModeSelector";
import {
type DetectedDisplayRecordingMode,
DISPLAY_SURFACE_TO_RECORDING_MODE,
diff --git a/apps/web/app/(org)/dashboard/dashboard-data.ts b/apps/web/app/(org)/dashboard/dashboard-data.ts
index e2a45473a..f0df4de14 100644
--- a/apps/web/app/(org)/dashboard/dashboard-data.ts
+++ b/apps/web/app/(org)/dashboard/dashboard-data.ts
@@ -350,8 +350,8 @@ export async function getDashboardData(user: typeof userSelectProps) {
...m.member,
user: {
...m.user!,
- image: m.user!.image
- ? yield* imageUploads.resolveImageUrl(m.user!.image)
+ image: m.user?.image
+ ? yield* imageUploads.resolveImageUrl(m.user?.image)
: null,
},
};
diff --git a/apps/web/app/(org)/dashboard/folder/[id]/components/ClientMyCapsLink.tsx b/apps/web/app/(org)/dashboard/folder/[id]/components/ClientMyCapsLink.tsx
index dd8488b89..fe119dfba 100644
--- a/apps/web/app/(org)/dashboard/folder/[id]/components/ClientMyCapsLink.tsx
+++ b/apps/web/app/(org)/dashboard/folder/[id]/components/ClientMyCapsLink.tsx
@@ -1,6 +1,5 @@
"use client";
-import { Avatar } from "@cap/ui";
import type { Space, Video } from "@cap/web-domain";
import clsx from "clsx";
import Link from "next/link";
@@ -36,7 +35,7 @@ export function ClientMyCapsLink({
return () => {
unregister();
};
- }, []);
+ }, [handleDrop]);
// Handle drag events for desktop
const handleDragOver = (e: React.DragEvent<HTMLAnchorElement>) => {
diff --git a/apps/web/app/(org)/dashboard/folder/[id]/components/SubfolderDialog.tsx b/apps/web/app/(org)/dashboard/folder/[id]/components/SubfolderDialog.tsx
index 3fdc67ba3..62f0046e2 100644
--- a/apps/web/app/(org)/dashboard/folder/[id]/components/SubfolderDialog.tsx
+++ b/apps/web/app/(org)/dashboard/folder/[id]/components/SubfolderDialog.tsx
@@ -20,7 +20,6 @@ import { useRouter } from "next/navigation";
import React, { useEffect, useRef, useState } from "react";
import { toast } from "sonner";
import { useEffectMutation, useRpcClient } from "@/lib/EffectRuntime";
-import { withRpc } from "@/lib/Rpcs";
import { useDashboardContext } from "../../../Contexts";
import {
BlueFolder,
diff --git a/apps/web/app/(org)/dashboard/settings/account/Settings.tsx b/apps/web/app/(org)/dashboard/settings/account/Settings.tsx
index e9df809f1..a3625c8d1 100644
--- a/apps/web/app/(org)/dashboard/settings/account/Settings.tsx
+++ b/apps/web/app/(org)/dashboard/settings/account/Settings.tsx
@@ -1,6 +1,5 @@
"use client";
-import type { users } from "@cap/database/schema";
import {
Button,
Card,
@@ -17,7 +16,6 @@ import { useEffect, useId, useState } from "react";
import { toast } from "sonner";
import { SignedImageUrl } from "@/components/SignedImageUrl";
import { useEffectMutation, useRpcClient } from "@/lib/EffectRuntime";
-import { withRpc } from "@/lib/Rpcs";
import { useDashboardContext } from "../../Contexts";
import { ProfileImage } from "./components/ProfileImage";
import { patchAccountSettings } from "./server";
diff --git a/apps/web/app/(org)/dashboard/settings/organization/components/CapSettingsCard.tsx b/apps/web/app/(org)/dashboard/settings/organization/components/CapSettingsCard.tsx
index 561df22df..13ce22178 100644
--- a/apps/web/app/(org)/dashboard/settings/organization/components/CapSettingsCard.tsx
+++ b/apps/web/app/(org)/dashboard/settings/organization/components/CapSettingsCard.tsx
@@ -1,7 +1,6 @@
"use client";
import { Card, CardDescription, CardHeader, CardTitle, Switch } from "@cap/ui";
-import { userIsPro } from "@cap/utils";
import { useDebounce } from "@uidotdev/usehooks";
import clsx from "clsx";
import { useEffect, useRef, useState } from "react";
diff --git a/apps/web/app/(org)/dashboard/settings/organization/components/CustomDomainDialog/CustomDomainDialog.tsx b/apps/web/app/(org)/dashboard/settings/organization/components/CustomDomainDialog/CustomDomainDialog.tsx
index 225aaceb3..45b154d32 100644
--- a/apps/web/app/(org)/dashboard/settings/organization/components/CustomDomainDialog/CustomDomainDialog.tsx
+++ b/apps/web/app/(org)/dashboard/settings/organization/components/CustomDomainDialog/CustomDomainDialog.tsx
@@ -214,7 +214,7 @@ const CustomDomainDialog = ({
}
}
},
- onError: (error, { showToasts }) => {
+ onError: (_error, { showToasts }) => {
if (showToasts) {
toast.error("Failed to check domain verification");
}
@@ -346,7 +346,7 @@ const CustomDomainDialog = ({
} else if (isVerified) {
handleNext();
}
- }, [isVerified, stepState.currentIndex]);
+ }, [isVerified, stepState.currentIndex, handleClose, handleNext]);
return (
<>
@@ -439,35 +439,30 @@ const CustomDomainDialog = ({
</Button>
)}
- {currentStep.id === "domain" && (
- <>
- {user.isPro ? (
- <Button
- onClick={handleDomainSubmit}
- size="sm"
- spinner={updateDomainMutation.isPending}
- disabled={
- updateDomainMutation.isPending || !domain.trim()
- }
- variant="dark"
- className="min-w-[100px]"
- >
- Next
- </Button>
- ) : (
- <Button
- variant="blue"
- size="sm"
- onClick={() => {
- setShowUpgradeModal(true);
- handleClose();
- }}
- >
- Upgrade To Cap Pro
- </Button>
- )}
- </>
- )}
+ {currentStep.id === "domain" &&
+ (user.isPro ? (
+ <Button
+ onClick={handleDomainSubmit}
+ size="sm"
+ spinner={updateDomainMutation.isPending}
+ disabled={updateDomainMutation.isPending || !domain.trim()}
+ variant="dark"
+ className="min-w-[100px]"
+ >
+ Next
+ </Button>
+ ) : (
+ <Button
+ variant="blue"
+ size="sm"
+ onClick={() => {
+ setShowUpgradeModal(true);
+ handleClose();
+ }}
+ >
+ Upgrade To Cap Pro
+ </Button>
+ ))}
</DialogFooter>
)}
</DialogContent>
diff --git a/apps/web/app/(org)/dashboard/settings/organization/components/CustomDomainDialog/VerifyStep.tsx b/apps/web/app/(org)/dashboard/settings/organization/components/CustomDomainDialog/VerifyStep.tsx
index 4f9659b22..5c8eb5d35 100644
--- a/apps/web/app/(org)/dashboard/settings/organization/components/CustomDomainDialog/VerifyStep.tsx
+++ b/apps/web/app/(org)/dashboard/settings/organization/components/CustomDomainDialog/VerifyStep.tsx
@@ -123,7 +123,11 @@ const VerifyStep = ({
return () => {
clearInterval(interval);
};
- }, [activeOrganization?.organization.customDomain, isVerified]);
+ }, [
+ activeOrganization?.organization.customDomain,
+ isVerified,
+ checkVerification,
+ ]);
return (
<div className="space-y-6">
diff --git a/apps/web/app/(org)/dashboard/settings/organization/components/InviteDialog.tsx b/apps/web/app/(org)/dashboard/settings/organization/components/InviteDialog.tsx
index 3b7653686..86e32d8d3 100644
--- a/apps/web/app/(org)/dashboard/settings/organization/components/InviteDialog.tsx
+++ b/apps/web/app/(org)/dashboard/settings/organization/components/InviteDialog.tsx
@@ -76,7 +76,7 @@ export const InviteDialog = ({
setIsOpen(false);
try {
await handleManageBilling();
- } catch (error) {
+ } catch (_error) {
setUpgradeLoading(false);
}
};
diff --git a/apps/web/app/(org)/dashboard/settings/organization/components/MembersCard.tsx b/apps/web/app/(org)/dashboard/settings/organization/components/MembersCard.tsx
index d704f3f42..2eff19bce 100644
--- a/apps/web/app/(org)/dashboard/settings/organization/components/MembersCard.tsx
+++ b/apps/web/app/(org)/dashboard/settings/organization/components/MembersCard.tsx
@@ -55,7 +55,7 @@ export const MembersCard = ({
try {
await removeOrganizationInvite(
inviteId,
- activeOrganization!.organization.id,
+ activeOrganization?.organization.id,
);
toast.success("Invite deleted successfully");
router.refresh();
@@ -91,7 +91,7 @@ export const MembersCard = ({
try {
await removeOrganizationMember(
pendingMember.id,
- activeOrganization!.organization.id,
+ activeOrganization?.organization.id,
);
toast.success("Member removed successfully");
setConfirmOpen(false);
@@ -199,75 +199,71 @@ export const MembersCard = ({
</TableRow>
</TableHeader>
<TableBody>
- {activeOrganization?.members &&
- activeOrganization.members.map((member) => (
- <TableRow key={member.id}>
- <TableCell>{member.user.name}</TableCell>
- <TableCell>{member.user.email}</TableCell>
- <TableCell>
- {isMemberOwner(member.user.id) ? "Owner" : "Member"}
- </TableCell>
- <TableCell>
- {format(member.createdAt, "MMM d, yyyy")}
- </TableCell>
- <TableCell>Active</TableCell>
- <TableCell>
- {!isMemberOwner(member.user.id) ? (
- <Button
- type="button"
- size="xs"
- variant="destructive"
- className="min-w-[unset] h-[28px]"
- onClick={() => {
- if (isOwner) {
- handleRemoveMember({
- id: member.id,
- user: {
- name: member.user.name ?? "(No Name)",
- email: member.user.email ?? "(No Email)",
- },
- });
- } else {
- showOwnerToast();
- }
- }}
- disabled={!isOwner}
- >
- Remove
- </Button>
- ) : (
- "-"
- )}
- </TableCell>
- </TableRow>
- ))}
- {activeOrganization?.invites &&
- activeOrganization.invites.map((invite) => (
- <TableRow key={invite.id}>
- <TableCell>{invite.id}</TableCell>
- <TableCell>{invite.invitedEmail}</TableCell>
- <TableCell>Member</TableCell>
- <TableCell>-</TableCell>
- <TableCell>Invited</TableCell>
- <TableCell>
+ {activeOrganization?.members?.map((member) => (
+ <TableRow key={member.id}>
+ <TableCell>{member.user.name}</TableCell>
+ <TableCell>{member.user.email}</TableCell>
+ <TableCell>
+ {isMemberOwner(member.user.id) ? "Owner" : "Member"}
+ </TableCell>
+ <TableCell>{format(member.createdAt, "MMM d, yyyy")}</TableCell>
+ <TableCell>Active</TableCell>
+ <TableCell>
+ {!isMemberOwner(member.user.id) ? (
<Button
type="button"
size="xs"
variant="destructive"
+ className="min-w-[unset] h-[28px]"
onClick={() => {
if (isOwner) {
- handleDeleteInvite(invite.id);
+ handleRemoveMember({
+ id: member.id,
+ user: {
+ name: member.user.name ?? "(No Name)",
+ email: member.user.email ?? "(No Email)",
+ },
+ });
} else {
showOwnerToast();
}
}}
disabled={!isOwner}
>
- Delete Invite
+ Remove
</Button>
- </TableCell>
- </TableRow>
- ))}
+ ) : (
+ "-"
+ )}
+ </TableCell>
+ </TableRow>
+ ))}
+ {activeOrganization?.invites?.map((invite) => (
+ <TableRow key={invite.id}>
+ <TableCell>{invite.id}</TableCell>
+ <TableCell>{invite.invitedEmail}</TableCell>
+ <TableCell>Member</TableCell>
+ <TableCell>-</TableCell>
+ <TableCell>Invited</TableCell>
+ <TableCell>
+ <Button
+ type="button"
+ size="xs"
+ variant="destructive"
+ onClick={() => {
+ if (isOwner) {
+ handleDeleteInvite(invite.id);
+ } else {
+ showOwnerToast();
+ }
+ }}
+ disabled={!isOwner}
+ >
+ Delete Invite
+ </Button>
+ </TableCell>
+ </TableRow>
+ ))}
</TableBody>
</Table>
</Card>
diff --git a/apps/web/app/(org)/dashboard/settings/organization/components/OrgName.tsx b/apps/web/app/(org)/dashboard/settings/organization/components/OrgName.tsx
index 5917c1821..4fd718fab 100644
--- a/apps/web/app/(org)/dashboard/settings/organization/components/OrgName.tsx
+++ b/apps/web/app/(org)/dashboard/settings/organization/components/OrgName.tsx
@@ -19,7 +19,7 @@ const OrgName = () => {
setSaveLoading(true);
await updateOrganizationDetails({
organizationName: orgName,
- organizationId: activeOrganization!.organization.id,
+ organizationId: activeOrganization?.organization.id,
});
toast.success("Settings updated successfully");
router.refresh();
diff --git a/apps/web/app/(org)/dashboard/spaces/[spaceId]/SharedCaps.tsx b/apps/web/app/(org)/dashboard/spaces/[spaceId]/SharedCaps.tsx
index 121fa8eb3..b662460a9 100644
--- a/apps/web/app/(org)/dashboard/spaces/[spaceId]/SharedCaps.tsx
+++ b/apps/web/app/(org)/dashboard/spaces/[spaceId]/SharedCaps.tsx
@@ -5,11 +5,9 @@ import { Button } from "@cap/ui";
import type { Organisation, Space, User, Video } from "@cap/web-domain";
import { faFolderPlus, faInfoCircle } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import { useQuery } from "@tanstack/react-query";
import { useRouter, useSearchParams } from "next/navigation";
import { useState } from "react";
import { useVideosAnalyticsQuery } from "@/lib/Queries/Analytics";
-import { AnalyticsRequest } from "@/lib/Requests/AnalyticsRequest";
import { useDashboardContext } from "../../Contexts";
import { CapPagination } from "../../caps/components/CapPagination";
import Folder, { type FolderDataType } from "../../caps/components/Folder";
diff --git a/apps/web/app/(org)/dashboard/spaces/[spaceId]/components/EmptySharedCapState.tsx b/apps/web/app/(org)/dashboard/spaces/[spaceId]/components/EmptySharedCapState.tsx
index aef2cd346..fe0a4eebd 100644
--- a/apps/web/app/(org)/dashboard/spaces/[spaceId]/components/EmptySharedCapState.tsx
+++ b/apps/web/app/(org)/dashboard/spaces/[spaceId]/components/EmptySharedCapState.tsx
@@ -40,7 +40,7 @@ export const EmptySharedCapState: React.FC<EmptySharedCapStateProps> = ({
<div className="flex flex-col flex-1 justify-center items-center w-full h-full">
<div className="mx-auto mb-20 w-full max-w-md">
<EmptyCap
- key={theme + "empty-shared-cap"}
+ key={`${theme}empty-shared-cap`}
className="max-w-[300px] w-full mx-auto md:max-w-[600px] h-[250px]"
/>
</div>
diff --git a/apps/web/app/(org)/dashboard/spaces/[spaceId]/components/MemberSelect.tsx b/apps/web/app/(org)/dashboard/spaces/[spaceId]/components/MemberSelect.tsx
index 4d83760b8..3d290ca27 100644
--- a/apps/web/app/(org)/dashboard/spaces/[spaceId]/components/MemberSelect.tsx
+++ b/apps/web/app/(org)/dashboard/spaces/[spaceId]/components/MemberSelect.tsx
@@ -115,7 +115,6 @@ export const MemberSelect = forwardRef<HTMLDivElement, MemberSelectProps>(
className,
disabled && "pointer-events-none",
)}
- tabIndex={0}
aria-disabled={disabled}
{...props}
>
diff --git a/apps/web/app/(org)/dashboard/spaces/[spaceId]/components/VirtualizedVideoGrid.tsx b/apps/web/app/(org)/dashboard/spaces/[spaceId]/components/VirtualizedVideoGrid.tsx
index e4c688a40..5eb6475dd 100644
--- a/apps/web/app/(org)/dashboard/spaces/[spaceId]/components/VirtualizedVideoGrid.tsx
+++ b/apps/web/app/(org)/dashboard/spaces/[spaceId]/components/VirtualizedVideoGrid.tsx
@@ -1,6 +1,6 @@
import type { Video } from "@cap/web-domain";
import { Grid, useGrid } from "@virtual-grid/react";
-import React, { type RefObject, useEffect, useRef, useState } from "react";
+import { type RefObject, useEffect, useRef, useState } from "react";
import type { VideoData } from "./AddVideosDialogBase";
import VideoCard from "./VideoCard";
diff --git a/apps/web/app/(org)/dashboard/spaces/browse/page.tsx b/apps/web/app/(org)/dashboard/spaces/browse/page.tsx
index 78343710d..5a501b52d 100644
--- a/apps/web/app/(org)/dashboard/spaces/browse/page.tsx
+++ b/apps/web/app/(org)/dashboard/spaces/browse/page.tsx
@@ -123,79 +123,75 @@ export default function BrowseSpacesPage() {
</td>
</tr>
)}
- {filteredSpaces &&
- filteredSpaces.map((space: Spaces) => {
- return (
- <tr
- key={space.id}
- onClick={() => router.push(`/dashboard/spaces/${space.id}`)}
- className="border-t transition-colors cursor-pointer hover:bg-gray-2 border-gray-3"
- >
- <td className="flex gap-3 items-center px-6 py-4">
- <SignedImageUrl
- image={space.iconUrl}
- name={space.name}
- className="relative flex-shrink-0 size-7"
- letterClass="text-sm"
- />
- <span className="text-sm font-semibold text-gray-12">
- {space.name}
- </span>
- </td>
- <td className="px-6 py-4 text-sm text-gray-12">
- {space.memberCount} member
- {space.memberCount === 1 ? "" : "s"}
- </td>
- <td className="px-6 py-4 text-sm text-gray-12">
- {space.videoCount} video
- {space.videoCount === 1 ? "" : "s"}
- </td>
- <td className="px-6 py-4 text-sm text-gray-12">
- {space.createdById === user?.id ? "Admin" : "Member"}
- </td>
- <td className="px-6">
- {space.createdById === user?.id && !space.primary ? (
- <div className="flex gap-2">
- <Button
- variant="gray"
- className="size-8 p-0 min-w-[unset]"
- size="sm"
- onClick={(e) => {
- e.stopPropagation();
- setEditSpace({
- id: space.id,
- name: space.name,
- members: (trueActiveOrgMembers || []).map(
- (m: { user: { id: string } }) => m.user.id,
- ),
- iconUrl: space.iconUrl,
- });
- setShowSpaceDialog(true);
- }}
- >
- <FontAwesomeIcon icon={faEdit} className="size-3" />
- </Button>
- <Button
- variant="gray"
- onClick={(e) => handleDeleteSpace(e, space)}
- className="size-8 p-0 min-w-[unset]"
- size="sm"
- >
- <FontAwesomeIcon
- icon={faTrash}
- className="size-3"
- />
- </Button>
- </div>
- ) : (
- <div className="h-8 text-gray-10">
- <p>...</p>
- </div>
- )}
- </td>
- </tr>
- );
- })}
+ {filteredSpaces?.map((space: Spaces) => {
+ return (
+ <tr
+ key={space.id}
+ onClick={() => router.push(`/dashboard/spaces/${space.id}`)}
+ className="border-t transition-colors cursor-pointer hover:bg-gray-2 border-gray-3"
+ >
+ <td className="flex gap-3 items-center px-6 py-4">
+ <SignedImageUrl
+ image={space.iconUrl}
+ name={space.name}
+ className="relative flex-shrink-0 size-7"
+ letterClass="text-sm"
+ />
+ <span className="text-sm font-semibold text-gray-12">
+ {space.name}
+ </span>
+ </td>
+ <td className="px-6 py-4 text-sm text-gray-12">
+ {space.memberCount} member
+ {space.memberCount === 1 ? "" : "s"}
+ </td>
+ <td className="px-6 py-4 text-sm text-gray-12">
+ {space.videoCount} video
+ {space.videoCount === 1 ? "" : "s"}
+ </td>
+ <td className="px-6 py-4 text-sm text-gray-12">
+ {space.createdById === user?.id ? "Admin" : "Member"}
+ </td>
+ <td className="px-6">
+ {space.createdById === user?.id && !space.primary ? (
+ <div className="flex gap-2">
+ <Button
+ variant="gray"
+ className="size-8 p-0 min-w-[unset]"
+ size="sm"
+ onClick={(e) => {
+ e.stopPropagation();
+ setEditSpace({
+ id: space.id,
+ name: space.name,
+ members: (trueActiveOrgMembers || []).map(
+ (m: { user: { id: string } }) => m.user.id,
+ ),
+ iconUrl: space.iconUrl,
+ });
+ setShowSpaceDialog(true);
+ }}
+ >
+ <FontAwesomeIcon icon={faEdit} className="size-3" />
+ </Button>
+ <Button
+ variant="gray"
+ onClick={(e) => handleDeleteSpace(e, space)}
+ className="size-8 p-0 min-w-[unset]"
+ size="sm"
+ >
+ <FontAwesomeIcon icon={faTrash} className="size-3" />
+ </Button>
+ </div>
+ ) : (
+ <div className="h-8 text-gray-10">
+ <p>...</p>
+ </div>
+ )}
+ </td>
+ </tr>
+ );
+ })}
</tbody>
</table>
</div>
diff --git a/apps/web/app/(org)/login/form.tsx b/apps/web/app/(org)/login/form.tsx
index 4f4588f19..8348b136e 100644
--- a/apps/web/app/(org)/login/form.tsx
+++ b/apps/web/app/(org)/login/form.tsx
@@ -92,7 +92,7 @@ export function LoginForm() {
},
body: JSON.stringify({
priceId: pendingPriceId,
- quantity: parseInt(pendingQuantity),
+ quantity: parseInt(pendingQuantity, 10),
}),
});
const data = await response.json();
@@ -300,7 +300,7 @@ export function LoginForm() {
);
}
})
- .catch((error) => {
+ .catch((_error) => {
setEmailSent(false);
setLoading(false);
// Catch block is rarely triggered with NextAuth
diff --git a/apps/web/app/(org)/onboarding/components/CustomDomainPage.tsx b/apps/web/app/(org)/onboarding/components/CustomDomainPage.tsx
index 2572ba8d4..45dec1e32 100644
--- a/apps/web/app/(org)/onboarding/components/CustomDomainPage.tsx
+++ b/apps/web/app/(org)/onboarding/components/CustomDomainPage.tsx
@@ -1,7 +1,6 @@
"use client";
import { Button } from "@cap/ui";
-import { Effect } from "effect";
import { useRouter } from "next/navigation";
import { startTransition, useState } from "react";
import { toast } from "sonner";
diff --git a/apps/web/app/(org)/onboarding/components/InviteTeamPage.tsx b/apps/web/app/(org)/onboarding/components/InviteTeamPage.tsx
index 326b1673a..68c6ba3ad 100644
--- a/apps/web/app/(org)/onboarding/components/InviteTeamPage.tsx
+++ b/apps/web/app/(org)/onboarding/components/InviteTeamPage.tsx
@@ -6,13 +6,11 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import NumberFlow from "@number-flow/react";
import { useMutation } from "@tanstack/react-query";
import clsx from "clsx";
-import { Effect } from "effect";
import { useRouter } from "next/navigation";
import { type MouseEvent, startTransition, useId, useState } from "react";
import { toast } from "sonner";
import { useStripeContext } from "@/app/Layout/StripeContext";
import { useEffectMutation, useRpcClient } from "@/lib/EffectRuntime";
-import { withRpc } from "@/lib/Rpcs";
import { homepageCopy } from "../../../../data/homepage-copy";
import { Base } from "./Base";
diff --git a/apps/web/app/(org)/onboarding/components/OrganizationSetupPage.tsx b/apps/web/app/(org)/onboarding/components/OrganizationSetupPage.tsx
index 31a8a09e1..6b314f063 100644
--- a/apps/web/app/(org)/onboarding/components/OrganizationSetupPage.tsx
+++ b/apps/web/app/(org)/onboarding/components/OrganizationSetupPage.tsx
@@ -9,7 +9,6 @@ import { useRouter } from "next/navigation";
import { startTransition, useRef, useState } from "react";
import { toast } from "sonner";
import { useEffectMutation, useRpcClient } from "@/lib/EffectRuntime";
-import { withRpc } from "@/lib/Rpcs";
import { Base } from "./Base";
export function OrganizationSetupPage({
diff --git a/apps/web/app/(org)/signup/form.tsx b/apps/web/app/(org)/signup/form.tsx
index 10e9dede1..94bfc864e 100644
--- a/apps/web/app/(org)/signup/form.tsx
+++ b/apps/web/app/(org)/signup/form.tsx
@@ -92,7 +92,7 @@ export function SignupForm() {
},
body: JSON.stringify({
priceId: pendingPriceId,
- quantity: parseInt(pendingQuantity),
+ quantity: parseInt(pendingQuantity, 10),
}),
});
const data = await response.json();
@@ -300,7 +300,7 @@ export function SignupForm() {
);
}
})
- .catch((error) => {
+ .catch((_error) => {
setEmailSent(false);
setLoading(false);
// Catch block is rarely triggered with NextAuth
@@ -459,23 +459,16 @@ const NormalSignup = ({
className="flex flex-col gap-3 justify-center items-center"
>
{!oauthError && (
- <>
- <MotionButton
- variant="gray"
- type="button"
- className="flex gap-2 justify-center items-center w-full text-sm"
- onClick={handleGoogleSignIn}
- disabled={loading}
- >
- <Image
- src="/google.svg"
- alt="Google"
- width={16}
- height={16}
- />
- Sign up with Google
- </MotionButton>
- </>
+ <MotionButton
+ variant="gray"
+ type="button"
+ className="flex gap-2 justify-center items-center w-full text-sm"
+ onClick={handleGoogleSignIn}
+ disabled={loading}
+ >
+ <Image src="/google.svg" alt="Google" width={16} height={16} />
+ Sign up with Google
+ </MotionButton>
)}
{oauthError && (
diff --git a/apps/web/app/(org)/verify-otp/form.tsx b/apps/web/app/(org)/verify-otp/form.tsx
index a7161c346..57253e074 100644
--- a/apps/web/app/(org)/verify-otp/form.tsx
+++ b/apps/web/app/(org)/verify-otp/form.tsx
@@ -8,7 +8,7 @@ import { motion } from "framer-motion";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { signIn } from "next-auth/react";
-import { startTransition, useEffect, useRef, useState } from "react";
+import { useEffect, useRef, useState } from "react";
import { toast } from "sonner";
export function VerifyOTPForm({
@@ -22,7 +22,7 @@ export function VerifyOTPForm({
}) {
const [code, setCode] = useState(["", "", "", "", "", ""]);
const [lastResendTime, setLastResendTime] = useState<number | null>(
- lastSent ? parseInt(lastSent) : null,
+ lastSent ? parseInt(lastSent, 10) : null,
);
const inputRefs = useRef<(HTMLInputElement | null)[]>([]);
const router = useRouter();
@@ -42,7 +42,7 @@ export function VerifyOTPForm({
});
setCode(newCode);
- const nextEmptyIndex = newCode.findIndex((digit) => digit === "");
+ const nextEmptyIndex = newCode.indexOf("");
if (nextEmptyIndex !== -1) {
inputRefs.current[nextEmptyIndex]?.focus();
} else {
diff --git a/apps/web/app/(site)/blog/_components/Share.tsx b/apps/web/app/(site)/blog/_components/Share.tsx
index bc61fa64b..211b4f15c 100644
--- a/apps/web/app/(site)/blog/_components/Share.tsx
+++ b/apps/web/app/(site)/blog/_components/Share.tsx
@@ -17,43 +17,41 @@ export function Share({ post, url }: ShareProps) {
const [copied, setCopied] = useState(false);
return (
- <>
- <div className="mt-6 py-6 px-3 bg-gray-1 text-center rounded-xl">
- <h3 className="mb-2 mt-0 text-lg font-semibold">Share this post</h3>
- <div className="flex justify-center gap-4">
- <a
- href={`https://twitter.com/intent/tweet?text=${encodeURIComponent(
- post.metadata.title,
- )}&url=${encodeURIComponent(url)}`}
- target="_blank"
- rel="noopener noreferrer"
- className="text-lg text-gray-600 hover:text-blue-500 hover:underline"
- >
- Twitter
- </a>
- <a
- href={`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(
- url,
- )}`}
- target="_blank"
- rel="noopener noreferrer"
- className="text-lg text-gray-600 hover:text-blue-700 hover:underline"
- >
- LinkedIn
- </a>
- <button
- onClick={() => {
- navigator.clipboard.writeText(url);
- toast.success("Link copied to clipboard");
- setCopied(true);
- setTimeout(() => setCopied(false), 2000);
- }}
- className="text-lg text-gray-600 hover:text-gray-900 underline"
- >
- {copied ? "Link copied" : "Copy Link"}
- </button>
- </div>
+ <div className="mt-6 py-6 px-3 bg-gray-1 text-center rounded-xl">
+ <h3 className="mb-2 mt-0 text-lg font-semibold">Share this post</h3>
+ <div className="flex justify-center gap-4">
+ <a
+ href={`https://twitter.com/intent/tweet?text=${encodeURIComponent(
+ post.metadata.title,
+ )}&url=${encodeURIComponent(url)}`}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="text-lg text-gray-600 hover:text-blue-500 hover:underline"
+ >
+ Twitter
+ </a>
+ <a
+ href={`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(
+ url,
+ )}`}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="text-lg text-gray-600 hover:text-blue-700 hover:underline"
+ >
+ LinkedIn
+ </a>
+ <button
+ onClick={() => {
+ navigator.clipboard.writeText(url);
+ toast.success("Link copied to clipboard");
+ setCopied(true);
+ setTimeout(() => setCopied(false), 2000);
+ }}
+ className="text-lg text-gray-600 hover:text-gray-900 underline"
+ >
+ {copied ? "Link copied" : "Copy Link"}
+ </button>
</div>
- </>
+ </div>
);
}
diff --git a/apps/web/app/(site)/privacy/page.tsx b/apps/web/app/(site)/privacy/page.tsx
index cc01507b6..fbbf63c5c 100644
--- a/apps/web/app/(site)/privacy/page.tsx
+++ b/apps/web/app/(site)/privacy/page.tsx
@@ -17,131 +17,129 @@ export default function App() {
out to us.
</p>
<div className="text-left legal-body fade-in-up animate-delay-2">
- <>
- <p>
- At Cap Software, Inc. ("Cap," "we," "us," or "our"), we are
- committed to protecting your privacy and ensuring the security of
- your personal information. This Privacy Policy explains how we
- collect, use, disclose, and safeguard your information when you
- use our software application and services (collectively, the
- "Services"). By using our Services, you consent to the collection,
- use, and disclosure of your information as described in this
- Privacy Policy.
- </p>
- <ol>
- <li>
- <h3>Information We Collect</h3>
- <br />
- a. Personal Information: When you create an account, we collect
- your name, email address, and any other information you
- voluntarily provide to us.
- <br />
- b. Usage Data: We collect information about how you use our
- Services, such as the videos you create, the duration of your
- recordings, and the features you utilize.
- <br />
- c. Device Information: We may collect information about the
- devices you use to access our Services, including the hardware
- model, operating system and version, and unique device
- identifiers.
- <br />
- d. Cookies and Similar Technologies: We use cookies and similar
- technologies to enhance your experience, analyze trends, and
- administer our Services.
- </li>
- <li>
- <h3>How We Use Your Information</h3>
- <br />
- a. To provide, maintain, and improve our Services.
- <br />
- b. To communicate with you, provide customer support, and
- respond to your inquiries.
- <br />
- c. To personalize your experience and deliver content and
- product offerings relevant to your interests.
- <br />
- d. To detect, prevent, and address technical issues and protect
- against fraudulent or illegal activities.
- <br />
- e. To generate aggregated, anonymized data for statistical and
- research purposes.
- </li>
- <li>
- <h3>Sharing Your Information</h3>
- <br />
- a. We may share your information with third-party service
- providers who assist us in operating our Services and conducting
- our business.
- <br />
- b. We may disclose your information if required to do so by law
- or in the good faith belief that such action is necessary to
- comply with legal obligations or to protect our rights,
- property, or safety, or that of our users or the public.
- <br />
- c. In the event of a merger, acquisition, or sale of all or a
- portion of our assets, your information may be transferred as
- part of the transaction.
- </li>
- <li>
- <h3>Data Security</h3>
- <br />
- We implement reasonable security measures to protect your
- information from unauthorized access, alteration, disclosure, or
- destruction. However, no method of transmission over the
- internet or electronic storage is 100% secure, and we cannot
- guarantee absolute security.
- </li>
- <li>
- <h3>Your Choices</h3>
- <br />
- a. You can update, correct, or delete your account information
- at any time by logging into your account.
- <br />
- b. You can opt-out of receiving promotional emails from us by
- following the unsubscribe instructions provided in those emails.
- <br />
- c. You can control the use of cookies through your browser
- settings, but note that disabling cookies may limit your ability
- to use certain features of our Services.
- </li>
- <li>
- <h3>Retention of Your Information</h3>
- <br />
- We retain your information for as long as necessary to fulfill
- the purposes outlined in this Privacy Policy, unless a longer
- retention period is required or permitted by law.
- </li>
- <li>
- <h3>Children's Privacy</h3>
- <br />
- Our Services are not intended for children under the age of 13.
- We do not knowingly collect personal information from children
- under 13. If we become aware that a child under 13 has provided
- us with personal information, we will take steps to delete such
- information.
- </li>
- <li>
- <h3>Changes to This Privacy Policy</h3>
- <br />
- We may update our Privacy Policy from time to time. We will
- notify you of any changes by posting the new Privacy Policy on
- this page and updating the "Last Updated" date at the top of
- this Privacy Policy.
- </li>
- <li>
- <h3>Contact Us</h3>
- <br />
- If you have any questions or concerns about this Privacy Policy
- or our privacy practices, please contact us at [email protected].
- </li>
- </ol>
- <p>
- By using our Services, you acknowledge that you have read and
- understood this Privacy Policy and agree to be bound by its terms.
- </p>
- <p>Privacy Policy for Cap Software, Inc.</p>
- <p>Last Updated: 24th April 2024</p>
- </>
+ <p>
+ At Cap Software, Inc. ("Cap," "we," "us," or "our"), we are
+ committed to protecting your privacy and ensuring the security of
+ your personal information. This Privacy Policy explains how we
+ collect, use, disclose, and safeguard your information when you use
+ our software application and services (collectively, the
+ "Services"). By using our Services, you consent to the collection,
+ use, and disclosure of your information as described in this Privacy
+ Policy.
+ </p>
+ <ol>
+ <li>
+ <h3>Information We Collect</h3>
+ <br />
+ a. Personal Information: When you create an account, we collect
+ your name, email address, and any other information you
+ voluntarily provide to us.
+ <br />
+ b. Usage Data: We collect information about how you use our
+ Services, such as the videos you create, the duration of your
+ recordings, and the features you utilize.
+ <br />
+ c. Device Information: We may collect information about the
+ devices you use to access our Services, including the hardware
+ model, operating system and version, and unique device
+ identifiers.
+ <br />
+ d. Cookies and Similar Technologies: We use cookies and similar
+ technologies to enhance your experience, analyze trends, and
+ administer our Services.
+ </li>
+ <li>
+ <h3>How We Use Your Information</h3>
+ <br />
+ a. To provide, maintain, and improve our Services.
+ <br />
+ b. To communicate with you, provide customer support, and respond
+ to your inquiries.
+ <br />
+ c. To personalize your experience and deliver content and product
+ offerings relevant to your interests.
+ <br />
+ d. To detect, prevent, and address technical issues and protect
+ against fraudulent or illegal activities.
+ <br />
+ e. To generate aggregated, anonymized data for statistical and
+ research purposes.
+ </li>
+ <li>
+ <h3>Sharing Your Information</h3>
+ <br />
+ a. We may share your information with third-party service
+ providers who assist us in operating our Services and conducting
+ our business.
+ <br />
+ b. We may disclose your information if required to do so by law or
+ in the good faith belief that such action is necessary to comply
+ with legal obligations or to protect our rights, property, or
+ safety, or that of our users or the public.
+ <br />
+ c. In the event of a merger, acquisition, or sale of all or a
+ portion of our assets, your information may be transferred as part
+ of the transaction.
+ </li>
+ <li>
+ <h3>Data Security</h3>
+ <br />
+ We implement reasonable security measures to protect your
+ information from unauthorized access, alteration, disclosure, or
+ destruction. However, no method of transmission over the internet
+ or electronic storage is 100% secure, and we cannot guarantee
+ absolute security.
+ </li>
+ <li>
+ <h3>Your Choices</h3>
+ <br />
+ a. You can update, correct, or delete your account information at
+ any time by logging into your account.
+ <br />
+ b. You can opt-out of receiving promotional emails from us by
+ following the unsubscribe instructions provided in those emails.
+ <br />
+ c. You can control the use of cookies through your browser
+ settings, but note that disabling cookies may limit your ability
+ to use certain features of our Services.
+ </li>
+ <li>
+ <h3>Retention of Your Information</h3>
+ <br />
+ We retain your information for as long as necessary to fulfill the
+ purposes outlined in this Privacy Policy, unless a longer
+ retention period is required or permitted by law.
+ </li>
+ <li>
+ <h3>Children's Privacy</h3>
+ <br />
+ Our Services are not intended for children under the age of 13. We
+ do not knowingly collect personal information from children under
+ 13. If we become aware that a child under 13 has provided us with
+ personal information, we will take steps to delete such
+ information.
+ </li>
+ <li>
+ <h3>Changes to This Privacy Policy</h3>
+ <br />
+ We may update our Privacy Policy from time to time. We will notify
+ you of any changes by posting the new Privacy Policy on this page
+ and updating the "Last Updated" date at the top of this Privacy
+ Policy.
+ </li>
+ <li>
+ <h3>Contact Us</h3>
+ <br />
+ If you have any questions or concerns about this Privacy Policy or
+ our privacy practices, please contact us at [email protected].
+ </li>
+ </ol>
+ <p>
+ By using our Services, you acknowledge that you have read and
+ understood this Privacy Policy and agree to be bound by its terms.
+ </p>
+ <p>Privacy Policy for Cap Software, Inc.</p>
+ <p>Last Updated: 24th April 2024</p>
</div>
</div>
</div>
diff --git a/apps/web/app/(site)/self-hosting/SelfHostingPage.tsx b/apps/web/app/(site)/self-hosting/SelfHostingPage.tsx
index 6fc9cd4ae..a88c43927 100644
--- a/apps/web/app/(site)/self-hosting/SelfHostingPage.tsx
+++ b/apps/web/app/(site)/self-hosting/SelfHostingPage.tsx
@@ -23,104 +23,101 @@ export const SelfHostingPage = () => {
};
return (
- <>
- <div className="mt-[120px]">
- <div className="relative z-10 px-5 pt-24 pb-36 w-full">
- <div className="mx-auto text-center wrapper wrapper-sm">
- <h1 className="fade-in-down text-[2rem] font-medium leading-[2.5rem] md:text-[3.75rem] md:leading-[4rem] relative z-10 text-black mb-4">
- Self-host Cap
- </h1>
- <p className="mx-auto mb-8 max-w-3xl text-md sm:text-xl text-zinc-500 fade-in-down animate-delay-1">
- Deploy Cap on your own infrastructure with full control over your
- data. Ideal for enterprises and organizations with specific
- security requirements or those wanting to white label the
- platform.
- </p>
- </div>
- <div className="flex flex-col justify-center items-center mb-5 space-y-2 fade-in-up animate-delay-2 sm:flex-row sm:space-y-0 sm:space-x-2">
- <Button
- variant="blue"
- href="#features"
- size="lg"
- className="flex justify-center items-center w-full font-medium text-md sm:w-auto"
- onClick={(e) => handleSmoothScroll(e, "features")}
- >
- Learn More
- </Button>
- </div>
- <img
- src="/illustrations/mask-big-recorder.webp"
- alt="Self-hosting Background"
- className="absolute top-0 left-0 z-0 -mt-40 w-full h-auto pointer-events-none"
- />
+ <div className="mt-[120px]">
+ <div className="relative z-10 px-5 pt-24 pb-36 w-full">
+ <div className="mx-auto text-center wrapper wrapper-sm">
+ <h1 className="fade-in-down text-[2rem] font-medium leading-[2.5rem] md:text-[3.75rem] md:leading-[4rem] relative z-10 text-black mb-4">
+ Self-host Cap
+ </h1>
+ <p className="mx-auto mb-8 max-w-3xl text-md sm:text-xl text-zinc-500 fade-in-down animate-delay-1">
+ Deploy Cap on your own infrastructure with full control over your
+ data. Ideal for enterprises and organizations with specific security
+ requirements or those wanting to white label the platform.
+ </p>
+ </div>
+ <div className="flex flex-col justify-center items-center mb-5 space-y-2 fade-in-up animate-delay-2 sm:flex-row sm:space-y-0 sm:space-x-2">
+ <Button
+ variant="blue"
+ href="#features"
+ size="lg"
+ className="flex justify-center items-center w-full font-medium text-md sm:w-auto"
+ onClick={(e) => handleSmoothScroll(e, "features")}
+ >
+ Learn More
+ </Button>
</div>
- <LogoSection />
- <div className="pb-32 wrapper md:pb-40" id="features">
- <div className="space-y-3">
- {/* Section 1: 35% / 65% split */}
- <div className="grid grid-cols-1 gap-3 md:grid-cols-12">
- <div className="md:col-span-5">
- <FeatureCard
- title="Privacy-first"
- description="Host Cap on your own servers with complete data sovereignty. Maintain full control over your sensitive information and ensure compliance with your organization's security policies and regulatory requirements."
- imagePath="/illustrations/privacy.webp"
- imageAlt="Complete Control"
- imageHeight="h-[280px]"
- />
- </div>
- <div className="md:col-span-7">
- <FeatureCard
- title="Multi-Platform Support"
- description="Self-hosted Cap works seamlessly across macOS and Windows, giving your team the flexibility to collaborate regardless of their device preference. Deploy once and enable your entire organization to capture, share, and collaborate from any device."
- imagePath="/illustrations/multiplatmain.png"
- bg="/illustrations/multiplatbg.webp"
- imageAlt="Enterprise-Ready"
- className="bg-[center_top_-90px] bg-no-repeat bg-cover lg:bg-[center_top_-60px]"
- imageHeight="h-[280px]"
- />
- </div>
+ <img
+ src="/illustrations/mask-big-recorder.webp"
+ alt="Self-hosting Background"
+ className="absolute top-0 left-0 z-0 -mt-40 w-full h-auto pointer-events-none"
+ />
+ </div>
+ <LogoSection />
+ <div className="pb-32 wrapper md:pb-40" id="features">
+ <div className="space-y-3">
+ {/* Section 1: 35% / 65% split */}
+ <div className="grid grid-cols-1 gap-3 md:grid-cols-12">
+ <div className="md:col-span-5">
+ <FeatureCard
+ title="Privacy-first"
+ description="Host Cap on your own servers with complete data sovereignty. Maintain full control over your sensitive information and ensure compliance with your organization's security policies and regulatory requirements."
+ imagePath="/illustrations/privacy.webp"
+ imageAlt="Complete Control"
+ imageHeight="h-[280px]"
+ />
</div>
-
- {/* Section 2: 65% / 35% split */}
- <div className="grid grid-cols-1 gap-3 md:grid-cols-12">
- <div className="md:col-span-8">
- <FeatureCard
- title="Unlimited Recording and Cloud Storage"
- bg="/illustrations/multiplatbg.webp"
- description="Configure storage limits based on your infrastructure capacity. Self-hosting eliminates cloud storage fees and gives you complete control over retention policies, ideal for teams with high-volume recording needs or long-term archival requirements."
- imagePath="/illustrations/cloud-feature.webp"
- imageAlt="White Labeling"
- imageHeight="h-[215px]"
- className="lg:bg-[center_top_-150px] bg-[center_top_-120px] bg-no-repeat bg-cover"
- />
- </div>
- <div className="md:col-span-4">
- <FeatureCard
- title="High-Quality Video Capture"
- description="Deliver crystal-clear recordings to your team with self-hosted infrastructure optimized for your network. Eliminate quality degradation from third-party services and ensure consistent performance across your organization."
- imagePath="/illustrations/video-capture.webp"
- imageAlt="Data Sovereignty"
- imageHeight="h-[224px]"
- />
- </div>
+ <div className="md:col-span-7">
+ <FeatureCard
+ title="Multi-Platform Support"
+ description="Self-hosted Cap works seamlessly across macOS and Windows, giving your team the flexibility to collaborate regardless of their device preference. Deploy once and enable your entire organization to capture, share, and collaborate from any device."
+ imagePath="/illustrations/multiplatmain.png"
+ bg="/illustrations/multiplatbg.webp"
+ imageAlt="Enterprise-Ready"
+ className="bg-[center_top_-90px] bg-no-repeat bg-cover lg:bg-[center_top_-60px]"
+ imageHeight="h-[280px]"
+ />
</div>
+ </div>
- {/* Section 3: Full width */}
- <div className="grid grid-cols-1">
+ {/* Section 2: 65% / 35% split */}
+ <div className="grid grid-cols-1 gap-3 md:grid-cols-12">
+ <div className="md:col-span-8">
+ <FeatureCard
+ title="Unlimited Recording and Cloud Storage"
+ bg="/illustrations/multiplatbg.webp"
+ description="Configure storage limits based on your infrastructure capacity. Self-hosting eliminates cloud storage fees and gives you complete control over retention policies, ideal for teams with high-volume recording needs or long-term archival requirements."
+ imagePath="/illustrations/cloud-feature.webp"
+ imageAlt="White Labeling"
+ imageHeight="h-[215px]"
+ className="lg:bg-[center_top_-150px] bg-[center_top_-120px] bg-no-repeat bg-cover"
+ />
+ </div>
+ <div className="md:col-span-4">
<FeatureCard
- title="Advanced Team Collaboration"
- description="Enable seamless knowledge sharing across departments with customizable access controls and team workspaces. Self-hosted Cap provides enterprise-grade collaboration features that integrate with your existing authentication systems and team structure."
- imagePath="/illustrations/collaboration.webp"
- imageAlt="Dedicated Support"
- imageHeight="h-[285px]"
+ title="High-Quality Video Capture"
+ description="Deliver crystal-clear recordings to your team with self-hosted infrastructure optimized for your network. Eliminate quality degradation from third-party services and ensure consistent performance across your organization."
+ imagePath="/illustrations/video-capture.webp"
+ imageAlt="Data Sovereignty"
+ imageHeight="h-[224px]"
/>
</div>
</div>
+
+ {/* Section 3: Full width */}
+ <div className="grid grid-cols-1">
+ <FeatureCard
+ title="Advanced Team Collaboration"
+ description="Enable seamless knowledge sharing across departments with customizable access controls and team workspaces. Self-hosted Cap provides enterprise-grade collaboration features that integrate with your existing authentication systems and team structure."
+ imagePath="/illustrations/collaboration.webp"
+ imageAlt="Dedicated Support"
+ imageHeight="h-[285px]"
+ />
+ </div>
</div>
- <div className="px-5 mb-32 md:mb-40">
- <CommercialGetStarted />
- </div>
</div>
- </>
+ <div className="px-5 mb-32 md:mb-40">
+ <CommercialGetStarted />
+ </div>
+ </div>
);
};
diff --git a/apps/web/app/(site)/tools/PageContent.tsx b/apps/web/app/(site)/tools/PageContent.tsx
index f69b419fc..3b1b24300 100644
--- a/apps/web/app/(site)/tools/PageContent.tsx
+++ b/apps/web/app/(site)/tools/PageContent.tsx
@@ -1,10 +1,7 @@
"use client";
import { Button } from "@cap/ui";
-import { motion } from "framer-motion";
import Link from "next/link";
-import { useEffect } from "react";
-import LeftBlueHue from "@/components/pages/HomePage/LeftBlueHue";
interface ToolCategory {
title: string;
diff --git a/apps/web/app/Layout/GTag.tsx b/apps/web/app/Layout/GTag.tsx
index 9a04bf721..4ff434f56 100644
--- a/apps/web/app/Layout/GTag.tsx
+++ b/apps/web/app/Layout/GTag.tsx
@@ -28,25 +28,23 @@ export function GTag() {
}
return (
- <>
- <Script
- id={scriptId}
- strategy="afterInteractive"
- src={`https://www.googletagmanager.com/gtag/js?id=${awId}`}
- onLoad={() => {
- if (
- !gtagInitialized.current &&
- typeof window !== "undefined" &&
- window.gtag &&
- awId
- ) {
- window.gtag("js", new Date());
- window.gtag("config", awId);
- gtagInitialized.current = true;
- }
- }}
- />
- </>
+ <Script
+ id={scriptId}
+ strategy="afterInteractive"
+ src={`https://www.googletagmanager.com/gtag/js?id=${awId}`}
+ onLoad={() => {
+ if (
+ !gtagInitialized.current &&
+ typeof window !== "undefined" &&
+ window.gtag &&
+ awId
+ ) {
+ window.gtag("js", new Date());
+ window.gtag("config", awId);
+ gtagInitialized.current = true;
+ }
+ }}
+ />
);
}
diff --git a/apps/web/app/Layout/Intercom/Client.tsx b/apps/web/app/Layout/Intercom/Client.tsx
index a292adeed..fc469aea2 100644
--- a/apps/web/app/Layout/Intercom/Client.tsx
+++ b/apps/web/app/Layout/Intercom/Client.tsx
@@ -29,7 +29,7 @@ export function Client(props: { hash?: string }) {
});
}
}
- }, [props.hash, user]);
+ }, [props.hash, user, isBlogPage, isSharePage]);
return null;
}
diff --git a/apps/web/app/Layout/PosthogIdentify.tsx b/apps/web/app/Layout/PosthogIdentify.tsx
index 00644319f..851143c9a 100644
--- a/apps/web/app/Layout/PosthogIdentify.tsx
+++ b/apps/web/app/Layout/PosthogIdentify.tsx
@@ -1,6 +1,6 @@
"use client";
-import { Suspense, use, useEffect } from "react";
+import { Suspense, useEffect } from "react";
import { checkAndMarkUserSignedUpTracked } from "@/actions/analytics/track-user-signed-up";
import {
identifyUser,
diff --git a/apps/web/app/api/changelog/route.ts b/apps/web/app/api/changelog/route.ts
index ef024c4e7..e385031f0 100644
--- a/apps/web/app/api/changelog/route.ts
+++ b/apps/web/app/api/changelog/route.ts
@@ -12,7 +12,7 @@ export async function GET(request: Request) {
.map((post) => ({
metadata: post.metadata,
content: post.content,
- slug: parseInt(post.slug),
+ slug: parseInt(post.slug, 10),
}))
.sort((a, b) => b.slug - a.slug)
.map(({ metadata, content }) => ({ ...metadata, content }));
diff --git a/apps/web/app/api/changelog/status/route.ts b/apps/web/app/api/changelog/status/route.ts
index 3d6f5c110..813f8666a 100644
--- a/apps/web/app/api/changelog/status/route.ts
+++ b/apps/web/app/api/changelog/status/route.ts
@@ -18,7 +18,7 @@ export async function GET(request: Request) {
.map((post) => ({
metadata: post.metadata,
content: post.content,
- slug: parseInt(post.slug),
+ slug: parseInt(post.slug, 10),
}))
.sort((a, b) => b.slug - a.slug)
.map(({ metadata, content }) => ({ ...metadata, content }));
diff --git a/apps/web/app/api/desktop/[...route]/root.ts b/apps/web/app/api/desktop/[...route]/root.ts
index 18294c841..d240292ae 100644
--- a/apps/web/app/api/desktop/[...route]/root.ts
+++ b/apps/web/app/api/desktop/[...route]/root.ts
@@ -67,7 +67,7 @@ app.post(
success: true,
message: "Logs uploaded successfully",
});
- } catch (error) {
+ } catch (_error) {
return c.json({ error: "Failed to upload logs" }, { status: 500 });
}
},
@@ -115,7 +115,7 @@ app.post(
success: true,
message: "Feedback submitted successfully",
});
- } catch (error) {
+ } catch (_error) {
return c.json({ error: "Failed to submit feedback" }, { status: 500 });
}
},
diff --git a/apps/web/app/api/notifications/route.ts b/apps/web/app/api/notifications/route.ts
index f27ee584d..5fecdf2bd 100644
--- a/apps/web/app/api/notifications/route.ts
+++ b/apps/web/app/api/notifications/route.ts
@@ -11,7 +11,7 @@ import type { NotificationType } from "@/lib/Notification";
import { runPromise } from "@/lib/server";
import { jsonExtractString } from "@/utils/sql";
-const notificationDataSchema = z.object({
+const _notificationDataSchema = z.object({
authorId: z.string(),
content: z.string().optional(),
videoId: z.string(),
diff --git a/apps/web/app/api/releases/tauri/[version]/[target]/[arch]/route.ts b/apps/web/app/api/releases/tauri/[version]/[target]/[arch]/route.ts
index 91674a14d..7ad308796 100644
--- a/apps/web/app/api/releases/tauri/[version]/[target]/[arch]/route.ts
+++ b/apps/web/app/api/releases/tauri/[version]/[target]/[arch]/route.ts
@@ -5,7 +5,7 @@ const octokit = new Octokit();
export const runtime = "edge";
export async function GET(
- req: Request,
+ _req: Request,
props: RouteContext<"/api/releases/tauri/[version]/[target]/[arch]">,
) {
const params = await props.params;
diff --git a/apps/web/app/api/settings/billing/guest-checkout/route.ts b/apps/web/app/api/settings/billing/guest-checkout/route.ts
index f940ec204..a8e5dc63f 100644
--- a/apps/web/app/api/settings/billing/guest-checkout/route.ts
+++ b/apps/web/app/api/settings/billing/guest-checkout/route.ts
@@ -37,7 +37,7 @@ export async function POST(request: NextRequest) {
});
ph.capture({
- distinctId: "guest-" + checkoutSession.id,
+ distinctId: `guest-${checkoutSession.id}`,
event: "guest_checkout_started",
properties: {
price_id: priceId,
diff --git a/apps/web/app/api/settings/billing/manage/route.ts b/apps/web/app/api/settings/billing/manage/route.ts
index 6726df976..8d38fd0ab 100644
--- a/apps/web/app/api/settings/billing/manage/route.ts
+++ b/apps/web/app/api/settings/billing/manage/route.ts
@@ -7,7 +7,7 @@ import { eq } from "drizzle-orm";
import { type NextRequest, NextResponse } from "next/server";
import type Stripe from "stripe";
-export async function POST(request: NextRequest) {
+export async function POST(_request: NextRequest) {
const user = await getCurrentUser();
let customerId = user?.stripeCustomerId;
diff --git a/apps/web/app/api/thumbnail/route.ts b/apps/web/app/api/thumbnail/route.ts
index 96610c568..f17c62532 100644
--- a/apps/web/app/api/thumbnail/route.ts
+++ b/apps/web/app/api/thumbnail/route.ts
@@ -3,7 +3,7 @@ import { s3Buckets, videos } from "@cap/database/schema";
import { S3Buckets } from "@cap/web-backend";
import { Video } from "@cap/web-domain";
import { eq } from "drizzle-orm";
-import { Effect, Option } from "effect";
+import { Option } from "effect";
import type { NextRequest } from "next/server";
import { runPromise } from "@/lib/server";
import { getHeaders } from "@/utils/helpers";
diff --git a/apps/web/app/api/upload/[...route]/multipart.ts b/apps/web/app/api/upload/[...route]/multipart.ts
index 23dac0c22..40bd6e5e9 100644
--- a/apps/web/app/api/upload/[...route]/multipart.ts
+++ b/apps/web/app/api/upload/[...route]/multipart.ts
@@ -8,15 +8,13 @@ import { serverEnv } from "@cap/env";
import {
AwsCredentials,
Database,
- makeCurrentUser,
makeCurrentUserLayer,
provideOptionalAuth,
S3Buckets,
- Videos,
VideosPolicy,
VideosRepo,
} from "@cap/web-backend";
-import { CurrentUser, Policy, Video } from "@cap/web-domain";
+import { Policy, Video } from "@cap/web-domain";
import { zValidator } from "@hono/zod-validator";
import { and, eq } from "drizzle-orm";
import { Effect, Option, Schedule } from "effect";
@@ -438,7 +436,7 @@ app.post(
),
});
- const pathToInvalidate = "/" + fileKey;
+ const pathToInvalidate = `/${fileKey}`;
yield* Effect.promise(() =>
cloudfront.send(
diff --git a/apps/web/app/api/upload/[...route]/route.ts b/apps/web/app/api/upload/[...route]/route.ts
index 8a1c4cbb8..c4c1a5d73 100644
--- a/apps/web/app/api/upload/[...route]/route.ts
+++ b/apps/web/app/api/upload/[...route]/route.ts
@@ -1,7 +1,7 @@
import { Hono } from "hono";
import { handle } from "hono/vercel";
-import { corsMiddleware, withAuth } from "../../utils";
+import { corsMiddleware } from "../../utils";
import * as multipart from "./multipart";
import * as signed from "./signed";
diff --git a/apps/web/app/api/upload/[...route]/signed.ts b/apps/web/app/api/upload/[...route]/signed.ts
index 9dd656c51..779385ca4 100644
--- a/apps/web/app/api/upload/[...route]/signed.ts
+++ b/apps/web/app/api/upload/[...route]/signed.ts
@@ -15,11 +15,7 @@ import { Hono } from "hono";
import { z } from "zod";
import { runPromise } from "@/lib/server";
-import {
- isAtLeastSemver,
- isFromDesktopSemver,
- UPLOAD_PROGRESS_VERSION,
-} from "@/utils/desktop";
+import { isFromDesktopSemver, UPLOAD_PROGRESS_VERSION } from "@/utils/desktop";
import { stringOrNumberOptional } from "@/utils/zod";
import { withAuth } from "../../utils";
import { parseVideoIdOrFileKey } from "../utils";
@@ -84,7 +80,7 @@ app.post(
),
});
- const pathToInvalidate = "/" + fileKey;
+ const pathToInvalidate = `/${fileKey}`;
try {
const invalidation = await cloudfront.send(
diff --git a/apps/web/app/api/video/ai/route.ts b/apps/web/app/api/video/ai/route.ts
index 9639ef50e..8b0187f49 100644
--- a/apps/web/app/api/video/ai/route.ts
+++ b/apps/web/app/api/video/ai/route.ts
@@ -94,7 +94,7 @@ export async function GET(request: NextRequest) {
!videoOwnerQuery[0] ||
!(await isAiGenerationEnabled(videoOwnerQuery[0]))
) {
- const videoOwner = videoOwnerQuery[0];
+ const _videoOwner = videoOwnerQuery[0];
return Response.json(
{
processing: false,
diff --git a/apps/web/app/api/video/domain-info/route.ts b/apps/web/app/api/video/domain-info/route.ts
index dd6d2e83a..803bb33af 100644
--- a/apps/web/app/api/video/domain-info/route.ts
+++ b/apps/web/app/api/video/domain-info/route.ts
@@ -1,7 +1,7 @@
import { db } from "@cap/database";
import { organizations, sharedVideos, videos } from "@cap/database/schema";
import { Video } from "@cap/web-domain";
-import { and, eq } from "drizzle-orm";
+import { eq } from "drizzle-orm";
import type { NextRequest } from "next/server";
export async function GET(request: NextRequest) {
diff --git a/apps/web/app/embed/[videoId]/_components/EmbedVideo.tsx b/apps/web/app/embed/[videoId]/_components/EmbedVideo.tsx
index b6bacce12..a34584618 100644
--- a/apps/web/app/embed/[videoId]/_components/EmbedVideo.tsx
+++ b/apps/web/app/embed/[videoId]/_components/EmbedVideo.tsx
@@ -120,7 +120,7 @@ export const EmbedVideo = forwardRef<
setSubtitleUrl(null);
}
}
- }, [data.transcriptionStatus, transcriptData]);
+ }, [data.transcriptionStatus, transcriptData, subtitleUrl]);
// Handle chapters URL creation
useEffect(() => {
@@ -146,7 +146,7 @@ export const EmbedVideo = forwardRef<
setChaptersUrl(null);
}
}
- }, [chapters]);
+ }, [chapters, chaptersUrl]);
const isMp4Source =
data.source.type === "desktopMP4" || data.source.type === "webMP4";
diff --git a/apps/web/app/embed/[videoId]/page.tsx b/apps/web/app/embed/[videoId]/page.tsx
index 71368eec2..05f7da4b6 100644
--- a/apps/web/app/embed/[videoId]/page.tsx
+++ b/apps/web/app/embed/[videoId]/page.tsx
@@ -34,7 +34,7 @@ export async function generateMetadata(
Option.match({
onNone: () => notFound(),
onSome: ([video]) => ({
- title: video.name + " | Cap Recording",
+ title: `${video.name} | Cap Recording`,
description: "Watch this video on Cap",
openGraph: {
images: [
@@ -61,7 +61,7 @@ export async function generateMetadata(
},
twitter: {
card: "player",
- title: video.name + " | Cap Recording",
+ title: `${video.name} | Cap Recording`,
description: "Watch this video on Cap",
images: [
new URL(
diff --git a/apps/web/app/globals.css b/apps/web/app/globals.css
index cb9cd7406..204aae2be 100644
--- a/apps/web/app/globals.css
+++ b/apps/web/app/globals.css
@@ -150,7 +150,7 @@ html {
:where(blockquote p:first-of-type):not(
:where([class~="not-prose"], [class~="not-prose"] *)
)::before {
- content: "“" !important;
+ content: "“";
display: none;
}
@@ -819,16 +819,16 @@ footer a {
/* Firefox support */
.media-player video::cue {
- position: relative !important;
- bottom: 64px !important;
+ position: relative;
+ bottom: 64px;
}
.media-player[data-controls-visible] video::cue {
- bottom: 64px !important;
+ bottom: 64px;
}
.media-player[data-state="fullscreen"][data-controls-visible] video::cue {
- bottom: 64px !important;
+ bottom: 64px;
}
/* Safari-specific styles using CSS hacks */
@@ -836,7 +836,7 @@ footer a {
_::-webkit-full-page-media,
_:future,
:root #video-container {
- height: calc(100% - 1.7rem) !important;
+ height: calc(100% - 1.7rem);
}
}
@@ -898,7 +898,7 @@ footer a {
@media (max-width: 768px) {
.intercom-lightweight-app-launcher {
- bottom: 90px !important;
+ bottom: 90px;
}
}
diff --git a/apps/web/app/layout.tsx b/apps/web/app/layout.tsx
index bf9d86a20..1b595989d 100644
--- a/apps/web/app/layout.tsx
+++ b/apps/web/app/layout.tsx
@@ -1,16 +1,12 @@
import "@/app/globals.css";
-import { getCurrentUser } from "@cap/database/auth/session";
import { buildEnv, serverEnv } from "@cap/env";
-import { STRIPE_PLAN_IDS, userIsPro } from "@cap/utils";
-import { ImageUploads } from "@cap/web-backend";
-import type { ImageUpload } from "@cap/web-domain";
+import { STRIPE_PLAN_IDS } from "@cap/utils";
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
import { Effect } from "effect";
import type { Metadata } from "next";
import localFont from "next/font/local";
import type { PropsWithChildren } from "react";
import { SonnerToaster } from "@/components/SonnerToastProvider";
-import { EffectRuntime } from "@/lib/EffectRuntime";
import { runPromise } from "@/lib/server";
import { getBootstrapData } from "@/utils/getBootstrapData";
import { PublicEnvContext } from "@/utils/public-env";
diff --git a/apps/web/app/s/[videoId]/_components/AuthOverlay.tsx b/apps/web/app/s/[videoId]/_components/AuthOverlay.tsx
index e621fe001..6c3ea5599 100644
--- a/apps/web/app/s/[videoId]/_components/AuthOverlay.tsx
+++ b/apps/web/app/s/[videoId]/_components/AuthOverlay.tsx
@@ -2,7 +2,6 @@ import { NODE_ENV } from "@cap/env";
import { Button, Dialog, DialogContent, Input, LogoBadge } from "@cap/ui";
import { faArrowLeft, faEnvelope } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import { AnimatePresence } from "framer-motion";
import Image from "next/image";
import Link from "next/link";
import { useParams } from "next/navigation";
diff --git a/apps/web/app/s/[videoId]/_components/CapVideoPlayer.tsx b/apps/web/app/s/[videoId]/_components/CapVideoPlayer.tsx
index f05d17636..1e9e7123a 100644
--- a/apps/web/app/s/[videoId]/_components/CapVideoPlayer.tsx
+++ b/apps/web/app/s/[videoId]/_components/CapVideoPlayer.tsx
@@ -192,7 +192,7 @@ export function CapVideoPlayer({
}
retryCount.current += 1;
- }, [maxRetries]);
+ }, [videoRef.current]);
const setupRetry = useCallback(() => {
if (retryTimeout.current) {
@@ -232,7 +232,7 @@ export function CapVideoPlayer({
retryTimeout.current = setTimeout(() => {
reloadVideo();
}, retryInterval);
- }, [reloadVideo, maxRetries]);
+ }, [reloadVideo]);
// Reset state when video source changes
useEffect(() => {
@@ -248,7 +248,7 @@ export function CapVideoPlayer({
clearTimeout(retryTimeout.current);
retryTimeout.current = null;
}
- }, [resolvedSrc.refetch, videoSrc, enableCrossOrigin]);
+ }, [resolvedSrc.refetch]);
// Track video duration for comment markers
useEffect(() => {
@@ -264,7 +264,7 @@ export function CapVideoPlayer({
return () => {
video.removeEventListener("loadedmetadata", handleLoadedMetadata);
};
- }, [resolvedSrc.isLoading]);
+ }, [videoRef.current]);
// Track when all data is ready for comment markers
const [markersReady, setMarkersReady] = useState(false);
@@ -284,7 +284,7 @@ export function CapVideoPlayer({
if (duration > 0 && comments.length > 0 && videoRef.current) {
setMarkersReady(true);
}
- }, [duration, comments.length]);
+ }, [duration, comments.length, videoRef.current]);
useEffect(() => {
const video = videoRef.current;
@@ -339,11 +339,7 @@ export function CapVideoPlayer({
let captionTrack: TextTrack | null = null;
const handleCueChange = (): void => {
- if (
- captionTrack &&
- captionTrack.activeCues &&
- captionTrack.activeCues.length > 0
- ) {
+ if (captionTrack?.activeCues && captionTrack.activeCues.length > 0) {
const cue = captionTrack.activeCues[0] as VTTCue;
const plainText = cue.text.replace(/<[^>]*>/g, "");
setCurrentCue(plainText);
@@ -458,30 +454,40 @@ export function CapVideoPlayer({
captionTrack.removeEventListener("cuechange", handleCueChange);
}
};
- }, [hasPlayedOnce, resolvedSrc.isPending]);
-
- const generateVideoFrameThumbnail = useCallback((time: number): string => {
- const video = videoRef.current;
-
- if (!video) {
- return `https://placeholder.pics/svg/224x128/1f2937/ffffff/Loading ${Math.floor(time)}s`;
- }
+ }, [
+ hasPlayedOnce,
+ resolvedSrc.isPending,
+ hasError,
+ setupRetry,
+ videoLoaded,
+ videoRef.current,
+ ]);
+
+ const generateVideoFrameThumbnail = useCallback(
+ (time: number): string => {
+ const video = videoRef.current;
+
+ if (!video) {
+ return `https://placeholder.pics/svg/224x128/1f2937/ffffff/Loading ${Math.floor(time)}s`;
+ }
- const canvas = document.createElement("canvas");
- canvas.width = 224;
- canvas.height = 128;
- const ctx = canvas.getContext("2d");
-
- if (ctx) {
- try {
- ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
- return canvas.toDataURL("image/jpeg", 0.8);
- } catch (error) {
- return `https://placeholder.pics/svg/224x128/dc2626/ffffff/Error`;
+ const canvas = document.createElement("canvas");
+ canvas.width = 224;
+ canvas.height = 128;
+ const ctx = canvas.getContext("2d");
+
+ if (ctx) {
+ try {
+ ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
+ return canvas.toDataURL("image/jpeg", 0.8);
+ } catch (_error) {
+ return `https://placeholder.pics/svg/224x128/dc2626/ffffff/Error`;
+ }
}
- }
- return `https://placeholder.pics/svg/224x128/dc2626/ffffff/Error`;
- }, []);
+ return `https://placeholder.pics/svg/224x128/dc2626/ffffff/Error`;
+ },
+ [videoRef.current],
+ );
const isUploadFailed = uploadProgress?.status === "failed";
diff --git a/apps/web/app/s/[videoId]/_components/HLSVideoPlayer.tsx b/apps/web/app/s/[videoId]/_components/HLSVideoPlayer.tsx
index eebe6c296..55f76c489 100644
--- a/apps/web/app/s/[videoId]/_components/HLSVideoPlayer.tsx
+++ b/apps/web/app/s/[videoId]/_components/HLSVideoPlayer.tsx
@@ -121,7 +121,7 @@ export function HLSVideoPlayer({
video.removeEventListener("play", handlePlay);
video.removeEventListener("error", handleError);
};
- }, [hasPlayedOnce, videoSrc]);
+ }, [hasPlayedOnce, videoSrc, videoRef.current]);
// HLS setup
useEffect(() => {
@@ -185,7 +185,7 @@ export function HLSVideoPlayer({
} else {
console.error("HLSVideoPlayer: HLS is not supported in this browser");
}
- }, [videoSrc, hasPlayedOnce]);
+ }, [videoSrc, hasPlayedOnce, videoRef.current]);
// Caption handling
useEffect(() => {
@@ -195,11 +195,7 @@ export function HLSVideoPlayer({
let captionTrack: TextTrack | null = null;
const handleCueChange = (): void => {
- if (
- captionTrack &&
- captionTrack.activeCues &&
- captionTrack.activeCues.length > 0
- ) {
+ if (captionTrack?.activeCues && captionTrack.activeCues.length > 0) {
const activeCue = captionTrack.activeCues[0] as VTTCue;
setCurrentCue(activeCue.text);
} else {
@@ -268,7 +264,7 @@ export function HLSVideoPlayer({
captionTrack.removeEventListener("cuechange", handleCueChange);
}
};
- }, [captionsSrc]);
+ }, [captionsSrc, videoRef.current]);
const uploadProgressRaw = useUploadProgress(
videoId,
diff --git a/apps/web/app/s/[videoId]/_components/OtpForm.tsx b/apps/web/app/s/[videoId]/_components/OtpForm.tsx
index 56d3855c3..34d474389 100644
--- a/apps/web/app/s/[videoId]/_components/OtpForm.tsx
+++ b/apps/web/app/s/[videoId]/_components/OtpForm.tsx
@@ -42,7 +42,7 @@ const OtpForm = ({
});
setCode(newCode);
- const nextEmptyIndex = newCode.findIndex((digit) => digit === "");
+ const nextEmptyIndex = newCode.indexOf("");
if (nextEmptyIndex !== -1) {
inputRefs.current[nextEmptyIndex]?.focus();
} else {
diff --git a/apps/web/app/s/[videoId]/_components/ShareHeader.tsx b/apps/web/app/s/[videoId]/_components/ShareHeader.tsx
index 74662a06b..4e437a23e 100644
--- a/apps/web/app/s/[videoId]/_components/ShareHeader.tsx
+++ b/apps/web/app/s/[videoId]/_components/ShareHeader.tsx
@@ -1,9 +1,7 @@
"use client";
-import type { videos } from "@cap/database/schema";
import { buildEnv, NODE_ENV } from "@cap/env";
import { Button } from "@cap/ui";
-import { type ImageUpload, User } from "@cap/web-domain";
import {
faChartSimple,
faChevronDown,
@@ -220,7 +218,6 @@ export const ShareHeader = ({
onChange={(e) => setTitle(e.target.value)}
onBlur={handleBlur}
onKeyDown={handleKeyDown}
- autoFocus
className="w-full text-xl sm:text-2xl"
/>
) : (
diff --git a/apps/web/app/s/[videoId]/_components/ShareVideo.tsx b/apps/web/app/s/[videoId]/_components/ShareVideo.tsx
index 8c5db1f5d..396c41662 100644
--- a/apps/web/app/s/[videoId]/_components/ShareVideo.tsx
+++ b/apps/web/app/s/[videoId]/_components/ShareVideo.tsx
@@ -1,5 +1,4 @@
-import type { userSelectProps } from "@cap/database/auth/session";
-import type { comments as commentsSchema, videos } from "@cap/database/schema";
+import type { comments as commentsSchema } from "@cap/database/schema";
import { NODE_ENV } from "@cap/env";
import { Logo } from "@cap/ui";
import type { ImageUpload } from "@cap/web-domain";
@@ -11,7 +10,6 @@ import {
useRef,
useState,
} from "react";
-import type { OrganizationSettings } from "@/app/(org)/dashboard/dashboard-data";
import { UpgradeModal } from "@/components/UpgradeModal";
import type { VideoData } from "../types";
import { CapVideoPlayer } from "./CapVideoPlayer";
@@ -133,7 +131,7 @@ export const ShareVideo = forwardRef<
setSubtitleUrl(null);
}
}
- }, [data.transcriptionStatus, transcriptData]);
+ }, [data.transcriptionStatus, transcriptData, subtitleUrl]);
// Handle chapters URL creation
useEffect(() => {
@@ -159,7 +157,7 @@ export const ShareVideo = forwardRef<
setChaptersUrl(null);
}
}
- }, [chapters]);
+ }, [chapters, chaptersUrl]);
const isMp4Source =
data.source.type === "desktopMP4" || data.source.type === "webMP4";
diff --git a/apps/web/app/s/[videoId]/_components/Sidebar.tsx b/apps/web/app/s/[videoId]/_components/Sidebar.tsx
index c9302d037..11f927778 100644
--- a/apps/web/app/s/[videoId]/_components/Sidebar.tsx
+++ b/apps/web/app/s/[videoId]/_components/Sidebar.tsx
@@ -1,6 +1,5 @@
-import type { userSelectProps } from "@cap/database/auth/session";
-import type { comments as commentsSchema, videos } from "@cap/database/schema";
-import { classNames, userIsPro } from "@cap/utils";
+import type { comments as commentsSchema } from "@cap/database/schema";
+import { classNames } from "@cap/utils";
import type { ImageUpload, Video } from "@cap/web-domain";
import clsx from "clsx";
import { AnimatePresence, motion } from "framer-motion";
diff --git a/apps/web/app/s/[videoId]/_components/tabs/Activity/Comment.tsx b/apps/web/app/s/[videoId]/_components/tabs/Activity/Comment.tsx
index 55fef7d8f..a7df9d67c 100644
--- a/apps/web/app/s/[videoId]/_components/tabs/Activity/Comment.tsx
+++ b/apps/web/app/s/[videoId]/_components/tabs/Activity/Comment.tsx
@@ -1,5 +1,4 @@
-import type { userSelectProps } from "@cap/database/auth/session";
-import { Avatar, Button } from "@cap/ui";
+import { Button } from "@cap/ui";
import type { Comment } from "@cap/web-domain";
import { faReply, faTrash } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
diff --git a/apps/web/app/s/[videoId]/_components/tabs/Activity/CommentInput.tsx b/apps/web/app/s/[videoId]/_components/tabs/Activity/CommentInput.tsx
index e832a0418..7e6caa0f9 100644
--- a/apps/web/app/s/[videoId]/_components/tabs/Activity/CommentInput.tsx
+++ b/apps/web/app/s/[videoId]/_components/tabs/Activity/CommentInput.tsx
@@ -1,4 +1,3 @@
-import type { userSelectProps } from "@cap/database/auth/session";
import { Button } from "@cap/ui";
import type React from "react";
import { useEffect, useRef, useState } from "react";
diff --git a/apps/web/app/s/[videoId]/_components/tabs/Transcript.tsx b/apps/web/app/s/[videoId]/_components/tabs/Transcript.tsx
index 5d5d0d721..3fd774f80 100644
--- a/apps/web/app/s/[videoId]/_components/tabs/Transcript.tsx
+++ b/apps/web/app/s/[videoId]/_components/tabs/Transcript.tsx
@@ -1,6 +1,5 @@
"use client";
-import type { videos } from "@cap/database/schema";
import { Button } from "@cap/ui";
import { useMutation } from "@tanstack/react-query";
import { useInvalidateTranscript, useTranscript } from "hooks/use-transcript";
@@ -40,7 +39,8 @@ const parseVTT = (vttContent: string): TranscriptEntry[] => {
const minutes = parseInt(minutesStr, 10);
const seconds = parseInt(secondsStr, 10);
- if (isNaN(hours) || isNaN(minutes) || isNaN(seconds)) return null;
+ if (Number.isNaN(hours) || Number.isNaN(minutes) || Number.isNaN(seconds))
+ return null;
return hours * 3600 + minutes * 60 + seconds;
};
@@ -264,7 +264,7 @@ export const Transcript: React.FC<TranscriptProps> = ({ data, onSeek }) => {
return;
}
- const originalEntry = transcriptData.find(
+ const _originalEntry = transcriptData.find(
(entry) => entry.id === editingEntry,
);
@@ -582,7 +582,6 @@ export const Transcript: React.FC<TranscriptProps> = ({ data, onSeek }) => {
onChange={(e) => setEditText(e.target.value)}
className="w-full text-sm leading-relaxed bg-transparent resize-none text-gray-12 placeholder:text-gray-8 focus:outline-none"
rows={Math.max(2, Math.ceil(editText.length / 60))}
- autoFocus
onClick={(e) => e.stopPropagation()}
placeholder="Edit transcript text..."
/>
diff --git a/apps/web/app/s/[videoId]/_components/utils/transcript-utils.ts b/apps/web/app/s/[videoId]/_components/utils/transcript-utils.ts
index d24b1cd5b..14a986e17 100644
--- a/apps/web/app/s/[videoId]/_components/utils/transcript-utils.ts
+++ b/apps/web/app/s/[videoId]/_components/utils/transcript-utils.ts
@@ -93,7 +93,8 @@ export const parseVTT = (vttContent: string): TranscriptEntry[] => {
const minutes = parseInt(minutesStr, 10);
const seconds = parseInt(secondsStr, 10);
- if (isNaN(hours) || isNaN(minutes) || isNaN(seconds)) return null;
+ if (Number.isNaN(hours) || Number.isNaN(minutes) || Number.isNaN(seconds))
+ return null;
return hours * 3600 + minutes * 60 + seconds;
};
diff --git a/apps/web/app/s/[videoId]/_components/video/media-player.tsx b/apps/web/app/s/[videoId]/_components/video/media-player.tsx
index 3d576b71c..af4c6f20f 100644
--- a/apps/web/app/s/[videoId]/_components/video/media-player.tsx
+++ b/apps/web/app/s/[videoId]/_components/video/media-player.tsx
@@ -46,7 +46,7 @@ import {
useMediaSelector,
} from "media-chrome/react/media-store";
import * as React from "react";
-import { forwardRef, useCallback, useEffect } from "react";
+import { forwardRef, useEffect } from "react";
import * as ReactDOM from "react-dom";
import { useComposedRefs } from "@/app/lib/compose-refs";
import { cn } from "@/app/lib/utils";
@@ -608,7 +608,7 @@ function MediaPlayerRootImpl(props: MediaPlayerRootProps) {
case "8":
case "9": {
event.preventDefault();
- const percent = Number.parseInt(event.key) / 10;
+ const percent = Number.parseInt(event.key, 10) / 10;
const seekTime = mediaElement.duration * percent;
dispatch({
type: MediaActionTypes.MEDIA_SEEK_REQUEST,
@@ -2886,14 +2886,14 @@ function MediaPlayerSettings(props: MediaPlayerSettingsProps) {
[dispatch],
);
- const onSubtitlesToggle = React.useCallback(() => {
+ const _onSubtitlesToggle = React.useCallback(() => {
dispatch({
type: MediaActionTypes.MEDIA_TOGGLE_SUBTITLES_REQUEST,
detail: false,
});
}, [dispatch]);
- const onShowSubtitleTrack = React.useCallback(
+ const _onShowSubtitleTrack = React.useCallback(
(subtitleTrack: (typeof mediaSubtitlesList)[number]) => {
dispatch({
type: MediaActionTypes.MEDIA_TOGGLE_SUBTITLES_REQUEST,
@@ -2907,7 +2907,7 @@ function MediaPlayerSettings(props: MediaPlayerSettingsProps) {
[dispatch],
);
- const selectedSubtitleLabel = React.useMemo(() => {
+ const _selectedSubtitleLabel = React.useMemo(() => {
if (!isSubtitlesActive) return "Off";
if (mediaSubtitlesShowing.length > 0) {
return mediaSubtitlesShowing[0]?.label ?? "On";
diff --git a/apps/web/app/sitemap.ts b/apps/web/app/sitemap.ts
index 8d887ce94..149d75481 100644
--- a/apps/web/app/sitemap.ts
+++ b/apps/web/app/sitemap.ts
@@ -1,5 +1,5 @@
-import { promises as fs } from "fs";
-import path from "path";
+import { promises as fs } from "node:fs";
+import path from "node:path";
import { getBlogPosts, getDocs } from "@/utils/blog";
import { seoPages } from "../lib/seo-pages";
@@ -32,7 +32,7 @@ async function getPagePaths(
(segment) => !(segment.startsWith("(") && segment.endsWith(")")),
);
const routePath =
- pathSegments.length > 0 ? "/" + pathSegments.join("/") : "/";
+ pathSegments.length > 0 ? `/${pathSegments.join("/")}` : "/";
if (!routePath.includes("/dashboard") && !routePath.includes("[")) {
const stats = await fs.stat(fullPath);
diff --git a/apps/web/components/BentoScript.tsx b/apps/web/components/BentoScript.tsx
index 9cb568872..627012734 100644
--- a/apps/web/components/BentoScript.tsx
+++ b/apps/web/components/BentoScript.tsx
@@ -16,7 +16,7 @@ export function BentoScript({
}: {
user?: typeof users.$inferSelect | null;
}) {
- const pathname = usePathname();
+ const _pathname = usePathname();
useEffect(() => {
if (window.bento !== undefined) {
@@ -25,7 +25,7 @@ export function BentoScript({
}
window.bento.view();
}
- }, [pathname]);
+ }, [user]);
return (
<Script
diff --git a/apps/web/components/UsageButton.tsx b/apps/web/components/UsageButton.tsx
index 78b282993..1e00b743b 100644
--- a/apps/web/components/UsageButton.tsx
+++ b/apps/web/components/UsageButton.tsx
@@ -49,15 +49,13 @@ export const UsageButton = memo(
}
return (
- <>
- <Tooltip
- disable={!sidebarCollapsed}
- position="right"
- content="Upgrade to Pro"
- >
- <ProRiveButton toggleMobileNav={toggleMobileNav} />
- </Tooltip>
- </>
+ <Tooltip
+ disable={!sidebarCollapsed}
+ position="right"
+ content="Upgrade to Pro"
+ >
+ <ProRiveButton toggleMobileNav={toggleMobileNav} />
+ </Tooltip>
);
},
);
diff --git a/apps/web/components/VideoThumbnail.tsx b/apps/web/components/VideoThumbnail.tsx
index 773daf337..3124ffa56 100644
--- a/apps/web/components/VideoThumbnail.tsx
+++ b/apps/web/components/VideoThumbnail.tsx
@@ -80,7 +80,7 @@ export const VideoThumbnail: React.FC<VideoThumbnailProps> = memo(
if (imageRef.current?.complete && imageRef.current.naturalWidth !== 0) {
setImageStatus("success");
}
- }, []);
+ }, [setImageStatus]);
return (
<div
diff --git a/apps/web/components/blog/AuthorByline.tsx b/apps/web/components/blog/AuthorByline.tsx
index a8a11192d..6e57d02d4 100644
--- a/apps/web/components/blog/AuthorByline.tsx
+++ b/apps/web/components/blog/AuthorByline.tsx
@@ -16,7 +16,7 @@ export function AuthorByline({ authors }: AuthorBylineProps) {
return (
<div className="mt-16 pt-8 border-t border-gray-200">
<div className="flex flex-wrap gap-1 sm:gap-6">
- {authorList.map((author, index) => (
+ {authorList.map((author, _index) => (
<div key={author.name} className="flex items-center space-x-3">
<Image
src={author.image}
diff --git a/apps/web/components/blog/BlogTemplate.tsx b/apps/web/components/blog/BlogTemplate.tsx
index 6476c87f2..c81160bea 100644
--- a/apps/web/components/blog/BlogTemplate.tsx
+++ b/apps/web/components/blog/BlogTemplate.tsx
@@ -6,7 +6,6 @@ import Image from "next/image";
import Link from "next/link";
import { useEffect, useId } from "react";
import { formatDate } from "../../lib/utils";
-import { generateGradientFromSlug } from "../../utils/gradients";
interface BlogPost {
title: string;
diff --git a/apps/web/components/mdx.tsx b/apps/web/components/mdx.tsx
index cd373655f..770052307 100644
--- a/apps/web/components/mdx.tsx
+++ b/apps/web/components/mdx.tsx
@@ -1,7 +1,7 @@
import Image from "next/image";
import Link from "next/link";
-import { MDXRemote, MDXRemoteProps } from "next-mdx-remote/rsc";
-import React, { PropsWithChildren, type ReactNode } from "react";
+import { MDXRemote } from "next-mdx-remote/rsc";
+import React, { type ReactNode } from "react";
interface TableData {
headers: string[];
diff --git a/apps/web/components/pages/AboutPage.tsx b/apps/web/components/pages/AboutPage.tsx
index 682db8c6f..fe6e43c93 100644
--- a/apps/web/components/pages/AboutPage.tsx
+++ b/apps/web/components/pages/AboutPage.tsx
@@ -21,227 +21,224 @@ export const AboutPage = () => {
};
return (
- <>
- <div className="mt-[120px]">
- <div className="relative z-10 px-5 pt-24 pb-36 w-full">
- <div className="mx-auto text-center wrapper wrapper-sm">
- <h1 className="fade-in-down text-[2rem] leading-[2.5rem] md:text-[4rem] md:leading-[4.5rem] relative z-10 text-black mb-4">
- The open source screen recording and sharing app
- </h1>
- <p className="mx-auto mb-8 max-w-3xl text-md sm:text-xl text-zinc-500 fade-in-down animate-delay-1">
- Screen recording made simple, secure, and powerful. Cap gives you
- full control over your recordings with a focus on privacy and ease
- of use.
- </p>
- </div>
- <div className="flex flex-col justify-center items-center mb-5 space-y-2 fade-in-up animate-delay-2 sm:flex-row sm:space-y-0 sm:space-x-2">
- <Button
- variant="white"
- href="#video"
- size="lg"
- className="flex justify-center items-center w-full font-medium text-md sm:w-auto"
- onClick={(e) => handleSmoothScroll(e, "video")}
- >
- See it in Action
- </Button>
- <Button
- variant="primary"
- href="/download"
- size="lg"
- className="relative z-[20] w-full font-medium text-md sm:w-auto"
- >
- Download Cap
- </Button>
- </div>
- <img
- src="/illustrations/mask-big-recorder.webp"
- alt="About Background"
- className="absolute top-0 left-0 z-0 -mt-40 w-full h-auto pointer-events-none"
- />
+ <div className="mt-[120px]">
+ <div className="relative z-10 px-5 pt-24 pb-36 w-full">
+ <div className="mx-auto text-center wrapper wrapper-sm">
+ <h1 className="fade-in-down text-[2rem] leading-[2.5rem] md:text-[4rem] md:leading-[4.5rem] relative z-10 text-black mb-4">
+ The open source screen recording and sharing app
+ </h1>
+ <p className="mx-auto mb-8 max-w-3xl text-md sm:text-xl text-zinc-500 fade-in-down animate-delay-1">
+ Screen recording made simple, secure, and powerful. Cap gives you
+ full control over your recordings with a focus on privacy and ease
+ of use.
+ </p>
</div>
+ <div className="flex flex-col justify-center items-center mb-5 space-y-2 fade-in-up animate-delay-2 sm:flex-row sm:space-y-0 sm:space-x-2">
+ <Button
+ variant="white"
+ href="#video"
+ size="lg"
+ className="flex justify-center items-center w-full font-medium text-md sm:w-auto"
+ onClick={(e) => handleSmoothScroll(e, "video")}
+ >
+ See it in Action
+ </Button>
+ <Button
+ variant="primary"
+ href="/download"
+ size="lg"
+ className="relative z-[20] w-full font-medium text-md sm:w-auto"
+ >
+ Download Cap
+ </Button>
+ </div>
+ <img
+ src="/illustrations/mask-big-recorder.webp"
+ alt="About Background"
+ className="absolute top-0 left-0 z-0 -mt-40 w-full h-auto pointer-events-none"
+ />
+ </div>
- {/* Main Content */}
- <div className="pb-24 wrapper">
- <div className="mx-auto max-w-4xl">
- <div className="mt-14 mb-32">
- <figure className="mx-auto max-w-4xl space-y-3">
- <img
- src="/cap-team-film.jpeg"
- alt="The Cap team gathered together in San Francisco"
- loading="lazy"
- className="block w-full h-[220px] rounded-2xl object-cover object-center shadow-[0_18px_36px_rgba(15,23,42,0.12)] md:h-[450px]"
+ {/* Main Content */}
+ <div className="pb-24 wrapper">
+ <div className="mx-auto max-w-4xl">
+ <div className="mt-14 mb-32">
+ <figure className="mx-auto max-w-4xl space-y-3">
+ <img
+ src="/cap-team-film.jpeg"
+ alt="The Cap team gathered together in San Francisco"
+ loading="lazy"
+ className="block w-full h-[220px] rounded-2xl object-cover object-center shadow-[0_18px_36px_rgba(15,23,42,0.12)] md:h-[450px]"
+ />
+ <figcaption className="px-2 text-sm text-gray-500 text-left">
+ The Cap team in San Francisco
+ </figcaption>
+ </figure>
+ </div>
+
+ <div className="mb-12" id="video">
+ <div className="text-center max-w-[800px] mx-auto mb-10">
+ <h2 className="inline-block relative mb-6 text-3xl font-medium text-gray-800">
+ See Cap In Action
+ <span className="absolute -bottom-2 left-1/2 w-20 h-1 bg-gray-900 rounded-full transform -translate-x-1/2"></span>
+ </h2>
+ </div>
+ <div className="mx-auto max-w-3xl">
+ <div className="rounded-xl overflow-hidden shadow-[0_0_20px_rgba(0,0,0,0.08)]">
+ <MuxPlayer
+ playbackId="A6oZoUWVZjOIVZB6XnBMLagYnXE6xhDhp8Hcyky018hk"
+ metadataVideoTitle="Cap Demo"
+ accentColor="#111111"
+ style={{ aspectRatio: "16/9", width: "100%" }}
/>
- <figcaption className="px-2 text-sm text-gray-500 text-left">
- The Cap team in San Francisco
- </figcaption>
- </figure>
+ </div>
</div>
+ </div>
- <div className="mb-12" id="video">
- <div className="text-center max-w-[800px] mx-auto mb-10">
- <h2 className="inline-block relative mb-6 text-3xl font-medium text-gray-800">
- See Cap In Action
- <span className="absolute -bottom-2 left-1/2 w-20 h-1 bg-gray-900 rounded-full transform -translate-x-1/2"></span>
- </h2>
- </div>
- <div className="mx-auto max-w-3xl">
- <div className="rounded-xl overflow-hidden shadow-[0_0_20px_rgba(0,0,0,0.08)]">
- <MuxPlayer
- playbackId="A6oZoUWVZjOIVZB6XnBMLagYnXE6xhDhp8Hcyky018hk"
- metadataVideoTitle="Cap Demo"
- accentColor="#111111"
- style={{ aspectRatio: "16/9", width: "100%" }}
- />
- </div>
- </div>
+ <div className="space-y-8">
+ <div className="p-8 bg-gray-1 rounded-2xl border border-gray-4 backdrop-blur-sm shadow-[0_0_15px_rgba(0,0,0,0.03)] hover:shadow-[0_5px_30px_rgba(0,0,0,0.05)] transition-all duration-300 transform hover:-translate-y-[2px]">
+ <h2 className="mb-4 text-2xl font-semibold text-gray-800">
+ Why Cap?
+ </h2>
+ <p className="leading-relaxed text-gray-600">
+ Cap started with a simple idea: great ideas should be easy to
+ share. Whether you're explaining a concept, showing how
+ something works, or working with others, the tools you use
+ should make your job easier, not harder.
+ </p>
</div>
- <div className="space-y-8">
+ <div className="grid grid-cols-1 gap-8 md:grid-cols-2">
<div className="p-8 bg-gray-1 rounded-2xl border border-gray-4 backdrop-blur-sm shadow-[0_0_15px_rgba(0,0,0,0.03)] hover:shadow-[0_5px_30px_rgba(0,0,0,0.05)] transition-all duration-300 transform hover:-translate-y-[2px]">
+ <div className="flex justify-center items-center mb-4 w-12 h-12 bg-blue-50 rounded-full">
+ <span className="text-xl font-medium text-blue-500">1</span>
+ </div>
<h2 className="mb-4 text-2xl font-semibold text-gray-800">
- Why Cap?
+ The Problem
</h2>
<p className="leading-relaxed text-gray-600">
- Cap started with a simple idea: great ideas should be easy to
- share. Whether you're explaining a concept, showing how
- something works, or working with others, the tools you use
- should make your job easier, not harder.
+ After years of using other screen recording tools, we found
+ they often don't respect your privacy, limit what you can do,
+ and lock your content in their systems. Most of these tools
+ are run by big companies that are slow to improve and don't
+ listen to what users actually need.
</p>
</div>
- <div className="grid grid-cols-1 gap-8 md:grid-cols-2">
- <div className="p-8 bg-gray-1 rounded-2xl border border-gray-4 backdrop-blur-sm shadow-[0_0_15px_rgba(0,0,0,0.03)] hover:shadow-[0_5px_30px_rgba(0,0,0,0.05)] transition-all duration-300 transform hover:-translate-y-[2px]">
- <div className="flex justify-center items-center mb-4 w-12 h-12 bg-blue-50 rounded-full">
- <span className="text-xl font-medium text-blue-500">1</span>
- </div>
- <h2 className="mb-4 text-2xl font-semibold text-gray-800">
- The Problem
- </h2>
- <p className="leading-relaxed text-gray-600">
- After years of using other screen recording tools, we found
- they often don't respect your privacy, limit what you can
- do, and lock your content in their systems. Most of these
- tools are run by big companies that are slow to improve and
- don't listen to what users actually need.
- </p>
- </div>
-
- <div className="p-8 bg-gray-1 rounded-2xl border border-gray-4 backdrop-blur-sm shadow-[0_0_15px_rgba(0,0,0,0.03)] hover:shadow-[0_5px_30px_rgba(0,0,0,0.05)] transition-all duration-300 transform hover:-translate-y-[2px]">
- <div className="flex justify-center items-center mb-4 w-12 h-12 bg-blue-50 rounded-full">
- <span className="text-xl font-medium text-blue-500">2</span>
- </div>
- <h2 className="mb-4 text-2xl font-semibold text-gray-800">
- Our Solution
- </h2>
- <p className="leading-relaxed text-gray-600">
- So we built Cap—a simple, complete screen recording tool
- that anyone can use. Inspired by tools we love and built on
- principles we believe in, our goal is to help you share
- ideas easily while keeping control of your content. Cap
- makes your recordings better with features like automatic
- captions, easy zooming, simple editing, and flexible sharing
- options.
- </p>
- </div>
- </div>
-
<div className="p-8 bg-gray-1 rounded-2xl border border-gray-4 backdrop-blur-sm shadow-[0_0_15px_rgba(0,0,0,0.03)] hover:shadow-[0_5px_30px_rgba(0,0,0,0.05)] transition-all duration-300 transform hover:-translate-y-[2px]">
- <h2 className="mb-4 text-2xl font-semibold text-gray-800">
- Two Ways to Record
- </h2>
- <p className="mb-6 leading-relaxed text-gray-600">
- Cap gives you two simple ways to record:
- </p>
- <div className="grid grid-cols-1 gap-6 md:grid-cols-2">
- <div className="p-6 rounded-xl border bg-gray-50 border-gray-200 transition-transform duration-300 ease-out hover:-translate-y-[2px]">
- <h3 className="mb-3 text-xl font-semibold text-gray-900 flex items-center gap-2">
- <Zap
- aria-hidden="true"
- className="size-5 md:size-6"
- strokeWidth={1.5}
- fill="yellow"
- />
- Instant Mode
- </h3>
- <p className="text-gray-600">
- Share your screen right away with a simple link—no
- waiting, just record and share in seconds.
- </p>
- </div>
- <div className="p-6 rounded-xl border bg-gray-50 border-gray-200 transition-transform duration-300 ease-out hover:-translate-y-[2px]">
- <h3 className="mb-3 text-xl font-semibold text-gray-900 flex items-center gap-2">
- <Clapperboard
- aria-hidden="true"
- className="size-5 md:size-6"
- strokeWidth={1.5}
- fill="var(--blue-9)"
- />
- Studio Mode
- </h3>
- <p className="text-gray-600">
- Records at top quality. Captures both your screen and
- webcam separately so you can edit them later.
- </p>
- </div>
+ <div className="flex justify-center items-center mb-4 w-12 h-12 bg-blue-50 rounded-full">
+ <span className="text-xl font-medium text-blue-500">2</span>
</div>
- </div>
-
- <div className="p-8 bg-gray-1 rounded-2xl border border-gray-4 backdrop-blur-sm shadow-[0_0_15px_rgba(0,0,0,0.03)] hover:shadow-[0_5px_30px_rgba(0,0,0,0.05)] transition-all duration-300 transform hover:-translate-y-[2px]">
<h2 className="mb-4 text-2xl font-semibold text-gray-800">
- Privacy First
+ Our Solution
</h2>
<p className="leading-relaxed text-gray-600">
- Unlike other tools, Cap is built with your privacy as a top
- priority. We don't trap your data or force you to use only our
- systems. You can connect your own storage, keeping complete
- control of your recordings forever.
+ So we built Cap—a simple, complete screen recording tool that
+ anyone can use. Inspired by tools we love and built on
+ principles we believe in, our goal is to help you share ideas
+ easily while keeping control of your content. Cap makes your
+ recordings better with features like automatic captions, easy
+ zooming, simple editing, and flexible sharing options.
</p>
</div>
+ </div>
- <div className="p-8 bg-gray-1 rounded-2xl border border-gray-4 backdrop-blur-sm shadow-[0_0_15px_rgba(0,0,0,0.03)] hover:shadow-[0_5px_30px_rgba(0,0,0,0.05)]transition-all duration-300 transform hover:-translate-y-[2px]">
- <h2 className="mb-4 text-2xl font-semibold text-gray-800">
- Open to Everyone
- </h2>
- <p className="leading-relaxed text-gray-600">
- We believe in being open and transparent. Cap's code is
- available for anyone to see, use, and improve. This means your
- data will always be accessible, and our tool will keep getting
- better through community feedback and contributions.
- </p>
+ <div className="p-8 bg-gray-1 rounded-2xl border border-gray-4 backdrop-blur-sm shadow-[0_0_15px_rgba(0,0,0,0.03)] hover:shadow-[0_5px_30px_rgba(0,0,0,0.05)] transition-all duration-300 transform hover:-translate-y-[2px]">
+ <h2 className="mb-4 text-2xl font-semibold text-gray-800">
+ Two Ways to Record
+ </h2>
+ <p className="mb-6 leading-relaxed text-gray-600">
+ Cap gives you two simple ways to record:
+ </p>
+ <div className="grid grid-cols-1 gap-6 md:grid-cols-2">
+ <div className="p-6 rounded-xl border bg-gray-50 border-gray-200 transition-transform duration-300 ease-out hover:-translate-y-[2px]">
+ <h3 className="mb-3 text-xl font-semibold text-gray-900 flex items-center gap-2">
+ <Zap
+ aria-hidden="true"
+ className="size-5 md:size-6"
+ strokeWidth={1.5}
+ fill="yellow"
+ />
+ Instant Mode
+ </h3>
+ <p className="text-gray-600">
+ Share your screen right away with a simple link—no waiting,
+ just record and share in seconds.
+ </p>
+ </div>
+ <div className="p-6 rounded-xl border bg-gray-50 border-gray-200 transition-transform duration-300 ease-out hover:-translate-y-[2px]">
+ <h3 className="mb-3 text-xl font-semibold text-gray-900 flex items-center gap-2">
+ <Clapperboard
+ aria-hidden="true"
+ className="size-5 md:size-6"
+ strokeWidth={1.5}
+ fill="var(--blue-9)"
+ />
+ Studio Mode
+ </h3>
+ <p className="text-gray-600">
+ Records at top quality. Captures both your screen and webcam
+ separately so you can edit them later.
+ </p>
+ </div>
</div>
+ </div>
- <div className="p-8 bg-gray-1 rounded-2xl border border-gray-4 backdrop-blur-sm shadow-[0_0_15px_rgba(0,0,0,0.03)] hover:shadow-[0_5px_30px_rgba(0,0,0,0.05)] transition-all duration-300 transform hover:-translate-y-[2px]">
- <h2 className="mb-4 text-2xl font-semibold text-gray-800">
- Join Us
- </h2>
- <p className="leading-relaxed text-gray-600">
- We're working to make Cap the best screen recording tool for
- everyone. Whether you're creating content alone, working with
- a startup, or part of a large team, Cap works for you.
- </p>
- <p className="mt-3 leading-relaxed text-gray-600">
- Together, we're making it easier for everyone to share ideas
- and connect—one recording at a time.
- </p>
- <div className="mt-6">
- <Button
- className="inline-flex transform hover:-translate-y-[2px] transition-all duration-300"
- href="/download"
- variant="primary"
- size="lg"
- >
- Download Cap
- </Button>
- </div>
+ <div className="p-8 bg-gray-1 rounded-2xl border border-gray-4 backdrop-blur-sm shadow-[0_0_15px_rgba(0,0,0,0.03)] hover:shadow-[0_5px_30px_rgba(0,0,0,0.05)] transition-all duration-300 transform hover:-translate-y-[2px]">
+ <h2 className="mb-4 text-2xl font-semibold text-gray-800">
+ Privacy First
+ </h2>
+ <p className="leading-relaxed text-gray-600">
+ Unlike other tools, Cap is built with your privacy as a top
+ priority. We don't trap your data or force you to use only our
+ systems. You can connect your own storage, keeping complete
+ control of your recordings forever.
+ </p>
+ </div>
+
+ <div className="p-8 bg-gray-1 rounded-2xl border border-gray-4 backdrop-blur-sm shadow-[0_0_15px_rgba(0,0,0,0.03)] hover:shadow-[0_5px_30px_rgba(0,0,0,0.05)]transition-all duration-300 transform hover:-translate-y-[2px]">
+ <h2 className="mb-4 text-2xl font-semibold text-gray-800">
+ Open to Everyone
+ </h2>
+ <p className="leading-relaxed text-gray-600">
+ We believe in being open and transparent. Cap's code is
+ available for anyone to see, use, and improve. This means your
+ data will always be accessible, and our tool will keep getting
+ better through community feedback and contributions.
+ </p>
+ </div>
+
+ <div className="p-8 bg-gray-1 rounded-2xl border border-gray-4 backdrop-blur-sm shadow-[0_0_15px_rgba(0,0,0,0.03)] hover:shadow-[0_5px_30px_rgba(0,0,0,0.05)] transition-all duration-300 transform hover:-translate-y-[2px]">
+ <h2 className="mb-4 text-2xl font-semibold text-gray-800">
+ Join Us
+ </h2>
+ <p className="leading-relaxed text-gray-600">
+ We're working to make Cap the best screen recording tool for
+ everyone. Whether you're creating content alone, working with a
+ startup, or part of a large team, Cap works for you.
+ </p>
+ <p className="mt-3 leading-relaxed text-gray-600">
+ Together, we're making it easier for everyone to share ideas and
+ connect—one recording at a time.
+ </p>
+ <div className="mt-6">
+ <Button
+ className="inline-flex transform hover:-translate-y-[2px] transition-all duration-300"
+ href="/download"
+ variant="primary"
+ size="lg"
+ >
+ Download Cap
+ </Button>
</div>
</div>
</div>
+ </div>
- <div className="mt-16">
- <ReadyToGetStarted />
- </div>
+ <div className="mt-16">
+ <ReadyToGetStarted />
</div>
</div>
- </>
+ </div>
);
};
diff --git a/apps/web/components/pages/DocsPage.tsx b/apps/web/components/pages/DocsPage.tsx
index 226c0249d..f1deaf7e1 100644
--- a/apps/web/components/pages/DocsPage.tsx
+++ b/apps/web/components/pages/DocsPage.tsx
@@ -16,7 +16,7 @@ export const DocsPage = () => {
key={doc.slug}
className="overflow-hidden w-full bg-white rounded-xl border transition-shadow cursor-pointer hover:shadow-md"
>
- <Link href={"/docs/" + doc.slug}>
+ <Link href={`/docs/${doc.slug}`}>
{doc.metadata.image && (
<div className="w-full border-b">
<Image
@@ -35,15 +35,14 @@ export const DocsPage = () => {
</h2>
<p className="text-gray-600">{doc.metadata.summary}</p>
<div className="flex flex-wrap gap-2">
- {doc.metadata.tags &&
- doc.metadata.tags.split(", ").map((tag) => (
- <p
- key={tag}
- className="rounded-md min-w-fit flex-initial bg-gray-4 font-medium px-2 py-0.5 text-sm text-gray-11"
- >
- {tag}
- </p>
- ))}
+ {doc.metadata.tags?.split(", ").map((tag) => (
+ <p
+ key={tag}
+ className="rounded-md min-w-fit flex-initial bg-gray-4 font-medium px-2 py-0.5 text-sm text-gray-11"
+ >
+ {tag}
+ </p>
+ ))}
</div>
</div>
</Link>
diff --git a/apps/web/components/pages/HomePage/Header.tsx b/apps/web/components/pages/HomePage/Header.tsx
index 1619ff359..14740dc6f 100644
--- a/apps/web/components/pages/HomePage/Header.tsx
+++ b/apps/web/components/pages/HomePage/Header.tsx
@@ -2,7 +2,7 @@
"use client";
import { Button } from "@cap/ui";
-import { faAngleRight, faPlay } from "@fortawesome/free-solid-svg-icons";
+import { faPlay } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { AnimatePresence, motion } from "framer-motion";
import { useDetectPlatform } from "hooks/useDetectPlatform";
@@ -66,7 +66,7 @@ const Header = ({ serverHomepageCopyVariant = "" }: HeaderProps) => {
);
};
- const proArtRef = useRef<ProArtRef>(null);
+ const _proArtRef = useRef<ProArtRef>(null);
const headerContent = getHeaderContent();
diff --git a/apps/web/components/pages/StudentDiscountPage.tsx b/apps/web/components/pages/StudentDiscountPage.tsx
index f646608d4..2af6f8c9b 100644
--- a/apps/web/components/pages/StudentDiscountPage.tsx
+++ b/apps/web/components/pages/StudentDiscountPage.tsx
@@ -4,7 +4,6 @@ import { Button } from "@cap/ui";
import {
faBookOpen,
faCopy,
- faGraduationCap,
faRocket,
faUsers,
} from "@fortawesome/free-solid-svg-icons";
@@ -12,7 +11,6 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { motion } from "framer-motion";
import { useState } from "react";
import { toast } from "sonner";
-import { CommercialCard, ProCard } from "./HomePage/Pricing";
const fadeIn = {
hidden: { opacity: 0, y: 20 },
@@ -27,7 +25,7 @@ const fadeIn = {
}),
};
-const fadeInFromBottom = {
+const _fadeInFromBottom = {
hidden: { opacity: 0, y: 50 },
visible: (custom: number = 0) => ({
opacity: 1,
@@ -61,7 +59,7 @@ export const StudentDiscountPage = () => {
setCopied(true);
toast.success("Discount code copied!");
setTimeout(() => setCopied(false), 2000);
- } catch (err) {
+ } catch (_err) {
toast.error("Failed to copy code");
}
};
diff --git a/apps/web/components/pages/TermsPage.tsx b/apps/web/components/pages/TermsPage.tsx
index 1172fea06..bacd77298 100644
--- a/apps/web/components/pages/TermsPage.tsx
+++ b/apps/web/components/pages/TermsPage.tsx
@@ -13,161 +13,159 @@ export const TermsPage = () => {
hesitate to reach out to us.
</p>
<div className="text-left legal-body fade-in-up animate-delay-2">
- <>
- <ol>
- <li>
- <h3>Introduction</h3>
- <br />
- Welcome to Cap Software, Inc. ("Cap," "we," "us," or "our").
- These Terms of Service ("Terms") govern your access to and use
- of our website, software, and services (collectively, the
- "Services"). By accessing or using our Services, you agree to be
- bound by these Terms. If you do not agree to these Terms, you
- may not access or use our Services.
- </li>
- <li>
- <h3>Services</h3>
- <br />
- Cap provides a platform that allows users to record their screen
- and webcam, edit their recordings, generate shareable links, and
- collaborate with others through "Spaces." We offer a free plan
- with usage limits and a paid "Cap Pro" plan.
- </li>
- <li>
- <h3>User Accounts</h3>
- <br />
- To access certain features of our Services, you may be required
- to create an account. You are responsible for maintaining the
- confidentiality of your account information and for all
- activities that occur under your account. You agree to provide
- accurate, current, and complete information during the
- registration process and to update such information as needed.
- </li>
- <li>
- <h3>User Content</h3>
- <br />
- You are solely responsible for the content you record, upload,
- or otherwise make available through our Services ("User
- Content"). By making any User Content available through our
- Services, you grant to Cap a non-exclusive, transferable,
- sublicensable, worldwide, royalty-free license to use, copy,
- modify, create derivative works based upon, distribute, publicly
- display, and publicly perform your User Content in connection
- with operating and providing our Services.
- </li>
- <li>
- <h3>Intellectual Property</h3>
- <br />
- Our Services and their original content, features, and
- functionality are owned by Cap and are protected by
- international copyright, trademark, patent, trade secret, and
- other intellectual property or proprietary rights laws. You may
- not copy, modify, distribute, sell, or lease any part of our
- Services, nor may you reverse engineer or attempt to extract the
- source code of our software.
- </li>
- <li>
- <h3>User Conduct</h3>
- <br />
- You agree not to use our Services to:
- <br />
- a. Upload, post, or transmit any User Content that is unlawful,
- harmful, threatening, abusive, harassing, tortious, defamatory,
- vulgar, obscene, libelous, or otherwise objectionable;
- <br />
- b. Impersonate any person or entity or falsely state or
- otherwise misrepresent your affiliation with a person or entity;
- <br />
- c. Engage in any activity that interferes with or disrupts our
- Services or the servers and networks connected to our Services;
- <br />
- d. Attempt to gain unauthorized access to any portion of our
- Services or any other accounts, computer systems, or networks
- connected to our Services.
- </li>
- <li>
- <h3>Use of Company Logos</h3>
- <br />
- By using our Services, you agree that Cap may use your company’s
- name and logo for marketing and promotional purposes, including
- but not limited to displaying your logo on our website,
- presentations, and promotional materials, to indicate you as a
- user or customer of our Services. If you do not wish for your
- company’s name or logo to be used for such purposes, you may opt
- out by contacting us at [email protected].
- </li>
- <li>
- <h3>Privacy</h3>
- <br />
- Your privacy is important to us. Please review our Privacy
- Policy, which is incorporated into these Terms, to understand
- our practices regarding the collection, use, and disclosure of
- personal information.
- </li>
- <li>
- <h3>Termination</h3>
- <br />
- We may terminate or suspend your access to our Services at any
- time, with or without cause or notice, at our sole discretion.
- Upon termination, your right to use our Services will
- immediately cease.
- </li>
- <li>
- <h3>Disclaimer of Warranties</h3>
- <br />
- Our Services are provided "as is" and "as available" without
- warranties of any kind, either express or implied, including but
- not limited to warranties of merchantability, fitness for a
- particular purpose, and non-infringement.
- </li>
- <li>
- <h3>Limitation of Liability</h3>
- <br />
- To the fullest extent permitted by law, Cap shall not be liable
- for any indirect, incidental, special, consequential, or
- punitive damages, or any loss of profits or revenues, whether
- incurred directly or indirectly, or any loss of data, use,
- goodwill, or other intangible losses.
- </li>
- <li>
- <h3>Indemnification</h3>
- <br />
- You agree to defend, indemnify, and hold harmless Cap and its
- affiliates, officers, agents, and employees from and against any
- claims, damages, obligations, losses, liabilities, costs, or
- debt, and expenses (including but not limited to attorney's
- fees) arising from your use of and access to our Services or
- your violation of these Terms.
- </li>
- <li>
- <h3>Governing Law and Jurisdiction</h3>
- <br />
- These Terms shall be governed by and construed in accordance
- with the laws of the State of Delaware, without giving effect to
- any principles of conflicts of law. Any legal action or
- proceeding arising under these Terms will be brought exclusively
- in the federal or state courts located in Dover, Delaware, and
- you consent to personal jurisdiction and venue in such courts.
- </li>
- <li>
- <h3>Changes to These Terms</h3>
- <br />
- We reserve the right, at our sole discretion, to modify or
- replace these Terms at any time. If a revision is material, we
- will provide at least 30 days' notice prior to any new terms
- taking effect. By continuing to access or use our Services after
- any revisions become effective, you agree to be bound by the
- revised terms.
- </li>
- <li>
- <h3>Contact Us</h3>
- <br />
- If you have any questions about these Terms, please contact us
- </li>
- </ol>
- <p>Last updated: 24th April 2024</p>
- </>
+ <ol>
+ <li>
+ <h3>Introduction</h3>
+ <br />
+ Welcome to Cap Software, Inc. ("Cap," "we," "us," or "our"). These
+ Terms of Service ("Terms") govern your access to and use of our
+ website, software, and services (collectively, the "Services"). By
+ accessing or using our Services, you agree to be bound by these
+ Terms. If you do not agree to these Terms, you may not access or
+ use our Services.
+ </li>
+ <li>
+ <h3>Services</h3>
+ <br />
+ Cap provides a platform that allows users to record their screen
+ and webcam, edit their recordings, generate shareable links, and
+ collaborate with others through "Spaces." We offer a free plan
+ with usage limits and a paid "Cap Pro" plan.
+ </li>
+ <li>
+ <h3>User Accounts</h3>
+ <br />
+ To access certain features of our Services, you may be required to
+ create an account. You are responsible for maintaining the
+ confidentiality of your account information and for all activities
+ that occur under your account. You agree to provide accurate,
+ current, and complete information during the registration process
+ and to update such information as needed.
+ </li>
+ <li>
+ <h3>User Content</h3>
+ <br />
+ You are solely responsible for the content you record, upload, or
+ otherwise make available through our Services ("User Content"). By
+ making any User Content available through our Services, you grant
+ to Cap a non-exclusive, transferable, sublicensable, worldwide,
+ royalty-free license to use, copy, modify, create derivative works
+ based upon, distribute, publicly display, and publicly perform
+ your User Content in connection with operating and providing our
+ Services.
+ </li>
+ <li>
+ <h3>Intellectual Property</h3>
+ <br />
+ Our Services and their original content, features, and
+ functionality are owned by Cap and are protected by international
+ copyright, trademark, patent, trade secret, and other intellectual
+ property or proprietary rights laws. You may not copy, modify,
+ distribute, sell, or lease any part of our Services, nor may you
+ reverse engineer or attempt to extract the source code of our
+ software.
+ </li>
+ <li>
+ <h3>User Conduct</h3>
+ <br />
+ You agree not to use our Services to:
+ <br />
+ a. Upload, post, or transmit any User Content that is unlawful,
+ harmful, threatening, abusive, harassing, tortious, defamatory,
+ vulgar, obscene, libelous, or otherwise objectionable;
+ <br />
+ b. Impersonate any person or entity or falsely state or otherwise
+ misrepresent your affiliation with a person or entity;
+ <br />
+ c. Engage in any activity that interferes with or disrupts our
+ Services or the servers and networks connected to our Services;
+ <br />
+ d. Attempt to gain unauthorized access to any portion of our
+ Services or any other accounts, computer systems, or networks
+ connected to our Services.
+ </li>
+ <li>
+ <h3>Use of Company Logos</h3>
+ <br />
+ By using our Services, you agree that Cap may use your company’s
+ name and logo for marketing and promotional purposes, including
+ but not limited to displaying your logo on our website,
+ presentations, and promotional materials, to indicate you as a
+ user or customer of our Services. If you do not wish for your
+ company’s name or logo to be used for such purposes, you may opt
+ out by contacting us at [email protected].
+ </li>
+ <li>
+ <h3>Privacy</h3>
+ <br />
+ Your privacy is important to us. Please review our Privacy Policy,
+ which is incorporated into these Terms, to understand our
+ practices regarding the collection, use, and disclosure of
+ personal information.
+ </li>
+ <li>
+ <h3>Termination</h3>
+ <br />
+ We may terminate or suspend your access to our Services at any
+ time, with or without cause or notice, at our sole discretion.
+ Upon termination, your right to use our Services will immediately
+ cease.
+ </li>
+ <li>
+ <h3>Disclaimer of Warranties</h3>
+ <br />
+ Our Services are provided "as is" and "as available" without
+ warranties of any kind, either express or implied, including but
+ not limited to warranties of merchantability, fitness for a
+ particular purpose, and non-infringement.
+ </li>
+ <li>
+ <h3>Limitation of Liability</h3>
+ <br />
+ To the fullest extent permitted by law, Cap shall not be liable
+ for any indirect, incidental, special, consequential, or punitive
+ damages, or any loss of profits or revenues, whether incurred
+ directly or indirectly, or any loss of data, use, goodwill, or
+ other intangible losses.
+ </li>
+ <li>
+ <h3>Indemnification</h3>
+ <br />
+ You agree to defend, indemnify, and hold harmless Cap and its
+ affiliates, officers, agents, and employees from and against any
+ claims, damages, obligations, losses, liabilities, costs, or debt,
+ and expenses (including but not limited to attorney's fees)
+ arising from your use of and access to our Services or your
+ violation of these Terms.
+ </li>
+ <li>
+ <h3>Governing Law and Jurisdiction</h3>
+ <br />
+ These Terms shall be governed by and construed in accordance with
+ the laws of the State of Delaware, without giving effect to any
+ principles of conflicts of law. Any legal action or proceeding
+ arising under these Terms will be brought exclusively in the
+ federal or state courts located in Dover, Delaware, and you
+ consent to personal jurisdiction and venue in such courts.
+ </li>
+ <li>
+ <h3>Changes to These Terms</h3>
+ <br />
+ We reserve the right, at our sole discretion, to modify or replace
+ these Terms at any time. If a revision is material, we will
+ provide at least 30 days' notice prior to any new terms taking
+ effect. By continuing to access or use our Services after any
+ revisions become effective, you agree to be bound by the revised
+ terms.
+ </li>
+ <li>
+ <h3>Contact Us</h3>
+ <br />
+ If you have any questions about these Terms, please contact us at
+ </li>
+ </ol>
+ <p>Last updated: 24th April 2024</p>
</div>
</div>
</div>
diff --git a/apps/web/components/pages/UpdatesPage.tsx b/apps/web/components/pages/UpdatesPage.tsx
index 9d0555c79..6aa1ce969 100644
--- a/apps/web/components/pages/UpdatesPage.tsx
+++ b/apps/web/components/pages/UpdatesPage.tsx
@@ -105,15 +105,14 @@ export const UpdatesPage = () => {
)}
</div>
<div className="flex flex-wrap gap-2">
- {post.metadata.tags &&
- post.metadata.tags.split(", ").map((tag, index) => (
- <p
- key={index}
- className="rounded-md bg-gray-3 font-medium px-2 py-0.5 text-sm text-gray-12"
- >
- {tag}
- </p>
- ))}
+ {post.metadata.tags?.split(", ").map((tag, index) => (
+ <p
+ key={index}
+ className="rounded-md bg-gray-3 font-medium px-2 py-0.5 text-sm text-gray-12"
+ >
+ {tag}
+ </p>
+ ))}
</div>
</div>
</Link>
diff --git a/apps/web/components/pages/_components/ComparePlans.tsx b/apps/web/components/pages/_components/ComparePlans.tsx
index 82977169a..bf6244f65 100644
--- a/apps/web/components/pages/_components/ComparePlans.tsx
+++ b/apps/web/components/pages/_components/ComparePlans.tsx
@@ -349,7 +349,7 @@ export const ComparePlans = () => {
</th>
{plans.map((plan) => (
<th
- key={plan.name + "-cta"}
+ key={`${plan.name}-cta`}
className={clsx(
"px-4 pb-6 border-b border-gray-5",
COLUMN_WIDTH,
diff --git a/apps/web/components/pages/seo/AgenciesPage.tsx b/apps/web/components/pages/seo/AgenciesPage.tsx
index a46d59fc7..b9f5e9a41 100644
--- a/apps/web/components/pages/seo/AgenciesPage.tsx
+++ b/apps/web/components/pages/seo/AgenciesPage.tsx
@@ -3,10 +3,9 @@
import { Button } from "@cap/ui";
import { Fit, Layout, useRive } from "@rive-app/react-canvas";
import clsx from "clsx";
-import { Clapperboard, Minus, Plus, Users, Zap } from "lucide-react";
+import { Clapperboard, Minus, Plus, Zap } from "lucide-react";
import { AnimatePresence, motion } from "motion/react";
import { memo, useEffect, useState } from "react";
-import { SeoPageTemplate } from "@/components/seo/SeoPageTemplate";
import type { SeoPageContent } from "@/components/seo/types";
const PlatformSupportArt = memo(() => {
@@ -529,7 +528,7 @@ export const AgenciesPage = () => {
key={cellIndex.toString()}
className={`px-6 py-4 text-[15px] text-gray-10 ${
rowIndex ===
- agenciesContent.comparisonTable!.rows.length - 1
+ agenciesContent.comparisonTable?.rows.length - 1
? ""
: "border-b border-gray-5"
}`}
diff --git a/apps/web/components/seo/SeoPageTemplate.tsx b/apps/web/components/seo/SeoPageTemplate.tsx
index 10b00ecad..5652d01f3 100644
--- a/apps/web/components/seo/SeoPageTemplate.tsx
+++ b/apps/web/components/seo/SeoPageTemplate.tsx
@@ -400,7 +400,7 @@ export const SeoPageTemplate = ({
key={cellIndex.toString()}
className={`px-6 py-4 text-[15px] text-gray-10 ${
rowIndex ===
- content.comparisonTable!.rows.length - 1
+ content.comparisonTable?.rows.length - 1
? ""
: "border-b border-gray-5"
}`}
diff --git a/apps/web/components/text/SimplePlans.tsx b/apps/web/components/text/SimplePlans.tsx
index 597d07d21..564a6bae6 100644
--- a/apps/web/components/text/SimplePlans.tsx
+++ b/apps/web/components/text/SimplePlans.tsx
@@ -1,5 +1,3 @@
-import React from "react";
-
export const SimplePlans = () => {
return (
<svg
diff --git a/apps/web/components/tools/MediaFormatConverter.tsx b/apps/web/components/tools/MediaFormatConverter.tsx
index 4e25de860..864f2f1f6 100644
--- a/apps/web/components/tools/MediaFormatConverter.tsx
+++ b/apps/web/components/tools/MediaFormatConverter.tsx
@@ -162,7 +162,7 @@ export const MediaFormatConverter = ({
const [isDragging, setIsDragging] = useState(false);
const [currentSourceFormat, setCurrentSourceFormat] = useState(sourceFormat);
const [currentTargetFormat, setCurrentTargetFormat] = useState(targetFormat);
- const [supportedFormats, setSupportedFormats] = useState<string[]>([
+ const [_supportedFormats, setSupportedFormats] = useState<string[]>([
"mp4",
"webm",
]);
@@ -228,7 +228,7 @@ export const MediaFormatConverter = ({
useEffect(() => {
const loadRemotionModules = async () => {
try {
- const parser = await import("@remotion/media-parser");
+ const _parser = await import("@remotion/media-parser");
setMediaEngineLoaded(true);
} catch (error) {
console.error("Failed to load Remotion modules:", error);
@@ -354,7 +354,7 @@ export const MediaFormatConverter = ({
} catch (err: any) {
console.error("Detailed conversion error:", err);
- if (MediaParser.hasBeenAborted && MediaParser.hasBeenAborted(err)) {
+ if (MediaParser.hasBeenAborted?.(err)) {
setError("Conversion was cancelled");
} else {
let errorMessage = "Conversion failed: ";
@@ -385,7 +385,7 @@ export const MediaFormatConverter = ({
const parser = await import("@remotion/media-parser");
const webcodecs = await import("@remotion/webcodecs");
- const handleProgress = (progressEvent: { progress: number }) => {
+ const _handleProgress = (progressEvent: { progress: number }) => {
setProgress(Math.min(Math.round(progressEvent.progress * 100), 99));
};
@@ -411,8 +411,8 @@ export const MediaFormatConverter = ({
setProgress(100);
trackEvent(`${conversionPath}_conversion_completed`, {
- fileSize: file!.size,
- fileName: file!.name,
+ fileSize: file?.size,
+ fileName: file?.name,
outputSize: blob.size,
});
} catch (error) {
@@ -424,9 +424,9 @@ export const MediaFormatConverter = ({
const convertVideoToGif = async (inputFile: File): Promise<void> => {
try {
const parser = await import("@remotion/media-parser");
- const webcodecs = await import("@remotion/webcodecs");
+ const _webcodecs = await import("@remotion/webcodecs");
- const onProgress = ({
+ const _onProgress = ({
overallProgress,
}: {
overallProgress: number | null;
@@ -555,14 +555,14 @@ export const MediaFormatConverter = ({
recordedChunksRef.current = [gifBlob];
trackEvent(`${conversionPath}_conversion_completed`, {
- fileSize: file!.size,
- fileName: file!.name,
+ fileSize: file?.size,
+ fileName: file?.name,
outputSize: gifBlob.size,
});
} catch (error) {
console.error("Error converting video to GIF:", error);
- if (MediaParser.hasBeenAborted && MediaParser.hasBeenAborted(error)) {
+ if (MediaParser.hasBeenAborted?.(error)) {
setError("Conversion was cancelled");
} else {
let errorMessage = "GIF conversion failed: ";
@@ -656,14 +656,14 @@ export const MediaFormatConverter = ({
recordedChunksRef.current = [blob];
trackEvent(`${conversionPath}_conversion_completed`, {
- fileSize: file!.size,
- fileName: file!.name,
+ fileSize: file?.size,
+ fileName: file?.name,
outputSize: blob.size,
});
} catch (error) {
console.error("Error converting video format:", error);
- if (MediaParser.hasBeenAborted && MediaParser.hasBeenAborted(error)) {
+ if (MediaParser.hasBeenAborted?.(error)) {
setError("Conversion was cancelled");
} else {
let errorMessage = "Conversion failed: ";
@@ -884,7 +884,7 @@ export const MediaFormatConverter = ({
min="1"
max="20"
value={gifQuality}
- onChange={(e) => setGifQuality(parseInt(e.target.value))}
+ onChange={(e) => setGifQuality(parseInt(e.target.value, 10))}
className="w-full"
/>
<span className="ml-2 text-sm w-8 text-gray-600">
@@ -905,7 +905,7 @@ export const MediaFormatConverter = ({
min="5"
max="30"
value={gifFps}
- onChange={(e) => setGifFps(parseInt(e.target.value))}
+ onChange={(e) => setGifFps(parseInt(e.target.value, 10))}
className="w-full"
/>
<span className="ml-2 text-sm w-8 text-gray-600">{gifFps}</span>
@@ -925,7 +925,7 @@ export const MediaFormatConverter = ({
max="1280"
step="80"
value={gifMaxWidth}
- onChange={(e) => setGifMaxWidth(parseInt(e.target.value))}
+ onChange={(e) => setGifMaxWidth(parseInt(e.target.value, 10))}
className="w-full"
/>
<span className="ml-2 text-sm w-10 text-gray-600">
diff --git a/apps/web/components/tools/SpeedController.tsx b/apps/web/components/tools/SpeedController.tsx
index 1f8ee341c..4d1f550d9 100644
--- a/apps/web/components/tools/SpeedController.tsx
+++ b/apps/web/components/tools/SpeedController.tsx
@@ -233,7 +233,7 @@ export const SpeedController = () => {
if (!supportsAudio) {
console.warn(
- "Selected MIME type does not support audio: " + selectedMimeType,
+ `Selected MIME type does not support audio: ${selectedMimeType}`,
);
includeAudio = false;
}
@@ -283,8 +283,8 @@ export const SpeedController = () => {
selectedSpeed < 1 ? "slowing_down" : "speeding_up"
}_completed`,
{
- fileSize: file!.size,
- fileName: file!.name,
+ fileSize: file?.size,
+ fileName: file?.name,
outputSize: blob.size,
speedFactor: selectedSpeed,
},
diff --git a/apps/web/components/tools/ToolsPageTemplate.tsx b/apps/web/components/tools/ToolsPageTemplate.tsx
index 94fb809ae..1c06bda22 100644
--- a/apps/web/components/tools/ToolsPageTemplate.tsx
+++ b/apps/web/components/tools/ToolsPageTemplate.tsx
@@ -14,7 +14,7 @@ const renderHTML = (content: string) => {
return <span dangerouslySetInnerHTML={{ __html: styledContent }} />;
};
-const LeftBlueHue = () => {
+const _LeftBlueHue = () => {
return (
<svg
className="absolute top-0 -left-24 z-0 opacity-20 pointer-events-none md:opacity-40"
diff --git a/apps/web/components/tools/TrimmingTool.tsx b/apps/web/components/tools/TrimmingTool.tsx
index 0aa564648..0451b19c0 100644
--- a/apps/web/components/tools/TrimmingTool.tsx
+++ b/apps/web/components/tools/TrimmingTool.tsx
@@ -193,7 +193,7 @@ export const TrimmingTool = () => {
if (videoPreviewRef.current) {
setVideoState((prev) => ({
...prev,
- currentTime: videoPreviewRef.current!.currentTime,
+ currentTime: videoPreviewRef.current?.currentTime,
}));
}
};
@@ -203,7 +203,7 @@ export const TrimmingTool = () => {
const video = videoPreviewRef.current;
if (
- isNaN(video.duration) ||
+ Number.isNaN(video.duration) ||
video.duration === Infinity ||
video.duration === 0
) {
@@ -400,7 +400,7 @@ export const TrimmingTool = () => {
if (!supportsAudio) {
console.warn(
- "Selected MIME type does not support audio: " + selectedMimeType,
+ `Selected MIME type does not support audio: ${selectedMimeType}`,
);
includeAudio = false;
}
@@ -413,9 +413,7 @@ export const TrimmingTool = () => {
if (
(video as any).mozHasAudio ||
Boolean((video as any).webkitAudioDecodedByteCount) ||
- Boolean(
- (video as any).audioTracks && (video as any).audioTracks.length,
- )
+ Boolean((video as any).audioTracks?.length)
) {
const audioContext = new (
window.AudioContext || (window as any).webkitAudioContext
@@ -470,8 +468,8 @@ export const TrimmingTool = () => {
}));
trackEvent("trimming_tool_trim_completed", {
- fileSize: fileState.file!.size,
- fileName: fileState.file!.name,
+ fileSize: fileState.file?.size,
+ fileName: fileState.file?.name,
outputSize: blob.size,
startTime: trimState.startTime,
endTime: trimState.endTime,
@@ -659,7 +657,7 @@ export const TrimmingTool = () => {
if (newEndTime > trimState.startTime && videoState.info) {
setTrimState((prev) => ({
...prev,
- endTime: Math.min(newEndTime, videoState.info!.duration),
+ endTime: Math.min(newEndTime, videoState.info?.duration),
}));
}
};
@@ -680,7 +678,7 @@ export const TrimmingTool = () => {
if (videoPreviewRef.current && videoState.currentTime < trimState.endTime) {
setTrimState((prev) => ({
...prev,
- startTime: videoPreviewRef.current!.currentTime,
+ startTime: videoPreviewRef.current?.currentTime,
}));
}
};
@@ -692,7 +690,7 @@ export const TrimmingTool = () => {
) {
setTrimState((prev) => ({
...prev,
- endTime: videoPreviewRef.current!.currentTime,
+ endTime: videoPreviewRef.current?.currentTime,
}));
}
};
@@ -722,7 +720,7 @@ export const TrimmingTool = () => {
window.removeEventListener("dragover", preventDefaults);
window.removeEventListener("drop", preventDefaults);
};
- }, []);
+ }, [cleanupResources, processingState.outputUrl]);
return (
<div className="w-full">
diff --git a/apps/web/lib/effect-react-query.ts b/apps/web/lib/effect-react-query.ts
index f9d0d651f..d71cd66a1 100644
--- a/apps/web/lib/effect-react-query.ts
+++ b/apps/web/lib/effect-react-query.ts
@@ -238,10 +238,10 @@ export function makeUseEffectMutation<R>(
const mutationFn = options.mutationFn;
const throwOnDefect = options.throwOnDefect ?? false;
const throwOnError = options.throwOnError;
- const onMutate = options.onMutate;
- const onSuccess = options.onSuccess;
- const onError = options.onError;
- const onSettled = options.onSettled;
+ const _onMutate = options.onMutate;
+ const _onSuccess = options.onSuccess;
+ const _onError = options.onError;
+ const _onSettled = options.onSettled;
const runtime = useEffectRuntime();
diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs
index 0a5d0cfb4..558f34234 100644
--- a/apps/web/next.config.mjs
+++ b/apps/web/next.config.mjs
@@ -2,8 +2,8 @@
import("dotenv").then(({ config }) => config({ path: "../../.env" }));
-import fs from "fs";
-import path from "path";
+import fs from "node:fs";
+import path from "node:path";
const packageJson = JSON.parse(
fs.readFileSync(path.resolve("./package.json"), "utf8"),
diff --git a/apps/web/public/gif.worker.js b/apps/web/public/gif.worker.js
index 9b46fc07c..f01a64fd4 100644
--- a/apps/web/public/gif.worker.js
+++ b/apps/web/public/gif.worker.js
@@ -3,10 +3,10 @@
function s(o, u) {
if (!n[o]) {
if (!t[o]) {
- var a = typeof require == "function" && require;
+ var a = typeof require === "function" && require;
if (!u && a) return a(o, !0);
if (i) return i(o, !0);
- var f = new Error("Cannot find module '" + o + "'");
+ var f = new Error(`Cannot find module '${o}'`);
throw ((f.code = "MODULE_NOT_FOUND"), f);
}
var l = (n[o] = { exports: {} });
@@ -26,13 +26,13 @@
}
return n[o].exports;
}
- var i = typeof require == "function" && require;
+ var i = typeof require === "function" && require;
for (var o = 0; o < r.length; o++) s(r[o]);
return s;
})(
{
1: [
- (require, module, exports) => {
+ (require, module, _exports) => {
var NeuQuant = require("./TypedNeuQuant.js");
var LZWEncoder = require("./LZWEncoder.js");
function ByteArray() {
@@ -108,10 +108,7 @@
};
GIFEncoder.prototype.addFrame = function (imageData) {
this.image = imageData;
- this.colorTab =
- this.globalPalette && this.globalPalette.slice
- ? this.globalPalette
- : null;
+ this.colorTab = this.globalPalette?.slice ? this.globalPalette : null;
this.getImagePixels();
this.analyzePixels();
if (this.globalPalette === true) this.globalPalette = this.colorTab;
@@ -143,12 +140,7 @@
this.globalPalette = palette;
};
GIFEncoder.prototype.getGlobalPalette = function () {
- return (
- (this.globalPalette &&
- this.globalPalette.slice &&
- this.globalPalette.slice(0)) ||
- this.globalPalette
- );
+ return this.globalPalette?.slice?.(0) || this.globalPalette;
};
GIFEncoder.prototype.writeHeader = function () {
this.out.writeUTFBytes("GIF89a");
@@ -174,7 +166,7 @@
this.transIndex = this.findClosest(this.transparent, true);
}
};
- GIFEncoder.prototype.indexPixels = function (imgq) {
+ GIFEncoder.prototype.indexPixels = function (_imgq) {
var nPix = this.pixels.length / 3;
this.indexedPixels = new Uint8Array(nPix);
var k = 0;
@@ -225,7 +217,7 @@
],
};
if (!kernel || !kernels[kernel]) {
- throw "Unknown dithering kernel: " + kernel;
+ throw `Unknown dithering kernel: ${kernel}`;
}
var ds = kernels[kernel];
var index = 0,
@@ -237,8 +229,8 @@
for (var y = 0; y < height; y++) {
if (serpentine) direction = direction * -1;
for (
- var x = direction == 1 ? 0 : width - 1,
- xend = direction == 1 ? width : 0;
+ var x = direction === 1 ? 0 : width - 1,
+ xend = direction === 1 ? width : 0;
x !== xend;
x += direction
) {
@@ -258,8 +250,8 @@
var eg = g1 - g2;
var eb = b1 - b2;
for (
- var i = direction == 1 ? 0 : ds.length - 1,
- end = direction == 1 ? ds.length : 0;
+ var i = direction === 1 ? 0 : ds.length - 1,
+ end = direction === 1 ? ds.length : 0;
i !== end;
i += direction
) {
@@ -301,7 +293,7 @@
if (this.neuQuant && !used) {
return this.neuQuant.lookupRGB(r, g, b);
}
- var c = b | (g << 8) | (r << 16);
+ var _c = b | (g << 8) | (r << 16);
var minpos = 0;
var dmin = 256 * 256 * 256;
var len = this.colorTab.length;
@@ -409,7 +401,7 @@
{ "./LZWEncoder.js": 2, "./TypedNeuQuant.js": 3 },
],
2: [
- (require, module, exports) => {
+ (_require, module, _exports) => {
var EOF = -1;
var BITS = 12;
var HSIZE = 5003;
@@ -459,7 +451,7 @@
hsize_reg = HSIZE;
cl_hash(hsize_reg);
output(ClearCode, outs);
- outer_loop: while ((c = nextPixel()) != EOF) {
+ outer_loop: while ((c = nextPixel()) !== EOF) {
fcode = (c << BITS) + ent;
i = (c << hshift) ^ ent;
if (htab[i] === fcode) {
@@ -527,11 +519,11 @@
clear_flg = false;
} else {
++n_bits;
- if (n_bits == BITS) maxcode = 1 << BITS;
+ if (n_bits === BITS) maxcode = 1 << BITS;
else maxcode = MAXCODE(n_bits);
}
}
- if (code == EOFCode) {
+ if (code === EOFCode) {
while (cur_bits > 0) {
char_out(cur_accum & 255, outs);
cur_accum >>= 8;
@@ -547,7 +539,7 @@
{},
],
3: [
- (require, module, exports) => {
+ (_require, module, _exports) => {
var ncycles = 100;
var netsize = 256;
var maxnetpos = netsize - 1;
@@ -555,7 +547,7 @@
var intbiasshift = 16;
var intbias = 1 << intbiasshift;
var gammashift = 10;
- var gamma = 1 << gammashift;
+ var _gamma = 1 << gammashift;
var betashift = 10;
var beta = intbias >> betashift;
var betagamma = intbias << (gammashift - betashift);
@@ -566,7 +558,7 @@
var radiusdec = 30;
var alphabiasshift = 10;
var initalpha = 1 << alphabiasshift;
- var alphadec;
+ var _alphadec;
var radbiasshift = 8;
var radbias = 1 << radbiasshift;
var alpharadbshift = alphabiasshift + radbiasshift;
@@ -680,7 +672,7 @@
}
}
q = network[smallpos];
- if (i != smallpos) {
+ if (i !== smallpos) {
j = q[0];
q[0] = p[0];
p[0] = j;
@@ -694,7 +686,7 @@
q[3] = p[3];
p[3] = j;
}
- if (smallval != previouscol) {
+ if (smallval !== previouscol) {
netindex[previouscol] = (startpos + i) >> 1;
for (j = previouscol + 1; j < smallval; j++) netindex[j] = i;
previouscol = smallval;
@@ -835,7 +827,7 @@
{},
],
4: [
- (require, module, exports) => {
+ (require, _module, _exports) => {
var GIFEncoder, renderFrame;
GIFEncoder = require("./GIFEncoder.js");
renderFrame = (frame) => {
diff --git a/apps/web/tools/compress-images.js b/apps/web/tools/compress-images.js
index ff88ed09e..3d9464a8f 100644
--- a/apps/web/tools/compress-images.js
+++ b/apps/web/tools/compress-images.js
@@ -9,12 +9,12 @@
* replaces the original files with optimized versions.
*/
-const fs = require("fs");
-const path = require("path");
-const { execSync } = require("child_process");
-const readline = require("readline");
-const os = require("os");
-const crypto = require("crypto");
+const fs = require("node:fs");
+const path = require("node:path");
+const { execSync } = require("node:child_process");
+const readline = require("node:readline");
+const os = require("node:os");
+const crypto = require("node:crypto");
// Create a unique temporary directory for installation
function createTempInstallDir() {
@@ -38,7 +38,7 @@ function loadDependencies() {
const chalk = require("chalk");
return { sharp, glob, chalk };
- } catch (e) {
+ } catch (_e) {
// If dependencies are missing, install them in a temporary directory
console.log(`Required dependencies not found. Installing temporarily...`);
@@ -84,7 +84,7 @@ function loadDependencies() {
if (tempDir && fs.existsSync(tempDir)) {
try {
fs.rmSync(tempDir, { recursive: true });
- } catch (e) {}
+ } catch (_e) {}
}
process.exit(1);
@@ -105,7 +105,7 @@ async function askForConfirmation(question) {
const rl = createInterface();
return new Promise((resolve) => {
- rl.question(question + " (y/n): ", (answer) => {
+ rl.question(`${question} (y/n): `, (answer) => {
rl.close();
resolve(answer.toLowerCase() === "y" || answer.toLowerCase() === "yes");
});
@@ -207,7 +207,7 @@ async function main() {
}
// Clear the progress line
- process.stdout.write("\r" + " ".repeat(100) + "\r");
+ process.stdout.write(`\r${" ".repeat(100)}\r`);
// Calculate total savings
const totalSavingsMB = (
@@ -219,21 +219,21 @@ async function main() {
100
).toFixed(2);
- console.log("\n\n" + chalk.blue("📊 ===== Compression Summary ====="));
+ console.log(`\n\n${chalk.blue("📊 ===== Compression Summary =====")}`);
console.log(
chalk.blue(
- `📦 Original Size: ${chalk.yellow((totalSize.original / (1024 * 1024)).toFixed(2) + " MB")}`,
+ `📦 Original Size: ${chalk.yellow(`${(totalSize.original / (1024 * 1024)).toFixed(2)} MB`)}`,
),
);
console.log(
chalk.blue(
- `📦 Compressed Size: ${chalk.yellow((totalSize.compressed / (1024 * 1024)).toFixed(2) + " MB")}`,
+ `📦 Compressed Size: ${chalk.yellow(`${(totalSize.compressed / (1024 * 1024)).toFixed(2)} MB`)}`,
),
);
console.log(
- chalk.blue(
- `💰 Saved: ${chalk.green(totalSavingsMB + " MB")} (${chalk.green(totalSavingsPercent + "%")})`,
- ) + "\n",
+ `${chalk.blue(
+ `💰 Saved: ${chalk.green(`${totalSavingsMB} MB`)} (${chalk.green(`${totalSavingsPercent}%`)})`,
+ )}\n`,
);
if (failedImages.length > 0) {
@@ -289,7 +289,7 @@ async function main() {
}
// Clear the progress line
- process.stdout.write("\r" + " ".repeat(100) + "\r");
+ process.stdout.write(`\r${" ".repeat(100)}\r`);
// Remove compressed directory
fs.rmSync(compressedDir, { recursive: true, force: true });
@@ -312,7 +312,7 @@ async function main() {
chalk.blue(" 2. Run this tool again if you decide to apply changes"),
);
console.log(
- chalk.blue(" 3. Or manually replace images you want to use") + "\n",
+ `${chalk.blue(" 3. Or manually replace images you want to use")}\n`,
);
}
}
diff --git a/apps/web/utils/blog.ts b/apps/web/utils/blog.ts
index 4013aa610..800c17cc9 100644
--- a/apps/web/utils/blog.ts
+++ b/apps/web/utils/blog.ts
@@ -1,5 +1,5 @@
-import fs from "fs";
-import path from "path";
+import fs from "node:fs";
+import path from "node:path";
import { getAllInteractiveBlogPosts } from "./blog-registry";
export type PostMetadata = {
diff --git a/apps/web/utils/changelog.ts b/apps/web/utils/changelog.ts
index 1527f1f30..d6304914f 100644
--- a/apps/web/utils/changelog.ts
+++ b/apps/web/utils/changelog.ts
@@ -1,5 +1,5 @@
-import fs from "fs";
-import path from "path";
+import fs from "node:fs";
+import path from "node:path";
export type ChangelogMetadata = {
title: string;
@@ -12,9 +12,9 @@ export type ChangelogMetadata = {
function parseFrontmatter(fileContent: string) {
const frontmatterRegex = /---\s*([\s\S]*?)\s*---/;
const match = frontmatterRegex.exec(fileContent);
- const frontMatterBlock = match![1];
+ const frontMatterBlock = match?.[1];
const content = fileContent.replace(frontmatterRegex, "").trim();
- const frontMatterLines = frontMatterBlock!.trim().split("\n");
+ const frontMatterLines = frontMatterBlock?.trim().split("\n");
const metadata: Partial<ChangelogMetadata> = {};
frontMatterLines.forEach((line) => {
diff --git a/apps/web/utils/platform.tsx b/apps/web/utils/platform.tsx
index ace400a53..df06df54f 100644
--- a/apps/web/utils/platform.tsx
+++ b/apps/web/utils/platform.tsx
@@ -50,11 +50,11 @@ export const getPlatformIcon = (platform: string | null): React.ReactNode => {
export const getVersionText = (platform: string | null): React.ReactNode => {
if (platform === "macos") {
- return <>macOS 13.1+ recommended</>;
+ return "macOS 13.1+ recommended";
} else if (platform === "windows") {
- return <>Windows 10+ recommended</>;
+ return "Windows 10+ recommended";
} else {
- return <>macOS 13.1+ recommended</>;
+ return "macOS 13.1+ recommended";
}
};
diff --git a/apps/web/utils/video/ffmpeg/helpers.ts b/apps/web/utils/video/ffmpeg/helpers.ts
index 7bf130882..d6faa89db 100644
--- a/apps/web/utils/video/ffmpeg/helpers.ts
+++ b/apps/web/utils/video/ffmpeg/helpers.ts
@@ -35,7 +35,7 @@ export function generateMasterPlaylist(
xStreamInfo?: string,
) {
const streamInfo = xStreamInfo
- ? xStreamInfo + ',AUDIO="audio"'
+ ? `${xStreamInfo},AUDIO="audio"`
: `BANDWIDTH=${bandwidth},RESOLUTION=${resolution},AUDIO="audio"`;
const masterPlaylist = `#EXTM3U
#EXT-X-VERSION:4
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs
index 93c73127b..28171fa99 100644
--- a/crates/editor/src/editor.rs
+++ b/crates/editor/src/editor.rs
@@ -81,6 +81,7 @@ impl Renderer {
uniforms: ProjectUniforms,
finished: oneshot::Sender<()>,
cursor: Arc<CursorEvents>,
+ #[allow(dead_code)]
frame_number: u32,
}
diff --git a/crates/enc-ffmpeg/src/video/h264.rs b/crates/enc-ffmpeg/src/video/h264.rs
index e709c7d80..78e0099a0 100644
--- a/crates/enc-ffmpeg/src/video/h264.rs
+++ b/crates/enc-ffmpeg/src/video/h264.rs
@@ -133,6 +133,7 @@ impl H264EncoderBuilder {
Err(last_error.unwrap_or(H264EncoderError::CodecNotFound))
}
+ #[allow(clippy::too_many_arguments)]
fn build_with_codec(
codec: Codec,
encoder_options: Dictionary<'static>,
@@ -384,7 +385,12 @@ fn get_codec_and_options(
preset: H264Preset,
) -> Vec<(Codec, Dictionary<'static>)> {
let keyframe_interval_secs = 2;
- let keyframe_interval = keyframe_interval_secs * config.frame_rate.numerator();
+ let denominator = config.frame_rate.denominator();
+ let frames_per_sec = config.frame_rate.numerator() as f64
+ / if denominator == 0 { 1 } else { denominator } as f64;
+ let keyframe_interval = (keyframe_interval_secs as f64 * frames_per_sec)
+ .round()
+ .max(1.0) as i32;
let keyframe_interval_str = keyframe_interval.to_string();
let encoder_priority: &[&str] = if cfg!(target_os = "macos") {
diff --git a/crates/frame-converter/src/d3d11.rs b/crates/frame-converter/src/d3d11.rs
index 4fa7bc344..dffc31055 100644
--- a/crates/frame-converter/src/d3d11.rs
+++ b/crates/frame-converter/src/d3d11.rs
@@ -566,6 +566,17 @@ unsafe fn copy_mapped_to_frame(src: *const u8, src_stride: usize, frame: &mut fr
);
}
}
+ Pixel::YUYV422 => {
+ let bytes_per_pixel = 2;
+ let row_bytes = frame.width() as usize * bytes_per_pixel;
+ for y in 0..height {
+ ptr::copy_nonoverlapping(
+ src.add(y * src_stride),
+ frame.data_mut(0).as_mut_ptr().add(y * frame.stride(0)),
+ row_bytes,
+ );
+ }
+ }
_ => {}
}
}
diff --git a/crates/frame-converter/src/videotoolbox.rs b/crates/frame-converter/src/videotoolbox.rs
index 78fa04c5c..6703dad04 100644
--- a/crates/frame-converter/src/videotoolbox.rs
+++ b/crates/frame-converter/src/videotoolbox.rs
@@ -1,5 +1,6 @@
use crate::{ConversionConfig, ConvertError, ConverterBackend, FrameConverter};
use ffmpeg::{format::Pixel, frame};
+use parking_lot::Mutex;
use std::{
ffi::c_void,
ptr,
@@ -83,8 +84,12 @@ fn pixel_to_cv_format(pixel: Pixel) -> Option<u32> {
}
}
+struct SessionHandle(VTPixelTransferSessionRef);
+
+unsafe impl Send for SessionHandle {}
+
pub struct VideoToolboxConverter {
- session: VTPixelTransferSessionRef,
+ session: Mutex<SessionHandle>,
input_format: Pixel,
input_cv_format: u32,
output_format: Pixel,
@@ -133,7 +138,7 @@ impl VideoToolboxConverter {
);
Ok(Self {
- session,
+ session: Mutex::new(SessionHandle(session)),
input_format: config.input_format,
input_cv_format,
output_format: config.output_format,
@@ -248,10 +253,11 @@ impl VideoToolboxConverter {
impl Drop for VideoToolboxConverter {
fn drop(&mut self) {
- if !self.session.is_null() {
+ let session = self.session.get_mut().0;
+ if !session.is_null() {
unsafe {
- VTPixelTransferSessionInvalidate(self.session);
- CFRelease(self.session as *const c_void);
+ VTPixelTransferSessionInvalidate(session);
+ CFRelease(session as *const c_void);
}
}
}
@@ -272,8 +278,11 @@ impl FrameConverter for VideoToolboxConverter {
let input_buffer = self.create_input_pixel_buffer(&input)?;
let output_buffer = self.create_output_pixel_buffer()?;
- let status = unsafe {
- VTPixelTransferSessionTransferImage(self.session, input_buffer, output_buffer)
+ let status = {
+ let session_guard = self.session.lock();
+ unsafe {
+ VTPixelTransferSessionTransferImage(session_guard.0, input_buffer, output_buffer)
+ }
};
unsafe {
@@ -321,6 +330,3 @@ impl FrameConverter for VideoToolboxConverter {
Some(self.verified_hardware.load(Ordering::Relaxed))
}
}
-
-unsafe impl Send for VideoToolboxConverter {}
-unsafe impl Sync for VideoToolboxConverter {}
diff --git a/crates/recording/examples/encoding-benchmark.rs b/crates/recording/examples/encoding-benchmark.rs
index 6b1219566..456a45d3c 100644
--- a/crates/recording/examples/encoding-benchmark.rs
+++ b/crates/recording/examples/encoding-benchmark.rs
@@ -110,9 +110,8 @@ fn run_synthetic_benchmark(
let start = Instant::now();
let mut next_frame_time = start;
- let mut frame_sequence = 0u64;
- for _ in 0..total_frames {
+ for frame_sequence in 0..total_frames {
let now = Instant::now();
if now < next_frame_time {
std::thread::sleep(next_frame_time - now);
diff --git a/crates/recording/examples/recording-benchmark.rs b/crates/recording/examples/recording-benchmark.rs
index 75cf11576..87adbe7da 100644
--- a/crates/recording/examples/recording-benchmark.rs
+++ b/crates/recording/examples/recording-benchmark.rs
@@ -71,8 +71,8 @@ async fn run_recording_benchmark(
println!("\n=== Recording Benchmark Results ===\n");
println!("Recording duration: {:.2}s", config.duration_secs);
- println!("Stop/finalize time: {:?}", stop_duration);
- println!("Total time: {:?}", total_duration);
+ println!("Stop/finalize time: {stop_duration:?}");
+ println!("Total time: {total_duration:?}");
println!("Output path: {}", result.project_path.display());
let content_dir = result
@@ -85,8 +85,8 @@ async fn run_recording_benchmark(
let size_mb = metadata.len() as f64 / (1024.0 * 1024.0);
let bitrate_mbps = size_mb * 8.0 / config.duration_secs as f64;
println!("\nScreen recording:");
- println!(" Size: {:.2} MB", size_mb);
- println!(" Bitrate: {:.2} Mbps", bitrate_mbps);
+ println!(" Size: {size_mb:.2} MB");
+ println!(" Bitrate: {bitrate_mbps:.2} Mbps");
}
if include_camera {
@@ -94,8 +94,8 @@ async fn run_recording_benchmark(
let size_mb = metadata.len() as f64 / (1024.0 * 1024.0);
let bitrate_mbps = size_mb * 8.0 / config.duration_secs as f64;
println!("\nCamera recording:");
- println!(" Size: {:.2} MB", size_mb);
- println!(" Bitrate: {:.2} Mbps", bitrate_mbps);
+ println!(" Size: {size_mb:.2} MB");
+ println!(" Bitrate: {bitrate_mbps:.2} Mbps");
}
}
@@ -156,10 +156,7 @@ async fn stress_test_recording(
cycle_duration_secs: u64,
) -> Result<(), Box<dyn std::error::Error>> {
println!("\n=== Recording Stress Test ===\n");
- println!(
- "Running {} cycles of {}s recordings\n",
- cycles, cycle_duration_secs
- );
+ println!("Running {cycles} cycles of {cycle_duration_secs}s recordings\n");
let mut start_times = Vec::new();
let mut stop_times = Vec::new();
@@ -199,18 +196,18 @@ async fn stress_test_recording(
let min_start = start_times.iter().min().unwrap();
println!("Start times:");
- println!(" Average: {:?}", avg_start);
- println!(" Min: {:?}", min_start);
- println!(" Max: {:?}", max_start);
+ println!(" Average: {avg_start:?}");
+ println!(" Min: {min_start:?}");
+ println!(" Max: {max_start:?}");
let avg_stop: Duration = stop_times.iter().sum::<Duration>() / cycles;
let max_stop = stop_times.iter().max().unwrap();
let min_stop = stop_times.iter().min().unwrap();
println!("\nStop times:");
- println!(" Average: {:?}", avg_stop);
- println!(" Min: {:?}", min_stop);
- println!(" Max: {:?}", max_stop);
+ println!(" Average: {avg_stop:?}");
+ println!(" Min: {min_stop:?}");
+ println!(" Max: {max_stop:?}");
Ok(())
}
diff --git a/crates/recording/src/feeds/camera.rs b/crates/recording/src/feeds/camera.rs
index 8de67cc35..2c2ffe0f1 100644
--- a/crates/recording/src/feeds/camera.rs
+++ b/crates/recording/src/feeds/camera.rs
@@ -559,21 +559,18 @@ async fn setup_camera(
if let Ok(bytes) = frame.native().bytes() {
use cap_mediafoundation_utils::IMFMediaBufferExt;
- use windows::Win32::Media::MediaFoundation::{
- IMFMediaBuffer, MFCreateMemoryBuffer,
- };
- use windows::core::Interface;
+ use windows::Win32::Media::MediaFoundation::MFCreateMemoryBuffer;
let data_len = bytes.len();
if let Ok(buffer) = (unsafe { MFCreateMemoryBuffer(data_len as u32) }) {
- if let Ok(mut lock) = buffer.lock_mut() {
+ if let Ok(mut lock) = buffer.lock() {
lock.copy_from_slice(&*bytes);
drop(lock);
let _ = unsafe { buffer.SetCurrentLength(data_len as u32) };
let _ = native_recipient
.tell(NewNativeFrame(NativeCameraFrame {
- buffer,
+ buffer: std::sync::Arc::new(std::sync::Mutex::new(buffer)),
pixel_format: frame.native().pixel_format,
width: frame.native().width as u32,
height: frame.native().height as u32,
diff --git a/crates/recording/src/output_pipeline/win.rs b/crates/recording/src/output_pipeline/win.rs
index d1779f212..b1c2cae30 100644
--- a/crates/recording/src/output_pipeline/win.rs
+++ b/crates/recording/src/output_pipeline/win.rs
@@ -386,16 +386,14 @@ fn duration_to_timespan(duration: Duration) -> TimeSpan {
#[derive(Clone)]
pub struct NativeCameraFrame {
- pub buffer: windows::Win32::Media::MediaFoundation::IMFMediaBuffer,
+ pub buffer:
+ std::sync::Arc<std::sync::Mutex<windows::Win32::Media::MediaFoundation::IMFMediaBuffer>>,
pub pixel_format: cap_camera_windows::PixelFormat,
pub width: u32,
pub height: u32,
pub timestamp: Timestamp,
}
-unsafe impl Send for NativeCameraFrame {}
-unsafe impl Sync for NativeCameraFrame {}
-
impl VideoFrame for NativeCameraFrame {
fn timestamp(&self) -> Timestamp {
self.timestamp
@@ -708,7 +706,11 @@ fn upload_mf_buffer_to_texture(
_ => 2,
};
- let lock = frame.buffer.lock()?;
+ let buffer_guard = frame
+ .buffer
+ .lock()
+ .map_err(|_| windows::core::Error::from(windows::core::HRESULT(-1)))?;
+ let lock = buffer_guard.lock()?;
let data = &*lock;
let row_pitch = frame.width * bytes_per_pixel;
diff --git a/crates/recording/src/sources/mod.rs b/crates/recording/src/sources/mod.rs
index e86649ec5..686ac8af1 100644
--- a/crates/recording/src/sources/mod.rs
+++ b/crates/recording/src/sources/mod.rs
@@ -7,3 +7,4 @@ pub mod screen_capture;
pub use camera::*;
pub use microphone::*;
pub use native_camera::*;
+pub use screen_capture::*;
diff --git a/crates/scap-targets/src/main.rs b/crates/scap-targets/src/main.rs
index 8994ce11b..8a836ddb5 100644
--- a/crates/scap-targets/src/main.rs
+++ b/crates/scap-targets/src/main.rs
@@ -30,7 +30,7 @@ fn main() {
);
if refresh_rate > 0.0 {
- println!(" Refresh Rate: {} Hz", refresh_rate);
+ println!(" Refresh Rate: {refresh_rate} Hz");
} else {
println!(" Refresh Rate: Unknown");
}
@@ -83,7 +83,7 @@ fn main() {
}
if let Some(owner) = window.owner_name() {
- println!(" Application: {}", owner);
+ println!(" Application: {owner}");
} else {
println!(" Application: Unknown");
}
@@ -104,7 +104,7 @@ fn main() {
if let Some(topmost) = scap_targets::Window::get_topmost_at_cursor()
&& let Some(owner) = topmost.owner_name()
{
- println!("Testing icon extraction for: {}", owner);
+ println!("Testing icon extraction for: {owner}");
match topmost.app_icon() {
Some(icon_data) => {
@@ -134,7 +134,7 @@ fn main() {
if let Some((topmost_window, level)) = relevant_windows.first()
&& let Some(owner) = topmost_window.owner_name()
{
- print!("\rTopmost: {} (level: {}) ", owner, level);
+ print!("\rTopmost: {owner} (level: {level}) ");
std::io::Write::flush(&mut std::io::stdout()).unwrap();
}
diff --git a/infra/sst.config.ts b/infra/sst.config.ts
index 0437ff74b..c148670f8 100644
--- a/infra/sst.config.ts
+++ b/infra/sst.config.ts
@@ -1,16 +1,14 @@
/// <reference path="./.sst/platform/config.d.ts" />
-import type { Input, Output } from "@pulumi/pulumi";
-
const GITHUB_ORG = "CapSoftware";
-const GITHUB_REPO = "Cap";
-const GITHUB_APP_ID = "1196731";
+const _GITHUB_REPO = "Cap";
+const _GITHUB_APP_ID = "1196731";
const VERCEL_PROJECT_NAME = "cap-web";
const VERCEL_TEAM_SLUG = "mc-ilroy";
const VERCEL_TEAM_ID = "team_vbZRU7UW78rpKKIj4c9PfFAC";
-const CLOUDFLARE_ACCOUNT_ID = "3de2dd633194481d80f68f55257bdbaa";
+const _CLOUDFLARE_ACCOUNT_ID = "3de2dd633194481d80f68f55257bdbaa";
const AXIOM_API_TOKEN = "xaat-c0704be6-e942-4935-b068-3b491d7cc00f";
const AXIOM_DATASET = "cap-otel";
@@ -103,7 +101,7 @@ export default $config({
? aws.cloudfront.getDistributionOutput({ id: "E36XSZEM0VIIYB" })
: null;
- const vercelUser = new aws.iam.User("VercelUser", { forceDestroy: false });
+ const _vercelUser = new aws.iam.User("VercelUser", { forceDestroy: false });
const vercelProject = vercel.getProjectOutput({
name: VERCEL_PROJECT_NAME,
diff --git a/packages/config/vite/index.ts b/packages/config/vite/index.ts
index 58672de10..9d5b8c64d 100644
--- a/packages/config/vite/index.ts
+++ b/packages/config/vite/index.ts
@@ -1,5 +1,5 @@
+import path from "node:path";
import react from "@vitejs/plugin-react";
-import path from "path";
import { defineConfig } from "vite";
// https://vitejs.dev/config/
diff --git a/packages/config/vite/relativeAliasResolver.ts b/packages/config/vite/relativeAliasResolver.ts
index 8c624fea2..1681ff558 100644
--- a/packages/config/vite/relativeAliasResolver.ts
+++ b/packages/config/vite/relativeAliasResolver.ts
@@ -1,5 +1,5 @@
-import fs from "fs/promises";
-import path from "path";
+import fs from "node:fs/promises";
+import path from "node:path";
import type { Alias } from "vite";
const pkgJsonCache = new Map();
@@ -12,8 +12,8 @@ const resolver: Alias = {
const [_, sourcePath] = source.split("~/");
- if (importer!.includes("/src/")) {
- const [pkg] = importer!.split("/src/");
+ if (importer?.includes("/src/")) {
+ const [pkg] = importer?.split("/src/");
root = `${pkg!}/src`;
} else {
diff --git a/packages/database/auth/auth-options.ts b/packages/database/auth/auth-options.ts
index 388b480b9..2d78b247e 100644
--- a/packages/database/auth/auth-options.ts
+++ b/packages/database/auth/auth-options.ts
@@ -1,6 +1,5 @@
import crypto from "node:crypto";
import { serverEnv } from "@cap/env";
-import { Organisation, User } from "@cap/web-domain";
import { eq } from "drizzle-orm";
import type { NextAuthOptions } from "next-auth";
import { getServerSession as _getServerSession } from "next-auth";
@@ -11,7 +10,7 @@ import type { Provider } from "next-auth/providers/index";
import WorkOSProvider from "next-auth/providers/workos";
import { sendEmail } from "../emails/config.ts";
import { db } from "../index.ts";
-import { organizationMembers, organizations, users } from "../schema.ts";
+import { users } from "../schema.ts";
import { isEmailAllowedForSignup } from "./domain-utils.ts";
import { DrizzleAdapter } from "./drizzle-adapter.ts";
diff --git a/packages/database/types/index.ts b/packages/database/types/index.ts
index 47ddf78fa..e6c55b6c9 100644
--- a/packages/database/types/index.ts
+++ b/packages/database/types/index.ts
@@ -1,3 +1 @@
export * from "./metadata";
-
-import type * as _ from "./next-auth";
diff --git a/packages/database/types/next-auth.d.ts b/packages/database/types/next-auth.d.ts
index bb10f1c95..7c3e0a41d 100644
--- a/packages/database/types/next-auth.d.ts
+++ b/packages/database/types/next-auth.d.ts
@@ -1,5 +1,4 @@
-import type { JWT } from "next-auth/jwt";
-import type { Session, User } from "next-auth";
+import type { User } from "next-auth";
type UserId = string;
diff --git a/packages/ui/src/components/Pagination.tsx b/packages/ui/src/components/Pagination.tsx
index bc8400edf..0455869f3 100644
--- a/packages/ui/src/components/Pagination.tsx
+++ b/packages/ui/src/components/Pagination.tsx
@@ -5,7 +5,6 @@ import { type ButtonProps, buttonVariants } from "./Button";
const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (
<nav
- role="navigation"
aria-label="pagination"
className={classNames("flex justify-center mx-auto w-full", className)}
{...props}
diff --git a/packages/ui/style/tailwind.config.js b/packages/ui/style/tailwind.config.js
index 9cfbb0c3c..d91300eff 100644
--- a/packages/ui/style/tailwind.config.js
+++ b/packages/ui/style/tailwind.config.js
@@ -75,7 +75,6 @@ module.exports = (__app, _options) => {
gray: getColorScale("gray"),
"gray-a": getColorScale("gray-a", true),
blue: getColorScale("blue"),
- red: getColorScale("red"),
border: "hsl(var(--border))",
input: "hsl(var(--input))",
ring: "hsl(var(--ring))",
diff --git a/packages/web-backend/src/Auth.ts b/packages/web-backend/src/Auth.ts
index 08cebb6cf..ae3a26442 100644
--- a/packages/web-backend/src/Auth.ts
+++ b/packages/web-backend/src/Auth.ts
@@ -4,7 +4,6 @@ import {
CurrentUser,
type DatabaseError,
HttpAuthMiddleware,
- type ImageUpload,
} from "@cap/web-domain";
import { HttpApiError, HttpServerRequest } from "@effect/platform";
import * as Dz from "drizzle-orm";
diff --git a/packages/web-backend/src/S3Buckets/index.ts b/packages/web-backend/src/S3Buckets/index.ts
index 67f53cabd..0e9b1bc6e 100644
--- a/packages/web-backend/src/S3Buckets/index.ts
+++ b/packages/web-backend/src/S3Buckets/index.ts
@@ -1,6 +1,5 @@
import * as S3 from "@aws-sdk/client-s3";
import * as CloudFrontPresigner from "@aws-sdk/cloudfront-signer";
-import { fromContainerMetadata, fromSSO } from "@aws-sdk/credential-providers";
import { decrypt } from "@cap/database/crypto";
import type { S3Bucket, User } from "@cap/web-domain";
import { Config, Effect, Layer, Option } from "effect";
diff --git a/packages/web-domain/src/Folder.ts b/packages/web-domain/src/Folder.ts
index 561badfb8..824b49955 100644
--- a/packages/web-domain/src/Folder.ts
+++ b/packages/web-domain/src/Folder.ts
@@ -1,6 +1,6 @@
import { HttpApiSchema } from "@effect/platform";
import { Rpc, RpcGroup } from "@effect/rpc";
-import { Effect, Schema } from "effect";
+import { Schema } from "effect";
import { RpcAuthMiddleware } from "./Authentication.ts";
import { InternalError } from "./Errors.ts";
import { OrganisationId } from "./Organisation.ts";
diff --git a/scripts/analytics/delete-all-data.js b/scripts/analytics/delete-all-data.js
index f0328fa91..ccbbc4de5 100644
--- a/scripts/analytics/delete-all-data.js
+++ b/scripts/analytics/delete-all-data.js
@@ -103,7 +103,7 @@ async function deleteAllData() {
},
);
ok = true;
- } catch (e1) {
+ } catch (_e1) {
try {
await client.request(
`/v0/datasources/${encodeURIComponent(datasource)}/data`,
@@ -112,7 +112,7 @@ async function deleteAllData() {
},
);
ok = true;
- } catch (e2) {
+ } catch (_e2) {
await client.request(
`/v0/datasources/${encodeURIComponent(datasource)}`,
{
diff --git a/scripts/analytics/migrate-dub-to-tinybird.js b/scripts/analytics/migrate-dub-to-tinybird.js
index 5e412292e..ce6bccc54 100644
--- a/scripts/analytics/migrate-dub-to-tinybird.js
+++ b/scripts/analytics/migrate-dub-to-tinybird.js
@@ -4793,9 +4793,9 @@ function dayMidpointIso(day) {
}
}
try {
- const d = new Date(dayStr + "T00:00:00.000Z");
+ const d = new Date(`${dayStr}T00:00:00.000Z`);
if (!Number.isNaN(d.getTime())) {
- return d.toISOString().slice(0, 10) + "T12:00:00.000Z";
+ return `${d.toISOString().slice(0, 10)}T12:00:00.000Z`;
}
} catch {}
return null;
@@ -5381,7 +5381,7 @@ async function migrateVideo({
const dateStrWithUTC =
tsStr.includes("Z") || tsStr.match(/[+-]\d{2}:?\d{2}$/)
? tsStr
- : tsStr + "T00:00:00.000Z";
+ : `${tsStr}T00:00:00.000Z`;
parsedDate = new Date(dateStrWithUTC);
if (!Number.isNaN(parsedDate.getTime())) {
day = parsedDate.toISOString().slice(0, 10);
diff --git a/scripts/setup.js b/scripts/setup.js
index 2ab6c109e..8c7de397c 100644
--- a/scripts/setup.js
+++ b/scripts/setup.js
@@ -148,6 +148,7 @@ async function main() {
console.log("Copied ffmpeg/lib and ffmpeg/include to target/native-deps");
const { stdout: vcInstallDir } = await exec(
+ // biome-ignore lint/suspicious/noTemplateCurlyInString: PowerShell syntax, not JS template literal
'$(& "${env:ProgramFiles(x86)}/Microsoft Visual Studio/Installer/vswhere.exe" -latest -property installationPath)',
{ shell: "powershell.exe" },
);
diff --git a/scripts/symbolicate-macos-crash.js b/scripts/symbolicate-macos-crash.js
index a49d30e58..4cb63437f 100644
--- a/scripts/symbolicate-macos-crash.js
+++ b/scripts/symbolicate-macos-crash.js
@@ -31,7 +31,7 @@ async function main() {
for (let i = 1; i < crashedSectionLines.length; i++) {
const line = crashedSectionLines[i];
- const [left, right] = line.split("\t").map((l) => l.trim());
+ const [_left, right] = line.split("\t").map((l) => l.trim());
const [address, loadAddressOrSymbol] = right.split(" ");
if (!loadAddressOrSymbol.startsWith("0x")) continue;
const loadAddress = loadAddressOrSymbol;