Compare commits

..

1 Commits

Author SHA1 Message Date
Kit Langton 85f03b2712 fix(tui): clarify working copy actions 2026-08-06 19:56:40 -04:00
5 changed files with 11 additions and 29 deletions
@@ -258,6 +258,7 @@ export function DialogMoveSession(props: DialogMoveSessionProps) {
const choice = await DialogWorkspaceFileChanges.show(dialog, status?.data ?? [], {
title: "Delete working copy?",
message: "This working copy has file changes. Do you want to delete it anyway?",
labels: { no: "cancel", yes: "delete" },
})
if (choice !== "yes") {
reopen()
+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">
@@ -29,6 +29,7 @@ export function DialogWorkspaceFileChanges(props: {
onSelect: (choice: WorkspaceFileChangesChoice) => void
title?: string
message?: string
labels?: Partial<Record<WorkspaceFileChangesChoice, string>>
}) {
const dialog = useDialog()
const theme = useTheme("elevated")
@@ -125,7 +126,9 @@ export function DialogWorkspaceFileChanges(props: {
dialog.clear()
}}
>
<text fg={item === store.active ? theme.text.action.primary.focused : theme.text.subdued}>{item}</text>
<text fg={item === store.active ? theme.text.action.primary.focused : theme.text.subdued}>
{props.labels?.[item] ?? (item === "no" ? "cancel" : "move")}
</text>
</box>
)}
</For>
@@ -137,7 +140,11 @@ export function DialogWorkspaceFileChanges(props: {
DialogWorkspaceFileChanges.show = (
dialog: DialogContext,
files: VcsFileStatus[],
options?: { title?: string; message?: string },
options?: {
title?: string
message?: string
labels?: Partial<Record<WorkspaceFileChangesChoice, string>>
},
) => {
return new Promise<WorkspaceFileChangesChoice | undefined>((resolve) => {
dialog.replace(
-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"),
-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")
})