MCPcopy
hub / github.com/anomalyco/opencode / Page

Function Page

packages/app/src/pages/session.tsx:335–2062  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

333}
334
335export default function Page() {
336 const serverSync = useServerSync()
337 const layout = useLayout()
338 const local = useLocal()
339 const file = useFile()
340 const sync = useSync()
341 const queryClient = useQueryClient()
342 const dialog = useDialog()
343 const language = useLanguage()
344 const sdk = useSDK()
345 const serverSDK = useServerSDK()
346 const settings = useSettings()
347 const platform = usePlatform()
348 const prompt = usePrompt()
349 const comments = useComments()
350 const terminal = useTerminal()
351 const [searchParams, setSearchParams] = useSearchParams<{ prompt?: string }>()
352 const location = useLocation()
353 const navigate = useNavigate()
354 const { params, sessionKey, workspaceKey, tabs, view } = useSessionLayout()
355 const sessionOwnership = createSessionOwnership(sessionKey)
356 const newSessionDesign = createMemo(() => settings.general.newLayoutDesigns())
357
358 createEffect(() => {
359 if (!prompt.ready()) return
360 untrack(() => {
361 if (params.id) return
362 const text = searchParams.prompt
363 if (!text) return
364 prompt.set([{ type: "text", content: text, start: 0, end: text.length }], text.length)
365 setSearchParams({ ...searchParams, prompt: undefined })
366 })
367 })
368
369 const [ui, setUi] = createStore({
370 pendingMessage: undefined as string | undefined,
371 reviewSnap: false,
372 scrollGesture: 0,
373 scroll: {
374 overflow: false,
375 bottom: true,
376 jump: false,
377 },
378 })
379
380 const composer = createSessionComposerController()
381 const inputController = createPromptInputController({
382 sessionKey,
383 sessionID: () => params.id,
384 queryOptions: serverSync().queryOptions,
385 })
386
387 const workspaceTabs = createMemo(() => layout.tabs(workspaceKey))
388
389 createEffect(
390 on(
391 () => params.id,
392 (id, prev) => {

Callers

nothing calls this directly

Calls 15

useSyncFunction · 0.90
useDialogFunction · 0.90
useSessionLayoutFunction · 0.90
createSessionOwnershipFunction · 0.90
base64EncodeFunction · 0.90
createSizingFunction · 0.90
shouldShowFileTreeFunction · 0.90
createSessionTabsFunction · 0.90
createTimelineModelFunction · 0.90
syncSessionModelFunction · 0.90

Tested by

no test coverage detected