From 8846336e1128cf9b28b66ae1d77f953d7b6b14f6 Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" <219766164+opencode-agent[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2026 20:29:34 -0400 Subject: [PATCH] refactor(tui): remove unused fade file path (#39954) Co-authored-by: Kit Langton --- packages/tui/src/ui/fade-file-path.tsx | 56 -------------------------- 1 file changed, 56 deletions(-) delete mode 100644 packages/tui/src/ui/fade-file-path.tsx diff --git a/packages/tui/src/ui/fade-file-path.tsx b/packages/tui/src/ui/fade-file-path.tsx deleted file mode 100644 index 8243b7f2e4..0000000000 --- a/packages/tui/src/ui/fade-file-path.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import type { RGBA } from "@opentui/core" -import { createEffect, createMemo, createSignal, Show } from "solid-js" -import { useConfig } from "../config" -import { tint } from "../theme/color" -import { createAnimatable, tween } from "./animation" -import { FilePath } from "./file-path" - -// FilePath that crossfades when its value changes: the old path fades to the -// background, the text swaps at the midpoint, and the new path fades back in. -// The initial value renders immediately; only subsequent changes animate. -export function FadeFilePath(props: { - value: string | undefined - maxWidth: number - fg: RGBA - bg: RGBA - basenameFg?: RGBA -}) { - const config = useConfig().data - const fade = createAnimatable( - { front: 1 }, - { - enabled: () => config.animations ?? true, - transition: tween({ duration: 0.3 }), - }, - ) - const [text, setText] = createSignal(props.value) - const [previous, setPrevious] = createSignal() - - createEffect((current: string | undefined) => { - const next = props.value - if (next === undefined || next === current) return current - setText(next) - if (current === undefined) return next - setPrevious(current) - fade.jump({ front: 0 }) - fade.animate({ front: 1 }) - return next - }, props.value) - - const display = createMemo(() => (previous() !== undefined && fade.value().front < 0.5 ? previous() : text())) - const fg = createMemo(() => { - if (previous() === undefined || fade.value().front >= 1) return props.fg - return tint(props.bg, props.fg, Math.abs(fade.value().front * 2 - 1)) - }) - - return ( - - = 1 ? props.basenameFg : undefined} - /> - - ) -}