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
6 changed files with 15 additions and 13 deletions
@@ -128,7 +128,6 @@ export function DialogMcp() {
{
title: toggleTitle(),
command: "dialog.mcp.toggle",
variant: toggleTitle() === "disconnect" ? "destructive" : "primary",
onTrigger: (option) => {
setFocused(option.value as string)
toggle(option.value as string)
@@ -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()
@@ -372,7 +373,6 @@ export function DialogMoveSession(props: DialogMoveSessionProps) {
{
command: "dialog.move_session.delete",
title: "delete",
variant: "destructive",
disabled: (option) => {
const value = option?.value
if (!value || value.type !== "directory" || value.subdirectory) return true
@@ -236,7 +236,6 @@ export function DialogSessionList() {
{
command: "session.delete",
title: "delete",
variant: "destructive",
onTrigger: (option: { value: string }) => {
if (toDelete() !== option.value) {
setToDelete(option.value)
@@ -75,7 +75,6 @@ export function DialogStash(props: { onSelect: (entry: StashEntry) => void }) {
{
command: "stash.delete",
title: "delete",
variant: "destructive",
onTrigger: (option) => {
if (toDelete() === option.value) {
stash.remove(option.value)
@@ -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(
+5 -7
View File
@@ -45,7 +45,6 @@ export interface DialogSelectProps<T> {
type DialogSelectActionBase<T> = {
command: string
title: string
variant?: "primary" | "destructive"
side?: "left" | "right"
hidden?: boolean
disabled?: boolean | ((option: DialogSelectOption<T> | undefined) => boolean)
@@ -552,19 +551,18 @@ export function DialogSelect<T>(props: DialogSelectProps<T>) {
const item = action.item
const active = createMemo(() => isActionFocused(item))
const disabled = createMemo(() => isActionDisabled(item))
const variant = () => item.variant ?? "primary"
return (
<box
flexDirection="row"
backgroundColor={active() ? theme.background.action[variant()].focused : RGBA.fromInts(0, 0, 0, 0)}
backgroundColor={active() ? theme.background.action.primary.focused : RGBA.fromInts(0, 0, 0, 0)}
onMouseUp={() => trigger(item)}
>
<text
fg={
disabled()
? theme.text.action[variant()].disabled
? theme.text.action.primary.disabled
: active()
? theme.text.action[variant()].focused
? theme.text.action.primary.focused
: theme.text.default
}
attributes={active() ? TextAttributes.BOLD : undefined}
@@ -574,9 +572,9 @@ export function DialogSelect<T>(props: DialogSelectProps<T>) {
<text
fg={
disabled()
? theme.text.action[variant()].disabled
? theme.text.action.primary.disabled
: active()
? theme.text.action[variant()].focused
? theme.text.action.primary.focused
: theme.text.subdued
}
>