Compare commits

..

2 Commits

Author SHA1 Message Date
Kit Langton fa1448649e test(tui): remove redundant export dialog coverage 2026-08-06 19:56:43 -04:00
Kit Langton 8587b39747 fix(tui): show export copy focus 2026-08-06 19:56:43 -04:00
4 changed files with 5 additions and 29 deletions
+1 -22
View File
@@ -3,7 +3,6 @@ import { useTerminalDimensions } from "@opentui/solid"
import { createMemo, createResource, createSignal, For, Show } from "solid-js"
import { renderUnicodeCompact } from "uqr"
import { useClient } from "../context/client"
import { Keymap } from "../context/keymap"
import { useTheme } from "../context/theme"
import { useDialog } from "../ui/dialog"
import { errorMessage } from "../util/error"
@@ -21,22 +20,6 @@ export function DialogPair(props: { credentials?: DialogPairCredentials }) {
const [loadError, setLoadError] = createSignal<unknown>()
const [showPassword, setShowPassword] = createSignal(false)
const [passwordHover, setPasswordHover] = createSignal(false)
const shortcuts = Keymap.useShortcuts()
const togglePassword = () => {
setShowPassword((current) => !current)
}
Keymap.createLayer(() => ({
mode: "modal",
commands: [
{
id: "dialog.pair.toggle_password",
title: showPassword() ? "Hide pairing password" : "Show pairing password",
group: "Dialog",
run: togglePassword,
},
],
}))
dialog.setSize("large")
dialog.setCentered(true)
@@ -78,14 +61,10 @@ export function DialogPair(props: { credentials?: DialogPairCredentials }) {
wrapMode="word"
onMouseOver={() => setPasswordHover(true)}
onMouseOut={() => setPasswordHover(false)}
onMouseUp={togglePassword}
onMouseUp={() => setShowPassword((current) => !current)}
>
{showPassword() ? value.password : "************"}
</text>
<text fg={theme.text.default} onMouseUp={togglePassword}>
{shortcuts.get("dialog.pair.toggle_password")} {" "}
<span style={{ fg: theme.text.subdued }}>{showPassword() ? "hide password" : "show password"}</span>
</text>
</box>
<Show when={value.urls.some((url) => ["localhost", "127.0.0.1", "[::1]"].includes(new URL(url).hostname))}>
<text fg={theme.text.subdued} wrapMode="word">
-1
View File
@@ -220,7 +220,6 @@ export const Definitions = {
"dialog.move_session.new": keybind("ctrl+m", "New project copy"),
"dialog.move_session.delete": keybind("ctrl+d", "Delete project copy"),
"dialog.move_session.refresh": keybind("ctrl+r", "Refresh project copies"),
"dialog.pair.toggle_password": keybind("space", "Show or hide pairing password"),
"prompt.autocomplete.prev": keybind("up,ctrl+p", "Move to previous autocomplete item"),
"prompt.autocomplete.next": keybind("down,ctrl+n", "Move to next autocomplete item"),
"prompt.autocomplete.hide": keybind("escape", "Hide autocomplete"),
@@ -200,10 +200,12 @@ export function DialogExportOptions(props: DialogExportOptionsProps) {
<box
paddingLeft={4}
paddingRight={4}
backgroundColor={overlayTheme.background.default}
backgroundColor={
store.active === "copy" ? theme.background.action.primary.focused : overlayTheme.background.default
}
onMouseUp={() => confirm("copy")}
>
<text fg={overlayTheme.text.default}>Copy</text>
<text fg={store.active === "copy" ? theme.text.action.primary.focused : overlayTheme.text.default}>Copy</text>
</box>
<box
paddingLeft={4}
-4
View File
@@ -5,7 +5,3 @@ test("binds agent cycling only to shift+tab by default", () => {
expect(TuiKeybind.Definitions.agent_cycle.default).toBe("shift+tab")
expect(TuiKeybind.Definitions.agent_cycle_reverse.default).toBe("none")
})
test("binds pairing password visibility to space by default", () => {
expect(TuiKeybind.Definitions["dialog.pair.toggle_password"].default).toBe("space")
})