feat(tui): make select list column sizing configurable (#2154)
* feat(tui): make select list layout configurable * feat(tui): tune select list column sizing * test(tui): fix select list alignment assertions
This commit is contained in:
committed by
GitHub
parent
e5b5738255
commit
c9a3d14aa5
@@ -5,6 +5,7 @@ import {
|
||||
getCapabilities,
|
||||
type SelectItem,
|
||||
SelectList,
|
||||
type SelectListLayoutOptions,
|
||||
type SettingItem,
|
||||
SettingsList,
|
||||
Spacer,
|
||||
@@ -13,6 +14,11 @@ import {
|
||||
import { getSelectListTheme, getSettingsListTheme, theme } from "../theme/theme.js";
|
||||
import { DynamicBorder } from "./dynamic-border.js";
|
||||
|
||||
const SETTINGS_SUBMENU_SELECT_LIST_LAYOUT: SelectListLayoutOptions = {
|
||||
minPrimaryColumnWidth: 12,
|
||||
maxPrimaryColumnWidth: 32,
|
||||
};
|
||||
|
||||
const THINKING_DESCRIPTIONS: Record<ThinkingLevel, string> = {
|
||||
off: "No reasoning",
|
||||
minimal: "Very brief reasoning (~1k tokens)",
|
||||
@@ -100,7 +106,12 @@ class SelectSubmenu extends Container {
|
||||
this.addChild(new Spacer(1));
|
||||
|
||||
// Select list
|
||||
this.selectList = new SelectList(options, Math.min(options.length, 10), getSelectListTheme());
|
||||
this.selectList = new SelectList(
|
||||
options,
|
||||
Math.min(options.length, 10),
|
||||
getSelectListTheme(),
|
||||
SETTINGS_SUBMENU_SELECT_LIST_LAYOUT,
|
||||
);
|
||||
|
||||
// Pre-select current value
|
||||
const currentIndex = options.findIndex((o) => o.value === currentValue);
|
||||
|
||||
Reference in New Issue
Block a user