Skip to content

Commit 3dbf5e3

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 01237c5 commit 3dbf5e3

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"
@@ -248,6 +248,7 @@ export function DialogSelect<T>(props: DialogSelectProps<T>) {
248248
<box
249249
id={JSON.stringify(option.value)}
250250
flexDirection="row"
251+
flexWrap="wrap"
251252
onMouseUp={() => {
252253
option.onSelect?.(dialog)
253254
props.onSelect?.(option)
@@ -325,10 +326,10 @@ function Option(props: {
325326
flexGrow={1}
326327
fg={props.active ? fg : props.current ? theme.primary : theme.text}
327328
attributes={props.active ? TextAttributes.BOLD : undefined}
328-
overflow="hidden"
329-
paddingLeft={3}
329+
wrapMode="word"
330+
maxHeight={2}
330331
>
331-
{Locale.truncate(props.title, 61)}
332+
{Locale.truncate(props.title, 122)}
332333
<Show when={props.description}>
333334
<span style={{ fg: props.active ? fg : theme.textMuted }}> {props.description}</span>
334335
</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)