chore: run biome lints

This commit is contained in:
Anish Sarkar 2025-12-25 19:32:18 +05:30
parent ee5d14c86c
commit 46bb52a444
5 changed files with 22 additions and 36 deletions

View file

@ -26,7 +26,9 @@ import { notesApiService } from "@/lib/apis/notes-api.service";
import { authenticatedFetch, getBearerToken, redirectToLogin } from "@/lib/auth-utils"; import { authenticatedFetch, getBearerToken, redirectToLogin } from "@/lib/auth-utils";
// BlockNote types // BlockNote types
type BlockNoteInlineContent = string | { text?: string; type?: string; styles?: Record<string, unknown> }; type BlockNoteInlineContent =
| string
| { text?: string; type?: string; styles?: Record<string, unknown> };
interface BlockNoteBlock { interface BlockNoteBlock {
type: string; type: string;

View file

@ -41,23 +41,23 @@ const useAttachmentSrc = () => {
const { file, src } = useAssistantState( const { file, src } = useAssistantState(
useShallow(({ attachment }): { file?: File; src?: string } => { useShallow(({ attachment }): { file?: File; src?: string } => {
if (!attachment || attachment.type !== "image") return {}; if (!attachment || attachment.type !== "image") return {};
// First priority: use File object if available (for new uploads) // First priority: use File object if available (for new uploads)
if (attachment.file) return { file: attachment.file }; if (attachment.file) return { file: attachment.file };
// Second priority: use stored imageDataUrl (for persisted messages) // Second priority: use stored imageDataUrl (for persisted messages)
// This is stored in our custom ChatAttachment interface // This is stored in our custom ChatAttachment interface
const customAttachment = attachment as { imageDataUrl?: string }; const customAttachment = attachment as { imageDataUrl?: string };
if (customAttachment.imageDataUrl) { if (customAttachment.imageDataUrl) {
return { src: customAttachment.imageDataUrl }; return { src: customAttachment.imageDataUrl };
} }
// Third priority: try to extract from content array (standard assistant-ui format) // Third priority: try to extract from content array (standard assistant-ui format)
if (Array.isArray(attachment.content)) { if (Array.isArray(attachment.content)) {
const contentSrc = attachment.content.filter((c) => c.type === "image")[0]?.image; const contentSrc = attachment.content.filter((c) => c.type === "image")[0]?.image;
if (contentSrc) return { src: contentSrc }; if (contentSrc) return { src: contentSrc };
} }
return {}; return {};
}) })
); );
@ -297,9 +297,7 @@ const MessageAttachmentChip: FC = () => {
}; };
export const UserMessageAttachments: FC = () => { export const UserMessageAttachments: FC = () => {
return ( return <MessagePrimitive.Attachments components={{ Attachment: MessageAttachmentChip }} />;
<MessagePrimitive.Attachments components={{ Attachment: MessageAttachmentChip }} />
);
}; };
export const ComposerAttachments: FC = () => { export const ComposerAttachments: FC = () => {

View file

@ -505,7 +505,13 @@ const Composer: FC = () => {
setMentionedDocuments([]); setMentionedDocuments([]);
setMentionedDocumentIds([]); setMentionedDocumentIds([]);
} }
}, [showDocumentPopover, isThreadRunning, composerRuntime, setMentionedDocuments, setMentionedDocumentIds]); }, [
showDocumentPopover,
isThreadRunning,
composerRuntime,
setMentionedDocuments,
setMentionedDocumentIds,
]);
// Handle document removal from inline editor // Handle document removal from inline editor
const handleDocumentRemove = useCallback( const handleDocumentRemove = useCallback(

View file

@ -69,10 +69,7 @@ function useEntranceAnimation(delay = 0): boolean {
/** /**
* Check if an extension belongs to a specific category * Check if an extension belongs to a specific category
*/ */
function isExtensionInCategory( function isExtensionInCategory(ext: string, category: FileExtensionCategory): boolean {
ext: string,
category: FileExtensionCategory
): boolean {
return (FILE_EXTENSIONS[category] as readonly string[]).includes(ext); return (FILE_EXTENSIONS[category] as readonly string[]).includes(ext);
} }
@ -172,8 +169,7 @@ function parseAndRenderWithBadges(text: string): React.ReactNode {
// Chain of Thought Components // Chain of Thought Components
// ============================================================================ // ============================================================================
export interface ChainOfThoughtItemProps export interface ChainOfThoughtItemProps extends React.HTMLAttributes<HTMLDivElement> {
extends React.HTMLAttributes<HTMLDivElement> {
children: React.ReactNode; children: React.ReactNode;
} }
@ -183,10 +179,7 @@ export const ChainOfThoughtItem: React.FC<ChainOfThoughtItemProps> = ({
...props ...props
}) => ( }) => (
<div <div
className={cn( className={cn("text-muted-foreground text-sm flex flex-wrap items-center gap-1", className)}
"text-muted-foreground text-sm flex flex-wrap items-center gap-1",
className
)}
{...props} {...props}
> >
{typeof children === "string" ? parseAndRenderWithBadges(children) : children} {typeof children === "string" ? parseAndRenderWithBadges(children) : children}
@ -290,10 +283,7 @@ export interface ChainOfThoughtProps {
className?: string; className?: string;
} }
export const ChainOfThought: React.FC<ChainOfThoughtProps> = ({ export const ChainOfThought: React.FC<ChainOfThoughtProps> = ({ children, className }) => {
children,
className,
}) => {
const childrenArray = React.Children.toArray(children); const childrenArray = React.Children.toArray(children);
return ( return (

View file

@ -135,10 +135,7 @@ export function parseThinkingResult(data: unknown): DeepAgentThinkingResult {
/** /**
* Check if title contains any of the keywords * Check if title contains any of the keywords
*/ */
function titleContainsKeywords( function titleContainsKeywords(title: string, keywords: readonly string[]): boolean {
title: string,
keywords: readonly string[]
): boolean {
const titleLower = title.toLowerCase(); const titleLower = title.toLowerCase();
return keywords.some((keyword) => titleLower.includes(keyword)); return keywords.some((keyword) => titleLower.includes(keyword));
} }
@ -180,15 +177,8 @@ interface ThinkingStepDisplayProps {
/** /**
* Component to display a single thinking step with controlled open state * Component to display a single thinking step with controlled open state
*/ */
const ThinkingStepDisplay: FC<ThinkingStepDisplayProps> = ({ const ThinkingStepDisplay: FC<ThinkingStepDisplayProps> = ({ step, isOpen, onToggle }) => {
step, const icon = useMemo(() => getStepIcon(step.status, step.title), [step.status, step.title]);
isOpen,
onToggle,
}) => {
const icon = useMemo(
() => getStepIcon(step.status, step.title),
[step.status, step.title]
);
const isInProgress = step.status === STEP_STATUS.IN_PROGRESS; const isInProgress = step.status === STEP_STATUS.IN_PROGRESS;
const isCompleted = step.status === STEP_STATUS.COMPLETED; const isCompleted = step.status === STEP_STATUS.COMPLETED;