Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

Merge upstream main into source selector test hooks

AjTheSpideya18dc39babf4
diff --cc src/components/launch/LaunchWindow.tsx
index 66d8d92e5,bba5f494c..e40d58c94
--- a/src/components/launch/LaunchWindow.tsx
+++ b/src/components/launch/LaunchWindow.tsx
@@@ -610,10 -610,36 +610,37 @@@ export function LaunchWindow()
{getIcon("drag", "text-white/30")}
</div>
+ <Tooltip
+ content={
+ trayLayout === "horizontal"
+ ? t("tooltips.useVerticalTray")
+ : t("tooltips.useHorizontalTray")
+ }
+ >
+ <button
+ data-testid="launch-tray-layout-button"
+ type="button"
+ aria-label={
+ trayLayout === "horizontal"
+ ? t("tooltips.useVerticalTray")
+ : t("tooltips.useHorizontalTray")
+ }
+ aria-pressed={trayLayout === "vertical"}
+ className={`${hudIconBtnClasses} ${styles.electronNoDrag}`}
+ onClick={toggleTrayLayout}
+ >
+ {trayLayout === "horizontal" ? (
+ <Columns3 size={ICON_SIZE} className="text-white/60" />
+ ) : (
+ <Rows3 size={ICON_SIZE} className="text-white/60" />
+ )}
+ </button>
+ </Tooltip>
+
{/* Source selector */}
<button
+ data-testid="launch-source-selector-button"
- className={`${hudGroupClasses} h-8 px-2.5 ${styles.electronNoDrag}`}
+ className={`${hudGroupClasses} h-8 ${trayLayout === "vertical" ? "w-8 justify-center px-0" : "px-2.5"} ${styles.electronNoDrag}`}
onClick={openSourceSelector}
disabled={recording}
title={selectedSource}
diff --cc src/components/launch/SourceSelector.tsx
index 65daa9aef,17e7444cb..b1a8a6a96
--- a/src/components/launch/SourceSelector.tsx
+++ b/src/components/launch/SourceSelector.tsx
@@@ -72,9 -82,32 +82,33 @@@ export function SourceSelector()
);
}
+ if (hasNoSources) {
+ return (
+ <div
+ className={`h-full flex items-center justify-center ${styles.glassContainer}`}
+ style={{ minHeight: "100vh" }}
+ >
+ <div className="max-w-[320px] px-6 text-center">
+ <h2 className="text-sm font-semibold text-white">{t("sourceSelector.emptyTitle")}</h2>
+ <p className="mt-2 text-xs leading-5 text-zinc-400">
+ {loadFailed
+ ? t("sourceSelector.loadFailedDescription")
+ : t("sourceSelector.emptyDescription")}
+ </p>
+ <Button
+ onClick={() => void fetchSources()}
+ className="mt-4 h-8 rounded-lg bg-[#34B27B] px-5 text-[11px] font-semibold text-white transition-transform duration-150 hover:bg-[#34B27B]/85 active:scale-95"
+ >
+ {tc("actions.reload")}
+ </Button>
+ </div>
+ </div>
+ );
+ }
+
const renderSourceCard = (source: DesktopSource) => {
const isSelected = selectedSource?.id === source.id;
+ const sourceKind = source.id.startsWith("screen:") ? "screen" : "window";
return (
<div
key={source.id}