Skip to content

Commit 3d3153f

Browse files
committed
chore(app): address terminal preview review comments
1 parent 7217069 commit 3d3153f

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

‎packages/app/src/web/terminal-inline-images-core.ts‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,27 @@ export const splitTerminalInlineImageOutput = (
5353
return segments
5454
}
5555

56+
/**
57+
* Coordinates terminal output writes for one parsed segment.
58+
*
59+
* This function only sequences the supplied writer callbacks. It does not fetch
60+
* image data, allocate decorations, or mutate terminal state directly; those
61+
* effects belong to the writer implementation.
62+
*
63+
* @pure false - invokes effectful writer callbacks.
64+
* @effect writer callbacks: writeText, writePreviewLineBreak, writePreviews.
65+
* @precondition segment is the next queued terminal output segment and
66+
* onComplete belongs to the caller's active output queue drain.
67+
* @postcondition writeText is requested exactly once; when previews are enabled
68+
* and imagePaths is non-empty, the preview line break and preview writes are
69+
* requested in order before onComplete.
70+
* @invariant segment.text is emitted before any preview callback, and preview
71+
* callbacks never run when imagePaths is empty or previews are disabled.
72+
* @complexity O(1) plus writer callback complexity; image paths are forwarded
73+
* without iteration.
74+
* @throws Through writer callbacks or onComplete only; this function has no
75+
* explicit throw path.
76+
*/
5677
export const writeTerminalOutputSegment = (
5778
{ inlineImagePreviewsEnabledRef, segment, writer }: TerminalOutputSegmentWriteArgs,
5879
onComplete: () => void

‎packages/app/src/web/terminal-panel-runtime.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ export const useTerminalSessionLifecycle = (
227227
}, [
228228
connectionRef,
229229
hostRef,
230-
inlineImagePreviewsEnabledRef,
231230
notifyMessage,
232231
onAttachFailure,
233232
runtimeRef,

0 commit comments

Comments
 (0)