Skip to content

Commit 9ac6669

Browse files
feat(tui): allow session names to wrap to two lines in dialog
- Replace overflow hidden with wrapMode word to enable text wrapping - Add maxHeight=2 to limit to two lines - Add flexWrap=wrap on option container to allow content flow - Change truncation from 61 to 122 chars (~2 lines worth)
1 parent 76880dc commit 9ac6669

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

packages/opencode/src/cli/cmd/tui/ui/dialog-select.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { InputRenderable, RGBA, ScrollBoxRenderable, TextAttributes } from "@opentui/core"
22
import { useTheme, selectedForeground } from "@tui/context/theme"
3-
import { entries, filter, flatMap, groupBy, pipe, take } from "remeda"
3+
import { entries, filter, flatMap, groupBy, pipe } from "remeda"
44
import { batch, createEffect, createMemo, For, Show, type JSX, on } from "solid-js"
55
import { createStore } from "solid-js/store"
66
import { useKeyboard, useTerminalDimensions } from "@opentui/solid"
@@ -238,6 +238,7 @@ export function DialogSelect<T>(props: DialogSelectProps<T>) {
238238
<box
239239
id={JSON.stringify(option.value)}
240240
flexDirection="row"
241+
flexWrap="wrap"
241242
onMouseUp={() => {
242243
option.onSelect?.(dialog)
243244
props.onSelect?.(option)
@@ -314,10 +315,10 @@ function Option(props: {
314315
flexGrow={1}
315316
fg={props.active ? fg : props.current ? theme.primary : theme.text}
316317
attributes={props.active ? TextAttributes.BOLD : undefined}
317-
overflow="hidden"
318-
paddingLeft={3}
318+
wrapMode="word"
319+
maxHeight={2}
319320
>
320-
{Locale.truncate(props.title, 61)}
321+
{Locale.truncate(props.title, 122)}
321322
<Show when={props.description}>
322323
<span style={{ fg: props.active ? fg : theme.textMuted }}> {props.description}</span>
323324
</Show>

packages/plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424
"typescript": "catalog:",
2525
"@typescript/native-preview": "catalog:"
2626
}
27-
}
27+
}

packages/sdk/js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@
2929
"publishConfig": {
3030
"directory": "dist"
3131
}
32-
}
32+
}

0 commit comments

Comments
 (0)