Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion apps/desktop/src/main/ipc/register-desktop-ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ import { MAC_TERMINAL_PORT_CHANNEL } from "@luke/features/mac-terminal-wire";
import { TERMINAL_PORT_CHANNEL } from "@luke/features/terminal-acts";
import { highlightSnippet } from "@luke/host";
import { createActPortHandler, type PlatformActProcedures } from "@luke/host/act-port";
import { createHostActRouter, type PlatformActRows } from "@luke/host/act-router";
import {
createHostActRouter,
type PlatformActRows,
transcriptFollowActRows,
} from "@luke/host/act-router";
import { ACT_KIND } from "@luke/host/acts";
import type { AppStateSnapshot } from "@luke/host/app-state";
import { channels } from "@luke/host/bridge";
Expand Down Expand Up @@ -117,6 +121,14 @@ export function registerDesktopIpc(services: DesktopServices): void {
experimentOn: () =>
experimentOn(state.snapshot().settings?.experiments ?? NO_EXPERIMENTS, EXPERIMENT.BROWSER),
}),
...transcriptFollowActRows<WebContents>({
host: operator.host,
deliver: (sender, changed) => {
if (!sender.isDestroyed()) sender.send(channels.onTranscript, changed);
},
whenGone: whenPageGone,
run,
}),
[ACT_KIND.UPDATE_CHECK]: () => updates.check(),
[ACT_KIND.UPDATE_INSTALL]: () => updates.install(),
[ACT_KIND.UPDATE_OPEN_RELEASE]: () => updates.openLatestRelease(),
Expand Down
20 changes: 19 additions & 1 deletion apps/web/src/app/web-host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import {
type HostActDependencies,
type PlatformActRows,
refusedRows,
type TranscriptFollowActKind,
transcriptFollowActRows,
} from "@luke/host/act-router";
import { ACT_KIND } from "@luke/host/acts";
import { AgentNoticeDoors } from "@luke/host/agent-notices";
Expand Down Expand Up @@ -250,6 +252,7 @@ const noticeDoors = (
function platformRows(
http: HttpClient.HttpClient,
doors: WebNoticeDoors,
follows: Pick<PlatformActRows<WebSender>, TranscriptFollowActKind>,
): PlatformActRows<WebSender> {
const feedback = feedbackDelivery({ url: new URL(FEEDBACK_PATH, location.origin).href });
return {
Expand All @@ -263,6 +266,7 @@ function platformRows(
[ACT_KIND.NOTIFICATIONS_TEST]: () => doors.postTest(),
[ACT_KIND.FEEDBACK_SEND]: ({ submission }) =>
Effect.provideService(feedback.deliver(submission), HttpClient.HttpClient, http),
...follows,
};
}

Expand Down Expand Up @@ -431,7 +435,21 @@ const composedWeb = (run: WebHostOptions["run"]) =>
const made = yield* createInProcessBridge<WebSender>({
sender: window,
routerFor: () =>
createHostActRouter(hostRowDependencies(operator), platformRows(http, doors)),
createHostActRouter(
hostRowDependencies(operator),
platformRows(
http,
doors,
// The tab's transcripts are followed at the host and each page said to the page, which is
// the tab's one panel and is gone only with the host.
transcriptFollowActRows<WebSender>({
host: operator.host,
deliver: (_page, changed) => events?.onTranscript(changed),
whenGone: () => undefined,
run,
}),
),
),
run,
state,
windowFacts: () => ({ fullScreen: document.fullscreenElement !== null }),
Expand Down
Loading
Loading