mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
Various spelling improvements (#3497)
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> Co-authored-by: Sandy Tao <sandytao520@icloud.com>
This commit is contained in:
@@ -298,7 +298,7 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => {
|
||||
config.getContentGeneratorConfig().authType ===
|
||||
AuthType.LOGIN_WITH_GOOGLE
|
||||
) {
|
||||
// Use actual user tier if available, otherwise default to FREE tier behavior (safe default)
|
||||
// Use actual user tier if available; otherwise, default to FREE tier behavior (safe default)
|
||||
const isPaidTier =
|
||||
userTier === UserTierId.LEGACY || userTier === UserTierId.STANDARD;
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ export const Footer: React.FC<FooterProps> = ({
|
||||
</Text>
|
||||
) : process.env.SANDBOX === 'sandbox-exec' ? (
|
||||
<Text color={Colors.AccentYellow}>
|
||||
MacOS Seatbelt{' '}
|
||||
macOS Seatbelt{' '}
|
||||
<Text color={Colors.Gray}>({process.env.SEATBELT_PROFILE})</Text>
|
||||
</Text>
|
||||
) : (
|
||||
|
||||
@@ -448,7 +448,7 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
|
||||
return;
|
||||
}
|
||||
|
||||
// Fallback to the text buffer's default input handling for all other keys
|
||||
// Fall back to the text buffer's default input handling for all other keys
|
||||
buffer.handleInput(key);
|
||||
},
|
||||
[
|
||||
|
||||
@@ -73,7 +73,7 @@ export function ThemeDialog({
|
||||
const initialThemeIndex = themeItems.findIndex(
|
||||
(item) => item.value === selectedThemeName,
|
||||
);
|
||||
// If not found, fallback to the first theme
|
||||
// If not found, fall back to the first theme
|
||||
const safeInitialThemeIndex = initialThemeIndex >= 0 ? initialThemeIndex : 0;
|
||||
|
||||
const scopeItems = [
|
||||
@@ -185,7 +185,7 @@ export function ThemeDialog({
|
||||
}
|
||||
|
||||
// Don't focus the scope selection if it is hidden due to height constraints.
|
||||
const currenFocusedSection = !showScopeSelection ? 'theme' : focusedSection;
|
||||
const currentFocusedSection = !showScopeSelection ? 'theme' : focusedSection;
|
||||
|
||||
// Vertical space taken by elements other than the two code blocks in the preview pane.
|
||||
// Includes "Preview" title, borders, and margin between blocks.
|
||||
@@ -224,8 +224,8 @@ export function ThemeDialog({
|
||||
<Box flexDirection="row">
|
||||
{/* Left Column: Selection */}
|
||||
<Box flexDirection="column" width="45%" paddingRight={2}>
|
||||
<Text bold={currenFocusedSection === 'theme'} wrap="truncate">
|
||||
{currenFocusedSection === 'theme' ? '> ' : ' '}Select Theme{' '}
|
||||
<Text bold={currentFocusedSection === 'theme'} wrap="truncate">
|
||||
{currentFocusedSection === 'theme' ? '> ' : ' '}Select Theme{' '}
|
||||
<Text color={Colors.Gray}>{otherScopeModifiedMessage}</Text>
|
||||
</Text>
|
||||
<RadioButtonSelect
|
||||
@@ -234,25 +234,25 @@ export function ThemeDialog({
|
||||
initialIndex={safeInitialThemeIndex}
|
||||
onSelect={handleThemeSelect}
|
||||
onHighlight={handleThemeHighlight}
|
||||
isFocused={currenFocusedSection === 'theme'}
|
||||
isFocused={currentFocusedSection === 'theme'}
|
||||
maxItemsToShow={8}
|
||||
showScrollArrows={true}
|
||||
showNumbers={currenFocusedSection === 'theme'}
|
||||
showNumbers={currentFocusedSection === 'theme'}
|
||||
/>
|
||||
|
||||
{/* Scope Selection */}
|
||||
{showScopeSelection && (
|
||||
<Box marginTop={1} flexDirection="column">
|
||||
<Text bold={currenFocusedSection === 'scope'} wrap="truncate">
|
||||
{currenFocusedSection === 'scope' ? '> ' : ' '}Apply To
|
||||
<Text bold={currentFocusedSection === 'scope'} wrap="truncate">
|
||||
{currentFocusedSection === 'scope' ? '> ' : ' '}Apply To
|
||||
</Text>
|
||||
<RadioButtonSelect
|
||||
items={scopeItems}
|
||||
initialIndex={0} // Default to User Settings
|
||||
onSelect={handleScopeSelect}
|
||||
onHighlight={handleScopeHighlight}
|
||||
isFocused={currenFocusedSection === 'scope'}
|
||||
showNumbers={currenFocusedSection === 'scope'}
|
||||
isFocused={currentFocusedSection === 'scope'}
|
||||
showNumbers={currentFocusedSection === 'scope'}
|
||||
/>
|
||||
</Box>
|
||||
)}
|
||||
@@ -261,7 +261,7 @@ export function ThemeDialog({
|
||||
{/* Right Column: Preview */}
|
||||
<Box flexDirection="column" width="55%" paddingLeft={2}>
|
||||
<Text bold>Preview</Text>
|
||||
{/* Get the Theme object for the highlighted theme, fallback to default if not found */}
|
||||
{/* Get the Theme object for the highlighted theme, fall back to default if not found */}
|
||||
{(() => {
|
||||
const previewTheme =
|
||||
themeManager.getTheme(
|
||||
|
||||
@@ -146,7 +146,7 @@ function executeShellCommand(
|
||||
process.kill(-child.pid, 'SIGKILL');
|
||||
}
|
||||
} catch (_e) {
|
||||
// Fallback to killing just the main process if group kill fails.
|
||||
// Fall back to killing just the main process if group kill fails.
|
||||
if (!exited) child.kill('SIGKILL');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ describe('useHistoryManager', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should not change history if updateHistoryItem is called with a non-existent ID', () => {
|
||||
it('should not change history if updateHistoryItem is called with a nonexistent ID', () => {
|
||||
const { result } = renderHook(() => useHistory());
|
||||
const timestamp = Date.now();
|
||||
const itemData: Omit<HistoryItem, 'id'> = {
|
||||
@@ -107,7 +107,7 @@ describe('useHistoryManager', () => {
|
||||
const originalHistory = [...result.current.history]; // Clone before update attempt
|
||||
|
||||
act(() => {
|
||||
result.current.updateItem(99999, { text: 'Should not apply' }); // Non-existent ID
|
||||
result.current.updateItem(99999, { text: 'Should not apply' }); // Nonexistent ID
|
||||
});
|
||||
|
||||
expect(result.current.history).toEqual(originalHistory);
|
||||
|
||||
@@ -67,7 +67,7 @@ describe('useShellHistory', () => {
|
||||
expect(command).toBe('cmd2');
|
||||
});
|
||||
|
||||
it('should handle a non-existent history file gracefully', async () => {
|
||||
it('should handle a nonexistent history file gracefully', async () => {
|
||||
const error = new Error('File not found') as NodeJS.ErrnoException;
|
||||
error.code = 'ENOENT';
|
||||
mockedFs.readFile.mockRejectedValue(error);
|
||||
|
||||
@@ -341,7 +341,7 @@ describe('useReactToolScheduler', () => {
|
||||
const schedule = result.current[1];
|
||||
const request: ToolCallRequestInfo = {
|
||||
callId: 'call1',
|
||||
name: 'nonExistentTool',
|
||||
name: 'nonexistentTool',
|
||||
args: {},
|
||||
};
|
||||
|
||||
@@ -361,7 +361,7 @@ describe('useReactToolScheduler', () => {
|
||||
request,
|
||||
response: expect.objectContaining({
|
||||
error: expect.objectContaining({
|
||||
message: 'Tool "nonExistentTool" not found in registry.',
|
||||
message: 'Tool "nonexistentTool" not found in registry.',
|
||||
}),
|
||||
}),
|
||||
}),
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Shades of Purple Theme — for Highlightjs.
|
||||
* Shades of Purple Theme — for Highlight.js.
|
||||
* @author Ahmad Awais <https://twitter.com/mrahmadawais/>
|
||||
*/
|
||||
import { type ColorsTheme, Theme } from './theme.js';
|
||||
|
||||
@@ -85,7 +85,7 @@ describe('ThemeManager', () => {
|
||||
expect(themeManager.getTheme('MyCustomTheme')).toBeDefined();
|
||||
});
|
||||
|
||||
it('should fallback to default theme if active theme is invalid', () => {
|
||||
it('should fall back to default theme if active theme is invalid', () => {
|
||||
(themeManager as unknown as { activeTheme: unknown }).activeTheme = {
|
||||
name: 'NonExistent',
|
||||
type: 'custom',
|
||||
|
||||
@@ -117,7 +117,7 @@ class ThemeManager {
|
||||
if (process.env.NO_COLOR) {
|
||||
return NoColorTheme;
|
||||
}
|
||||
// Ensure the active theme is always valid (fallback to default if not)
|
||||
// Ensure the active theme is always valid (fall back to default if not)
|
||||
if (!this.activeTheme || !this.findThemeByName(this.activeTheme.name)) {
|
||||
this.activeTheme = DEFAULT_THEME;
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ export class Theme {
|
||||
inkTheme[key] = resolvedColor;
|
||||
}
|
||||
// If color is not resolvable, it's omitted from the map,
|
||||
// allowing fallback to the default foreground color.
|
||||
// this enables falling back to the default foreground color.
|
||||
}
|
||||
// We currently only care about the 'color' property for Ink rendering.
|
||||
// Other properties like background, fontStyle, etc., are ignored.
|
||||
|
||||
@@ -50,7 +50,7 @@ function renderHastNode(
|
||||
}
|
||||
|
||||
// Determine the color to pass down: Use this element's specific color
|
||||
// if found, otherwise, continue passing down the already inherited color.
|
||||
// if found; otherwise, continue passing down the already inherited color.
|
||||
const colorToPassDown = elementColor || inheritedColor;
|
||||
|
||||
// Recursively render children, passing the determined color down
|
||||
@@ -70,7 +70,7 @@ function renderHastNode(
|
||||
|
||||
// Handle Root Node: Start recursion with initially inherited color
|
||||
if (node.type === 'root') {
|
||||
// Check if children array is empty - this happens when lowlight can't detect language – fallback to plain text
|
||||
// Check if children array is empty - this happens when lowlight can't detect language – fall back to plain text
|
||||
if (!node.children || node.children.length === 0) {
|
||||
return null;
|
||||
}
|
||||
@@ -161,7 +161,7 @@ export function colorizeCode(
|
||||
`[colorizeCode] Error highlighting code for language "${language}":`,
|
||||
error,
|
||||
);
|
||||
// Fallback to plain text with default color on error
|
||||
// Fall back to plain text with default color on error
|
||||
// Also display line numbers in fallback
|
||||
const lines = codeToHighlight.split('\n');
|
||||
const padWidth = String(lines.length).length; // Calculate padding width based on number of lines
|
||||
|
||||
@@ -200,7 +200,7 @@ describe('commandUtils', () => {
|
||||
expect(mockChild.stdin.end).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should fallback to xsel when xclip fails', async () => {
|
||||
it('should fall back to xsel when xclip fails', async () => {
|
||||
const testText = 'Hello, world!';
|
||||
let callCount = 0;
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ This function aims to find an *intelligent* or "safe" index within the provided
|
||||
* **Single Line Breaks:** If no double newline is found in a suitable range, it will look for a single newline (`\n`).
|
||||
* Any newline chosen as a split point must also not be inside a code block.
|
||||
|
||||
4. **Fallback to `idealMaxLength`:**
|
||||
4. **Fall back to `idealMaxLength`:**
|
||||
* If no "safer" split point (respecting code blocks or finding suitable newlines) is identified before or at `idealMaxLength`, and `idealMaxLength` itself is not determined to be an unsafe split point (e.g., inside a code block), the function may return a length larger than `idealMaxLength`, again it CANNOT break markdown formatting. This could happen with very long lines of text without Markdown block structures or newlines.
|
||||
|
||||
**In essence, `findSafeSplitPoint` tries to be a good Markdown citizen when forced to divide content, preferring structural boundaries over arbitrary character limits, with a strong emphasis on not corrupting code blocks.**
|
||||
|
||||
Reference in New Issue
Block a user