Skip to content

Commit e6d3258

Browse files
authored
Merge branch 'main' into fix/gitlab-ssh-port-detection
2 parents cf103b2 + f5ef0dd commit e6d3258

565 files changed

Lines changed: 24145 additions & 11607 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎AGENTS.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ Full glossary with file links: `docs/internals/glossary.md`
158158
## Taste
159159

160160
- Complexity belongs at the adapter boundary. Orchestration stays pure, UI stays dumb.
161+
- `apps/web/src/components/ui` exports own their look. Pick a `variant` or `size`; do not restyle one with `className`. If none fits and the look is a generic concept, add a variant to the component; a look that belongs to one feature stays in that feature's own component, not in `components/ui`. Layout classes (width, flex, margin, position) belong on the parent. `shadcn/no-restyle` fails lint on violations.
161162
- Inferred types over annotations. `any` is the enemy.
162163
- Comments describe how a thing is used, and move when the code moves. To be used mostly to describe functions, not to annotate every line of behavior.
163164
- Our users drive agents all day and notice a dropped frame, a lying spinner, and a stale label. No continuously repainting animations; they peg the GPU on high-refresh displays.

‎apps/desktop/src/ipc/channels.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,5 @@ export const PREVIEW_POINTER_EVENT_CHANNEL = "desktop:preview-pointer-event";
113113
export const MAC_PERMISSION_HELPER_CHANNEL = "desktop:mac-permission-helper";
114114

115115
export const CHECK_SYSTEM_PERMISSION_CHANNEL = "desktop:check-system-permission";
116+
117+
export const PREVIEW_RECORDING_INPUT_CHANNEL = "desktop:preview-recording-input";

‎apps/desktop/src/ipc/methods/preview.ts‎

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ import {
3030
} from "@t3tools/contracts";
3131
import * as Effect from "effect/Effect";
3232
import * as Schema from "effect/Schema";
33+
import * as Option from "effect/Option";
3334
import * as NodeURL from "node:url";
3435

3536
import * as ElectronWindow from "../../electron/ElectronWindow.ts";
3637
import * as BrowserImport from "../../preview/BrowserImport/BrowserImport.ts";
3738
import * as PreviewManager from "../../preview/Manager.ts";
39+
import * as DesktopClientSettings from "../../settings/DesktopClientSettings.ts";
3840
import { PREVIEW_WEBVIEW_PREFERENCES } from "../../preview/WebviewPreferences.ts";
3941
import * as IpcChannels from "../channels.ts";
4042
import * as DesktopIpc from "../DesktopIpc.ts";
@@ -50,6 +52,9 @@ export const installPreviewEventForwarding = Effect.fn(
5052
yield* manager.subscribeRecordingFrames((frame) =>
5153
electronWindow.sendAll(IpcChannels.PREVIEW_RECORDING_FRAME_CHANNEL, frame),
5254
);
55+
yield* manager.subscribeRecordingInputs((event) =>
56+
electronWindow.sendAll(IpcChannels.PREVIEW_RECORDING_INPUT_CHANNEL, event),
57+
);
5358
yield* manager.subscribePointerEvents((event) =>
5459
electronWindow.sendAll(IpcChannels.PREVIEW_POINTER_EVENT_CHANNEL, event),
5560
);
@@ -180,11 +185,21 @@ export const cancelPickElement = tabMethod(
180185
"desktop.ipc.preview.cancelPickElement",
181186
(manager, tabId) => manager.cancelPickElement(tabId),
182187
);
183-
export const startRecording = tabMethod(
184-
IpcChannels.PREVIEW_RECORDING_START_CHANNEL,
185-
"desktop.ipc.preview.startRecording",
186-
(manager, tabId) => manager.startRecording(tabId),
187-
);
188+
export const startRecording = DesktopIpc.makeIpcMethod({
189+
channel: IpcChannels.PREVIEW_RECORDING_START_CHANNEL,
190+
payload: DesktopPreviewTabInputSchema,
191+
result: Schema.Void,
192+
handler: Effect.fn("desktop.ipc.preview.startRecording")(function* ({ tabId }) {
193+
const manager = yield* PreviewManager.PreviewManager;
194+
const store = yield* DesktopClientSettings.DesktopClientSettings;
195+
const settings = yield* store.get;
196+
const options = Option.map(settings, (value) => ({
197+
showKeyPresses: value.browserRecordingShowKeyPresses,
198+
showMousePresses: value.browserRecordingShowMousePresses,
199+
}));
200+
yield* manager.startRecording(tabId, Option.getOrUndefined(options));
201+
}),
202+
});
188203
export const stopRecording = tabMethod(
189204
IpcChannels.PREVIEW_RECORDING_STOP_CHANNEL,
190205
"desktop.ipc.preview.stopRecording",

‎apps/desktop/src/preload.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type {
22
DesktopBridge,
33
DesktopPreviewPointerEvent,
4+
DesktopPreviewRecordingInputEvent,
45
DesktopPreviewRecordingFrame,
56
DesktopPreviewTabState,
67
DesktopSnapShotEvent,
@@ -327,6 +328,15 @@ contextBridge.exposeInMainWorld("desktopBridge", {
327328
ipcRenderer.invoke(IpcChannels.PREVIEW_PICTURE_IN_PICTURE_CLOSE_CHANNEL, { tabId }),
328329
},
329330
recording: {
331+
onInput: (listener) => {
332+
const wrappedListener = (_event: Electron.IpcRendererEvent, event: unknown) => {
333+
if (typeof event !== "object" || event === null) return;
334+
listener(event as DesktopPreviewRecordingInputEvent);
335+
};
336+
ipcRenderer.on(IpcChannels.PREVIEW_RECORDING_INPUT_CHANNEL, wrappedListener);
337+
return () =>
338+
ipcRenderer.removeListener(IpcChannels.PREVIEW_RECORDING_INPUT_CHANNEL, wrappedListener);
339+
},
330340
startScreencast: (tabId) =>
331341
ipcRenderer.invoke(IpcChannels.PREVIEW_RECORDING_START_CHANNEL, { tabId }),
332342
stopScreencast: (tabId) =>

‎apps/desktop/src/preview/BrowserImport/ChromiumKeys.module.test.ts‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ vi.mock("@napi-rs/keyring", () => {
77
throw new Error("Cannot find native binding");
88
});
99

10-
it("loads browser import code without a keyring native binding", async () => {
11-
await expect(import("./ChromiumKeys.ts")).resolves.toBeDefined();
12-
});
13-
1410
it.effect("reports an unavailable keychain when the macOS binding cannot load", () =>
1511
Effect.gen(function* () {
1612
const { ChromiumKeyError, resolveChromiumKeys } = yield* Effect.promise(

‎apps/desktop/src/preview/GuestProtocol.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@ export const ANNOTATION_CAPTURED_CHANNEL = "preview:annotation-captured";
55
export const ANNOTATION_THEME_CHANNEL = "preview:annotation-theme";
66
export const HUMAN_INPUT_CHANNEL = "preview:human-input";
77
export const MOUSE_NAVIGATE_CHANNEL = "preview:mouse-navigate";
8+
export const RECORDING_CURSOR_CHANNEL = "preview:recording-cursor";
9+
export const RECORDING_POINTER_CHANNEL = "preview:recording-pointer";
10+
export const RECORDING_KEY_CHANNEL = "preview:recording-key";
11+
export const RECORDING_INPUT_CHANNEL = "preview:recording-input";
12+
export const RECORDING_CONTROLLER_CHANNEL = "preview:recording-controller";

0 commit comments

Comments
 (0)