mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-14 03:56:55 +03:00
refactor(tui): drop never-passed component props (#53001)
This commit is contained in:
committed by
GitHub
Unverified
parent
0d98734fb2
commit
552d2b9c8a
@@ -296,7 +296,6 @@ export function DiffViewerContent(props: {
|
||||
sourceDetail?: string
|
||||
sourceBase?: Pick<Vcs.Base, "name" | "ref"> | null
|
||||
unavailable?: boolean
|
||||
navigation?: "tree" | "list"
|
||||
loadImage?: (file: string, signal: AbortSignal) => Promise<Uint8Array>
|
||||
preferences?: DiffPreferences
|
||||
onPreferencesChange?: (value: DiffPreferences) => void
|
||||
@@ -878,7 +877,6 @@ export function DiffViewerContent(props: {
|
||||
files={files()}
|
||||
loading={props.loading ?? false}
|
||||
error={props.error}
|
||||
layout={props.navigation}
|
||||
width={fileTreeWidth()}
|
||||
selectedFileIndex={
|
||||
selectedFileIndex() ?? (singlePatch() ? visiblePatchFiles()[0]?.fileIndex : undefined)
|
||||
|
||||
@@ -23,11 +23,7 @@ type Entry =
|
||||
readonly error?: string
|
||||
}
|
||||
|
||||
export function PluginsDialog(props: {
|
||||
context: Plugin.Context
|
||||
plugins: ReturnType<typeof usePlugin>
|
||||
server?: () => readonly PluginInfo[]
|
||||
}) {
|
||||
export function PluginsDialog(props: { context: Plugin.Context; plugins: ReturnType<typeof usePlugin> }) {
|
||||
const dialog = useDialog()
|
||||
const [locked, setLocked] = createSignal(false)
|
||||
const [checking, setChecking] = createSignal(false)
|
||||
@@ -36,7 +32,7 @@ export function PluginsDialog(props: {
|
||||
const [showInternal, setShowInternal] = createSignal(false)
|
||||
const [pending, setPending] = createSignal<readonly string[]>([])
|
||||
const [server, { refetch, mutate }] = createResource(
|
||||
() => (props.server ? undefined : (props.context.location ?? props.context.data.location.default())),
|
||||
() => props.context.location ?? props.context.data.location.default(),
|
||||
(location) => props.context.client.plugin.list({ location }).then((result) => result.data),
|
||||
)
|
||||
onMount(() => dialog.setSize("large"))
|
||||
@@ -69,7 +65,7 @@ export function PluginsDialog(props: {
|
||||
status: plugin.status,
|
||||
error: plugin.status === "failed" ? plugin.error : undefined,
|
||||
}))
|
||||
const serverEntries: Entry[] = (props.server?.() ?? server() ?? []).map((plugin) => ({
|
||||
const serverEntries: Entry[] = (server() ?? []).map((plugin) => ({
|
||||
key: `server:${plugin.id ?? source(plugin, props.context)}`,
|
||||
runtime: "server" as const,
|
||||
internal: plugin.source.type === "builtin",
|
||||
|
||||
@@ -2607,11 +2607,9 @@ function useToolPermission(part: () => SessionMessageAssistantTool | undefined)
|
||||
|
||||
function InlineTool(props: {
|
||||
icon: string
|
||||
iconColor?: RGBA
|
||||
color?: RGBA
|
||||
complete: unknown
|
||||
pending: string
|
||||
failure?: string
|
||||
spinner?: boolean
|
||||
running?: boolean
|
||||
status?: JSX.Element
|
||||
@@ -2651,7 +2649,6 @@ function InlineTool(props: {
|
||||
return (
|
||||
<InlineToolRow
|
||||
icon={props.icon}
|
||||
iconColor={props.iconColor}
|
||||
color={fg()}
|
||||
errorColor={theme.text.feedback.error.base}
|
||||
failed={failed()}
|
||||
@@ -2660,7 +2657,6 @@ function InlineTool(props: {
|
||||
errorExpanded={errorExpanded()}
|
||||
complete={props.complete}
|
||||
pending={props.pending}
|
||||
failure={props.failure}
|
||||
spinner={props.spinner}
|
||||
status={props.status}
|
||||
onMouseOver={() => clickable() && setHover(true)}
|
||||
|
||||
@@ -10,7 +10,7 @@ import "../../component/title-shimmer"
|
||||
import { getScrollAcceleration } from "../../util/scroll"
|
||||
import { SESSION_SIDEBAR_WIDTH } from "../../ui/layout"
|
||||
|
||||
export function Sidebar(props: { sessionID: string; overlay?: boolean }) {
|
||||
export function Sidebar(props: { sessionID: string }) {
|
||||
const data = useData()
|
||||
const theme = useTheme()
|
||||
const config = useConfig().data
|
||||
@@ -27,7 +27,7 @@ export function Sidebar(props: { sessionID: string; overlay?: boolean }) {
|
||||
paddingBottom={1}
|
||||
paddingLeft={2}
|
||||
paddingRight={2}
|
||||
position={props.overlay ? "absolute" : "relative"}
|
||||
position="relative"
|
||||
>
|
||||
<box flexShrink={0} paddingRight={2} paddingBottom={1}>
|
||||
<title_shimmer
|
||||
|
||||
Reference in New Issue
Block a user