mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
refactor(vscode-ide-companion): remove deprecated file locations
- Removed old InfoBanner.tsx file location - Removed old ReadToolCall.tsx file location These files have been moved to new directory structures.
This commit is contained in:
@@ -1,109 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Qwen Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import type React from 'react';
|
||||
import { TerminalIcon, CloseIcon } from './icons/index.js';
|
||||
|
||||
interface InfoBannerProps {
|
||||
/**
|
||||
* Whether the banner is visible
|
||||
*/
|
||||
visible: boolean;
|
||||
|
||||
/**
|
||||
* Callback when the banner is dismissed
|
||||
*/
|
||||
onDismiss: () => void;
|
||||
|
||||
/**
|
||||
* Optional: Custom message content (if not provided, uses default)
|
||||
*/
|
||||
message?: React.ReactNode;
|
||||
|
||||
/**
|
||||
* Optional: Custom link text
|
||||
*/
|
||||
linkText?: string;
|
||||
|
||||
/**
|
||||
* Optional: Callback when the link is clicked
|
||||
*/
|
||||
onLinkClick?: (e: React.MouseEvent<HTMLAnchorElement>) => void;
|
||||
}
|
||||
|
||||
export const InfoBanner: React.FC<InfoBannerProps> = ({
|
||||
visible,
|
||||
onDismiss,
|
||||
message,
|
||||
linkText = 'Switch back in Settings.',
|
||||
onLinkClick,
|
||||
}) => {
|
||||
if (!visible) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className="flex items-center justify-between"
|
||||
style={{
|
||||
gap: '12px',
|
||||
padding: '12px 16px',
|
||||
backgroundColor: 'var(--app-input-secondary-background)',
|
||||
borderColor: 'var(--app-primary-border-color)',
|
||||
}}
|
||||
>
|
||||
<div className="flex items-center flex-1 min-w-0" style={{ gap: '12px' }}>
|
||||
{/* Icon */}
|
||||
<TerminalIcon className="flex-shrink-0 w-4 h-4" />
|
||||
|
||||
{/* Message */}
|
||||
<label
|
||||
className="m-0 leading-snug text-[13px]"
|
||||
style={{ color: 'var(--app-primary-foreground)' }}
|
||||
>
|
||||
{message || (
|
||||
<>
|
||||
Prefer the Terminal experience?{' '}
|
||||
{onLinkClick && (
|
||||
<a
|
||||
href="#"
|
||||
className="no-underline hover:underline cursor-pointer outline-none"
|
||||
style={{ color: 'var(--app-qwen-orange)' }}
|
||||
onClick={onLinkClick}
|
||||
>
|
||||
{linkText}
|
||||
</a>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
{/* Close button */}
|
||||
<button
|
||||
className="flex items-center justify-center cursor-pointer rounded"
|
||||
style={{
|
||||
background: 'none',
|
||||
border: 'none',
|
||||
padding: '6px',
|
||||
color: 'var(--app-secondary-foreground)',
|
||||
borderRadius: '4px',
|
||||
}}
|
||||
onMouseEnter={(e) => {
|
||||
e.currentTarget.style.backgroundColor =
|
||||
'var(--app-ghost-button-hover-background)';
|
||||
}}
|
||||
onMouseLeave={(e) => {
|
||||
e.currentTarget.style.backgroundColor = 'transparent';
|
||||
}}
|
||||
aria-label="Close banner"
|
||||
onClick={onDismiss}
|
||||
>
|
||||
<CloseIcon className="w-[10px] h-[10px]" />
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -1,74 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Qwen Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Read tool call component - specialized for file reading operations
|
||||
*/
|
||||
|
||||
import type React from 'react';
|
||||
import type { BaseToolCallProps } from './shared/types.js';
|
||||
import { ToolCallContainer } from './shared/LayoutComponents.js';
|
||||
import { groupContent } from './shared/utils.js';
|
||||
import { FileLink } from '../ui/FileLink.js';
|
||||
|
||||
/**
|
||||
* Specialized component for Read tool calls
|
||||
* Optimized for displaying file reading operations
|
||||
* Shows: Read filename (no content preview)
|
||||
*/
|
||||
export const ReadToolCall: React.FC<BaseToolCallProps> = ({ toolCall }) => {
|
||||
const { content, locations, toolCallId } = toolCall;
|
||||
|
||||
// Group content by type
|
||||
const { errors } = groupContent(content);
|
||||
|
||||
// Error case: show error
|
||||
if (errors.length > 0) {
|
||||
const path = locations?.[0]?.path || '';
|
||||
return (
|
||||
<ToolCallContainer
|
||||
label={'Read'}
|
||||
status="error"
|
||||
toolCallId={toolCallId}
|
||||
labelSuffix={
|
||||
path ? (
|
||||
<FileLink
|
||||
path={path}
|
||||
showFullPath={false}
|
||||
className="text-xs font-mono text-[var(--app-secondary-foreground)] hover:underline"
|
||||
/>
|
||||
) : undefined
|
||||
}
|
||||
>
|
||||
{errors.join('\n')}
|
||||
</ToolCallContainer>
|
||||
);
|
||||
}
|
||||
|
||||
// Success case: show which file was read with filename in label
|
||||
if (locations && locations.length > 0) {
|
||||
const path = locations[0].path;
|
||||
return (
|
||||
<ToolCallContainer
|
||||
label={'Read'}
|
||||
status="success"
|
||||
toolCallId={toolCallId}
|
||||
labelSuffix={
|
||||
path ? (
|
||||
<FileLink
|
||||
path={path}
|
||||
showFullPath={false}
|
||||
className="text-xs font-mono text-[var(--app-secondary-foreground)] hover:underline"
|
||||
/>
|
||||
) : undefined
|
||||
}
|
||||
>
|
||||
{null}
|
||||
</ToolCallContainer>
|
||||
);
|
||||
}
|
||||
|
||||
// No file info, don't show
|
||||
return null;
|
||||
};
|
||||
Reference in New Issue
Block a user