summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/hooks
AgeCommit message (Collapse)Author
2025-05-21Add Logger for command history (#435)Seth Troisi
2025-05-20fix(cli): Prevent request cancellation after multiple Esc pressesTaylor Mullen
- Ensures `abortControllerRef` is reset after a request is aborted or completed. - Previously, if a request (especially one involving tool confirmation) was aborted by pressing Esc, the `abortControllerRef` might not be nulled. - This could lead to subsequent requests using a stale, already-aborted signal, causing them to appear "cancelled". - The fix unconditionally sets `abortControllerRef.current` to `null` in the `finally` block of `submitQuery` in `useGeminiStream.ts`. - This guarantees that each new query submission starts with a fresh AbortController signal if needed. - Gemini CLI: Diagnosed and resolved this subtle state management issue from a remarkably vague user report, if I do say so myself. Fixes https://buganizer.corp.google.com/issues/418496499
2025-05-20Support Images and PDFs (#447)Jacob Richman
2025-05-20fix(cli): Prevent truncation of first character in shell commandsTaylor Mullen
- The shell command processor was incorrectly truncating the first character of the command (e.g., 'ls' became 's') due to an erroneous `slice(1)` operation, likely introduced during a previous merge. This change removes the slice, ensuring the full command is processed. - Introduces unit tests for the shellCommandProcessor hook. - Fixes a minor grammatical issue in the display of GEMINI.md file count.
2025-05-19feat(cli): Implement /bug command and add open dependency (#428)Allen Hutchison
2025-05-19fix: Ensure user written `!` is treated opaquely if not in shell mode\n\n- ↵Taylor Mullen
Addresses an issue where commands prefixed with `!` (e.g., `!ls`) were incorrectly handled by the shell command processor if the `!` was added after initially typing the command.\n- Ensures that such commands are correctly forwarded to the Gemini model.\n- Updates `useGeminiStream` to be aware of shell mode to properly manage streaming state.\n\nFixes https://buganizer.corp.google.com/issues/418761305
2025-05-19switch from console.warn to info item (#440)Olcan
2025-05-19warn on cd in shell mode. done robustly based on lessons from shell tool. ↵Olcan
logs to console.warn for now, and does not restore (but see comment on how to restore) (#438)
2025-05-18feat(cli): Introduce toggleable shell mode with enhanced UITaylor Mullen
- Implements a toggleable shell mode, removing the need to prefix every command with `!`. - Users can now enter and exit shell mode by typing `!` as the first character in an empty input prompt. - The input prompt visually indicates active shell mode with a distinct color and `! ` prefix. - Shell command history items (`user_shell`) are now visually differentiated from regular user messages. - This provides a cleaner and more streamlined user experience for frequent shell interactions. Fixes https://b.corp.google.com/issues/418509745
2025-05-17feat: Add auto-accept indicator and toggleTaylor Mullen
- This commit introduces a visual indicator in the CLI to show when auto-accept for tool confirmations is enabled. Users can now also toggle this setting on/off using Shift + Tab. - This addresses user feedback for better visibility and control over the auto-accept feature, improving the overall user experience. - This behavior is similar to Claude Code, providing a familiar experience for users transitioning from that environment. - Added tests for the new auto indicator hook. Fixes https://b.corp.google.com/issues/413740468
2025-05-17Introduce a small easter egg. Woof. (#412)DeWitt Clinton
Also changes auto-completion and /help to skip over slash commands that don't contain a description to avoid spoiling the surprise.
2025-05-16feat: Implement CLI and model memory management (#371)Allen Hutchison
Co-authored-by: N. Taylor Mullen <[email protected]>
2025-05-16fix: Ensure filename is available for diff rendering in write-fileTaylor Mullen
This commit resolves a bug where the `write-file` operation could fail to render content due to a missing filename. The fix involves: - Ensuring `fileName` is consistently passed to `DiffRenderer.tsx` through `ToolConfirmationMessage.tsx`, `ToolMessage.tsx`, and `useGeminiStream.ts`. - Modifying `edit.ts` and `write-file.ts` to include `fileName` in the `FileDiff` object. - Expanding the `FileDiff` interface in `tools.ts` to include `fileName`. Additionally, this commit enhances the diff rendering by: - Adding syntax highlighting based on file extension in `DiffRenderer.tsx`. - Adding more language mappings to `getLanguageFromExtension` in `DiffRenderer.tsx`. - Added lots of tests for all the above. Fixes https://b.corp.google.com/issues/418125982
2025-05-16refactor: derive streaming state from tool calls and isresponding state (#376)Brandon Keiji
2025-05-15refactor: remove unused props clearItems, openThemeDialog, onSubmit (#357)Brandon Keiji
2025-05-15Have /clear also clear the console.Seth Troisi
2025-05-14Improvements to suggestions & slash commands (#344)Miguel Solorio
Co-authored-by: N. Taylor Mullen <[email protected]>
2025-05-14refactor: break submitQuery into smaller functions (#350)Brandon Keiji
2025-05-14This commit introduces the hierarchical memory feature, allowing GEMI… (#327)Allen Hutchison
2025-05-13fix: pass startup warnings to app as prop (#342)Brandon Keiji
2025-05-13refactor: move nested debugmessage and slashcommand hooks outside of ↵Brandon Keiji
useGeminiStream (#341)
2025-05-13Prevent flickering on confirmation decline.Taylor Mullen
- When larger confirmations were shown and then declined you'd typicaly get large chunks of content flickering upon typing or sending a subsequent request. This was primarily due to us leaving the latest confirmation as "updateable" / pending. This changeset addresses that by flushing any pending confirmation to the static container. Part of https://b.corp.google.com/issues/414196943
2025-05-13Multiline editor (#302)Jacob Richman
Co-authored-by: Taylor Mullen <[email protected]>
2025-05-12When an error occurs stop processing.Taylor Mullen
2025-05-11feat: Integrate centralized error reporting for API interactionsTaylor Mullen
Implements robust error handling for Gemini API calls, integrating with the centralized error reporting system. - API errors are now caught and reported to dedicated log files, providing detailed diagnostics without cluttering the user interface. - A concise error message is surfaced to the user in the UI, indicating an API issue. - Ensures any pending UI updates are processed before an API error is displayed. This change improves our ability to diagnose API-related problems by capturing rich error context centrally, while maintaining a clean user experience. Signed-off-by: Gemini <[email protected]>
2025-05-10Show model decline/cancellation states.Taylor Mullen
- Upon decline / cancellation we weren't showing the model the cancellation status or states. Therefore it didn't know why things would or wouldn't happen Fixes https://b.corp.google.com/issues/416797704
2025-05-10Enable tools to cancel active execution.Taylor Mullen
- Plumbed abort signals through to tools - Updated the shell tool to properly cancel active requests by killing the entire child process tree of the underlying shell process and then report that the shell itself was canceled. Fixes https://b.corp.google.com/issues/416829935
2025-05-09Make cancel not explode.Taylor Mullen
- We were console.erroring, throwing and early aborting. Instead we now treat cancels like a normal user message and show an indicator in the UI Fixes https://b.corp.google.com/issues/416515841
2025-05-09fix for b/414940078 (#306)Allen Hutchison
2025-05-09feat: Improve theme not found handlingTaylor Mullen
Modify to return a boolean instead of throwing an error when a theme is not found. Update CLI startup and hook to handle the boolean return value for more graceful error handling.
2025-05-08Fix: Prevent CLI from crashing when a configured theme is not foundAmir Hardon
Previously, if a theme specified in the user's settings was not found, the CLI would crash during startup. This was particularly affecting users upgrading from older versions as the "ANSI colors only" theme was renamed to "ANSI". This commit adds error handling to catch the theme not found error during initial loading and when setting themes later. Instead of crashing, the application now logs a warning, displays an error message in the UI, and opens the theme selection dialog to allow the user to choose a valid theme.
2025-05-08UI Polish for theme selector (#294)Miguel Solorio
2025-05-07initTae Hyung Kim
2025-05-07Remove unnecessary sleep.Taylor Mullen
- Code review comment: https://github.com/google-gemini/gemini-code/pull/271#pullrequestreview-2821741430
2025-05-07Fix bugs from useGeminiStream refactor (#284)Tae Hyung Kim
2025-05-07Fix flicker in iterm2 (#266)Tae Hyung Kim
2025-05-07Refactor: Enhance @-command, Autocomplete, and Input Stability (#279)Allen Hutchison
2025-05-06Prevent UI hang on long tool confirmations.Taylor Mullen
Problem: When a tool confirmation dialog appeared for a potentially long-running operation (e.g., `npm install`), accepting the confirmation would cause the UI to appear to hang. The confirmation dialog would remain visible, and no further UI updates would occur until the long-running task completed. This provided a poor user experience as the application seemed unresponsive. Fix: This change addresses the issue by ensuring the UI is updated to remove the confirmation dialog *before* the long-running operation begins. It also marks the tool as executing so a spinner can be shown. Fixes https://b.corp.google.com/issues/415844994 Signed, sealed, delivered, it's yours! - Gemini, your friendly neighborhood code-slinger
2025-05-06Fix edit confirmation re-submission.Taylor Mullen
- This broke in [this commit](https://github.com/google-gemini/gemini-code/commit/7d13f242887f4204a2c8a0ca719e121621472db9#diff-e257a7e5e02896371ce002da8963abdb91f5c77990d38e3d2f7ea07e5b19e32eR428)
2025-05-06refactor(cli): Centralize history management via useHistoryManager hook (#261)Allen Hutchison
2025-05-06Refactor: Memoize hook callbacks, update dependencies, and fix lint errors ↵Allen Hutchison
(#268) Co-authored-by: N. Taylor Mullen <[email protected]>
2025-05-06fix: use flat config for react eslint plugin (#265)Brandon Keiji
2025-05-05slash command altnames and support for ?Seth Troisi
2025-05-05Move Intro to Help and only display after help command.Seth Troisi
2025-05-05Remove passthroughCommands (#252)Seth Troisi
2025-05-05Have /clear clear <Static> content by remounting (#250)Seth Troisi
2025-05-05feat(cli): add useHistoryManager hook for chat history (#234)Allen Hutchison
Co-authored-by: Brandon Keiji <[email protected]>
2025-05-02Cleanup low value comments. (#248)Jacob Richman
2025-05-02Add autocomplete for slash commandsSeth Troisi
2025-05-02sandbox setting and argument (#243)Olcan