fix(cli): prevent flicker on tall approval dialogs, refactor logic out from plan into other inlines (#777)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Charles Packer
2026-02-01 18:04:01 -08:00
committed by GitHub
parent ab00aae7c5
commit ac2950b2a2
5 changed files with 260 additions and 6 deletions

View File

@@ -16,6 +16,7 @@ type Props = {
isFocused?: boolean;
approveAlwaysText?: string;
allowPersistence?: boolean;
showPreview?: boolean;
};
// Horizontal line character for Claude Code style
@@ -56,6 +57,7 @@ export const InlineGenericApproval = memo(
isFocused = true,
approveAlwaysText,
allowPersistence = true,
showPreview = true,
}: Props) => {
const [selectedOption, setSelectedOption] = useState(0);
const {
@@ -165,13 +167,15 @@ export const InlineGenericApproval = memo(
: "Type reason · Esc to cancel"
: "Enter to select · Esc to cancel";
const optionsMarginTop = showPreview ? 1 : 0;
return (
<Box flexDirection="column">
{/* Static tool content - memoized to prevent re-render on keystroke */}
{memoizedToolContent}
{showPreview && memoizedToolContent}
{/* Options */}
<Box marginTop={1} flexDirection="column">
<Box marginTop={optionsMarginTop} flexDirection="column">
{/* Option 1: Yes */}
<Box flexDirection="row">
<Box width={5} flexShrink={0}>