feat: Fix flickering in iTerm + scrolling + performance issues.

- Refactors history display using Ink's <Static> component to prevent flickering and improve performance by rendering completed items statically.
- Introduces ConsolePatcher component to capture and display console.log, console.warn, and console.error output within the Ink UI, addressing native handling issues.
- Introduce a new content splitting mechanism to work better for static items. Basically when content gets too long we will now split content into multiple blocks for Gemini messages to ensure that we can statically cache larger pieces of history.

Fixes:
- https://b.corp.google.com/issues/411450097
- https://b.corp.google.com/issues/412716309
This commit is contained in:
Taylor Mullen
2025-04-25 17:11:08 -07:00
committed by N. Taylor Mullen
parent aa65a4a1fc
commit 5be89befef
15 changed files with 514 additions and 102 deletions

View File

@@ -14,7 +14,12 @@ interface InputPromptProps {
}
export const InputPrompt: React.FC<InputPromptProps> = ({ onSubmit }) => {
const [value, setValue] = React.useState('');
const [value, setValue] = React.useState(
"I'd like to update my web fetch tool to be a little smarter about the content it fetches from web pages. Instead of returning the entire HTML to the LLM I was extract the body text and other important information to reduce the amount of tokens we need to use.",
);
// const [value, setValue] = React.useState('Add "Hello World" to the top of README.md');
// const [value, setValue] = React.useState('show me "Hello World" in as many langauges as you can think of');
const { isFocused } = useFocus({ autoFocus: true });
useInput(