fix(web): stop the transcript scrolling itself on every streamed chunk #4884
ClosedAsimNet(GitHub profile, opens in a new tab)wants to merge 1 commit into
main fromrefs/pull/4884/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- @@ -0,0 +1 @@1+/**
- @@ -0,0 +69,21 @@69+ RpcClient.makeProtocolSocket({ retryTransientErrors: false, retryPolicy: Schedule.recurs(0) }),70+ ).pipe(Layer.provide(Layer.mergeAll(socketLayer, RpcSerialization.layerJson)));71+72+ const ctx = yield* Layer.build(protocolLayer);73+ const client = yield* RpcClient.make(WsRpcGroup).pipe(Effect.provide(ctx));74+75+ // Make sure the shell exists. Re-opening an existing terminal is fine.76+ yield* client[WS_METHODS.terminalOpen]({77+ threadId: THREAD_ID,78+ terminalId: TERMINAL_ID,79+ cwd,80+ cols: 200,81+ rows: 50,82+ }).pipe(Effect.catchCause((cause) => Effect.logDebug(`open: ${String(cause)}`)));83+84+ const done = yield* Deferred.make<number>();85+ let buf = "";86+ let printedUpTo = 0;87+ let streaming = false;88+89+ const onChunk = (chunk: string) =>@@ -0,0 +135,21 @@135+136+ yield* Deferred.await(attached);137+ const line = `printf '\\n${BEGIN}\\n'; ${command}; printf '\\n${END}%s\\n' "$?"\r`;138+ yield* client[WS_METHODS.terminalWrite]({139+ threadId: THREAD_ID,140+ terminalId: TERMINAL_ID,141+ data: line,142+ });143+144+ const code = yield* Deferred.await(done).pipe(Effect.timeout(`${timeoutSec} seconds`));145+ process.stdout.write("\n");146+ return code;147+});148+149+Effect.runPromise(Effect.scoped(program) as any).then(150+ (code) => process.exit(Number(code)),151+ (err) => {152+ console.error("\n[rexec] failed:", err?.message ?? err);153+ process.exit(1);154+ },155+);@@ -0,0 +13,21 @@13+import { RpcClient } from "effect/unstable/rpc";14+import * as RpcSerialization from "effect/unstable/rpc/RpcSerialization";15+import * as Socket from "effect/unstable/socket/Socket";16+import { WS_METHODS, WsRpcGroup } from "./src/rpc.ts";17+18+const BASE = process.env.T3_BASE ?? "http://100.77.192.114:3773";19+const TOKEN = process.env.T3_TOKEN ?? "";20+const THREAD_ID = process.env.T3_THREAD ?? "claude-remote-build";21+const TERMINAL_ID = process.env.T3_TERM ?? "term-1";22+23+const argv = process.argv.slice(2);24+let cwd = "~";25+let timeoutSec = 3600;26+const cmdParts: Array<string> = [];27+for (let i = 0; i < argv.length; i++) {28+ if (argv[i] === "--cwd") cwd = argv[++i]!;29+ else if (argv[i] === "--timeout") timeoutSec = Number(argv[++i]);30+ else if (argv[i] === "--") (cmdParts.push(...argv.slice(i + 1)), (i = argv.length));31+ else cmdParts.push(argv[i]!);32+}33+const command = cmdParts.join(" ");
- packages/contracts/tmp-rexec.ts line 155OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -0,0 +135,21 @@135+136+ yield* Deferred.await(attached);137+ const line = `printf '\\n${BEGIN}\\n'; ${command}; printf '\\n${END}%s\\n' "$?"\r`;138+ yield* client[WS_METHODS.terminalWrite]({139+ threadId: THREAD_ID,140+ terminalId: TERMINAL_ID,141+ data: line,142+ });143+144+ const code = yield* Deferred.await(done).pipe(Effect.timeout(`${timeoutSec} seconds`));145+ process.stdout.write("\n");146+ return code;147+});148+149+Effect.runPromise(Effect.scoped(program) as any).then(150+ (code) => process.exit(Number(code)),151+ (err) => {152+ console.error("\n[rexec] failed:", err?.message ?? err);153+ process.exit(1);154+ },155+);apps/web/src/components/ChatView.tsx line 5708OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -5677,4 +5702,7 @@56775702 !inlineRightPanelOwnsTitleBar &&56785703 "wco:pr-[var(--workspace-native-controls-inset)]",56795704 )5680- : "workspace-topbar pl-[calc(env(safe-area-inset-left)+0.75rem)] pr-[calc(env(safe-area-inset-right)+0.75rem)] sm:pl-[calc(env(safe-area-inset-left)+1.25rem)] sm:pr-[calc(env(safe-area-inset-right)+1.25rem)]",5705+ : // --safe-area-inset-start/end resolve to the physical side that5706+ // matches the reading direction, so the notch inset lands on the5707+ // right edge in RTL instead of following the LTR assumption.5708+ "workspace-topbar ps-[calc(var(--safe-area-inset-start)+0.75rem)] pe-[calc(var(--safe-area-inset-end)+0.75rem)] sm:ps-[calc(var(--safe-area-inset-start)+1.25rem)] sm:pe-[calc(var(--safe-area-inset-end)+1.25rem)]",apps/web/src/components/ChatView.tsx line 3674OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -3654,5 +3665,10 @@36543665 }, []);3655366636563667 const onIsAtEndChange = useCallback((isAtEnd: boolean) => {3668+ // Leaving the live edge while live-follow owns the scroll position is the3669+ // list settling, not the reader navigating, so the pill stays hidden. With3670+ // follow-output off nothing is chasing the edge, and falling behind is3671+ // exactly when the pill has to appear.36573672 if (36583673 !isAtEnd &&3674+ chatAutoScrollRef.current &&
- @@ -5677,4 +5702,7 @@56775702 !inlineRightPanelOwnsTitleBar &&56785703 "wco:pr-[var(--workspace-native-controls-inset)]",56795704 )5680- : "workspace-topbar pl-[calc(env(safe-area-inset-left)+0.75rem)] pr-[calc(env(safe-area-inset-right)+0.75rem)] sm:pl-[calc(env(safe-area-inset-left)+1.25rem)] sm:pr-[calc(env(safe-area-inset-right)+1.25rem)]",5705+ : // --safe-area-inset-start/end resolve to the physical side that5706+ // matches the reading direction, so the notch inset lands on the5707+ // right edge in RTL instead of following the LTR assumption.5708+ "workspace-topbar ps-[calc(var(--safe-area-inset-start)+0.75rem)] pe-[calc(var(--safe-area-inset-end)+0.75rem)] sm:ps-[calc(var(--safe-area-inset-start)+1.25rem)] sm:pe-[calc(var(--safe-area-inset-end)+1.25rem)]",@@ -1498,0 +1508,21 @@1508+ .ultrathink-chroma,1509+ .ultrathink-pill,1510+ .ultrathink-word,1511+ [class*="animate-status-pulse"],1512+ [class*="animate-status-ping"],1513+ [class*="animate-sidebar-working-text"],1514+ [class*="animate-skeleton"],1515+ [class*="animate-pulse"] {1516+ animation: none !important;1517+ }1518+}1519+1520+html[data-reduce-motion="true"] .ultrathink-frame::before,1521+html[data-reduce-motion="true"] .ultrathink-chroma,1522+html[data-reduce-motion="true"] .ultrathink-pill,1523+html[data-reduce-motion="true"] .ultrathink-word,1524+html[data-reduce-motion="true"] [class*="animate-status-pulse"],1525+html[data-reduce-motion="true"] [class*="animate-status-ping"],1526+html[data-reduce-motion="true"] [class*="animate-sidebar-working-text"],1527+html[data-reduce-motion="true"] [class*="animate-skeleton"],1528+html[data-reduce-motion="true"] [class*="animate-pulse"] {@@ -0,0 +1,20 @@1+/**2+ * Temporary bridge: run a shell command on a remote T3 Code environment by3+ * driving the `terminal.*` WS RPCs. Lives inside packages/contracts so that4+ * `effect` and the contract schemas resolve without a root install.5+ *6+ * Usage: node tmp-rexec.ts --cwd <dir> [--timeout <sec>] -- <command...>7+ */8+import * as Deferred from "effect/Deferred";9+import * as Effect from "effect/Effect";10+import * as Layer from "effect/Layer";11+import * as Schedule from "effect/Schedule";12+import * as Stream from "effect/Stream";13+import { RpcClient } from "effect/unstable/rpc";14+import * as RpcSerialization from "effect/unstable/rpc/RpcSerialization";15+import * as Socket from "effect/unstable/socket/Socket";16+import { WS_METHODS, WsRpcGroup } from "./src/rpc.ts";17+18+const BASE = process.env.T3_BASE ?? "http://100.77.192.114:3773";19+const TOKEN = process.env.T3_TOKEN ?? "";20+const THREAD_ID = process.env.T3_THREAD ?? "claude-remote-build";
juliusmarminge closed this
Sign in to join this conversation.



Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
e27f51e1-f80a-46b5-bb71-7a05ef03fe43You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share