lint format

This commit is contained in:
Ting-Wai To 2025-08-14 02:02:26 -07:00
parent 6a3a25038a
commit 98fd9492be
4 changed files with 38 additions and 24 deletions

View file

@ -70,7 +70,10 @@ export function Selector<T extends SelectorOption>({
<Text color="blue" bold>
{title}
</Text>
<Text color="gray">{loadingMessage}</Text>
<Text> </Text>
<Text italic color="gray">
{loadingMessage}
</Text>
</Box>
);
}
@ -94,22 +97,23 @@ export function Selector<T extends SelectorOption>({
);
}
const defaultRenderOption = (
option: T,
isSelected: boolean,
isCurrent: boolean,
) => (
<Text
color={isSelected ? "blue" : "white"}
bold={isSelected}
inverse={isSelected}
>
{isSelected ? "> " : " "}
{option.name}
{option.displaySuffix || ""}
{isCurrent ? " (current)" : ""}
</Text>
);
// Transform options for ink-ui Select
const selectOptions = options.map((option) => {
const displayName = option.name + (option.displaySuffix || "");
return {
label: displayName,
value: option.id,
};
});
// Handle selection change from ink-ui Select
const handleChange = (value: string) => {
const selectedOption = options.find((option) => option.id === value);
if (selectedOption) {
onSelect(selectedOption);
}
};
return (
<Box

View file

@ -47,7 +47,9 @@ const SlashCommandUI: React.FC<SlashCommandUIProps> = ({
});
// Find the longest command name for alignment
const maxCommandLength = Math.max(...filteredCommands.map(cmd => cmd.name.length));
const maxCommandLength = Math.max(
...filteredCommands.map((cmd) => cmd.name.length),
);
if (filteredCommands.length === 0) {
return (
<Box paddingX={1} marginX={1} marginBottom={1}>
@ -61,14 +63,18 @@ const SlashCommandUI: React.FC<SlashCommandUIProps> = ({
{filteredCommands.map((command, index) => {
const isSelected = index === selectedIndex;
const paddedCommandName = `/${command.name}`.padEnd(maxCommandLength + 1);
const paddedCommandName = `/${command.name}`.padEnd(
maxCommandLength + 1,
);
return (
<Box key={command.name}>
<Text color={isSelected ? "blue" : "white"} bold={isSelected}>
{" "}{paddedCommandName}
{" "}
{paddedCommandName}
<Text color={isSelected ? "blue" : "gray"}>
{" "}{command.description}
{" "}
{command.description}
</Text>
</Text>
</Box>

View file

@ -211,7 +211,7 @@ const BottomStatusBar: React.FC<BottomStatusBarProps> = ({
closeCurrentScreen,
}) => (
<Box flexDirection="row" justifyContent="space-between" alignItems="center">
<Box flexDirection="row" alignItems="center">
<Box marginLeft={2} flexDirection="row" alignItems="center">
{currentMode === "normal" && (
<>
<Text color="dim" wrap="truncate-start">

View file

@ -469,10 +469,14 @@ const UserInput: React.FC<UserInputProps> = ({
return (
<>
{(inputMode || isWaitingForResponse) && (
<Text italic color="gray">▋{placeholderText}</Text>
<Text italic color="gray">
▋{placeholderText}
</Text>
)}
{!inputMode && !isWaitingForResponse && (
<Text italic color="gray">{placeholderText}</Text>
<Text italic color="gray">
{placeholderText}
</Text>
)}
</>
);