- Introduced a new IPC handler for reading binary files as base64 for inline previews, enhancing the editor's capability to display images directly. - Implemented a placeholder component for non-previewable binary files, providing users with file information and an option to open in the system viewer. - Enhanced the EditorFileWatcher to ignore permission errors and adjusted debounce timing for better performance during file system events. - Updated the ProjectFileService to include a method for reading binary previews with security checks and MIME type validation. - Improved the EditorImagePreview component to handle loading states and display images with a checkerboard background for transparency. - Refactored the EditorBinaryState component to utilize the new binary preview functionality, streamlining the display of binary files.
32 lines
831 B
TypeScript
32 lines
831 B
TypeScript
/**
|
|
* Styled span for rendering inline code chip tokens in the backdrop overlay.
|
|
* Uses the same text as the textarea (transparent) to maintain pixel-perfect alignment.
|
|
*
|
|
* Purple color scheme to distinguish from @mention badges (blue).
|
|
*/
|
|
|
|
import type { InlineChip } from '@renderer/types/inlineChip';
|
|
|
|
const CHIP_BG = 'rgba(139, 92, 246, 0.15)';
|
|
const CHIP_TEXT = '#a78bfa';
|
|
|
|
interface CodeChipBadgeProps {
|
|
chip: InlineChip;
|
|
/** The full chip token text (e.g. "📄auth.ts:10-15") */
|
|
tokenText: string;
|
|
}
|
|
|
|
export const CodeChipBadge = ({ tokenText }: CodeChipBadgeProps): React.JSX.Element => {
|
|
return (
|
|
<span
|
|
style={{
|
|
backgroundColor: CHIP_BG,
|
|
color: CHIP_TEXT,
|
|
borderRadius: '4px',
|
|
boxShadow: `0 0 0 1.5px ${CHIP_BG}`,
|
|
}}
|
|
>
|
|
{tokenText}
|
|
</span>
|
|
);
|
|
};
|