refactor(tui): rename link concept to pair

This commit is contained in:
Dax Raad 2026-07-09 13:05:20 -04:00
commit 6fb526741b
5 changed files with 16 additions and 16 deletions

View file

@ -47,7 +47,7 @@ import { useConnected } from "./component/use-connected"
import { DialogMcp } from "./component/dialog-mcp"
import { DialogStatus } from "./component/dialog-status"
import { DialogDebug } from "./component/dialog-debug"
import { DialogLink, type DialogLinkCredentials } from "./component/dialog-link"
import { DialogPair, type DialogPairCredentials } from "./component/dialog-pair"
import { createOpencodeClient } from "@opencode-ai/sdk/v2/client"
import { DialogThemeList } from "./component/dialog-theme-list"
import { DialogHelp } from "./ui/dialog-help"
@ -123,7 +123,7 @@ const appBindingCommands = [
"provider.connect",
"console.org.switch",
"opencode.status",
"server.link",
"server.pair",
"opencode.debug",
"theme.switch",
"theme.switch_mode",
@ -358,7 +358,7 @@ export const run = Effect.fn("Tui.run")(function* (input: TuiInput) {
<App
onSnapshot={input.onSnapshot}
pluginHost={input.pluginHost}
link={
pair={
input.server.endpoint.auth
? input.server.endpoint.auth
: {
@ -414,7 +414,7 @@ export const run = Effect.fn("Tui.run")(function* (input: TuiInput) {
function App(props: {
onSnapshot?: () => Promise<string[]>
pluginHost: TuiPluginHost
link?: DialogLinkCredentials
pair?: DialogPairCredentials
}) {
const log = useLog({ component: "app" })
const startup = useTuiStartup()
@ -849,11 +849,11 @@ function App(props: {
category: "System",
},
{
name: "server.link",
title: "Show server info",
slashName: "link",
name: "server.pair",
title: "Pair device",
slashName: "pair",
run: () => {
dialog.replace(() => <DialogLink credentials={props.link} />)
dialog.replace(() => <DialogPair credentials={props.pair} />)
},
category: "System",
},

View file

@ -7,12 +7,12 @@ import { useTheme } from "../context/theme"
import { useDialog } from "../ui/dialog"
import { errorMessage } from "../util/error"
export type DialogLinkCredentials = {
export type DialogPairCredentials = {
readonly username: string
readonly password: string
}
export function DialogLink(props: { credentials?: DialogLinkCredentials }) {
export function DialogPair(props: { credentials?: DialogPairCredentials }) {
const sdk = useSDK()
const dialog = useDialog()
const dimensions = useTerminalDimensions()
@ -97,7 +97,7 @@ export function DialogLink(props: { credentials?: DialogLinkCredentials }) {
<box paddingLeft={2} paddingRight={2} paddingBottom={1} gap={1}>
<box flexDirection="row" justifyContent="space-between">
<text fg={theme.text} attributes={TextAttributes.BOLD}>
Link
Pair
</text>
<text fg={theme.textMuted} onMouseUp={() => dialog.clear()}>
esc