feat: 优化useSettingsHooks以及全面review DiffRender的settings的入参是否有缺失

This commit is contained in:
BlockHand 2026-01-23 15:30:08 +08:00
parent 1a87ae9dde
commit a9280d992e
5 changed files with 62 additions and 22 deletions

View file

@ -30,7 +30,7 @@ import {
TOOL_STATUS,
} from '../../constants.js';
import { theme } from '../../semantic-colors.js';
import { SettingsContext } from '../../contexts/SettingsContext.js';
import { useSettings } from '../../contexts/SettingsContext.js';
import type { LoadedSettings } from '../../../config/settings.js';
const STATIC_HEIGHT = 1;
@ -247,7 +247,7 @@ export const ToolMessage: React.FC<ToolMessageProps> = ({
ptyId,
config,
}) => {
const settings = React.useContext(SettingsContext);
const settings = useSettings();
const isThisShellFocused =
(name === SHELL_COMMAND_NAME || name === 'Shell') &&
status === ToolCallStatus.Executing &&