Skip to content

Commit 45aeca5

Browse files
committed
lint
1 parent 8912d7e commit 45aeca5

File tree

10 files changed

+39
-20
lines changed

10 files changed

+39
-20
lines changed

apps/twig/src/main/trpc/routers/os.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,10 @@ export const osRouter = router({
158158
.input(
159159
z.object({
160160
filePath: z.string(),
161-
maxSizeBytes: z.number().optional().default(10 * 1024 * 1024),
161+
maxSizeBytes: z
162+
.number()
163+
.optional()
164+
.default(10 * 1024 * 1024),
162165
}),
163166
)
164167
.query(async ({ input }) => {

apps/twig/src/renderer/features/code-editor/components/CodeEditorPanel.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@ export function CodeEditorPanel({
4848
{ enabled: !isInsideRepo && !isImage, staleTime: Infinity },
4949
);
5050

51-
const { data: fileContent, isLoading, error } = isInsideRepo
52-
? repoQuery
53-
: absoluteQuery;
51+
const {
52+
data: fileContent,
53+
isLoading,
54+
error,
55+
} = isInsideRepo ? repoQuery : absoluteQuery;
5456

5557
if (isImage) {
5658
return (

apps/twig/src/renderer/features/message-editor/components/ImageAttachmentsBar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function ImageThumbnail({
3939
<Dialog.Trigger>
4040
<button
4141
type="button"
42-
className="inline-flex items-center gap-1 rounded-[var(--radius-1)] bg-[var(--gray-a3)] p-1 text-[10px] leading-tight font-medium text-[var(--gray-11)] hover:bg-[var(--gray-a4)]"
42+
className="inline-flex items-center gap-1 rounded-[var(--radius-1)] bg-[var(--gray-a3)] p-1 font-medium text-[10px] text-[var(--gray-11)] leading-tight hover:bg-[var(--gray-a4)]"
4343
>
4444
{dataUrl ? (
4545
<img
@@ -99,7 +99,7 @@ function FileChip({
9999
}) {
100100
return (
101101
<div className="group relative flex-shrink-0">
102-
<span className="inline-flex items-center gap-1 rounded-[var(--radius-1)] bg-[var(--gray-a3)] p-1 text-[10px] leading-tight font-medium text-[var(--gray-11)]">
102+
<span className="inline-flex items-center gap-1 rounded-[var(--radius-1)] bg-[var(--gray-a3)] p-1 font-medium text-[10px] text-[var(--gray-11)] leading-tight">
103103
<span className="max-w-[120px] truncate">@{attachment.label}</span>
104104
</span>
105105
<IconButton

apps/twig/src/renderer/features/message-editor/components/MessageEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import { useTiptapEditor } from "../tiptap/useTiptapEditor";
1111
import type { EditorHandle } from "../types";
1212
import type { EditorContent as EditorContentType } from "../utils/content";
1313
import { AdapterIndicator } from "./AdapterIndicator";
14-
import { AttachmentsBar } from "./ImageAttachmentsBar";
1514
import { DiffStatsIndicator } from "./DiffStatsIndicator";
1615
import { EditorToolbar } from "./EditorToolbar";
16+
import { AttachmentsBar } from "./ImageAttachmentsBar";
1717
import { ModeIndicatorInput } from "./ModeIndicatorInput";
1818

1919
export type { EditorHandle as MessageEditorHandle };

apps/twig/src/renderer/features/message-editor/tiptap/MentionChipView.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
import { type NodeViewProps, NodeViewWrapper } from "@tiptap/react";
22
import type { MentionChipAttrs } from "./MentionChipNode";
33

4-
function DefaultChip({
5-
type,
6-
label,
7-
}: {
8-
type: string;
9-
label: string;
10-
}) {
4+
function DefaultChip({ type, label }: { type: string; label: string }) {
115
const isCommand = type === "command";
126
const prefix = isCommand ? "/" : "@";
137

148
return (
159
<span
16-
className={`${isCommand ? "cli-slash-command" : "cli-file-mention"} inline select-all cursor-default rounded-[var(--radius-1)] bg-[var(--accent-a3)] px-1 py-px text-xs font-medium text-[var(--accent-11)]`}
10+
className={`${isCommand ? "cli-slash-command" : "cli-file-mention"} inline cursor-default select-all rounded-[var(--radius-1)] bg-[var(--accent-a3)] px-1 py-px font-medium text-[var(--accent-11)] text-xs`}
1711
contentEditable={false}
1812
>
1913
{prefix}

apps/twig/src/renderer/features/message-editor/tiptap/useTiptapEditor.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ export function useTiptapEditor(options: UseTiptapEditorOptions) {
334334
}
335335
// Only run on mount / session change
336336
// eslint-disable-next-line react-hooks/exhaustive-deps
337-
}, [sessionId]);
337+
}, [draft.restoredAttachments]);
338338

339339
const submit = useCallback(() => {
340340
if (!editor) return;
@@ -364,7 +364,15 @@ export function useTiptapEditor(options: UseTiptapEditorOptions) {
364364
setAttachments([]);
365365
draft.clearDraft();
366366
}
367-
}, [editor, disabled, submitDisabled, isLoading, draft, clearOnSubmit, attachments]);
367+
}, [
368+
editor,
369+
disabled,
370+
submitDisabled,
371+
isLoading,
372+
draft,
373+
clearOnSubmit,
374+
attachments,
375+
]);
368376

369377
submitRef.current = submit;
370378

apps/twig/src/renderer/features/message-editor/types.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import type { AvailableCommand } from "@agentclientprotocol/sdk";
2-
import type { EditorContent, FileAttachment, MentionChip } from "./utils/content";
2+
import type {
3+
EditorContent,
4+
FileAttachment,
5+
MentionChip,
6+
} from "./utils/content";
37

48
export interface EditorHandle {
59
focus: () => void;

apps/twig/src/renderer/features/message-editor/utils/content.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ export function extractFilePaths(content: EditorContent): string[] {
8787
const seen = new Set<string>();
8888

8989
for (const seg of content.segments) {
90-
if (seg.type === "chip" && seg.chip.type === "file" && !seen.has(seg.chip.id)) {
90+
if (
91+
seg.type === "chip" &&
92+
seg.chip.type === "file" &&
93+
!seen.has(seg.chip.id)
94+
) {
9195
seen.add(seg.chip.id);
9296
filePaths.push(seg.chip.id);
9397
}

apps/twig/src/renderer/features/task-detail/components/TaskInput.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ export function TaskInput() {
158158
}, []);
159159

160160
return (
161+
// biome-ignore lint/a11y/noStaticElementInteractions: drag-and-drop container
161162
<div
162163
ref={containerRef}
163164
style={{

apps/twig/src/renderer/features/task-detail/components/TaskInputEditor.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,10 @@ export const TaskInputEditor = forwardRef<
153153
}
154154
}}
155155
>
156-
<AttachmentsBar attachments={attachments} onRemove={removeAttachment} />
156+
<AttachmentsBar
157+
attachments={attachments}
158+
onRemove={removeAttachment}
159+
/>
157160

158161
<Flex
159162
align="start"

0 commit comments

Comments
 (0)