import { createSignal } from "solid-js"
import type { SessionDocument } from "../document"
import { MarkdownProvider } from "../context/markdown"
import { CURRENT_SESSION_ID, STORY_MODEL, STORY_TIME } from "../storybook/current-session-fixtures"
import { CurrentSessionProviders } from "../storybook/current-session-story"
import { SessionTimeline } from "./session-timeline"
export default {
title: "OpenCode/Conversation/Code blocks",
id: "current-session-code-blocks",
component: SessionTimeline,
parameters: { layout: "fullscreen" },
}
const earlier = [
"The type check passes locally on Bun 1.4.4 with the default heap. CI uses the same lockfile, so the difference is",
"in how the runner starts the process rather than in the dependencies.",
].join(" ")
const reply = [
"The runner sets `NODE_OPTIONS` before install, so the type check runs out of memory. Reproduce it with:",
"",
"```sh",
'NODE_OPTIONS="--max-old-space-size=4096 --enable-source-maps" bun install --frozen-lockfile --filter "@opencode/session-ui" && bun run --cwd packages/session-ui typecheck:tsc',
"```",
"",
"The failing line reads the setting before the override:",
"",
"```ts",
"export const resolveCodeBlockPreference = (settings: Settings, block: MarkdownCodeBlock, override?: boolean) => override ?? settings.general.wrapCodeBlocks()",
"return resolveCodeBlockPreference(settings, block)",
"```",
"",
"Then run the check again:",
"",
"```sh",
"bun typecheck",
"```",
].join("\n")
export const LongLines = {
args: { wrap: false },
render: (args: { wrap: boolean }) =>