Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/tui/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ import {
PowerlineSetup,
StatusLinePreview,
TerminalOptionsMenu,
TerminalWidthMenu
TerminalWidthMenu,
type MainMenuOption
} from './components';

const GITHUB_REPO_URL = 'https://github.com/sirmalloc/ccstatusline';
Expand Down Expand Up @@ -206,7 +207,7 @@ export const App: React.FC = () => {
}
};

const handleMainMenuSelect = async (value: string) => {
const handleMainMenuSelect = async (value: MainMenuOption) => {
switch (value) {
case 'lines':
setScreen('lines');
Expand Down
15 changes: 13 additions & 2 deletions src/tui/components/MainMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,18 @@ import React, { useState } from 'react';
import type { Settings } from '../../types/Settings';
import { type PowerlineFontStatus } from '../../utils/powerline';

export type MainMenuOption = 'lines'
| 'colors'
| 'powerline'
| 'terminalConfig'
| 'globalOverrides'
| 'install'
| 'starGithub'
| 'save'
| 'exit';

export interface MainMenuProps {
onSelect: (value: string) => void;
onSelect: (value: MainMenuOption) => void;
isClaudeInstalled: boolean;
hasChanges: boolean;
initialSelection?: number;
Expand Down Expand Up @@ -59,7 +69,8 @@ export const MainMenu: React.FC<MainMenuProps> = ({ onSelect, isClaudeInstalled,
} else if (key.return) {
const item = selectableItems[selectedIndex];
if (item) {
onSelect(item.value);
// Since we filtered by selectable: true, value is guaranteed to be MainMenuOption
onSelect(item.value as MainMenuOption);
}
}
});
Expand Down