Skip to content

Commit 75a00df

Browse files
committed
feat: add terminal width display to session list panel
1 parent 7c35466 commit 75a00df

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

source/ui/components/panels/SessionListPanel.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
} from '../../../utils/session/sessionManager.js';
77
import {useI18n} from '../../../i18n/index.js';
88
import {useTheme} from '../../contexts/ThemeContext.js';
9+
import {useTerminalSize} from '../../../hooks/ui/useTerminalSize.js';
910

1011
type Props = {
1112
onSelectSession: (sessionId: string) => void;
@@ -15,6 +16,7 @@ type Props = {
1516
export default function SessionListPanel({onSelectSession, onClose}: Props) {
1617
const {t} = useI18n();
1718
const {theme} = useTheme();
19+
const {columns: terminalWidth} = useTerminalSize();
1820
const [sessions, setSessions] = useState<SessionListItem[]>([]);
1921
const [loading, setLoading] = useState(true);
2022
const [loadingMore, setLoadingMore] = useState(false);
@@ -344,6 +346,11 @@ export default function SessionListPanel({onSelectSession, onClose}: Props) {
344346

345347
return (
346348
<Box paddingX={1} flexDirection="column">
349+
<Box height={1}>
350+
<Text color={theme.colors.menuSecondary} dimColor>
351+
{'─'.repeat(Math.max(0, terminalWidth - 2))}
352+
</Text>
353+
</Box>
347354
<Box flexDirection="column">
348355
<Text color={theme.colors.menuInfo} bold>
349356
{t.sessionListPanel.title} ({selectedIndex + 1}/{sessions.length}

0 commit comments

Comments
 (0)