-
Notifications
You must be signed in to change notification settings - Fork 14.2k
fix(patch): cherry-pick 0a7ee67 to release/v0.8.2-pr-10900 to patch version v0.8.2 and create version 0.8.3 #10928
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,27 +4,43 @@ | |
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| import { Box, Text } from 'ink'; | ||
| import { Box, Text, useIsScreenReaderEnabled } from 'ink'; | ||
| import { useAppContext } from '../contexts/AppContext.js'; | ||
| import { useUIState } from '../contexts/UIStateContext.js'; | ||
| import { theme } from '../semantic-colors.js'; | ||
| import { StreamingState } from '../types.js'; | ||
| import { UpdateNotification } from './UpdateNotification.js'; | ||
|
|
||
| import { homedir } from 'node:os'; | ||
| import path from 'node:path'; | ||
|
|
||
| const settingsPath = path.join(homedir(), '.gemini', 'settings.json'); | ||
|
|
||
| export const Notifications = () => { | ||
| const { startupWarnings } = useAppContext(); | ||
| const { initError, streamingState, updateInfo } = useUIState(); | ||
|
|
||
| const isScreenReaderEnabled = useIsScreenReaderEnabled(); | ||
| const showStartupWarnings = startupWarnings.length > 0; | ||
| const showInitError = | ||
| initError && streamingState !== StreamingState.Responding; | ||
|
|
||
| if (!showStartupWarnings && !showInitError && !updateInfo) { | ||
| if ( | ||
| !showStartupWarnings && | ||
| !showInitError && | ||
| !updateInfo && | ||
| !isScreenReaderEnabled | ||
| ) { | ||
| return null; | ||
| } | ||
|
|
||
| return ( | ||
| <> | ||
| {isScreenReaderEnabled && ( | ||
| <Text> | ||
| You are currently in screen reader-friendly view. To switch out, open{' '} | ||
| {settingsPath} and remove the entry for {'"screenReader"'}. | ||
| </Text> | ||
|
Comment on lines
+39
to
+42
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The instruction to the user is ambiguous and relies on a hardcoded path that may be incorrect. The setting is A clearer and safer message would be to instruct the user on the setting they need to change, without specifying a file path. |
||
| )} | ||
| {updateInfo && <UpdateNotification message={updateInfo.message} />} | ||
| {showStartupWarnings && ( | ||
| <Box | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hardcoding the path to the settings file is brittle. The Gemini CLI supports multiple configuration files with a specific order of precedence (e.g., user, project, system). If the screen reader setting is enabled in a higher-precedence file like a project's
.gemini/settings.json, editing the user-level file at the hardcoded path will not disable the feature, leading to user confusion.This path logic should be removed from the UI component. The path, if needed, should be provided by the application's configuration service.