|
|
@@ -56,7 +56,6 @@ import { useFileComponent } from "@opencode-ai/ui/context/file"
|
|
|
import { shouldMarkBoundaryGesture, normalizeWheelDelta } from "@/pages/session/message-gesture"
|
|
|
import { SessionContextUsage } from "@/components/session-context-usage"
|
|
|
import { useDialog } from "@opencode-ai/ui/context/dialog"
|
|
|
-import { createResizeObserver } from "@solid-primitives/resize-observer"
|
|
|
import { useLanguage } from "@/context/language"
|
|
|
import { useSessionKey } from "@/pages/session/session-layout"
|
|
|
import { useServerSDK } from "@/context/server-sdk"
|
|
|
@@ -95,8 +94,6 @@ const taskDescription = (part: PartType, sessionID: string) => {
|
|
|
if (typeof value === "string" && value) return value
|
|
|
}
|
|
|
|
|
|
-const pace = (width: number) => Math.round(Math.max(1200, Math.min(3200, (Math.max(width, 360) * 2000) / 900)))
|
|
|
-
|
|
|
const boundaryTarget = (root: HTMLElement, target: EventTarget | null) => {
|
|
|
const current = target instanceof Element ? target : undefined
|
|
|
const nested = current?.closest("[data-scrollable]")
|
|
|
@@ -567,18 +564,7 @@ export function MessageTimeline(props: {
|
|
|
open: false,
|
|
|
dismiss: null as "escape" | "outside" | null,
|
|
|
})
|
|
|
- const [bar, setBar] = createStore({
|
|
|
- ms: pace(640),
|
|
|
- })
|
|
|
let more: HTMLButtonElement | undefined
|
|
|
- let head: HTMLDivElement | undefined
|
|
|
-
|
|
|
- const updateTitleMetrics = () => {
|
|
|
- if (!head || head.clientWidth <= 0) return
|
|
|
- setBar("ms", pace(head.clientWidth))
|
|
|
- }
|
|
|
-
|
|
|
- createResizeObserver(() => head, updateTitleMetrics)
|
|
|
|
|
|
const bindListRoot = (root: HTMLDivElement) => {
|
|
|
if (root === listRoot()) return
|
|
|
@@ -1291,10 +1277,6 @@ export function MessageTimeline(props: {
|
|
|
>
|
|
|
<Show when={showHeader()}>
|
|
|
<div
|
|
|
- ref={(el) => {
|
|
|
- head = el
|
|
|
- updateTitleMetrics()
|
|
|
- }}
|
|
|
data-session-title
|
|
|
classList={{
|
|
|
"sticky top-0 z-30 bg-[linear-gradient(to_bottom,var(--background-stronger)_48px,transparent)]": true,
|
|
|
@@ -1306,17 +1288,6 @@ export function MessageTimeline(props: {
|
|
|
"md:max-w-200 md:mx-auto 2xl:max-w-[1000px]": props.centered,
|
|
|
}}
|
|
|
>
|
|
|
- <Show when={workingStatus() !== "hidden" && settings.general.showSessionProgressBar()}>
|
|
|
- <div data-component="session-progress" data-state={workingStatus()} aria-hidden="true">
|
|
|
- <div
|
|
|
- data-component="session-progress-bar"
|
|
|
- style={{
|
|
|
- background: tint() ?? "var(--icon-interactive-base)",
|
|
|
- animation: `session-progress-whip ${bar.ms}ms infinite`,
|
|
|
- }}
|
|
|
- />
|
|
|
- </div>
|
|
|
- </Show>
|
|
|
<div class="h-12 w-full flex items-center justify-between gap-2">
|
|
|
<div class="flex items-center gap-1 min-w-0 flex-1 pr-3">
|
|
|
<div class="flex items-center min-w-0 grow-1">
|