Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

feat(ok): bug reports carry images and a contact email (PRD-7688) (#4090)

Andrew Mikofalvyb9d2104dfd4d
diff --git a/.changeset/bug-reporter-images-and-contact-email.md b/.changeset/bug-reporter-images-and-contact-email.md
new file mode 100644
index 000000000..24c5685bf
--- /dev/null
+++ b/.changeset/bug-reporter-images-and-contact-email.md
@@ -0,0 +1,11 @@
+---
+"@inkeep/open-knowledge": patch
+---
+
+The bug reporter can now carry your own images and a contact email.
+
+- **Attach your own screenshots or photos.** The report dialog has a "Your images" row that takes up to 3 PNG, JPEG, or WebP images alongside the automatic screenshot — the cases the automatic capture structurally cannot show, like a native system dialog, a second monitor, or a phone photo of a hang. They land inside the diagnostic zip you can inspect before sending, and inline in the ticket next to the automatic screenshot. Images are not redacted, which the row says, and removing one before you create the report is one click. A failed image upload never fails the report.
+- **Leave an address, once.** A "Share your email for followups" checkbox reveals an email field, the same control the feedback form already has. Unchecked, it never blocks sending. Checked, the address rides the report so the team can reply — which is what reporters have been improvising by typing their name into the note, where it becomes the ticket title.
+- **The address is remembered, and forgettable.** Once given it prefills next time, on both the bug reporter and the feedback form: one stored value, two surfaces, so the feedback form stops asking you to retype it on every send. Unchecking the box and sending deletes the stored address rather than just switching a flag off — reopen and the field is empty, with nothing recoverable by re-checking it. The value stays on your device and is transmitted only inside a report you sent with the box checked.
+
+Released desktop builds keep filing exactly as they do today: every wire change is additive, and a client that sends neither field produces a byte-identical ticket.
diff --git a/packages/app/src/components/FeedbackForm.tsx b/packages/app/src/components/FeedbackForm.tsx
index 98adc5c61..d9b96a1cc 100644
--- a/packages/app/src/components/FeedbackForm.tsx
+++ b/packages/app/src/components/FeedbackForm.tsx
@@ -4,30 +4,26 @@ import { zodResolver } from '@hookform/resolvers/zod';
import type { MessageDescriptor } from '@lingui/core';
import { msg } from '@lingui/core/macro';
import { Trans, useLingui } from '@lingui/react/macro';
-import { Paperclip, ThumbsDown, ThumbsUp, X } from 'lucide-react';
-import { type FC, type ReactNode, useEffect, useRef, useState } from 'react';
+import { ThumbsDown, ThumbsUp, X } from 'lucide-react';
+import type { ReactNode } from 'react';
import { useForm, useWatch } from 'react-hook-form';
import { toast } from 'sonner';
import { z } from 'zod';
-import { fileToFeedbackAttachment, submitFeedback } from '@/lib/feedback';
-import { cn } from '@/lib/utils';
+import { commitContactEmail, contactEmailStore } from '@/lib/contact-email-store';
+import { submitFeedback, toFeedbackAttachmentPayloads } from '@/lib/feedback';
import {
- Attachment,
- AttachmentAction,
- AttachmentActions,
- AttachmentContent,
- AttachmentDescription,
- AttachmentGroup,
- AttachmentMedia,
- AttachmentTitle,
-} from './ui/attachment';
+ ACCEPTED_IMAGE_TYPES,
+ MAX_IMAGE_ATTACHMENTS,
+ MAX_IMAGE_ATTACHMENTS_TOTAL_BYTES,
+} from '@/lib/image-attachments';
+import { cn } from '@/lib/utils';
+import { ImageAttachmentList, ImageAttachmentPicker } from './ImageAttachments';
import { Button } from './ui/button';
import { Checkbox } from './ui/checkbox';
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from './ui/form';
import { Input } from './ui/input';
import { Textarea } from './ui/textarea';
import { ToggleGroup, ToggleGroupItem } from './ui/toggle-group';
-import { Tooltip, TooltipContent, TooltipTrigger } from './ui/tooltip';
const REASONS: { value: string; label: MessageDescriptor }[] = [
{ value: 'too-slow', label: msg`Too slow` },
@@ -38,39 +34,13 @@ const REASONS: { value: string; label: MessageDescriptor }[] = [
{ value: 'other', label: msg`Other` },
];
-const MAX_ATTACHMENTS = 3;
-const MAX_ATTACHMENTS_TOTAL_BYTES = 3 * 1024 * 1024;
-const ACCEPTED_IMAGE_TYPES = ['image/png', 'image/jpeg', 'image/webp'];
+const MAX_ATTACHMENTS = MAX_IMAGE_ATTACHMENTS;
const selectedStateClassName =
'data-[state=on]:border-primary data-[state=on]:bg-primary/5 data-[state=on]:text-primary';
const pillClassName = `rounded-full border border-input bg-transparent px-3 ${selectedStateClassName}`;
-function formatFileSize(bytes: number): string {
- if (bytes < 1024) return `${bytes} B`;
- if (bytes < 1024 * 1024) return `${Math.round(bytes / 1024)} KB`;
- return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
-}
-
-function mergeAttachments(current: File[], picked: FileList | null): File[] {
- const seen = new Set(current.map((f) => `${f.name}:${f.size}`));
- const accepted = Array.from(picked ?? []).filter(
- (f) => ACCEPTED_IMAGE_TYPES.includes(f.type) && !seen.has(`${f.name}:${f.size}`),
- );
- return [...current, ...accepted].slice(0, MAX_ATTACHMENTS);
-}
-
-const AttachmentImagePreview: FC<{ file: File }> = ({ file }) => {
- const [url, setUrl] = useState<string | null>(null);
- useEffect(() => {
- const objectUrl = URL.createObjectURL(file);
- setUrl(objectUrl);
- return () => URL.revokeObjectURL(objectUrl);
- }, [file]);
- return url ? <img src={url} alt="" className="size-full object-cover" /> : null;
-};
-
export const FeedbackForm = ({
onSuccess,
source = 'resources_menu',
@@ -87,7 +57,6 @@ export const FeedbackForm = ({
className?: string;
}) => {
const { t } = useLingui();
- const fileInputRef = useRef<HTMLInputElement>(null);
const schema = z
.object({
@@ -98,11 +67,13 @@ export const FeedbackForm = ({
.array(z.instanceof(File))
.max(MAX_ATTACHMENTS, t`You can attach up to ${MAX_ATTACHMENTS} images.`)
.refine(
- (files) => files.every((f) => ACCEPTED_IMAGE_TYPES.includes(f.type)),
+ (files) =>
+ files.every((f) => (ACCEPTED_IMAGE_TYPES as readonly string[]).includes(f.type)),
t`Only PNG, JPEG, or WebP images are allowed.`,
)
.refine(
- (files) => files.reduce((total, f) => total + f.size, 0) <= MAX_ATTACHMENTS_TOTAL_BYTES,
+ (files) =>
+ files.reduce((total, f) => total + f.size, 0) <= MAX_IMAGE_ATTACHMENTS_TOTAL_BYTES,
t`Attachments must total under 3 MB.`,
),
shareEmail: z.boolean(),
@@ -113,6 +84,8 @@ export const FeedbackForm = ({
message: t`Please enter a valid email.`,
});
+ const rememberedEmail = contactEmailStore.getSnapshot().email;
+
const form = useForm<z.infer<typeof schema>>({
resolver: zodResolver(schema),
defaultValues: {
@@ -120,8 +93,8 @@ export const FeedbackForm = ({
reasons: [],
message: '',
attachments: [],
- shareEmail: false,
- email: '',
+ shareEmail: rememberedEmail !== null,
+ email: rememberedEmail ?? '',
},
});
@@ -131,28 +104,35 @@ export const FeedbackForm = ({
const shareEmail = useWatch({ control: form.control, name: 'shareEmail' });
const attachments = useWatch({ control: form.control, name: 'attachments' });
- const atMaxAttachments = attachments.length >= MAX_ATTACHMENTS;
const attachmentsError = form.formState.errors.attachments;
const setAttachments = (files: File[]) =>
form.setValue('attachments', files, { shouldValidate: true });
const onSubmit = async (data: z.infer<typeof schema>) => {
try {
- const attachments = data.attachments.length
- ? await Promise.all(data.attachments.map(fileToFeedbackAttachment))
- : undefined;
+ const email = data.shareEmail && data.email ? data.email : undefined;
+ const attachments = await toFeedbackAttachmentPayloads(data.attachments);
const result = await submitFeedback({
kind: 'general',
rating: data.rating,
reasons: data.reasons,
message: data.message.trim() || undefined,
- email: data.shareEmail && data.email ? data.email : undefined,
- attachments,
+ email,
+ ...attachments,
source,
});
if (result.ok) {
toast.success(t`Thanks for the feedback!`);
- form.reset();
+ commitContactEmail(data.shareEmail, data.email);
+ const remembered = contactEmailStore.getSnapshot().email;
+ form.reset({
+ rating: undefined,
+ reasons: [],
+ message: '',
+ attachments: [],
+ shareEmail: remembered !== null,
+ email: remembered ?? '',
+ });
onSuccess?.();
return;
}
@@ -292,48 +272,10 @@ export const FeedbackForm = ({
placeholder={t`Tell us more (optional)`}
className={cn('resize-none pb-9', compact ? 'min-h-16' : 'min-h-20')}
/>
- <Tooltip>
- {}
- <TooltipTrigger asChild>
- <span
- className={cn(
- 'absolute bottom-1.5 left-1.5 inline-flex',
- atMaxAttachments && 'cursor-not-allowed',
- )}
- >
- <Button
- type="button"
- variant="ghost"
- size="icon"
- disabled={atMaxAttachments}
- onClick={() => fileInputRef.current?.click()}
- className="size-7 text-muted-foreground"
- >
- <Paperclip className="size-4" />
- <span className="sr-only">
- <Trans>Attach images</Trans>
- </span>
- </Button>
- </span>
- </TooltipTrigger>
- <TooltipContent>
- {atMaxAttachments ? (
- <Trans>Maximum {MAX_ATTACHMENTS} attachments</Trans>
- ) : (
- <Trans>Attach images</Trans>
- )}
- </TooltipContent>
- </Tooltip>
- <Input
- ref={fileInputRef}
- type="file"
- accept={ACCEPTED_IMAGE_TYPES.join(',')}
- multiple
- className="hidden"
- onChange={(e) => {
- setAttachments(mergeAttachments(attachments, e.target.files));
- e.target.value = '';
- }}
+ <ImageAttachmentPicker
+ files={attachments}
+ onChange={setAttachments}
+ className="absolute bottom-1.5 left-1.5"
/>
</div>
</FormControl>
@@ -341,36 +283,11 @@ export const FeedbackForm = ({
)}
/>
- {attachments.length > 0 && (
- <AttachmentGroup>
- {attachments.map((file, index) => (
- <Attachment key={`${file.name}:${file.size}`} size="xs">
- <AttachmentMedia variant="image">
- <AttachmentImagePreview file={file} />
- </AttachmentMedia>
- <AttachmentContent>
- <AttachmentTitle>{file.name}</AttachmentTitle>
- <AttachmentDescription>{formatFileSize(file.size)}</AttachmentDescription>
- </AttachmentContent>
- <AttachmentActions>
- <AttachmentAction
- type="button"
- aria-label={t`Remove ${file.name}`}
- onClick={() =>
- setAttachments(attachments.filter((_, i) => i !== index))
- }
- >
- <X className="size-3.5" />
- </AttachmentAction>
- </AttachmentActions>
- </Attachment>
- ))}
- </AttachmentGroup>
- )}
-
- {attachmentsError?.message && (
- <p className="text-destructive text-sm">{attachmentsError.message}</p>
- )}
+ <ImageAttachmentList
+ files={attachments}
+ onChange={setAttachments}
+ error={attachmentsError?.message ?? null}
+ />
</div>
</div>
<div className="space-y-2">
diff --git a/packages/app/src/components/ImageAttachments.tsx b/packages/app/src/components/ImageAttachments.tsx
new file mode 100644
index 000000000..9273e44dd
--- /dev/null
+++ b/packages/app/src/components/ImageAttachments.tsx
@@ -0,0 +1,154 @@
+import { Trans, useLingui } from '@lingui/react/macro';
+import { Paperclip, X } from 'lucide-react';
+import { type FC, useEffect, useRef, useState } from 'react';
+import {
+ ACCEPTED_IMAGE_TYPES,
+ formatFileSize,
+ type ImageAttachmentProblem,
+ MAX_IMAGE_ATTACHMENTS,
+ mergeImageAttachments,
+} from '@/lib/image-attachments';
+
+const MAX_ATTACHMENTS = MAX_IMAGE_ATTACHMENTS;
+
+import { cn } from '@/lib/utils';
+import {
+ Attachment,
+ AttachmentAction,
+ AttachmentActions,
+ AttachmentContent,
+ AttachmentDescription,
+ AttachmentGroup,
+ AttachmentMedia,
+ AttachmentTitle,
+} from './ui/attachment';
+import { Button } from './ui/button';
+import { Input } from './ui/input';
+import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './ui/tooltip';
+
+const ImageAttachmentPreview: FC<{ file: File }> = ({ file }) => {
+ const [url, setUrl] = useState<string | null>(null);
+ useEffect(() => {
+ const objectUrl = URL.createObjectURL(file);
+ setUrl(objectUrl);
+ return () => URL.revokeObjectURL(objectUrl);
+ }, [file]);
+ return url ? <img src={url} alt="" className="size-full object-cover" /> : null;
+};
+
+export interface ImageAttachmentPickerProps {
+ files: readonly File[];
+ onChange: (files: File[]) => void;
+ disabled?: boolean;
+ className?: string;
+}
+
+export const ImageAttachmentPicker: FC<ImageAttachmentPickerProps> = ({
+ files,
+ onChange,
+ disabled = false,
+ className,
+}) => {
+ const fileInputRef = useRef<HTMLInputElement>(null);
+ const atMax = files.length >= MAX_ATTACHMENTS;
+ const blocked = disabled || atMax;
+ return (
+ <>
+ <TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <span className={cn('inline-flex', blocked && 'cursor-not-allowed', className)}>
+ <Button
+ type="button"
+ variant="ghost"
+ size="icon"
+ disabled={blocked}
+ onClick={() => fileInputRef.current?.click()}
+ className="size-7 text-muted-foreground"
+ >
+ <Paperclip className="size-4" />
+ <span className="sr-only">
+ <Trans>Attach images</Trans>
+ </span>
+ </Button>
+ </span>
+ </TooltipTrigger>
+ <TooltipContent>
+ {atMax ? (
+ <Trans>Maximum {MAX_ATTACHMENTS} attachments</Trans>
+ ) : (
+ <Trans>Attach images</Trans>
+ )}
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ <Input
+ ref={fileInputRef}
+ type="file"
+ accept={ACCEPTED_IMAGE_TYPES.join(',')}
+ multiple
+ className="hidden"
+ onChange={(e) => {
+ onChange(mergeImageAttachments(files, e.target.files));
+ e.target.value = '';
+ }}
+ />
+ </>
+ );
+};
+
+export interface ImageAttachmentListProps {
+ files: readonly File[];
+ onChange: (files: File[]) => void;
+ error?: string | null;
+}
+
+export const ImageAttachmentList: FC<ImageAttachmentListProps> = ({
+ files,
+ onChange,
+ error = null,
+}) => {
+ const { t } = useLingui();
+ if (files.length === 0 && error === null) return null;
+ return (
+ <>
+ {files.length > 0 && (
+ <AttachmentGroup>
+ {files.map((file, index) => (
+ <Attachment key={`${file.name}:${file.size}`} size="xs">
+ <AttachmentMedia variant="image">
+ <ImageAttachmentPreview file={file} />
+ </AttachmentMedia>
+ <AttachmentContent>
+ <AttachmentTitle>{file.name}</AttachmentTitle>
+ <AttachmentDescription>{formatFileSize(file.size)}</AttachmentDescription>
+ </AttachmentContent>
+ <AttachmentActions>
+ <AttachmentAction
+ type="button"
+ aria-label={t`Remove ${file.name}`}
+ onClick={() => onChange(files.filter((_, i) => i !== index))}
+ >
+ <X className="size-3.5" />
+ </AttachmentAction>
+ </AttachmentActions>
+ </Attachment>
+ ))}
+ </AttachmentGroup>
+ )}
+ {error !== null && <p className="text-destructive text-sm">{error}</p>}
+ </>
+ );
+};
+
+export function useImageAttachmentProblemMessage(): (
+ problem: ImageAttachmentProblem | null,
+) => string | null {
+ const { t } = useLingui();
+ return (problem) => {
+ if (problem === null) return null;
+ if (problem === 'count') return t`You can attach up to ${MAX_ATTACHMENTS} images.`;
+ if (problem === 'type') return t`Only PNG, JPEG, or WebP images are allowed.`;
+ return t`Attachments must total under 3 MB.`;
+ };
+}
diff --git a/packages/app/src/components/ReportBugDialog.dom.test.tsx b/packages/app/src/components/ReportBugDialog.dom.test.tsx
index f5bef625a..545708ffc 100644
--- a/packages/app/src/components/ReportBugDialog.dom.test.tsx
+++ b/packages/app/src/components/ReportBugDialog.dom.test.tsx
@@ -13,6 +13,7 @@ import { useEffect, useState } from 'react';
import { afterEach, describe, expect, test, vi } from 'vitest';
import { TooltipProvider } from '@/components/ui/tooltip';
import { bugReportSendManager } from '@/lib/bug-report-send-manager';
+import { contactEmailStore } from '@/lib/contact-email-store';
import { installPointerPositionTracker } from '@/lib/pointer-position';
import { renderLinguiTemplate } from '@/test-utils/lingui-mock';
@@ -72,6 +73,7 @@ type CreateRequest = {
note?: string;
includeCrashDump?: boolean;
includeScreenshot?: boolean;
+ attachments?: { contentType: string; bytes: Uint8Array }[];
};
type SendRequest = OkBugReportSendInput;
@@ -394,6 +396,7 @@ describe('ReportBugDialog', () => {
note: 'upload me',
},
includeScreenshot: false,
+ includeAttachments: false,
},
]);
@@ -1172,3 +1175,169 @@ describe('ReportBugDialog', () => {
expect(screen.getByText('OpenKnowledge quit unexpectedly last time.')).not.toBeNull();
});
});
+
+describe('ReportBugDialog — contact email opt-in', () => {
+ afterEach(async () => {
+ cleanup();
+ contactEmailStore.forget();
+ await vi.waitFor(() => {
+ expect(bugReportSendManager.getSnapshot().some((op) => op.status === 'sending')).toBe(false);
+ });
+ clearBridge();
+ });
+
+ function emailCheckbox() {
+ return screen.getByRole('checkbox', { name: 'Share your email for followups' });
+ }
+
+ test('the input stays hidden until the box is ticked', async () => {
+ installBridge();
+ await renderDialog();
+
+ expect(screen.queryByPlaceholderText('[email protected]')).toBeNull();
+ await userEvent.click(emailCheckbox());
+ expect(screen.getByPlaceholderText('[email protected]')).not.toBeNull();
+ });
+
+ test('an unchecked box never blocks Create and sends no email on the wire', async () => {
+ const log = installBridge();
+ await renderDialog();
+
+ await createReport();
+ await userEvent.click(screen.getByRole('button', { name: 'Send report' }));
+
+ expect(log.sendCalls).toHaveLength(1);
+ expect(log.sendCalls[0]?.metadata.email).toBeUndefined();
+ });
+
+ test('a checked box with an invalid address blocks Create with the shared message', async () => {
+ const log = installBridge();
+ await renderDialog();
+
+ await userEvent.click(emailCheckbox());
+ await userEvent.type(screen.getByPlaceholderText('[email protected]'), 'nope');
+ await userEvent.click(screen.getByRole('button', { name: 'Create report' }));
+
+ expect(screen.getByText('Please enter a valid email.')).not.toBeNull();
+ expect(log.createCalls).toHaveLength(0);
+ });
+
+ test('a valid address rides the send metadata and is remembered for next time', async () => {
+ const log = installBridge();
+ await renderDialog();
+
+ await userEvent.click(emailCheckbox());
+ await userEvent.type(screen.getByPlaceholderText('[email protected]'), '[email protected]');
+ await createReport();
+ await userEvent.click(screen.getByRole('button', { name: 'Send report' }));
+
+ expect(log.sendCalls[0]?.metadata.email).toBe('[email protected]');
+ expect(contactEmailStore.getSnapshot().email).toBe('[email protected]');
+ });
+
+ test('a remembered address prefills the box and the input on open', async () => {
+ contactEmailStore.remember('[email protected]');
+ installBridge();
+ await renderDialog();
+
+ expect((emailCheckbox() as HTMLInputElement).getAttribute('data-state')).toBe('checked');
+ expect(screen.getByDisplayValue('[email protected]')).not.toBeNull();
+ });
+
+ test('unchecking and sending forgets the stored address entirely', async () => {
+ contactEmailStore.remember('[email protected]');
+ installBridge();
+ await renderDialog();
+
+ await userEvent.click(emailCheckbox());
+ await createReport();
+ await userEvent.click(screen.getByRole('button', { name: 'Send report' }));
+
+ expect(contactEmailStore.getSnapshot().email).toBeNull();
+ });
+});
+
+describe('ReportBugDialog — reporter attachments', () => {
+ afterEach(async () => {
+ cleanup();
+ contactEmailStore.forget();
+ await vi.waitFor(() => {
+ expect(bugReportSendManager.getSnapshot().some((op) => op.status === 'sending')).toBe(false);
+ });
+ clearBridge();
+ });
+
+ function pngFile(name: string, bytes = [0x89, 0x50, 0x4e, 0x47]) {
+ return new File([new Uint8Array(bytes)], name, { type: 'image/png' });
+ }
+
+ function fileInput(): HTMLInputElement {
+ const input = document.querySelector('input[type="file"]');
+ if (input === null) throw new Error('no attachment file input rendered');
+ return input as HTMLInputElement;
+ }
+
+ test('the row explains that reporter images are not redacted', async () => {
+ installBridge();
+ await renderDialog();
+
+ expect(screen.getByText('Your images')).not.toBeNull();
+ expect(screen.getByText(/aren't redacted/)).not.toBeNull();
+ });
+
+ test('a picked image renders a removable card and rides the create request', async () => {
+ const log = installBridge();
+ await renderDialog();
+
+ await userEvent.upload(fileInput(), pngFile('dialog.png'));
+ expect(screen.getByText('dialog.png')).not.toBeNull();
+
+ await userEvent.click(screen.getByRole('button', { name: 'Create report' }));
+ await screen.findByRole('heading', { name: 'Review your report' });
+
+ expect(log.createCalls[0]?.attachments).toHaveLength(1);
+ expect(log.createCalls[0]?.attachments?.[0]?.contentType).toBe('image/png');
+ expect(log.createCalls[0]?.attachments?.[0]?.bytes).toBeInstanceOf(Uint8Array);
+ });
+
+ test('removing the card drops it from the create request', async () => {
+ const log = installBridge();
+ await renderDialog();
+
+ await userEvent.upload(fileInput(), pngFile('dialog.png'));
+ await userEvent.click(screen.getByRole('button', { name: 'Remove dialog.png' }));
+ expect(screen.queryByText('dialog.png')).toBeNull();
+
+ await userEvent.click(screen.getByRole('button', { name: 'Create report' }));
+ await screen.findByRole('heading', { name: 'Review your report' });
+
+ expect(log.createCalls[0]?.attachments).toBeUndefined();
+ });
+
+ test('a fourth pick is refused at the cap and the picker disables', async () => {
+ installBridge();
+ await renderDialog();
+
+ await userEvent.upload(fileInput(), [
+ pngFile('a.png', [1]),
+ pngFile('b.png', [2]),
+ pngFile('c.png', [3]),
+ pngFile('d.png', [4]),
+ ]);
+
+ expect(screen.queryByText('d.png')).toBeNull();
+ expect(screen.getByRole('button', { name: 'Attach images' }).hasAttribute('disabled')).toBe(
+ true,
+ );
+ });
+
+ test('a report with no attachments sends includeAttachments false', async () => {
+ const log = installBridge();
+ await renderDialog();
+
+ await createReport();
+ await userEvent.click(screen.getByRole('button', { name: 'Send report' }));
+
+ expect(log.sendCalls[0]?.includeAttachments).toBe(false);
+ });
+});
diff --git a/packages/app/src/components/ReportBugDialogBody.tsx b/packages/app/src/components/ReportBugDialogBody.tsx
index 2c5ac81f0..fe9853f92 100644
--- a/packages/app/src/components/ReportBugDialogBody.tsx
+++ b/packages/app/src/components/ReportBugDialogBody.tsx
@@ -5,11 +5,19 @@ import type {
OkBugReportScreenshot,
ReportBundleSummary,
} from '@inkeep/open-knowledge-core';
-import { BUG_REPORT_SCREENSHOT_ZIP_ENTRY } from '@inkeep/open-knowledge-core';
+import {
+ BUG_REPORT_SCREENSHOT_ZIP_ENTRY,
+ isBugReportAttachmentEntry,
+} from '@inkeep/open-knowledge-core';
import { Plural, Trans, useLingui } from '@lingui/react/macro';
import { AlertCircleIcon, ArchiveIcon, ShieldIcon, TriangleAlertIcon } from 'lucide-react';
-import { useId, useRef, useState } from 'react';
+import { useEffect, useId, useRef, useState } from 'react';
import { BugReportPreviousReports } from '@/components/BugReportHistory';
+import {
+ ImageAttachmentList,
+ ImageAttachmentPicker,
+ useImageAttachmentProblemMessage,
+} from '@/components/ImageAttachments';
import { Badge } from '@/components/ui/badge';
import { Button } from '@/components/ui/button';
import { Checkbox } from '@/components/ui/checkbox';
@@ -22,11 +30,16 @@ import {
DialogHeader,
DialogTitle,
} from '@/components/ui/dialog';
+import { Input } from '@/components/ui/input';
import { Spinner } from '@/components/ui/spinner';
import { Textarea } from '@/components/ui/textarea';
+import { useContactEmail } from '@/hooks/use-contact-email';
import { bugReportSendManager } from '@/lib/bug-report-send-manager';
import { formatBundleSize, zipBasename } from '@/lib/bug-report-support';
+import { commitContactEmail } from '@/lib/contact-email-store';
+import { imageAttachmentsProblem, isImageAttachmentType } from '@/lib/image-attachments';
import { revealInFileManagerLabel } from '@/lib/platform-labels';
+import { isValidContactEmail } from '@/lib/validate-email';
export interface ReportBugCrashContext {
source: string;
@@ -106,10 +119,26 @@ const COMPOSE_IDLE: Phase = { step: 'compose', creating: false, createError: nul
function reportIncludesRawDump(report: CreatedReport): boolean {
return report.summary.files.some(
- (file) => file.startsWith('extra/') && file !== BUG_REPORT_SCREENSHOT_ZIP_ENTRY,
+ (file) =>
+ file.startsWith('extra/') &&
+ file !== BUG_REPORT_SCREENSHOT_ZIP_ENTRY &&
+ !isBugReportAttachmentEntry(file),
);
}
+function reportIncludesAttachments(report: CreatedReport): boolean {
+ return report.summary.files.some(isBugReportAttachmentEntry);
+}
+
+async function toAttachmentInputs(files: readonly File[]) {
+ const inputs = [];
+ for (const file of files) {
+ if (!isImageAttachmentType(file.type)) continue;
+ inputs.push({ contentType: file.type, bytes: new Uint8Array(await file.arrayBuffer()) });
+ }
+ return inputs;
+}
+
export interface ReportBugDialogProps {
open: boolean;
onOpenChange: (open: boolean) => void;
@@ -141,6 +170,10 @@ function ReportBugDialog({
crashInvite !== undefined ? crashInvite.minidumpAvailable === true : probedCrashDumpAvailable;
const [includeDump, setIncludeDump] = useState(crashInvite?.minidumpAvailable === true);
const [includeScreenshot, setIncludeScreenshot] = useState(true);
+ const [attachments, setAttachments] = useState<File[]>([]);
+ const [shareEmail, setShareEmail] = useState(false);
+ const [email, setEmail] = useState('');
+ const [emailError, setEmailError] = useState<string | null>(null);
const opSeqRef = useRef(0);
const noteId = useId();
const logsId = useId();
@@ -151,7 +184,23 @@ function ReportBugDialog({
const dumpHintId = useId();
const screenshotId = useId();
const screenshotHintId = useId();
+ const attachmentsId = useId();
+ const attachmentsHintId = useId();
+ const shareEmailId = useId();
+ const emailId = useId();
+ const emailErrorId = useId();
const whatToIncludeId = useId();
+ const attachmentProblemMessage = useImageAttachmentProblemMessage();
+ const attachmentsError = attachmentProblemMessage(imageAttachmentsProblem(attachments));
+
+ const rememberedEmail = useContactEmail().email;
+
+ useEffect(() => {
+ if (!open) return;
+ setShareEmail(rememberedEmail !== null);
+ setEmail(rememberedEmail ?? '');
+ setEmailError(null);
+ }, [open, rememberedEmail]);
const noteContextLines =
crashContext !== undefined
@@ -178,13 +227,22 @@ function ReportBugDialog({
});
return;
}
+ if (shareEmail && !isValidContactEmail(email.trim())) {
+ setEmailError(t`Please enter a valid email.`);
+ return;
+ }
+ setEmailError(null);
+ if (attachmentsError !== null) return;
const seq = ++opSeqRef.current;
setPhase({ step: 'compose', creating: true, createError: null });
+ const attachmentInputs = await toAttachmentInputs(attachments);
+ if (opSeqRef.current !== seq) return;
const result = await bugReport.create({
level: detailed ? 'full' : 'standard',
note: composeNote(note, noteContextLines),
...(crashDumpAvailable ? { includeCrashDump: includeDump } : {}),
...(screenshot !== null ? { includeScreenshot } : {}),
+ ...(attachmentInputs.length > 0 ? { attachments: attachmentInputs } : {}),
});
if (opSeqRef.current !== seq) return;
if (result.ok) {
@@ -202,16 +260,21 @@ function ReportBugDialog({
}
function handleSend(report: CreatedReport) {
+ const trimmedEmail = email.trim();
+ commitContactEmail(shareEmail, trimmedEmail);
bugReportSendManager.startBugReportSend({
kind: 'created-report',
report,
note: composeNote(note, noteContextLines),
includeScreenshot: report.summary.files.includes(BUG_REPORT_SCREENSHOT_ZIP_ENTRY),
+ includeAttachments: reportIncludesAttachments(report),
+ ...(shareEmail && isValidContactEmail(trimmedEmail) ? { email: trimmedEmail } : {}),
});
setNote('');
setDetailed(crashContext !== undefined || crashInvite !== undefined);
setIncludeDump(crashInvite?.minidumpAvailable === true);
setIncludeScreenshot(true);
+ setAttachments([]);
handleOpenChange(false);
}
@@ -430,6 +493,42 @@ function ReportBugDialog({
</div>
</div>
)}
+ {}
+ {/* biome-ignore lint/a11y/useSemanticElements: role="group" + aria-labelledby matches the sibling checkbox rows above without <fieldset>/<legend>'s layout-reset quirks. */}
+ <div
+ role="group"
+ aria-labelledby={attachmentsId}
+ aria-describedby={attachmentsHintId}
+ className="flex items-start gap-2.5"
+ >
+ <div className="mt-0.5 size-4 shrink-0" aria-hidden="true" />
+ <div className="flex min-w-0 flex-1 flex-col gap-0.5">
+ <p id={attachmentsId} className="text-sm font-medium">
+ <Trans>Your images</Trans>
+ </p>
+ <p id={attachmentsHintId} className="text-1sm text-muted-foreground">
+ <Trans>
+ Add up to 3 screenshots or photos of your own, like a system dialog, another
+ monitor, or a phone photo of a hang. They aren't redacted, so leave out
+ anything that shouldn't be shared.
+ </Trans>
+ </p>
+ <div className="mt-1.5 flex flex-col gap-2">
+ <div className="flex">
+ <ImageAttachmentPicker
+ files={attachments}
+ onChange={setAttachments}
+ disabled={phase.creating}
+ />
+ </div>
+ <ImageAttachmentList
+ files={attachments}
+ onChange={setAttachments}
+ error={attachmentsError}
+ />
+ </div>
+ </div>
+ </div>
{crashDumpAvailable && (
<div className="flex items-start gap-2.5">
<Checkbox
@@ -456,6 +555,45 @@ function ReportBugDialog({
)}
</div>
{}
+ <div className="flex flex-col gap-2">
+ <div className="flex items-center gap-2.5">
+ <Checkbox
+ id={shareEmailId}
+ checked={shareEmail}
+ onCheckedChange={(value) => {
+ setShareEmail(value === true);
+ setEmailError(null);
+ }}
+ disabled={phase.creating}
+ />
+ <label htmlFor={shareEmailId} className="text-sm">
+ <Trans>Share your email for followups</Trans>
+ </label>
+ </div>
+ {shareEmail && (
+ <div className="flex flex-col gap-1.5">
+ <Input
+ id={emailId}
+ type="email"
+ value={email}
+ onChange={(e) => {
+ setEmail(e.target.value);
+ setEmailError(null);
+ }}
+ placeholder={t`[email protected]`}
+ disabled={phase.creating}
+ aria-invalid={emailError !== null}
+ aria-describedby={emailError !== null ? emailErrorId : undefined}
+ />
+ {emailError !== null && (
+ <p id={emailErrorId} className="text-destructive text-sm">
+ {emailError}
+ </p>
+ )}
+ </div>
+ )}
+ </div>
+ {}
{crashInvite === undefined && crashContext === undefined ? (
<BugReportPreviousReports />
) : null}
diff --git a/packages/app/src/hooks/use-contact-email.ts b/packages/app/src/hooks/use-contact-email.ts
new file mode 100644
index 000000000..1db2f96d2
--- /dev/null
+++ b/packages/app/src/hooks/use-contact-email.ts
@@ -0,0 +1,10 @@
+import { useSyncExternalStore } from 'react';
+import {
+ type ContactEmailState,
+ type ContactEmailStore,
+ contactEmailStore,
+} from '@/lib/contact-email-store';
+
+export function useContactEmail(store: ContactEmailStore = contactEmailStore): ContactEmailState {
+ return useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);
+}
diff --git a/packages/app/src/lib/bug-report-send-manager.ts b/packages/app/src/lib/bug-report-send-manager.ts
index 7084d7a91..a2b77d963 100644
--- a/packages/app/src/lib/bug-report-send-manager.ts
+++ b/packages/app/src/lib/bug-report-send-manager.ts
@@ -10,6 +10,7 @@ import {
INERT_SEND_SPAN,
} from '@/lib/bug-report-send-otel';
import { zipBasename } from '@/lib/bug-report-support';
+import { type ContactEmailStore, contactEmailStore } from '@/lib/contact-email-store';
import type { OkDesktopBridge } from '@/lib/desktop-bridge-types';
export type BugReportSendBridge = Pick<OkDesktopBridge['bugReport'], 'send'>;
@@ -50,6 +51,8 @@ export type BugReportSendRequest =
readonly report: CreatedBugReport;
readonly note?: string;
readonly includeScreenshot: boolean;
+ readonly includeAttachments?: boolean;
+ readonly email?: string;
}
| { readonly kind: 'history-row'; readonly row: OkBugReportListRow };
@@ -66,11 +69,16 @@ interface SendInput {
readonly zipSizeBytes: number;
readonly metadata: OkBugReportSendMetadata;
readonly includeScreenshot?: boolean;
+ readonly includeAttachments?: boolean;
}
-function toSendInput(request: BugReportSendRequest): SendInput {
+function toSendInput(
+ request: BugReportSendRequest,
+ store: ContactEmailStore = contactEmailStore,
+): SendInput {
if (request.kind === 'history-row') {
const { row } = request;
+ const remembered = store.getSnapshot().email;
return {
zipPath: row.zipPath,
zipSizeBytes: row.zipBytes,
@@ -79,10 +87,11 @@ function toSendInput(request: BugReportSendRequest): SendInput {
systemWide: row.systemWide,
projectSlug: row.projectSlug,
...(row.note !== undefined ? { note: row.note } : {}),
+ ...(remembered !== null ? { email: remembered } : {}),
},
};
}
- const { report, note, includeScreenshot } = request;
+ const { report, note, includeScreenshot, includeAttachments, email } = request;
return {
zipPath: report.zipPath,
zipSizeBytes: report.zipSizeBytes,
@@ -91,8 +100,10 @@ function toSendInput(request: BugReportSendRequest): SendInput {
systemWide: report.summary.systemWide,
projectSlug: report.summary.projectSlug,
note,
+ ...(email !== undefined ? { email } : {}),
},
includeScreenshot,
+ ...(includeAttachments !== undefined ? { includeAttachments } : {}),
};
}
@@ -109,6 +120,7 @@ interface OperationRecord {
export function createBugReportSendManager(
getBridge: () => BugReportSendBridge | undefined,
+ emailStore: ContactEmailStore = contactEmailStore,
): BugReportSendManager {
const records = new Map<string, OperationRecord>();
const listeners = new Set<() => void>();
@@ -240,6 +252,9 @@ export function createBugReportSendManager(
...(input.includeScreenshot !== undefined
? { includeScreenshot: input.includeScreenshot }
: {}),
+ ...(input.includeAttachments !== undefined
+ ? { includeAttachments: input.includeAttachments }
+ : {}),
...(traceparent === undefined ? {} : { traceparent }),
});
settleFromResult(record, result);
@@ -251,7 +266,7 @@ export function createBugReportSendManager(
return {
startBugReportSend(request): BugReportSendOperation {
- const input = toSendInput(request);
+ const input = toSendInput(request, emailStore);
const operationId = zipBasename(input.zipPath);
const existing = records.get(operationId);
diff --git a/packages/app/src/lib/contact-email-store.test.ts b/packages/app/src/lib/contact-email-store.test.ts
new file mode 100644
index 000000000..f130b3993
--- /dev/null
+++ b/packages/app/src/lib/contact-email-store.test.ts
@@ -0,0 +1,178 @@
+import { describe, expect, test, vi } from 'vitest';
+import {
+ CONTACT_EMAIL_MAX_LENGTH,
+ CONTACT_EMAIL_STORAGE_KEY,
+ type ContactEmailStorage,
+ commitContactEmail,
+ createContactEmailStore,
+ DEFAULT_CONTACT_EMAIL_STATE,
+ readPersistedState,
+ writePersistedState,
+} from './contact-email-store.ts';
+
+function memoryStorage(initial: Record<string, string> = {}): ContactEmailStorage & {
+ raw(): string | null;
+} {
+ const data = new Map(Object.entries(initial));
+ return {
+ getItem(key) {
+ return data.get(key) ?? null;
+ },
+ setItem(key, value) {
+ data.set(key, value);
+ },
+ raw() {
+ return data.get(CONTACT_EMAIL_STORAGE_KEY) ?? null;
+ },
+ };
+}
+
+function refusingStorage(): ContactEmailStorage {
+ return {
+ getItem() {
+ return null;
+ },
+ setItem() {
+ throw new Error('QuotaExceededError');
+ },
+ };
+}
+
+describe('readPersistedState', () => {
+ test('absent key returns default', () => {
+ expect(readPersistedState(memoryStorage())).toEqual(DEFAULT_CONTACT_EMAIL_STATE);
+ });
+
+ test('round-trips a stored address', () => {
+ const s = memoryStorage({
+ [CONTACT_EMAIL_STORAGE_KEY]: JSON.stringify({ email: '[email protected]' }),
+ });
+ expect(readPersistedState(s)).toEqual({ email: '[email protected]' });
+ });
+
+ test('non-string, empty, and over-long values coerce to null', () => {
+ for (const email of [42, {}, null, '', ' ', 'x'.repeat(CONTACT_EMAIL_MAX_LENGTH + 1)]) {
+ const s = memoryStorage({ [CONTACT_EMAIL_STORAGE_KEY]: JSON.stringify({ email }) });
+ expect(readPersistedState(s)).toEqual(DEFAULT_CONTACT_EMAIL_STATE);
+ }
+ });
+
+ test('corrupt JSON returns default without throwing', () => {
+ const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});
+ const s = memoryStorage({ [CONTACT_EMAIL_STORAGE_KEY]: '{not json' });
+ expect(readPersistedState(s)).toEqual(DEFAULT_CONTACT_EMAIL_STATE);
+ warn.mockRestore();
+ });
+});
+
+describe('writePersistedState', () => {
+ test('writes the state verbatim', () => {
+ const s = memoryStorage();
+ writePersistedState({ email: '[email protected]' }, s);
+ expect(s.raw()).toBe(JSON.stringify({ email: '[email protected]' }));
+ });
+});
+
+describe('storage that refuses to write', () => {
+ test('a write failure does not propagate and the store keeps the value in memory', () => {
+ const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});
+ const store = createContactEmailStore(refusingStorage());
+ expect(() => store.remember('[email protected]')).not.toThrow();
+ expect(store.getSnapshot().email).toBe('[email protected]');
+ warn.mockRestore();
+ });
+});
+
+describe('createContactEmailStore', () => {
+ test('remember trims and persists; a fresh store over the same storage sees it', () => {
+ const shared = memoryStorage();
+ createContactEmailStore(shared).remember(' [email protected] ');
+ expect(createContactEmailStore(shared).getSnapshot().email).toBe('[email protected]');
+ });
+
+ test('remember ignores blank and over-long values', () => {
+ const store = createContactEmailStore(memoryStorage());
+ store.remember(' ');
+ expect(store.getSnapshot().email).toBeNull();
+ store.remember('x'.repeat(CONTACT_EMAIL_MAX_LENGTH + 1));
+ expect(store.getSnapshot().email).toBeNull();
+ });
+
+ test('forget clears the address, and nothing survives a fresh store', () => {
+ const shared = memoryStorage();
+ const store = createContactEmailStore(shared);
+ store.remember('[email protected]');
+ store.forget();
+ expect(store.getSnapshot().email).toBeNull();
+ expect(createContactEmailStore(shared).getSnapshot().email).toBeNull();
+ });
+
+ test('subscribe notifies on real transitions only', () => {
+ const store = createContactEmailStore(memoryStorage());
+ let calls = 0;
+ const unsub = store.subscribe(() => {
+ calls++;
+ });
+ store.remember('[email protected]');
+ store.remember('[email protected]');
+ store.forget();
+ store.forget();
+ unsub();
+ store.remember('[email protected]');
+ expect(calls).toBe(2);
+ });
+
+ test('install re-reads storage written after construction', () => {
+ const s = memoryStorage();
+ const store = createContactEmailStore(s);
+ expect(store.getSnapshot().email).toBeNull();
+ writePersistedState({ email: '[email protected]' }, s);
+ store.install();
+ expect(store.getSnapshot().email).toBe('[email protected]');
+ });
+
+ test('syncFromStorage adopts another window write and notifies', () => {
+ const shared = memoryStorage();
+ const thisWindow = createContactEmailStore(shared);
+ let notified = 0;
+ thisWindow.subscribe(() => {
+ notified++;
+ });
+
+ const otherWindow = createContactEmailStore(shared);
+ otherWindow.remember('[email protected]');
+
+ thisWindow.syncFromStorage();
+ expect(thisWindow.getSnapshot().email).toBe('[email protected]');
+ expect(notified).toBeGreaterThan(0);
+ });
+
+ test('syncFromStorage adopts another window forget', () => {
+ const shared = memoryStorage();
+ const thisWindow = createContactEmailStore(shared);
+ thisWindow.remember('[email protected]');
+
+ const otherWindow = createContactEmailStore(shared);
+ otherWindow.forget();
+
+ thisWindow.syncFromStorage();
+ expect(thisWindow.getSnapshot().email).toBeNull();
+ });
+});
+
+describe('commitContactEmail', () => {
+ test('a checked box remembers the address', () => {
+ const shared = memoryStorage();
+ const store = createContactEmailStore(shared);
+ commitContactEmail(true, '[email protected]', store);
+ expect(createContactEmailStore(shared).getSnapshot().email).toBe('[email protected]');
+ });
+
+ test('an unchecked box forgets a previously stored address', () => {
+ const shared = memoryStorage();
+ const store = createContactEmailStore(shared);
+ commitContactEmail(true, '[email protected]', store);
+ commitContactEmail(false, '[email protected]', store);
+ expect(createContactEmailStore(shared).getSnapshot().email).toBeNull();
+ });
+});
diff --git a/packages/app/src/lib/contact-email-store.ts b/packages/app/src/lib/contact-email-store.ts
new file mode 100644
index 000000000..8d0b8f2bf
--- /dev/null
+++ b/packages/app/src/lib/contact-email-store.ts
@@ -0,0 +1,135 @@
+export const CONTACT_EMAIL_STORAGE_KEY = 'ok-contact-email-v1';
+
+export const CONTACT_EMAIL_MAX_LENGTH = 320;
+
+export interface ContactEmailState {
+ readonly email: string | null;
+}
+
+export const DEFAULT_CONTACT_EMAIL_STATE: ContactEmailState = { email: null };
+
+export interface ContactEmailStorage {
+ getItem(key: string): string | null;
+ setItem(key: string, value: string): void;
+}
+
+export interface ContactEmailStore {
+ getSnapshot(): ContactEmailState;
+ subscribe(listener: () => void): () => void;
+ remember(email: string): void;
+ forget(): void;
+ syncFromStorage(): void;
+ install(): void;
+}
+
+function asStoredEmail(value: unknown): string | null {
+ if (typeof value !== 'string') return null;
+ const trimmed = value.trim();
+ if (trimmed === '' || trimmed.length > CONTACT_EMAIL_MAX_LENGTH) return null;
+ return trimmed;
+}
+
+function coerceState(parsed: unknown): ContactEmailState {
+ if (typeof parsed !== 'object' || parsed === null) return DEFAULT_CONTACT_EMAIL_STATE;
+ return { email: asStoredEmail((parsed as Record<string, unknown>).email) };
+}
+
+export function readPersistedState(storage?: ContactEmailStorage): ContactEmailState {
+ try {
+ const s = storage ?? localStorage;
+ const raw = s.getItem(CONTACT_EMAIL_STORAGE_KEY);
+ if (raw == null) return DEFAULT_CONTACT_EMAIL_STATE;
+ return coerceState(JSON.parse(raw));
+ } catch (err) {
+ console.warn('[contact-email-store] readPersistedState failed (corrupt/privacy/SSR)', err);
+ return DEFAULT_CONTACT_EMAIL_STATE;
+ }
+}
+
+export function writePersistedState(state: ContactEmailState, storage?: ContactEmailStorage): void {
+ try {
+ const s = storage ?? localStorage;
+ s.setItem(CONTACT_EMAIL_STORAGE_KEY, JSON.stringify(state));
+ } catch (err) {
+ console.warn('[contact-email-store] writePersistedState failed (quota/privacy/SSR)', err);
+ }
+}
+
+export function createContactEmailStore(storage?: ContactEmailStorage): ContactEmailStore {
+ let state = readPersistedState(storage);
+ const listeners = new Set<() => void>();
+ let installed = false;
+
+ function notify(): void {
+ for (const listener of listeners) listener();
+ }
+
+ function commit(next: ContactEmailState): void {
+ state = next;
+ writePersistedState(state, storage);
+ notify();
+ }
+
+ function syncFromStorage(): void {
+ state = readPersistedState(storage);
+ notify();
+ }
+
+ return {
+ getSnapshot(): ContactEmailState {
+ return state;
+ },
+
+ subscribe(listener): () => void {
+ listeners.add(listener);
+ return () => {
+ listeners.delete(listener);
+ };
+ },
+
+ remember(email): void {
+ const next = asStoredEmail(email);
+ if (next === null || next === state.email) return;
+ commit({ email: next });
+ },
+
+ forget(): void {
+ if (state.email === null) return;
+ commit({ email: null });
+ },
+
+ syncFromStorage,
+
+ install(): void {
+ if (installed) return;
+ installed = true;
+ syncFromStorage();
+ },
+ };
+}
+
+export const contactEmailStore: ContactEmailStore = createContactEmailStore();
+
+if (typeof window !== 'undefined' && typeof window.addEventListener === 'function') {
+ window.addEventListener('storage', (event) => {
+ if (event.key === CONTACT_EMAIL_STORAGE_KEY || event.key === null) {
+ contactEmailStore.syncFromStorage();
+ }
+ });
+}
+
+export function installContactEmailStore(): void {
+ contactEmailStore.install();
+}
+
+export function commitContactEmail(
+ shareEmail: boolean,
+ email: string,
+ store: ContactEmailStore = contactEmailStore,
+): void {
+ if (shareEmail) {
+ store.remember(email);
+ return;
+ }
+ store.forget();
+}
diff --git a/packages/app/src/lib/feedback.ts b/packages/app/src/lib/feedback.ts
index 85fc060e0..d909dbf4b 100644
--- a/packages/app/src/lib/feedback.ts
+++ b/packages/app/src/lib/feedback.ts
@@ -1,4 +1,9 @@
import { BROWSER_RUNTIME_VERSION } from './client-version';
+import {
+ IMAGE_ATTACHMENT_EXTENSIONS,
+ type ImageAttachmentType,
+ isImageAttachmentType,
+} from './image-attachments';
const importMetaEnv = (import.meta as unknown as { env?: Record<string, string | undefined> }).env;
@@ -16,7 +21,7 @@ type FeedbackRating = 'positive' | 'negative';
*/
type FeedbackImageType = 'image/png' | 'image/jpeg' | 'image/webp';
-export interface FeedbackAttachmentPayload {
+interface FeedbackAttachmentPayload {
contentType: FeedbackImageType;
base64: string;
}
@@ -28,9 +33,15 @@ export interface FeedbackPayload {
message?: string;
email?: string;
attachments?: FeedbackAttachmentPayload[];
+ attachmentAssetUrls?: string[];
source?: string;
}
+export type FeedbackAttachmentTransport =
+ | Record<string, never>
+ | { attachments: FeedbackAttachmentPayload[] }
+ | { attachmentAssetUrls: string[] };
+
export type FeedbackResult =
| { ok: true; reference: string }
| { ok: false; reason: 'invalid' | 'unavailable' | 'error' };
@@ -48,10 +59,48 @@ function fileToBase64(file: File): Promise<string> {
});
}
-export async function fileToFeedbackAttachment(file: File): Promise<FeedbackAttachmentPayload> {
+async function fileToFeedbackAttachment(file: File): Promise<FeedbackAttachmentPayload> {
return { contentType: file.type as FeedbackImageType, base64: await fileToBase64(file) };
}
+async function toBase64Transport(files: readonly File[]): Promise<FeedbackAttachmentTransport> {
+ return { attachments: await Promise.all(files.map(fileToFeedbackAttachment)) };
+}
+
+async function uploadThroughDesktop(files: readonly File[]): Promise<string[] | null> {
+ const bridge = typeof window === 'undefined' ? undefined : window.okDesktop;
+ if (bridge === undefined) return null;
+ const assetUrls: string[] = [];
+ for (const [index, file] of files.entries()) {
+ if (!isImageAttachmentType(file.type)) return null;
+ const contentType: ImageAttachmentType = file.type;
+ const bytes = new Uint8Array(await file.arrayBuffer());
+ const filename = `feedback-${index + 1}.${IMAGE_ATTACHMENT_EXTENSIONS[contentType]}`;
+ const result = await bridge.assetUpload.uploadImage({ contentType, bytes, filename });
+ if (!('assetUrl' in result)) {
+ console.warn(`[feedback] action=upload-image result=${result.error} index=${index}`);
+ return null;
+ }
+ assetUrls.push(result.assetUrl);
+ }
+ return assetUrls;
+}
+
+export async function toFeedbackAttachmentPayloads(
+ files: readonly File[],
+): Promise<FeedbackAttachmentTransport> {
+ if (files.length === 0) return {};
+ try {
+ const assetUrls = await uploadThroughDesktop(files);
+ if (assetUrls !== null) return { attachmentAssetUrls: assetUrls };
+ } catch (err) {
+ console.warn(
+ `[feedback] action=upload-image result=unexpected-error message=${err instanceof Error ? err.message : String(err)}`,
+ );
+ }
+ return toBase64Transport(files);
+}
+
function resolvePlatform(): string {
return (typeof window !== 'undefined' && window.okDesktop?.platform) || 'web';
}
diff --git a/packages/app/src/lib/image-attachments.test.ts b/packages/app/src/lib/image-attachments.test.ts
new file mode 100644
index 000000000..76b1a9504
--- /dev/null
+++ b/packages/app/src/lib/image-attachments.test.ts
@@ -0,0 +1,99 @@
+import { describe, expect, test } from 'vitest';
+import {
+ ACCEPTED_IMAGE_TYPES,
+ formatFileSize,
+ imageAttachmentsProblem,
+ isImageAttachmentType,
+ MAX_IMAGE_ATTACHMENTS,
+ MAX_IMAGE_ATTACHMENTS_TOTAL_BYTES,
+ mergeImageAttachments,
+ totalImageAttachmentBytes,
+} from './image-attachments.ts';
+
+function fakeFile(name: string, type: string, size: number): File {
+ const file = new File(['x'], name, { type });
+ Object.defineProperty(file, 'size', { value: size });
+ return file;
+}
+
+function fakeFileList(files: File[]): FileList {
+ return files as unknown as FileList;
+}
+
+describe('isImageAttachmentType', () => {
+ test('accepts exactly the three wire types', () => {
+ for (const type of ACCEPTED_IMAGE_TYPES) expect(isImageAttachmentType(type)).toBe(true);
+ expect(isImageAttachmentType('image/gif')).toBe(false);
+ expect(isImageAttachmentType('application/zip')).toBe(false);
+ });
+});
+
+describe('mergeImageAttachments', () => {
+ test('drops non-image picks', () => {
+ const merged = mergeImageAttachments(
+ [],
+ fakeFileList([fakeFile('a.png', 'image/png', 10), fakeFile('b.gif', 'image/gif', 10)]),
+ );
+ expect(merged.map((f) => f.name)).toEqual(['a.png']);
+ });
+
+ test('dedupes on name and size', () => {
+ const existing = [fakeFile('a.png', 'image/png', 10)];
+ const merged = mergeImageAttachments(
+ existing,
+ fakeFileList([fakeFile('a.png', 'image/png', 10), fakeFile('a.png', 'image/png', 11)]),
+ );
+ expect(merged).toHaveLength(2);
+ });
+
+ test('truncates at the cap', () => {
+ const merged = mergeImageAttachments(
+ [],
+ fakeFileList([
+ fakeFile('a.png', 'image/png', 1),
+ fakeFile('b.png', 'image/png', 2),
+ fakeFile('c.png', 'image/png', 3),
+ fakeFile('d.png', 'image/png', 4),
+ ]),
+ );
+ expect(merged).toHaveLength(MAX_IMAGE_ATTACHMENTS);
+ });
+
+ test('a null pick leaves the current list alone', () => {
+ const existing = [fakeFile('a.png', 'image/png', 10)];
+ expect(mergeImageAttachments(existing, null)).toEqual(existing);
+ });
+});
+
+describe('imageAttachmentsProblem', () => {
+ test('an empty or in-bounds list has no problem', () => {
+ expect(imageAttachmentsProblem([])).toBeNull();
+ expect(imageAttachmentsProblem([fakeFile('a.png', 'image/png', 1024)])).toBeNull();
+ });
+
+ test('reports count, type, and total in that precedence', () => {
+ const four = Array.from({ length: 4 }, (_, i) => fakeFile(`${i}.png`, 'image/png', 1));
+ expect(imageAttachmentsProblem(four)).toBe('count');
+ expect(imageAttachmentsProblem([fakeFile('a.gif', 'image/gif', 1)])).toBe('type');
+ expect(
+ imageAttachmentsProblem([
+ fakeFile('a.png', 'image/png', MAX_IMAGE_ATTACHMENTS_TOTAL_BYTES + 1),
+ ]),
+ ).toBe('total');
+ });
+
+ test('the total is the sum across files, not a per-file bound', () => {
+ const half = Math.ceil(MAX_IMAGE_ATTACHMENTS_TOTAL_BYTES / 2) + 1;
+ const files = [fakeFile('a.png', 'image/png', half), fakeFile('b.png', 'image/png', half)];
+ expect(totalImageAttachmentBytes(files)).toBeGreaterThan(MAX_IMAGE_ATTACHMENTS_TOTAL_BYTES);
+ expect(imageAttachmentsProblem(files)).toBe('total');
+ });
+});
+
+describe('formatFileSize', () => {
+ test('scales bytes, kilobytes, and megabytes', () => {
+ expect(formatFileSize(512)).toBe('512 B');
+ expect(formatFileSize(2048)).toBe('2 KB');
+ expect(formatFileSize(3 * 1024 * 1024)).toBe('3.0 MB');
+ });
+});
diff --git a/packages/app/src/lib/image-attachments.ts b/packages/app/src/lib/image-attachments.ts
new file mode 100644
index 000000000..c3ca144d4
--- /dev/null
+++ b/packages/app/src/lib/image-attachments.ts
@@ -0,0 +1,48 @@
+import {
+ BUG_REPORT_ATTACHMENT_CONTENT_TYPES,
+ BUG_REPORT_ATTACHMENT_EXTENSIONS,
+ MAX_BUG_REPORT_ATTACHMENTS,
+ MAX_BUG_REPORT_ATTACHMENTS_TOTAL_BYTES,
+ type OkImageAttachmentContentType,
+} from '@inkeep/open-knowledge-core';
+
+export const MAX_IMAGE_ATTACHMENTS = MAX_BUG_REPORT_ATTACHMENTS;
+
+export const MAX_IMAGE_ATTACHMENTS_TOTAL_BYTES = MAX_BUG_REPORT_ATTACHMENTS_TOTAL_BYTES;
+
+export const ACCEPTED_IMAGE_TYPES = BUG_REPORT_ATTACHMENT_CONTENT_TYPES;
+
+export type ImageAttachmentType = OkImageAttachmentContentType;
+
+export const IMAGE_ATTACHMENT_EXTENSIONS = BUG_REPORT_ATTACHMENT_EXTENSIONS;
+
+export type ImageAttachmentProblem = 'count' | 'type' | 'total';
+
+export function isImageAttachmentType(value: string): value is ImageAttachmentType {
+ return (ACCEPTED_IMAGE_TYPES as readonly string[]).includes(value);
+}
+
+export function totalImageAttachmentBytes(files: readonly File[]): number {
+ return files.reduce((total, file) => total + file.size, 0);
+}
+
+export function mergeImageAttachments(current: readonly File[], picked: FileList | null): File[] {
+ const seen = new Set(current.map((f) => `${f.name}:${f.size}`));
+ const accepted = Array.from(picked ?? []).filter(
+ (f) => isImageAttachmentType(f.type) && !seen.has(`${f.name}:${f.size}`),
+ );
+ return [...current, ...accepted].slice(0, MAX_IMAGE_ATTACHMENTS);
+}
+
+export function imageAttachmentsProblem(files: readonly File[]): ImageAttachmentProblem | null {
+ if (files.length > MAX_IMAGE_ATTACHMENTS) return 'count';
+ if (!files.every((f) => isImageAttachmentType(f.type))) return 'type';
+ if (totalImageAttachmentBytes(files) > MAX_IMAGE_ATTACHMENTS_TOTAL_BYTES) return 'total';
+ return null;
+}
+
+export function formatFileSize(bytes: number): string {
+ if (bytes < 1024) return `${bytes} B`;
+ if (bytes < 1024 * 1024) return `${Math.round(bytes / 1024)} KB`;
+ return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
+}
diff --git a/packages/app/src/lib/validate-email.ts b/packages/app/src/lib/validate-email.ts
new file mode 100644
index 000000000..51200c219
--- /dev/null
+++ b/packages/app/src/lib/validate-email.ts
@@ -0,0 +1,5 @@
+import { z } from 'zod';
+
+export function isValidContactEmail(value: string): boolean {
+ return z.email().safeParse(value).success;
+}
diff --git a/packages/app/src/locales/ar/messages.json b/packages/app/src/locales/ar/messages.json
index 443ac835f..db25335ab 100644
--- a/packages/app/src/locales/ar/messages.json
+++ b/packages/app/src/locales/ar/messages.json
@@ -2263,6 +2263,9 @@
"PMyJ9C": ["لا توجد جلسة تحرير بعد"],
"PPFQ3o": ["تم تثبيت «", ["0"], "» في ", ["1"]],
"PQCdtv": ["«", ["docName"], "» غير موجود."],
+ "PR0_fn": [
+ "أضِف حتى 3 لقطات شاشة أو صور من عندك، مثل مربع حوار في النظام، أو شاشة أخرى، أو صورة بالهاتف لتوقف التطبيق. لا يجري إخفاء محتواها، لذا استبعِد كل ما لا ينبغي مشاركته."
+ ],
"PR9FSv": ["انتقل إلى نتيجة البحث التالية في المحرر المرئي."],
"PRgIJh": ["تعذّر تحديث ", ["subRoot"], ": ", ["0"]],
"PRnH8G": ["من ", ["0"]],
@@ -5186,6 +5189,7 @@
"تعذّرت إعادة تشغيل الخادم — يعمل تحت حساب مختلف. أعد تشغيل جهازك لتحريره، ثم أعد فتح هذا المشروع."
],
"uUCrBv": ["رابط رمزي"],
+ "uV3EYs": ["صورك"],
"uVbUP8": ["الإعدادات…"],
"uX85yl": [
"تشمل ملفات الإعداد: <0>.ok/</0>، وإعدادات MCP لأدوات الذكاء الاصطناعي (<1>.mcp.json</1> وملفات كل أداة). مهاراتك غير مشمولة: فهي تتبع git مثل أي ملف آخر في المشروع.<2/><3>مشترك</3> يودعها في git، فيحصل كل من يستنسخ المستودع على الإعداد نفسه. <4/><5>أنا فقط</5> يبقيها خارج git (عبر <6>.git/info/exclude</6>)."
diff --git a/packages/app/src/locales/ar/messages.po b/packages/app/src/locales/ar/messages.po
index 5cdaef473..db6c09a4f 100644
--- a/packages/app/src/locales/ar/messages.po
+++ b/packages/app/src/locales/ar/messages.po
@@ -1550,6 +1550,10 @@ msgstr "إضافة إلى {gitignorePath}"
msgid "Add to Dictionary"
msgstr "إضافة إلى القاموس"
+#: src/components/ReportBugDialogBody.tsx
+msgid "Add up to 3 screenshots or photos of your own, like a system dialog, another monitor, or a phone photo of a hang. They aren't redacted, so leave out anything that shouldn't be shared."
+msgstr "أضِف حتى 3 لقطات شاشة أو صور من عندك، مثل مربع حوار في النظام، أو شاشة أخرى، أو صورة بالهاتف لتوقف التطبيق. لا يجري إخفاء محتواها، لذا استبعِد كل ما لا ينبغي مشاركته."
+
#: src/components/settings/frontmatter-schema-field-editor.tsx
msgid "Add value"
msgstr "إضافة قيمة"
@@ -2005,7 +2009,7 @@ msgstr "الأصل: {title}"
msgid "Attach a file"
msgstr "إرفاق ملف"
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Attach images"
msgstr "إرفاق صور"
@@ -2015,6 +2019,7 @@ msgid "Attachments"
msgstr "المرفقات"
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Attachments must total under 3 MB."
msgstr "يجب أن يقل إجمالي المرفقات عن 3 ميغابايت."
@@ -7925,7 +7930,7 @@ msgstr "قواعد markdownlint"
msgid "Match case"
msgstr "مطابقة حالة الأحرف"
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Maximum {MAX_ATTACHMENTS} attachments"
msgstr "بحد أقصى {MAX_ATTACHMENTS} مرفقات"
@@ -9093,6 +9098,7 @@ msgid "Only modified"
msgstr "المعدَّل فقط"
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Only PNG, JPEG, or WebP images are allowed."
msgstr "يُسمح بصور PNG أو JPEG أو WebP فقط."
@@ -10116,6 +10122,7 @@ msgid "Please enter a valid email address."
msgstr "يرجى إدخال عنوان بريد إلكتروني صالح."
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
msgid "Please enter a valid email."
msgstr "يرجى إدخال بريد إلكتروني صالح."
@@ -10718,7 +10725,7 @@ msgstr "إزالة"
#. placeholder {0}: file.name
#. placeholder {0}: image.name
#: src/components/acp/ThreadView.tsx
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Remove {0}"
msgstr "إزالة {0}"
@@ -11998,6 +12005,7 @@ msgid "Share URL"
msgstr "رابط المشاركة"
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
msgid "Share your email for followups"
msgstr "شارك بريدك الإلكتروني للمتابعة"
@@ -15100,6 +15108,7 @@ msgid "You can also manage this in Settings."
msgstr "يمكنك أيضًا إدارة هذا من الإعدادات."
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "You can attach up to {MAX_ATTACHMENTS} images."
msgstr "يمكنك إرفاق ما يصل إلى {MAX_ATTACHMENTS} صور."
@@ -15189,6 +15198,7 @@ msgid "You're subscribed!"
msgstr "تم اشتراكك!"
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
#: src/uninstall/UninstallSurveyScreen.tsx
@@ -15240,6 +15250,10 @@ msgstr "انتهت صلاحية جلسة GitHub لديك — سجّل الدخو
msgid "Your GitHub token is missing required scopes. Try signing in again."
msgstr "ينقص رمز GitHub لديك نطاقات مطلوبة. حاول تسجيل الدخول مرة أخرى."
+#: src/components/ReportBugDialogBody.tsx
+msgid "Your images"
+msgstr "صورك"
+
#: src/components/PublishToGitHubDialog.tsx
msgid "Your knowledge base is now on GitHub at <0>{ownerLogin}/{repoName}</0>."
msgstr "أصبحت قاعدة معرفتك على GitHub في <0>{ownerLogin}/{repoName}</0>."
diff --git a/packages/app/src/locales/bn/messages.json b/packages/app/src/locales/bn/messages.json
index 94a0284da..d8c62f7aa 100644
--- a/packages/app/src/locales/bn/messages.json
+++ b/packages/app/src/locales/bn/messages.json
@@ -1950,6 +1950,9 @@
"PMyJ9C": ["এখনও কোনো সম্পাদনা সেশন নেই"],
"PPFQ3o": ["\"", ["0"], "\" ", ["1"], "-এ ইনস্টল করা হয়েছে"],
"PQCdtv": ["\"", ["docName"], "\" নেই।"],
+ "PR0_fn": [
+ "নিজের সর্বোচ্চ ৩টি স্ক্রিনশট বা ছবি যোগ করুন, যেমন কোনো সিস্টেম ডায়ালগ, অন্য একটি মনিটর, বা অ্যাপ আটকে যাওয়ার সময় ফোনে তোলা ছবি। এগুলো থেকে গোপন তথ্য সরানো হয় না, তাই ভাগ করা উচিত নয় এমন কিছু রাখবেন না।"
+ ],
"PR9FSv": ["দৃশ্য-সম্পাদকের পরবর্তী খোঁজার ফলাফলে যান।"],
"PRgIJh": [["subRoot"], " হালনাগাদ করা যায়নি: ", ["0"]],
"PRnH8G": [["0"], "-এর মধ্যে"],
@@ -4455,6 +4458,7 @@
"সার্ভার পুনরায় চালু করা যায়নি — এটি অন্য অ্যাকাউন্টের অধীনে চলছে। এটি পরিষ্কার করতে কম্পিউটার পুনরায় চালু করুন, তারপর এই প্রকল্পটি আবার খুলুন।"
],
"uUCrBv": ["সিমলিংক"],
+ "uV3EYs": ["আপনার ছবি"],
"uVbUP8": ["সেটিং…"],
"uX85yl": [
"সেটআপ ফাইলের মধ্যে আছে: <0>.ok/</0>, AI-টুল MCP কনফিগ (<1>.mcp.json</1> ও প্রতি-টুল ফাইল)। আপনার স্কিল এর মধ্যে নেই — সেগুলো প্রকল্পের অন্য যেকোনো ফাইলের মতোই git অনুসরণ করে।<2/><3>ভাগ করা</3> সেগুলো git-এ কমিট করে, তাই যে-ই রিপোজিটরিটি ক্লোন করুক একই সেটআপ পায়। <4/><5>শুধু আমার</5> সেগুলো git-এর বাইরে রাখে (<6>.git/info/exclude</6>-এর মাধ্যমে)।"
diff --git a/packages/app/src/locales/bn/messages.po b/packages/app/src/locales/bn/messages.po
index e21eb98fb..e1c24df16 100644
--- a/packages/app/src/locales/bn/messages.po
+++ b/packages/app/src/locales/bn/messages.po
@@ -1546,6 +1546,10 @@ msgstr "{gitignorePath}-এ যোগ করুন"
msgid "Add to Dictionary"
msgstr "অভিধানে যোগ করুন"
+#: src/components/ReportBugDialogBody.tsx
+msgid "Add up to 3 screenshots or photos of your own, like a system dialog, another monitor, or a phone photo of a hang. They aren't redacted, so leave out anything that shouldn't be shared."
+msgstr "নিজের সর্বোচ্চ ৩টি স্ক্রিনশট বা ছবি যোগ করুন, যেমন কোনো সিস্টেম ডায়ালগ, অন্য একটি মনিটর, বা অ্যাপ আটকে যাওয়ার সময় ফোনে তোলা ছবি। এগুলো থেকে গোপন তথ্য সরানো হয় না, তাই ভাগ করা উচিত নয় এমন কিছু রাখবেন না।"
+
#: src/components/settings/frontmatter-schema-field-editor.tsx
msgid "Add value"
msgstr "মান যোগ করুন"
@@ -2001,7 +2005,7 @@ msgstr "সম্পদ: {title}"
msgid "Attach a file"
msgstr "একটি ফাইল সংযুক্ত করুন"
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Attach images"
msgstr "ছবি সংযুক্ত করুন"
@@ -2011,6 +2015,7 @@ msgid "Attachments"
msgstr "সংযুক্তি"
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Attachments must total under 3 MB."
msgstr "সংযুক্তির মোট আকার ৩ MB-র কম হতে হবে।"
@@ -7921,7 +7926,7 @@ msgstr "markdownlint নিয়ম"
msgid "Match case"
msgstr "অক্ষরের ছাঁদ মেলান"
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Maximum {MAX_ATTACHMENTS} attachments"
msgstr "সর্বোচ্চ {MAX_ATTACHMENTS}টি সংযুক্তি"
@@ -9089,6 +9094,7 @@ msgid "Only modified"
msgstr "কেবল পরিবর্তিত"
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Only PNG, JPEG, or WebP images are allowed."
msgstr "কেবল PNG, JPEG বা WebP ছবি অনুমোদিত।"
@@ -10112,6 +10118,7 @@ msgid "Please enter a valid email address."
msgstr "অনুগ্রহ করে একটি বৈধ ইমেইল ঠিকানা দিন।"
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
msgid "Please enter a valid email."
msgstr "অনুগ্রহ করে একটি বৈধ ইমেইল দিন।"
@@ -10714,7 +10721,7 @@ msgstr "সরান"
#. placeholder {0}: file.name
#. placeholder {0}: image.name
#: src/components/acp/ThreadView.tsx
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Remove {0}"
msgstr "{0} সরান"
@@ -11994,6 +12001,7 @@ msgid "Share URL"
msgstr "শেয়ার URL"
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
msgid "Share your email for followups"
msgstr "পরবর্তী যোগাযোগের জন্য আপনার ইমেইল দিন"
@@ -15096,6 +15104,7 @@ msgid "You can also manage this in Settings."
msgstr "আপনি এটি Settings-এও সামলাতে পারেন।"
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "You can attach up to {MAX_ATTACHMENTS} images."
msgstr "আপনি সর্বোচ্চ {MAX_ATTACHMENTS}টি ছবি সংযুক্ত করতে পারেন।"
@@ -15185,6 +15194,7 @@ msgid "You're subscribed!"
msgstr "আপনি সদস্য হয়েছেন!"
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
#: src/uninstall/UninstallSurveyScreen.tsx
@@ -15236,6 +15246,10 @@ msgstr "আপনার GitHub সেশনের মেয়াদ শেষ
msgid "Your GitHub token is missing required scopes. Try signing in again."
msgstr "আপনার GitHub টোকেনে আবশ্যক স্কোপ নেই। আবার সাইন ইন করে দেখুন।"
+#: src/components/ReportBugDialogBody.tsx
+msgid "Your images"
+msgstr "আপনার ছবি"
+
#: src/components/PublishToGitHubDialog.tsx
msgid "Your knowledge base is now on GitHub at <0>{ownerLogin}/{repoName}</0>."
msgstr "আপনার জ্ঞানভাণ্ডার এখন GitHub-এ <0>{ownerLogin}/{repoName}</0>-এ আছে।"
diff --git a/packages/app/src/locales/en/messages.json b/packages/app/src/locales/en/messages.json
index 70f7d1aa3..5a9f17086 100644
--- a/packages/app/src/locales/en/messages.json
+++ b/packages/app/src/locales/en/messages.json
@@ -2003,6 +2003,9 @@
"PMyJ9C": ["No edit session yet"],
"PPFQ3o": ["Installed \"", ["0"], "\" into ", ["1"]],
"PQCdtv": ["\"", ["docName"], "\" doesn't exist."],
+ "PR0_fn": [
+ "Add up to 3 screenshots or photos of your own, like a system dialog, another monitor, or a phone photo of a hang. They aren't redacted, so leave out anything that shouldn't be shared."
+ ],
"PR9FSv": ["Move to the next visual-editor find result."],
"PRgIJh": ["Couldn't update ", ["subRoot"], ": ", ["0"]],
"PRnH8G": ["of ", ["0"]],
@@ -4591,6 +4594,7 @@
"Couldn't restart the server — it's running under a different account. Restart your computer to clear it, then reopen this project."
],
"uUCrBv": ["symlink"],
+ "uV3EYs": ["Your images"],
"uVbUP8": ["Settings…"],
"uX85yl": [
"Setup files include: <0>.ok/</0>, AI-tool MCP configs (<1>.mcp.json</1> and per-tool files). Your skills are not covered — they follow git like any other file in the project.<2/><3>Shared</3> commits them to git, so anyone who clones the repo gets the same setup. <4/><5>Only me</5> keeps them out of git (via <6>.git/info/exclude</6>)."
diff --git a/packages/app/src/locales/en/messages.po b/packages/app/src/locales/en/messages.po
index 87dcf6797..26c073ae0 100644
--- a/packages/app/src/locales/en/messages.po
+++ b/packages/app/src/locales/en/messages.po
@@ -1550,6 +1550,10 @@ msgstr "Add to {gitignorePath}"
msgid "Add to Dictionary"
msgstr "Add to Dictionary"
+#: src/components/ReportBugDialogBody.tsx
+msgid "Add up to 3 screenshots or photos of your own, like a system dialog, another monitor, or a phone photo of a hang. They aren't redacted, so leave out anything that shouldn't be shared."
+msgstr "Add up to 3 screenshots or photos of your own, like a system dialog, another monitor, or a phone photo of a hang. They aren't redacted, so leave out anything that shouldn't be shared."
+
#: src/components/settings/frontmatter-schema-field-editor.tsx
msgid "Add value"
msgstr "Add value"
@@ -2005,7 +2009,7 @@ msgstr "Asset: {title}"
msgid "Attach a file"
msgstr "Attach a file"
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Attach images"
msgstr "Attach images"
@@ -2015,6 +2019,7 @@ msgid "Attachments"
msgstr "Attachments"
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Attachments must total under 3 MB."
msgstr "Attachments must total under 3 MB."
@@ -7925,7 +7930,7 @@ msgstr "markdownlint rules"
msgid "Match case"
msgstr "Match case"
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Maximum {MAX_ATTACHMENTS} attachments"
msgstr "Maximum {MAX_ATTACHMENTS} attachments"
@@ -9093,6 +9098,7 @@ msgid "Only modified"
msgstr "Only modified"
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Only PNG, JPEG, or WebP images are allowed."
msgstr "Only PNG, JPEG, or WebP images are allowed."
@@ -10116,6 +10122,7 @@ msgid "Please enter a valid email address."
msgstr "Please enter a valid email address."
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
msgid "Please enter a valid email."
msgstr "Please enter a valid email."
@@ -10718,7 +10725,7 @@ msgstr "Remove"
#. placeholder {0}: file.name
#. placeholder {0}: image.name
#: src/components/acp/ThreadView.tsx
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Remove {0}"
msgstr "Remove {0}"
@@ -11998,6 +12005,7 @@ msgid "Share URL"
msgstr "Share URL"
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
msgid "Share your email for followups"
msgstr "Share your email for followups"
@@ -15100,6 +15108,7 @@ msgid "You can also manage this in Settings."
msgstr "You can also manage this in Settings."
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "You can attach up to {MAX_ATTACHMENTS} images."
msgstr "You can attach up to {MAX_ATTACHMENTS} images."
@@ -15189,6 +15198,7 @@ msgid "You're subscribed!"
msgstr "You're subscribed!"
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
#: src/uninstall/UninstallSurveyScreen.tsx
@@ -15240,6 +15250,10 @@ msgstr "Your GitHub session expired — sign in again to verify push access."
msgid "Your GitHub token is missing required scopes. Try signing in again."
msgstr "Your GitHub token is missing required scopes. Try signing in again."
+#: src/components/ReportBugDialogBody.tsx
+msgid "Your images"
+msgstr "Your images"
+
#: src/components/PublishToGitHubDialog.tsx
msgid "Your knowledge base is now on GitHub at <0>{ownerLogin}/{repoName}</0>."
msgstr "Your knowledge base is now on GitHub at <0>{ownerLogin}/{repoName}</0>."
diff --git a/packages/app/src/locales/es/messages.json b/packages/app/src/locales/es/messages.json
index 428d1ca54..365dfd1de 100644
--- a/packages/app/src/locales/es/messages.json
+++ b/packages/app/src/locales/es/messages.json
@@ -2307,6 +2307,9 @@
"PMyJ9C": ["Todavía no hay sesión de edición"],
"PPFQ3o": ["Se instaló \"", ["0"], "\" en ", ["1"]],
"PQCdtv": ["\"", ["docName"], "\" no existe."],
+ "PR0_fn": [
+ "Añade hasta 3 capturas o fotos tuyas, como un diálogo del sistema, otro monitor o una foto del bloqueo hecha con el móvil. No se censuran, así que deja fuera cualquier cosa que no deba compartirse."
+ ],
"PR9FSv": ["Ir al siguiente resultado de búsqueda del editor visual."],
"PRgIJh": ["No se pudo actualizar ", ["subRoot"], ": ", ["0"]],
"PRnH8G": ["de ", ["0"]],
@@ -5283,6 +5286,7 @@
"No se pudo reiniciar el servidor: se está ejecutando con otra cuenta. Reinicia el equipo para liberarlo y vuelve a abrir este proyecto."
],
"uUCrBv": ["enlace simbólico"],
+ "uV3EYs": ["Tus imágenes"],
"uVbUP8": ["Ajustes…"],
"uX85yl": [
"Los archivos de configuración incluyen: <0>.ok/</0>, las configuraciones MCP de las herramientas de IA (<1>.mcp.json</1> y los archivos de cada herramienta). Tus habilidades no están incluidas: siguen a git como cualquier otro archivo del proyecto.<2/><3>Compartido</3> los guarda en git, así que quien clone el repositorio tendrá la misma configuración. <4/><5>Solo yo</5> los mantiene fuera de git (mediante <6>.git/info/exclude</6>)."
diff --git a/packages/app/src/locales/es/messages.po b/packages/app/src/locales/es/messages.po
index 78fdd8699..32c4559c7 100644
--- a/packages/app/src/locales/es/messages.po
+++ b/packages/app/src/locales/es/messages.po
@@ -1550,6 +1550,10 @@ msgstr "Añadir a {gitignorePath}"
msgid "Add to Dictionary"
msgstr "Añadir al diccionario"
+#: src/components/ReportBugDialogBody.tsx
+msgid "Add up to 3 screenshots or photos of your own, like a system dialog, another monitor, or a phone photo of a hang. They aren't redacted, so leave out anything that shouldn't be shared."
+msgstr "Añade hasta 3 capturas o fotos tuyas, como un diálogo del sistema, otro monitor o una foto del bloqueo hecha con el móvil. No se censuran, así que deja fuera cualquier cosa que no deba compartirse."
+
#: src/components/settings/frontmatter-schema-field-editor.tsx
msgid "Add value"
msgstr "Añadir valor"
@@ -2005,7 +2009,7 @@ msgstr "Recurso: {title}"
msgid "Attach a file"
msgstr "Adjuntar un archivo"
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Attach images"
msgstr "Adjuntar imágenes"
@@ -2015,6 +2019,7 @@ msgid "Attachments"
msgstr "Adjuntos"
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Attachments must total under 3 MB."
msgstr "Los adjuntos deben sumar menos de 3 MB."
@@ -7925,7 +7930,7 @@ msgstr "Reglas de markdownlint"
msgid "Match case"
msgstr "Distinguir mayúsculas"
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Maximum {MAX_ATTACHMENTS} attachments"
msgstr "Máximo {MAX_ATTACHMENTS} adjuntos"
@@ -9093,6 +9098,7 @@ msgid "Only modified"
msgstr "Solo los modificados"
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Only PNG, JPEG, or WebP images are allowed."
msgstr "Solo se admiten imágenes PNG, JPEG o WebP."
@@ -10116,6 +10122,7 @@ msgid "Please enter a valid email address."
msgstr "Escribe una dirección de correo válida."
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
msgid "Please enter a valid email."
msgstr "Escribe un correo válido."
@@ -10718,7 +10725,7 @@ msgstr "Quitar"
#. placeholder {0}: file.name
#. placeholder {0}: image.name
#: src/components/acp/ThreadView.tsx
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Remove {0}"
msgstr "Quitar {0}"
@@ -11998,6 +12005,7 @@ msgid "Share URL"
msgstr "URL para compartir"
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
msgid "Share your email for followups"
msgstr "Comparte tu correo para que podamos hacer seguimiento"
@@ -15100,6 +15108,7 @@ msgid "You can also manage this in Settings."
msgstr "También puedes gestionar esto en Ajustes."
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "You can attach up to {MAX_ATTACHMENTS} images."
msgstr "Puedes adjuntar hasta {MAX_ATTACHMENTS} imágenes."
@@ -15189,6 +15198,7 @@ msgid "You're subscribed!"
msgstr "¡Te has suscrito!"
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
#: src/uninstall/UninstallSurveyScreen.tsx
@@ -15240,6 +15250,10 @@ msgstr "Tu sesión de GitHub ha caducado: inicia sesión de nuevo para verificar
msgid "Your GitHub token is missing required scopes. Try signing in again."
msgstr "A tu token de GitHub le faltan ámbitos obligatorios. Prueba a iniciar sesión de nuevo."
+#: src/components/ReportBugDialogBody.tsx
+msgid "Your images"
+msgstr "Tus imágenes"
+
#: src/components/PublishToGitHubDialog.tsx
msgid "Your knowledge base is now on GitHub at <0>{ownerLogin}/{repoName}</0>."
msgstr "Tu base de conocimiento ya está en GitHub, en <0>{ownerLogin}/{repoName}</0>."
diff --git a/packages/app/src/locales/fr/messages.json b/packages/app/src/locales/fr/messages.json
index bbd154d00..7ba4d7d5f 100644
--- a/packages/app/src/locales/fr/messages.json
+++ b/packages/app/src/locales/fr/messages.json
@@ -2332,6 +2332,9 @@
"PMyJ9C": ["Pas encore de session de modification"],
"PPFQ3o": ["« ", ["0"], " » installé dans ", ["1"]],
"PQCdtv": ["« ", ["docName"], " » n'existe pas."],
+ "PR0_fn": [
+ "Ajoutez jusqu'à 3 captures ou photos de votre choix : une boîte de dialogue système, un autre écran, ou une photo prise au téléphone d'un blocage. Elles ne sont pas masquées, alors laissez de côté tout ce qui ne doit pas être partagé."
+ ],
"PR9FSv": ["Va au résultat de recherche suivant dans l'éditeur visuel."],
"PRgIJh": ["Impossible de mettre à jour ", ["subRoot"], " : ", ["0"]],
"PRnH8G": ["sur ", ["0"]],
@@ -5340,6 +5343,7 @@
"Impossible de redémarrer le serveur — il s'exécute sous un autre compte. Redémarrez votre ordinateur pour le libérer, puis rouvrez ce projet."
],
"uUCrBv": ["lien symbolique"],
+ "uV3EYs": ["Vos images"],
"uVbUP8": ["Paramètres…"],
"uX85yl": [
"Les fichiers de configuration comprennent : <0>.ok/</0>, les configurations MCP des outils IA (<1>.mcp.json</1> et les fichiers propres à chaque outil). Vos compétences ne sont pas concernées : elles suivent git comme n'importe quel autre fichier du projet.<2/><3>Partagé</3> les valide dans git, donc toute personne qui clone le dépôt obtient la même configuration. <4/><5>Moi uniquement</5> les tient à l'écart de git (via <6>.git/info/exclude</6>)."
diff --git a/packages/app/src/locales/fr/messages.po b/packages/app/src/locales/fr/messages.po
index d7510b7be..366535c56 100644
--- a/packages/app/src/locales/fr/messages.po
+++ b/packages/app/src/locales/fr/messages.po
@@ -1550,6 +1550,10 @@ msgstr "Ajouter à {gitignorePath}"
msgid "Add to Dictionary"
msgstr "Ajouter au dictionnaire"
+#: src/components/ReportBugDialogBody.tsx
+msgid "Add up to 3 screenshots or photos of your own, like a system dialog, another monitor, or a phone photo of a hang. They aren't redacted, so leave out anything that shouldn't be shared."
+msgstr "Ajoutez jusqu'à 3 captures ou photos de votre choix : une boîte de dialogue système, un autre écran, ou une photo prise au téléphone d'un blocage. Elles ne sont pas masquées, alors laissez de côté tout ce qui ne doit pas être partagé."
+
#: src/components/settings/frontmatter-schema-field-editor.tsx
msgid "Add value"
msgstr "Ajouter une valeur"
@@ -2005,7 +2009,7 @@ msgstr "Ressource : {title}"
msgid "Attach a file"
msgstr "Joindre un fichier"
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Attach images"
msgstr "Joindre des images"
@@ -2015,6 +2019,7 @@ msgid "Attachments"
msgstr "Pièces jointes"
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Attachments must total under 3 MB."
msgstr "Les pièces jointes doivent totaliser moins de 3 Mo."
@@ -7925,7 +7930,7 @@ msgstr "Règles markdownlint"
msgid "Match case"
msgstr "Respecter la casse"
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Maximum {MAX_ATTACHMENTS} attachments"
msgstr "{MAX_ATTACHMENTS} pièces jointes maximum"
@@ -9093,6 +9098,7 @@ msgid "Only modified"
msgstr "Modifiées uniquement"
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Only PNG, JPEG, or WebP images are allowed."
msgstr "Seules les images PNG, JPEG ou WebP sont autorisées."
@@ -10116,6 +10122,7 @@ msgid "Please enter a valid email address."
msgstr "Veuillez saisir une adresse e-mail valide."
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
msgid "Please enter a valid email."
msgstr "Veuillez saisir un e-mail valide."
@@ -10718,7 +10725,7 @@ msgstr "Retirer"
#. placeholder {0}: file.name
#. placeholder {0}: image.name
#: src/components/acp/ThreadView.tsx
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Remove {0}"
msgstr "Retirer {0}"
@@ -11998,6 +12005,7 @@ msgid "Share URL"
msgstr "URL de partage"
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
msgid "Share your email for followups"
msgstr "Partagez votre e-mail pour le suivi"
@@ -15100,6 +15108,7 @@ msgid "You can also manage this in Settings."
msgstr "Vous pouvez aussi gérer cela dans les Paramètres."
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "You can attach up to {MAX_ATTACHMENTS} images."
msgstr "Vous pouvez joindre jusqu'à {MAX_ATTACHMENTS} images."
@@ -15189,6 +15198,7 @@ msgid "You're subscribed!"
msgstr "Vous êtes abonné !"
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
#: src/uninstall/UninstallSurveyScreen.tsx
@@ -15240,6 +15250,10 @@ msgstr "Votre session GitHub a expiré — reconnectez-vous pour vérifier l'acc
msgid "Your GitHub token is missing required scopes. Try signing in again."
msgstr "Il manque des portées obligatoires à votre jeton GitHub. Essayez de vous reconnecter."
+#: src/components/ReportBugDialogBody.tsx
+msgid "Your images"
+msgstr "Vos images"
+
#: src/components/PublishToGitHubDialog.tsx
msgid "Your knowledge base is now on GitHub at <0>{ownerLogin}/{repoName}</0>."
msgstr "Votre base de connaissances est désormais sur GitHub, à l'adresse <0>{ownerLogin}/{repoName}</0>."
diff --git a/packages/app/src/locales/hi/messages.json b/packages/app/src/locales/hi/messages.json
index f39f9b720..a4499c632 100644
--- a/packages/app/src/locales/hi/messages.json
+++ b/packages/app/src/locales/hi/messages.json
@@ -1951,6 +1951,9 @@
"PMyJ9C": ["अभी कोई संपादन सत्र नहीं"],
"PPFQ3o": ["\"", ["0"], "\" को ", ["1"], " में इंस्टॉल किया गया"],
"PQCdtv": ["\"", ["docName"], "\" मौजूद नहीं है।"],
+ "PR0_fn": [
+ "अपनी ओर से 3 तक स्क्रीनशॉट या फ़ोटो जोड़ें, जैसे कोई सिस्टम डायलॉग, दूसरा मॉनिटर, या हैंग होते समय फ़ोन से ली गई फ़ोटो। इनसे गोपनीय जानकारी नहीं हटाई जाती, इसलिए ऐसा कुछ न रखें जो साझा नहीं करना है।"
+ ],
"PR9FSv": ["दृश्य-संपादक के अगले खोज परिणाम पर जाएँ।"],
"PRgIJh": [["subRoot"], " अपडेट नहीं किया जा सका: ", ["0"]],
"PRnH8G": [["0"], " में से"],
@@ -4440,6 +4443,7 @@
"सर्वर पुनः आरंभ नहीं किया जा सका — यह किसी दूसरे खाते के अंतर्गत चल रहा है। इसे साफ़ करने के लिए अपना कंप्यूटर पुनः आरंभ करें, फिर यह प्रोजेक्ट दोबारा खोलें।"
],
"uUCrBv": ["सिमलिंक"],
+ "uV3EYs": ["आपकी छवियाँ"],
"uVbUP8": ["सेटिंग…"],
"uX85yl": [
"सेटअप फ़ाइलों में शामिल हैं: <0>.ok/</0>, AI-टूल MCP कॉन्फ़िग (<1>.mcp.json</1> और प्रति-टूल फ़ाइलें)। आपकी स्किल इसमें शामिल नहीं हैं — वे प्रोजेक्ट की बाकी फ़ाइलों की तरह ही git का अनुसरण करती हैं।<2/><3>साझा</3> उन्हें git में कमिट करता है, इसलिए जो भी रिपॉज़िटरी क्लोन करता है उसे वही सेटअप मिलता है। <4/><5>केवल मेरे लिए</5> उन्हें git से बाहर रखता है (<6>.git/info/exclude</6> के ज़रिए)।"
diff --git a/packages/app/src/locales/hi/messages.po b/packages/app/src/locales/hi/messages.po
index 703ca8ae1..93ab6f5ba 100644
--- a/packages/app/src/locales/hi/messages.po
+++ b/packages/app/src/locales/hi/messages.po
@@ -1546,6 +1546,10 @@ msgstr "{gitignorePath} में जोड़ें"
msgid "Add to Dictionary"
msgstr "शब्दकोश में जोड़ें"
+#: src/components/ReportBugDialogBody.tsx
+msgid "Add up to 3 screenshots or photos of your own, like a system dialog, another monitor, or a phone photo of a hang. They aren't redacted, so leave out anything that shouldn't be shared."
+msgstr "अपनी ओर से 3 तक स्क्रीनशॉट या फ़ोटो जोड़ें, जैसे कोई सिस्टम डायलॉग, दूसरा मॉनिटर, या हैंग होते समय फ़ोन से ली गई फ़ोटो। इनसे गोपनीय जानकारी नहीं हटाई जाती, इसलिए ऐसा कुछ न रखें जो साझा नहीं करना है।"
+
#: src/components/settings/frontmatter-schema-field-editor.tsx
msgid "Add value"
msgstr "मान जोड़ें"
@@ -2001,7 +2005,7 @@ msgstr "एसेट: {title}"
msgid "Attach a file"
msgstr "फ़ाइल संलग्न करें"
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Attach images"
msgstr "छवियाँ संलग्न करें"
@@ -2011,6 +2015,7 @@ msgid "Attachments"
msgstr "संलग्नक"
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Attachments must total under 3 MB."
msgstr "संलग्नकों का कुल आकार 3 MB से कम होना चाहिए।"
@@ -7921,7 +7926,7 @@ msgstr "markdownlint नियम"
msgid "Match case"
msgstr "अक्षरों का आकार मिलाएँ"
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Maximum {MAX_ATTACHMENTS} attachments"
msgstr "अधिकतम {MAX_ATTACHMENTS} संलग्नक"
@@ -9089,6 +9094,7 @@ msgid "Only modified"
msgstr "केवल संशोधित"
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Only PNG, JPEG, or WebP images are allowed."
msgstr "केवल PNG, JPEG या WebP छवियाँ अनुमत हैं।"
@@ -10112,6 +10118,7 @@ msgid "Please enter a valid email address."
msgstr "कृपया एक मान्य ईमेल पता डालें।"
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
msgid "Please enter a valid email."
msgstr "कृपया एक मान्य ईमेल डालें।"
@@ -10714,7 +10721,7 @@ msgstr "हटाएँ"
#. placeholder {0}: file.name
#. placeholder {0}: image.name
#: src/components/acp/ThreadView.tsx
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Remove {0}"
msgstr "{0} हटाएँ"
@@ -11994,6 +12001,7 @@ msgid "Share URL"
msgstr "साझा URL"
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
msgid "Share your email for followups"
msgstr "आगे संपर्क के लिए अपना ईमेल साझा करें"
@@ -15096,6 +15104,7 @@ msgid "You can also manage this in Settings."
msgstr "आप इसे Settings में भी सँभाल सकते हैं।"
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "You can attach up to {MAX_ATTACHMENTS} images."
msgstr "आप {MAX_ATTACHMENTS} तक छवियाँ संलग्न कर सकते हैं।"
@@ -15185,6 +15194,7 @@ msgid "You're subscribed!"
msgstr "आपने सदस्यता ले ली!"
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
#: src/uninstall/UninstallSurveyScreen.tsx
@@ -15236,6 +15246,10 @@ msgstr "आपका GitHub सत्र समाप्त हो गया —
msgid "Your GitHub token is missing required scopes. Try signing in again."
msgstr "आपके GitHub टोकन में आवश्यक स्कोप नहीं हैं। फिर से साइन इन करके देखें।"
+#: src/components/ReportBugDialogBody.tsx
+msgid "Your images"
+msgstr "आपकी छवियाँ"
+
#: src/components/PublishToGitHubDialog.tsx
msgid "Your knowledge base is now on GitHub at <0>{ownerLogin}/{repoName}</0>."
msgstr "आपका ज्ञान आधार अब GitHub पर <0>{ownerLogin}/{repoName}</0> पर है।"
diff --git a/packages/app/src/locales/id/messages.json b/packages/app/src/locales/id/messages.json
index 83809b297..5131dc498 100644
--- a/packages/app/src/locales/id/messages.json
+++ b/packages/app/src/locales/id/messages.json
@@ -2019,6 +2019,9 @@
"PMyJ9C": ["Belum ada sesi penyuntingan"],
"PPFQ3o": ["\"", ["0"], "\" dipasang ke ", ["1"]],
"PQCdtv": ["\"", ["docName"], "\" tidak ada."],
+ "PR0_fn": [
+ "Tambahkan hingga 3 tangkapan layar atau foto Anda sendiri, misalnya dialog sistem, monitor lain, atau foto ponsel saat aplikasi macet. Isinya tidak disunting, jadi jangan sertakan apa pun yang tidak boleh dibagikan."
+ ],
"PR9FSv": ["Pergi ke hasil pencarian penyunting visual berikutnya."],
"PRgIJh": [["subRoot"], " tidak bisa diperbarui: ", ["0"]],
"PRnH8G": ["dari ", ["0"]],
@@ -4619,6 +4622,7 @@
"Server tidak bisa dimulai ulang — ia berjalan di bawah akun lain. Mulai ulang komputer Anda untuk membersihkannya, lalu buka lagi proyek ini."
],
"uUCrBv": ["symlink"],
+ "uV3EYs": ["Gambar Anda"],
"uVbUP8": ["Pengaturan…"],
"uX85yl": [
"Berkas penyiapan mencakup: <0>.ok/</0>, konfigurasi MCP alat AI (<1>.mcp.json</1> dan berkas tiap alat). Keterampilan Anda tidak termasuk: semuanya mengikuti git seperti berkas lain di proyek ini.<2/><3>Dibagikan</3> melakukan commit ke git, jadi siapa pun yang mengkloning repo mendapat penyiapan yang sama. <4/><5>Hanya saya</5> menahannya keluar dari git (lewat <6>.git/info/exclude</6>)."
diff --git a/packages/app/src/locales/id/messages.po b/packages/app/src/locales/id/messages.po
index a9588acdd..c14938456 100644
--- a/packages/app/src/locales/id/messages.po
+++ b/packages/app/src/locales/id/messages.po
@@ -1546,6 +1546,10 @@ msgstr "Tambahkan ke {gitignorePath}"
msgid "Add to Dictionary"
msgstr "Tambahkan ke kamus"
+#: src/components/ReportBugDialogBody.tsx
+msgid "Add up to 3 screenshots or photos of your own, like a system dialog, another monitor, or a phone photo of a hang. They aren't redacted, so leave out anything that shouldn't be shared."
+msgstr "Tambahkan hingga 3 tangkapan layar atau foto Anda sendiri, misalnya dialog sistem, monitor lain, atau foto ponsel saat aplikasi macet. Isinya tidak disunting, jadi jangan sertakan apa pun yang tidak boleh dibagikan."
+
#: src/components/settings/frontmatter-schema-field-editor.tsx
msgid "Add value"
msgstr "Tambahkan nilai"
@@ -2001,7 +2005,7 @@ msgstr "Aset: {title}"
msgid "Attach a file"
msgstr "Lampirkan berkas"
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Attach images"
msgstr "Lampirkan gambar"
@@ -2011,6 +2015,7 @@ msgid "Attachments"
msgstr "Lampiran"
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Attachments must total under 3 MB."
msgstr "Total lampiran harus di bawah 3 MB."
@@ -7921,7 +7926,7 @@ msgstr "Aturan markdownlint"
msgid "Match case"
msgstr "Cocokkan huruf besar-kecil"
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Maximum {MAX_ATTACHMENTS} attachments"
msgstr "Maksimal {MAX_ATTACHMENTS} lampiran"
@@ -9089,6 +9094,7 @@ msgid "Only modified"
msgstr "Hanya yang diubah"
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Only PNG, JPEG, or WebP images are allowed."
msgstr "Hanya gambar PNG, JPEG, atau WebP yang diizinkan."
@@ -10112,6 +10118,7 @@ msgid "Please enter a valid email address."
msgstr "Silakan masukkan alamat surel yang valid."
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
msgid "Please enter a valid email."
msgstr "Silakan masukkan surel yang valid."
@@ -10714,7 +10721,7 @@ msgstr "Hapus"
#. placeholder {0}: file.name
#. placeholder {0}: image.name
#: src/components/acp/ThreadView.tsx
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Remove {0}"
msgstr "Hapus {0}"
@@ -11994,6 +12001,7 @@ msgid "Share URL"
msgstr "URL berbagi"
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
msgid "Share your email for followups"
msgstr "Bagikan surel Anda untuk tindak lanjut"
@@ -15096,6 +15104,7 @@ msgid "You can also manage this in Settings."
msgstr "Anda juga bisa mengelola ini di Pengaturan."
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "You can attach up to {MAX_ATTACHMENTS} images."
msgstr "Anda bisa melampirkan hingga {MAX_ATTACHMENTS} gambar."
@@ -15185,6 +15194,7 @@ msgid "You're subscribed!"
msgstr "Anda sudah berlangganan!"
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
#: src/uninstall/UninstallSurveyScreen.tsx
@@ -15236,6 +15246,10 @@ msgstr "Sesi GitHub Anda kedaluwarsa — masuk lagi untuk memverifikasi akses pu
msgid "Your GitHub token is missing required scopes. Try signing in again."
msgstr "Token GitHub Anda kehilangan cakupan yang wajib. Coba masuk lagi."
+#: src/components/ReportBugDialogBody.tsx
+msgid "Your images"
+msgstr "Gambar Anda"
+
#: src/components/PublishToGitHubDialog.tsx
msgid "Your knowledge base is now on GitHub at <0>{ownerLogin}/{repoName}</0>."
msgstr "Basis pengetahuan Anda kini ada di GitHub di <0>{ownerLogin}/{repoName}</0>."
diff --git a/packages/app/src/locales/ko/messages.json b/packages/app/src/locales/ko/messages.json
index 8f04880ac..30defebc9 100644
--- a/packages/app/src/locales/ko/messages.json
+++ b/packages/app/src/locales/ko/messages.json
@@ -1947,6 +1947,9 @@
"PMyJ9C": ["아직 편집 세션 없음"],
"PPFQ3o": ["\"", ["0"], "\"을 ", ["1"], "에 설치했습니다"],
"PQCdtv": ["\"", ["docName"], "\" 문서가 존재하지 않습니다."],
+ "PR0_fn": [
+ "시스템 대화 상자, 다른 모니터, 멈춘 화면을 찍은 휴대폰 사진처럼 직접 찍은 스크린샷이나 사진을 최대 3장까지 추가하세요. 비공개 처리되지 않으므로 공유하면 안 되는 내용은 넣지 마세요."
+ ],
"PR9FSv": ["다음 비주얼 편집기 찾기 결과로 이동합니다."],
"PRgIJh": [["subRoot"], " 업데이트 실패: ", ["0"]],
"PRnH8G": [["0"], " 중"],
@@ -4424,6 +4427,7 @@
"서버를 다시 시작하지 못했습니다. 다른 계정으로 실행 중입니다. 컴퓨터를 다시 시작하여 해결한 다음 이 프로젝트를 다시 여세요."
],
"uUCrBv": ["심볼릭 링크"],
+ "uV3EYs": ["내 이미지"],
"uVbUP8": ["설정…"],
"uX85yl": [
"설정 파일에는 <0>.ok/</0>, AI 도구 MCP 구성(<1>.mcp.json</1> 및 도구별 파일)이 포함됩니다. 스킬은 포함되지 않습니다. 프로젝트의 다른 파일과 똑같이 git을 따릅니다.<2/><3>공유</3>는 이를 git에 커밋하므로 리포지토리를 클론하는 누구나 동일한 설정을 받습니다. <4/><5>나만 보기</5>는 <6>.git/info/exclude</6>를 통해 git에서 제외합니다."
diff --git a/packages/app/src/locales/ko/messages.po b/packages/app/src/locales/ko/messages.po
index 454fb06b7..86fb0bc15 100644
--- a/packages/app/src/locales/ko/messages.po
+++ b/packages/app/src/locales/ko/messages.po
@@ -1550,6 +1550,10 @@ msgstr "{gitignorePath}에 추가"
msgid "Add to Dictionary"
msgstr "사전에 추가"
+#: src/components/ReportBugDialogBody.tsx
+msgid "Add up to 3 screenshots or photos of your own, like a system dialog, another monitor, or a phone photo of a hang. They aren't redacted, so leave out anything that shouldn't be shared."
+msgstr "시스템 대화 상자, 다른 모니터, 멈춘 화면을 찍은 휴대폰 사진처럼 직접 찍은 스크린샷이나 사진을 최대 3장까지 추가하세요. 비공개 처리되지 않으므로 공유하면 안 되는 내용은 넣지 마세요."
+
#: src/components/settings/frontmatter-schema-field-editor.tsx
msgid "Add value"
msgstr "값 추가"
@@ -2005,7 +2009,7 @@ msgstr "에셋: {title}"
msgid "Attach a file"
msgstr "파일 첨부"
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Attach images"
msgstr "이미지 첨부"
@@ -2015,6 +2019,7 @@ msgid "Attachments"
msgstr "첨부 파일"
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Attachments must total under 3 MB."
msgstr "첨부 파일 총 용량은 3MB 미만이어야 합니다."
@@ -7925,7 +7930,7 @@ msgstr "markdownlint 규칙"
msgid "Match case"
msgstr "대소문자 구분"
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Maximum {MAX_ATTACHMENTS} attachments"
msgstr "첨부 파일 최대 {MAX_ATTACHMENTS}개"
@@ -9093,6 +9098,7 @@ msgid "Only modified"
msgstr "수정된 항목만"
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Only PNG, JPEG, or WebP images are allowed."
msgstr "PNG, JPEG 또는 WebP 이미지만 허용됩니다."
@@ -10116,6 +10122,7 @@ msgid "Please enter a valid email address."
msgstr "유효한 이메일 주소를 입력하세요."
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
msgid "Please enter a valid email."
msgstr "유효한 이메일을 입력하세요."
@@ -10718,7 +10725,7 @@ msgstr "제거"
#. placeholder {0}: file.name
#. placeholder {0}: image.name
#: src/components/acp/ThreadView.tsx
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Remove {0}"
msgstr "{0} 제거"
@@ -11998,6 +12005,7 @@ msgid "Share URL"
msgstr "공유 URL"
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
msgid "Share your email for followups"
msgstr "후속 연락을 위해 이메일 공유"
@@ -15100,6 +15108,7 @@ msgid "You can also manage this in Settings."
msgstr "설정에서 관리할 수 있습니다."
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "You can attach up to {MAX_ATTACHMENTS} images."
msgstr "{MAX_ATTACHMENTS}개 이미지를 첨부할 수 있습니다."
@@ -15189,6 +15198,7 @@ msgid "You're subscribed!"
msgstr "구독했습니다!"
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
#: src/uninstall/UninstallSurveyScreen.tsx
@@ -15240,6 +15250,10 @@ msgstr "GitHub 세션이 만료되었습니다. 푸시 권한을 확인하려면
msgid "Your GitHub token is missing required scopes. Try signing in again."
msgstr "GitHub 토큰에 필요한 범위가 없습니다. 다시 로그인하세요."
+#: src/components/ReportBugDialogBody.tsx
+msgid "Your images"
+msgstr "내 이미지"
+
#: src/components/PublishToGitHubDialog.tsx
msgid "Your knowledge base is now on GitHub at <0>{ownerLogin}/{repoName}</0>."
msgstr "지식 베이스가 이제 GitHub의 <0>{ownerLogin}/{repoName}</0>에 있습니다."
diff --git a/packages/app/src/locales/pseudo/messages.json b/packages/app/src/locales/pseudo/messages.json
index 46fe2a203..4674ec31d 100644
--- a/packages/app/src/locales/pseudo/messages.json
+++ b/packages/app/src/locales/pseudo/messages.json
@@ -2003,6 +2003,9 @@
"PMyJ9C": ["Ńō ēďĩţ śēśśĩōń ŷēţ"],
"PPFQ3o": ["Ĩńśţàĺĺēď \"", ["0"], "\" ĩńţō ", ["1"]],
"PQCdtv": ["\"", ["docName"], "\" ďōēśń'ţ ēxĩśţ."],
+ "PR0_fn": [
+ "Àďď ũƥ ţō 3 śćŕēēńśĥōţś ōŕ ƥĥōţōś ōƒ ŷōũŕ ōŵń, ĺĩķē à śŷśţēḿ ďĩàĺōĝ, àńōţĥēŕ ḿōńĩţōŕ, ōŕ à ƥĥōńē ƥĥōţō ōƒ à ĥàńĝ. Ţĥēŷ àŕēń'ţ ŕēďàćţēď, śō ĺēàvē ōũţ àńŷţĥĩńĝ ţĥàţ śĥōũĺďń'ţ ƀē śĥàŕēď."
+ ],
"PR9FSv": ["Ḿōvē ţō ţĥē ńēxţ vĩśũàĺ-ēďĩţōŕ ƒĩńď ŕēśũĺţ."],
"PRgIJh": ["Ćōũĺďń'ţ ũƥďàţē ", ["subRoot"], ": ", ["0"]],
"PRnH8G": ["ōƒ ", ["0"]],
@@ -4591,6 +4594,7 @@
"Ćōũĺďń'ţ ŕēśţàŕţ ţĥē śēŕvēŕ — ĩţ'ś ŕũńńĩńĝ ũńďēŕ à ďĩƒƒēŕēńţ àććōũńţ. Ŕēśţàŕţ ŷōũŕ ćōḿƥũţēŕ ţō ćĺēàŕ ĩţ, ţĥēń ŕēōƥēń ţĥĩś ƥŕōĴēćţ."
],
"uUCrBv": ["śŷḿĺĩńķ"],
+ "uV3EYs": ["Ŷōũŕ ĩḿàĝēś"],
"uVbUP8": ["Śēţţĩńĝś…"],
"uX85yl": [
"Śēţũƥ ƒĩĺēś ĩńćĺũďē: <0>.ōķ/</0>, ÀĨ-ţōōĺ ḾĆƤ ćōńƒĩĝś (<1>.ḿćƥ.Ĵśōń</1> àńď ƥēŕ-ţōōĺ ƒĩĺēś). Ŷōũŕ śķĩĺĺś àŕē ńōţ ćōvēŕēď — ţĥēŷ ƒōĺĺōŵ ĝĩţ ĺĩķē àńŷ ōţĥēŕ ƒĩĺē ĩń ţĥē ƥŕōĴēćţ.<2/><3>Śĥàŕēď</3> ćōḿḿĩţś ţĥēḿ ţō ĝĩţ, śō àńŷōńē ŵĥō ćĺōńēś ţĥē ŕēƥō ĝēţś ţĥē śàḿē śēţũƥ. <4/><5>Ōńĺŷ ḿē</5> ķēēƥś ţĥēḿ ōũţ ōƒ ĝĩţ (vĩà <6>.ĝĩţ/ĩńƒō/ēxćĺũďē</6>)."
diff --git a/packages/app/src/locales/pseudo/messages.po b/packages/app/src/locales/pseudo/messages.po
index cb4b4176d..e743ed194 100644
--- a/packages/app/src/locales/pseudo/messages.po
+++ b/packages/app/src/locales/pseudo/messages.po
@@ -1546,6 +1546,10 @@ msgstr ""
msgid "Add to Dictionary"
msgstr ""
+#: src/components/ReportBugDialogBody.tsx
+msgid "Add up to 3 screenshots or photos of your own, like a system dialog, another monitor, or a phone photo of a hang. They aren't redacted, so leave out anything that shouldn't be shared."
+msgstr ""
+
#: src/components/settings/frontmatter-schema-field-editor.tsx
msgid "Add value"
msgstr ""
@@ -2001,7 +2005,7 @@ msgstr ""
msgid "Attach a file"
msgstr ""
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Attach images"
msgstr ""
@@ -2011,6 +2015,7 @@ msgid "Attachments"
msgstr ""
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Attachments must total under 3 MB."
msgstr ""
@@ -7921,7 +7926,7 @@ msgstr ""
msgid "Match case"
msgstr ""
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Maximum {MAX_ATTACHMENTS} attachments"
msgstr ""
@@ -9089,6 +9094,7 @@ msgid "Only modified"
msgstr ""
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Only PNG, JPEG, or WebP images are allowed."
msgstr ""
@@ -10112,6 +10118,7 @@ msgid "Please enter a valid email address."
msgstr ""
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
msgid "Please enter a valid email."
msgstr ""
@@ -10714,7 +10721,7 @@ msgstr ""
#. placeholder {0}: file.name
#. placeholder {0}: image.name
#: src/components/acp/ThreadView.tsx
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Remove {0}"
msgstr ""
@@ -11994,6 +12001,7 @@ msgid "Share URL"
msgstr ""
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
msgid "Share your email for followups"
msgstr ""
@@ -15096,6 +15104,7 @@ msgid "You can also manage this in Settings."
msgstr ""
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "You can attach up to {MAX_ATTACHMENTS} images."
msgstr ""
@@ -15185,6 +15194,7 @@ msgid "You're subscribed!"
msgstr ""
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
#: src/uninstall/UninstallSurveyScreen.tsx
msgstr ""
@@ -15236,6 +15246,10 @@ msgstr ""
msgid "Your GitHub token is missing required scopes. Try signing in again."
msgstr ""
+#: src/components/ReportBugDialogBody.tsx
+msgid "Your images"
+msgstr ""
+
#: src/components/PublishToGitHubDialog.tsx
msgid "Your knowledge base is now on GitHub at <0>{ownerLogin}/{repoName}</0>."
msgstr ""
diff --git a/packages/app/src/locales/pt-BR/messages.json b/packages/app/src/locales/pt-BR/messages.json
index 12594ff63..542e47afe 100644
--- a/packages/app/src/locales/pt-BR/messages.json
+++ b/packages/app/src/locales/pt-BR/messages.json
@@ -2271,6 +2271,9 @@
"PMyJ9C": ["Ainda não há sessão de edição"],
"PPFQ3o": ["\"", ["0"], "\" instalado em ", ["1"]],
"PQCdtv": ["\"", ["docName"], "\" não existe."],
+ "PR0_fn": [
+ "Adicione até 3 capturas ou fotos suas, como uma caixa de diálogo do sistema, outro monitor ou uma foto do travamento feita com o celular. Elas não são ocultadas, então deixe de fora qualquer coisa que não deva ser compartilhada."
+ ],
"PR9FSv": ["Vai para o próximo resultado de busca do editor visual."],
"PRgIJh": ["Não deu para atualizar ", ["subRoot"], ": ", ["0"]],
"PRnH8G": ["de ", ["0"]],
@@ -5180,6 +5183,7 @@
"Não deu para reiniciar o servidor — ele está rodando em outra conta. Reinicie o computador para liberá-lo e abra este projeto de novo."
],
"uUCrBv": ["link simbólico"],
+ "uV3EYs": ["Suas imagens"],
"uVbUP8": ["Configurações…"],
"uX85yl": [
"Os arquivos de configuração incluem: <0>.ok/</0>, as configurações MCP das ferramentas de IA (<1>.mcp.json</1> e os arquivos de cada ferramenta). Suas habilidades não são incluídas: elas seguem o git como qualquer outro arquivo do projeto.<2/><3>Compartilhado</3> faz commit deles no git, então quem clonar o repositório recebe a mesma configuração. <4/><5>Somente eu</5> mantém tudo fora do git (via <6>.git/info/exclude</6>)."
diff --git a/packages/app/src/locales/pt-BR/messages.po b/packages/app/src/locales/pt-BR/messages.po
index 4950191c5..2ff4717d3 100644
--- a/packages/app/src/locales/pt-BR/messages.po
+++ b/packages/app/src/locales/pt-BR/messages.po
@@ -1546,6 +1546,10 @@ msgstr "Adicionar a {gitignorePath}"
msgid "Add to Dictionary"
msgstr "Adicionar ao dicionário"
+#: src/components/ReportBugDialogBody.tsx
+msgid "Add up to 3 screenshots or photos of your own, like a system dialog, another monitor, or a phone photo of a hang. They aren't redacted, so leave out anything that shouldn't be shared."
+msgstr "Adicione até 3 capturas ou fotos suas, como uma caixa de diálogo do sistema, outro monitor ou uma foto do travamento feita com o celular. Elas não são ocultadas, então deixe de fora qualquer coisa que não deva ser compartilhada."
+
#: src/components/settings/frontmatter-schema-field-editor.tsx
msgid "Add value"
msgstr "Adicionar valor"
@@ -2001,7 +2005,7 @@ msgstr "Recurso: {title}"
msgid "Attach a file"
msgstr "Anexar um arquivo"
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Attach images"
msgstr "Anexar imagens"
@@ -2011,6 +2015,7 @@ msgid "Attachments"
msgstr "Anexos"
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Attachments must total under 3 MB."
msgstr "Os anexos devem somar menos de 3 MB."
@@ -7921,7 +7926,7 @@ msgstr "Regras do markdownlint"
msgid "Match case"
msgstr "Diferenciar maiúsculas"
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Maximum {MAX_ATTACHMENTS} attachments"
msgstr "No máximo {MAX_ATTACHMENTS} anexos"
@@ -9089,6 +9094,7 @@ msgid "Only modified"
msgstr "Somente os modificados"
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Only PNG, JPEG, or WebP images are allowed."
msgstr "Só são aceitas imagens PNG, JPEG ou WebP."
@@ -10112,6 +10118,7 @@ msgid "Please enter a valid email address."
msgstr "Digite um endereço de e-mail válido."
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
msgid "Please enter a valid email."
msgstr "Digite um e-mail válido."
@@ -10714,7 +10721,7 @@ msgstr "Remover"
#. placeholder {0}: file.name
#. placeholder {0}: image.name
#: src/components/acp/ThreadView.tsx
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Remove {0}"
msgstr "Remover {0}"
@@ -11994,6 +12001,7 @@ msgid "Share URL"
msgstr "URL de compartilhamento"
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
msgid "Share your email for followups"
msgstr "Compartilhe seu e-mail para retorno"
@@ -15096,6 +15104,7 @@ msgid "You can also manage this in Settings."
msgstr "Você também pode gerenciar isto em Configurações."
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "You can attach up to {MAX_ATTACHMENTS} images."
msgstr "Você pode anexar até {MAX_ATTACHMENTS} imagens."
@@ -15185,6 +15194,7 @@ msgid "You're subscribed!"
msgstr "Assinatura confirmada!"
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
#: src/uninstall/UninstallSurveyScreen.tsx
@@ -15236,6 +15246,10 @@ msgstr "Sua sessão do GitHub expirou — entre de novo para verificar o acesso
msgid "Your GitHub token is missing required scopes. Try signing in again."
msgstr "Faltam escopos obrigatórios no seu token do GitHub. Tente entrar de novo."
+#: src/components/ReportBugDialogBody.tsx
+msgid "Your images"
+msgstr "Suas imagens"
+
#: src/components/PublishToGitHubDialog.tsx
msgid "Your knowledge base is now on GitHub at <0>{ownerLogin}/{repoName}</0>."
msgstr "Sua base de conhecimento já está no GitHub, em <0>{ownerLogin}/{repoName}</0>."
diff --git a/packages/app/src/locales/ur/messages.json b/packages/app/src/locales/ur/messages.json
index 61a3af47f..16564adfc 100644
--- a/packages/app/src/locales/ur/messages.json
+++ b/packages/app/src/locales/ur/messages.json
@@ -2048,6 +2048,9 @@
"PMyJ9C": ["ابھی کوئی ترمیمی سیشن نہیں"],
"PPFQ3o": ["«", ["0"], "» کو ", ["1"], " میں نصب کر دیا گیا"],
"PQCdtv": ["«", ["docName"], "» موجود نہیں ہے۔"],
+ "PR0_fn": [
+ "اپنی طرف سے زیادہ سے زیادہ 3 اسکرین شاٹ یا تصاویر شامل کریں، جیسے کوئی سسٹم ڈائیلاگ، دوسرا مانیٹر، یا ہینگ ہونے کے وقت فون سے لی گئی تصویر۔ انہیں چھپایا نہیں جاتا، اس لیے ایسا کچھ شامل نہ کریں جو شیئر نہیں کرنا۔"
+ ],
"PR9FSv": ["بصری ایڈیٹر کے اگلے تلاش نتیجے پر جائیں۔"],
"PRgIJh": [["subRoot"], " تازہ نہیں ہو سکا: ", ["0"]],
"PRnH8G": [["0"], " میں سے"],
@@ -4670,6 +4673,7 @@
"سرور دوبارہ نہیں چل سکا — یہ کسی مختلف اکاؤنٹ کے تحت چل رہا ہے۔ اسے صاف کرنے کے لیے اپنا کمپیوٹر دوبارہ چالو کریں، پھر یہ پروجیکٹ دوبارہ کھولیں۔"
],
"uUCrBv": ["سِم لنک"],
+ "uV3EYs": ["آپ کی تصاویر"],
"uVbUP8": ["ترتیبات…"],
"uX85yl": [
"سیٹ اپ کی فائلوں میں شامل ہیں: <0>.ok/</0>، AI ٹولز کی MCP کنفیگز (<1>.mcp.json</1> اور ہر ٹول کی فائلیں)۔ آپ کی مہارتیں اس میں شامل نہیں ہیں: وہ پروجیکٹ کی دیگر فائلوں کی طرح git کے تابع ہیں۔<2/><3>مشترک</3> انہیں git میں کمٹ کرتا ہے، تاکہ جو بھی ریپو کلون کرے اسے وہی سیٹ اپ ملے۔ <4/><5>صرف میں</5> انہیں git سے باہر رکھتا ہے (<6>.git/info/exclude</6> کے ذریعے)۔"
diff --git a/packages/app/src/locales/ur/messages.po b/packages/app/src/locales/ur/messages.po
index cbf1d7ca2..1eb4f47e5 100644
--- a/packages/app/src/locales/ur/messages.po
+++ b/packages/app/src/locales/ur/messages.po
@@ -1550,6 +1550,10 @@ msgstr "{gitignorePath} میں شامل کریں"
msgid "Add to Dictionary"
msgstr "لغت میں شامل کریں"
+#: src/components/ReportBugDialogBody.tsx
+msgid "Add up to 3 screenshots or photos of your own, like a system dialog, another monitor, or a phone photo of a hang. They aren't redacted, so leave out anything that shouldn't be shared."
+msgstr "اپنی طرف سے زیادہ سے زیادہ 3 اسکرین شاٹ یا تصاویر شامل کریں، جیسے کوئی سسٹم ڈائیلاگ، دوسرا مانیٹر، یا ہینگ ہونے کے وقت فون سے لی گئی تصویر۔ انہیں چھپایا نہیں جاتا، اس لیے ایسا کچھ شامل نہ کریں جو شیئر نہیں کرنا۔"
+
#: src/components/settings/frontmatter-schema-field-editor.tsx
msgid "Add value"
msgstr "قدر شامل کریں"
@@ -2005,7 +2009,7 @@ msgstr "اثاثہ: {title}"
msgid "Attach a file"
msgstr "فائل منسلک کریں"
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Attach images"
msgstr "تصاویر منسلک کریں"
@@ -2015,6 +2019,7 @@ msgid "Attachments"
msgstr "منسلکات"
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Attachments must total under 3 MB."
msgstr "منسلکات کا مجموعی حجم 3 MB سے کم ہونا چاہیے۔"
@@ -7925,7 +7930,7 @@ msgstr "markdownlint کے قواعد"
msgid "Match case"
msgstr "حروف کی حالت ملائیں"
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Maximum {MAX_ATTACHMENTS} attachments"
msgstr "زیادہ سے زیادہ {MAX_ATTACHMENTS} منسلکات"
@@ -9093,6 +9098,7 @@ msgid "Only modified"
msgstr "صرف ترمیم شدہ"
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Only PNG, JPEG, or WebP images are allowed."
msgstr "صرف PNG، JPEG یا WebP تصاویر کی اجازت ہے۔"
@@ -10116,6 +10122,7 @@ msgid "Please enter a valid email address."
msgstr "براہِ کرم درست ای میل پتہ درج کریں۔"
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
msgid "Please enter a valid email."
msgstr "براہِ کرم درست ای میل درج کریں۔"
@@ -10718,7 +10725,7 @@ msgstr "ہٹائیں"
#. placeholder {0}: file.name
#. placeholder {0}: image.name
#: src/components/acp/ThreadView.tsx
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Remove {0}"
msgstr "{0} ہٹائیں"
@@ -11998,6 +12005,7 @@ msgid "Share URL"
msgstr "شیئر URL"
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
msgid "Share your email for followups"
msgstr "رابطے کے لیے اپنا ای میل شیئر کریں"
@@ -15100,6 +15108,7 @@ msgid "You can also manage this in Settings."
msgstr "آپ اسے ترتیبات میں بھی سنبھال سکتے ہیں۔"
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "You can attach up to {MAX_ATTACHMENTS} images."
msgstr "آپ زیادہ سے زیادہ {MAX_ATTACHMENTS} تصاویر منسلک کر سکتے ہیں۔"
@@ -15189,6 +15198,7 @@ msgid "You're subscribed!"
msgstr "آپ رکن بن گئے!"
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
#: src/uninstall/UninstallSurveyScreen.tsx
@@ -15240,6 +15250,10 @@ msgstr "آپ کا GitHub سیشن ختم ہو گیا — پُش کی رسائی
msgid "Your GitHub token is missing required scopes. Try signing in again."
msgstr "آپ کے GitHub ٹوکن میں مطلوبہ دائرہ کار غائب ہیں۔ دوبارہ سائن اِن کر کے دیکھیں۔"
+#: src/components/ReportBugDialogBody.tsx
+msgid "Your images"
+msgstr "آپ کی تصاویر"
+
#: src/components/PublishToGitHubDialog.tsx
msgid "Your knowledge base is now on GitHub at <0>{ownerLogin}/{repoName}</0>."
msgstr "آپ کا نالج بیس اب GitHub پر <0>{ownerLogin}/{repoName}</0> پر ہے۔"
diff --git a/packages/app/src/locales/zh-Hans/messages.json b/packages/app/src/locales/zh-Hans/messages.json
index 6aecf7f5e..d0e3a15ff 100644
--- a/packages/app/src/locales/zh-Hans/messages.json
+++ b/packages/app/src/locales/zh-Hans/messages.json
@@ -1771,6 +1771,9 @@
"PMyJ9C": ["还没有编辑会话"],
"PPFQ3o": ["已把“", ["0"], "”安装到 ", ["1"]],
"PQCdtv": ["“", ["docName"], "”不存在。"],
+ "PR0_fn": [
+ "最多可添加 3 张你自己的截图或照片,比如系统对话框、另一台显示器,或者用手机拍下的卡顿画面。它们不会做隐去处理,所以请不要放入不该分享的内容。"
+ ],
"PR9FSv": ["跳到可视化编辑器的下一个查找结果。"],
"PRgIJh": ["无法更新 ", ["subRoot"], ":", ["0"]],
"PRnH8G": ["共 ", ["0"]],
@@ -4032,6 +4035,7 @@
"uQNW00": ["HEAD 处于游离状态——请检出一个分支以继续"],
"uQewpR": ["无法重启服务器——它正以另一个账户运行。请重启电脑清除后再打开这个项目。"],
"uUCrBv": ["符号链接"],
+ "uV3EYs": ["你的图片"],
"uVbUP8": ["设置…"],
"uX85yl": [
"配置文件包括:<0>.ok/</0>、AI 工具的 MCP 配置(<1>.mcp.json</1> 及各工具自己的文件)。你的技能不在其中:它们和项目里的其他文件一样受 git 管理。<2/><3>共享</3>会把它们提交到 git,因此克隆这个仓库的人都会得到相同的配置。<4/><5>仅自己</5>会把它们排除在 git 之外(通过 <6>.git/info/exclude</6>)。"
diff --git a/packages/app/src/locales/zh-Hans/messages.po b/packages/app/src/locales/zh-Hans/messages.po
index 0f2d7644c..45eb64ab7 100644
--- a/packages/app/src/locales/zh-Hans/messages.po
+++ b/packages/app/src/locales/zh-Hans/messages.po
@@ -1550,6 +1550,10 @@ msgstr "添加到 {gitignorePath}"
msgid "Add to Dictionary"
msgstr "添加到词典"
+#: src/components/ReportBugDialogBody.tsx
+msgid "Add up to 3 screenshots or photos of your own, like a system dialog, another monitor, or a phone photo of a hang. They aren't redacted, so leave out anything that shouldn't be shared."
+msgstr "最多可添加 3 张你自己的截图或照片,比如系统对话框、另一台显示器,或者用手机拍下的卡顿画面。它们不会做隐去处理,所以请不要放入不该分享的内容。"
+
#: src/components/settings/frontmatter-schema-field-editor.tsx
msgid "Add value"
msgstr "添加值"
@@ -2005,7 +2009,7 @@ msgstr "资源:{title}"
msgid "Attach a file"
msgstr "附加文件"
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Attach images"
msgstr "附加图片"
@@ -2015,6 +2019,7 @@ msgid "Attachments"
msgstr "附件"
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Attachments must total under 3 MB."
msgstr "附件总大小必须小于 3 MB。"
@@ -7925,7 +7930,7 @@ msgstr "markdownlint 规则"
msgid "Match case"
msgstr "区分大小写"
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Maximum {MAX_ATTACHMENTS} attachments"
msgstr "最多 {MAX_ATTACHMENTS} 个附件"
@@ -9093,6 +9098,7 @@ msgid "Only modified"
msgstr "仅显示已修改的"
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Only PNG, JPEG, or WebP images are allowed."
msgstr "只允许 PNG、JPEG 或 WebP 图片。"
@@ -10116,6 +10122,7 @@ msgid "Please enter a valid email address."
msgstr "请输入有效的电子邮件地址。"
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
msgid "Please enter a valid email."
msgstr "请输入有效的邮箱。"
@@ -10718,7 +10725,7 @@ msgstr "移除"
#. placeholder {0}: file.name
#. placeholder {0}: image.name
#: src/components/acp/ThreadView.tsx
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Remove {0}"
msgstr "移除 {0}"
@@ -11998,6 +12005,7 @@ msgid "Share URL"
msgstr "共享 URL"
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
msgid "Share your email for followups"
msgstr "留下你的邮箱以便我们跟进"
@@ -15100,6 +15108,7 @@ msgid "You can also manage this in Settings."
msgstr "你也可以在「设置」中管理这一项。"
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "You can attach up to {MAX_ATTACHMENTS} images."
msgstr "你最多可以附加 {MAX_ATTACHMENTS} 张图片。"
@@ -15189,6 +15198,7 @@ msgid "You're subscribed!"
msgstr "订阅成功!"
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
#: src/uninstall/UninstallSurveyScreen.tsx
@@ -15240,6 +15250,10 @@ msgstr "你的 GitHub 会话已过期——请重新登录以验证推送权限
msgid "Your GitHub token is missing required scopes. Try signing in again."
msgstr "你的 GitHub 令牌缺少必需的权限范围。请尝试重新登录。"
+#: src/components/ReportBugDialogBody.tsx
+msgid "Your images"
+msgstr "你的图片"
+
#: src/components/PublishToGitHubDialog.tsx
msgid "Your knowledge base is now on GitHub at <0>{ownerLogin}/{repoName}</0>."
msgstr "你的知识库现在已经在 GitHub 上,地址是 <0>{ownerLogin}/{repoName}</0>。"
diff --git a/packages/app/src/locales/zh-Hant/messages.json b/packages/app/src/locales/zh-Hant/messages.json
index 3dcc0b574..aec15149a 100644
--- a/packages/app/src/locales/zh-Hant/messages.json
+++ b/packages/app/src/locales/zh-Hant/messages.json
@@ -1795,6 +1795,9 @@
"PMyJ9C": ["還沒有編輯工作階段"],
"PPFQ3o": ["已把「", ["0"], "」安裝到 ", ["1"]],
"PQCdtv": ["「", ["docName"], "」不存在。"],
+ "PR0_fn": [
+ "最多可加入 3 張你自己的截圖或照片,例如系統對話框、另一台螢幕,或用手機拍下的卡頓畫面。它們不會做遮蔽處理,所以請不要放入不該分享的內容。"
+ ],
"PR9FSv": ["跳到視覺化編輯器的下一個尋找結果。"],
"PRgIJh": ["無法更新 ", ["subRoot"], ":", ["0"]],
"PRnH8G": ["共 ", ["0"]],
@@ -4060,6 +4063,7 @@
"無法重新啟動伺服器——它正以另一個帳戶執行。請重新啟動電腦來清除,再重新開啟這個專案。"
],
"uUCrBv": ["符號連結"],
+ "uV3EYs": ["你的圖片"],
"uVbUP8": ["設定…"],
"uX85yl": [
"設定檔案包括:<0>.ok/</0>、AI 工具的 MCP 設定(<1>.mcp.json</1> 以及各工具自己的檔案)。你的技能不在其中:它們和專案裡的其他檔案一樣受 git 管理。<2/><3>已分享</3>會把它們提交到 git,所以複製這個儲存庫的人都會得到相同的設定。<4/><5>僅自己</5>會把它們排除在 git 之外(透過 <6>.git/info/exclude</6>)。"
diff --git a/packages/app/src/locales/zh-Hant/messages.po b/packages/app/src/locales/zh-Hant/messages.po
index 5dfab1c88..a5f5c1398 100644
--- a/packages/app/src/locales/zh-Hant/messages.po
+++ b/packages/app/src/locales/zh-Hant/messages.po
@@ -1550,6 +1550,10 @@ msgstr "新增至 {gitignorePath}"
msgid "Add to Dictionary"
msgstr "加入詞典"
+#: src/components/ReportBugDialogBody.tsx
+msgid "Add up to 3 screenshots or photos of your own, like a system dialog, another monitor, or a phone photo of a hang. They aren't redacted, so leave out anything that shouldn't be shared."
+msgstr "最多可加入 3 張你自己的截圖或照片,例如系統對話框、另一台螢幕,或用手機拍下的卡頓畫面。它們不會做遮蔽處理,所以請不要放入不該分享的內容。"
+
#: src/components/settings/frontmatter-schema-field-editor.tsx
msgid "Add value"
msgstr "新增值"
@@ -2005,7 +2009,7 @@ msgstr "資產:{title}"
msgid "Attach a file"
msgstr "附加檔案"
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Attach images"
msgstr "附加圖片"
@@ -2015,6 +2019,7 @@ msgid "Attachments"
msgstr "附件"
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Attachments must total under 3 MB."
msgstr "附件總大小必須小於 3 MB。"
@@ -7925,7 +7930,7 @@ msgstr "markdownlint 規則"
msgid "Match case"
msgstr "區分大小寫"
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Maximum {MAX_ATTACHMENTS} attachments"
msgstr "最多 {MAX_ATTACHMENTS} 個附件"
@@ -9093,6 +9098,7 @@ msgid "Only modified"
msgstr "只顯示已修改的"
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Only PNG, JPEG, or WebP images are allowed."
msgstr "只允許 PNG、JPEG 或 WebP 圖片。"
@@ -10116,6 +10122,7 @@ msgid "Please enter a valid email address."
msgstr "請輸入有效的電子郵件地址。"
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
msgid "Please enter a valid email."
msgstr "請輸入有效的電子郵件。"
@@ -10718,7 +10725,7 @@ msgstr "移除"
#. placeholder {0}: file.name
#. placeholder {0}: image.name
#: src/components/acp/ThreadView.tsx
-#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "Remove {0}"
msgstr "移除 {0}"
@@ -11998,6 +12005,7 @@ msgid "Share URL"
msgstr "分享 URL"
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
msgid "Share your email for followups"
msgstr "留下你的電子郵件以便我們跟進"
@@ -15100,6 +15108,7 @@ msgid "You can also manage this in Settings."
msgstr "你也可以在「設定」中管理這一項。"
#: src/components/FeedbackForm.tsx
+#: src/components/ImageAttachments.tsx
msgid "You can attach up to {MAX_ATTACHMENTS} images."
msgstr "你最多可以附加 {MAX_ATTACHMENTS} 張圖片。"
@@ -15189,6 +15198,7 @@ msgid "You're subscribed!"
msgstr "訂閱成功!"
#: src/components/FeedbackForm.tsx
+#: src/components/ReportBugDialogBody.tsx
#: src/uninstall/UninstallSurveyScreen.tsx
@@ -15240,6 +15250,10 @@ msgstr "你的 GitHub 工作階段已過期——請重新登入以確認推送
msgid "Your GitHub token is missing required scopes. Try signing in again."
msgstr "你的 GitHub 權杖缺少必要的權限範圍。請試著重新登入。"
+#: src/components/ReportBugDialogBody.tsx
+msgid "Your images"
+msgstr "你的圖片"
+
#: src/components/PublishToGitHubDialog.tsx
msgid "Your knowledge base is now on GitHub at <0>{ownerLogin}/{repoName}</0>."
msgstr "你的知識庫現在已經在 GitHub 上,位置是 <0>{ownerLogin}/{repoName}</0>。"
diff --git a/packages/app/src/main.tsx b/packages/app/src/main.tsx
index e82c4f588..909ecd600 100644
--- a/packages/app/src/main.tsx
+++ b/packages/app/src/main.tsx
@@ -21,6 +21,7 @@ import '@/lib/desktop-bridge-types';
import { useHydrateRegisteredAgentMeta } from '@/lib/acp/catalog';
import { installClientFetchWrapper } from '@/lib/client-fetch';
import { installConsentListener } from '@/lib/consent-store';
+import { installContactEmailStore } from '@/lib/contact-email-store';
import { installCrashInviteListener } from '@/lib/crash-invite-store';
import { installFeedbackNudgeStore } from '@/lib/feedback-nudge-store';
import { i18n } from '@/lib/i18n';
@@ -73,6 +74,8 @@ installSubscribeCardStore();
installFeedbackNudgeStore();
+installContactEmailStore();
+
if (typeof window !== 'undefined' && window.okDesktop !== undefined) {
installPointerPositionTracker();
}
diff --git a/packages/app/tests/stress/fixtures/handoff-mocks.ts b/packages/app/tests/stress/fixtures/handoff-mocks.ts
index 7c6ebd846..1b46904ac 100644
--- a/packages/app/tests/stress/fixtures/handoff-mocks.ts
+++ b/packages/app/tests/stress/fixtures/handoff-mocks.ts
@@ -478,6 +478,9 @@ export async function installHandoffMocks(page: Page, cfg: HandoffMockConfig): P
delete: async () => ({ ok: true as const }),
onCrashDetected: () => () => {},
},
+ assetUpload: {
+ uploadImage: async () => ({ error: 'invalid-request' as const }),
+ },
navigator: {
open: async () => {},
},
diff --git a/packages/cli/src/diagnose/diagnostic-reports.ts b/packages/cli/src/diagnose/diagnostic-reports.ts
index 186b95383..bb66402f2 100644
--- a/packages/cli/src/diagnose/diagnostic-reports.ts
+++ b/packages/cli/src/diagnose/diagnostic-reports.ts
@@ -47,7 +47,7 @@ function normalizeSolidusEscapes(content: string): string {
return content.replace(/\\+\/?/g, (run) => {
if (!run.endsWith('/')) return run;
const backslashes = run.length - 1;
- return '\\'.repeat(backslashes - (backslashes % 2)) + '/';
+ return `${'\\'.repeat(backslashes - (backslashes % 2))}/`;
});
}
diff --git a/packages/core/src/desktop-bridge.ts b/packages/core/src/desktop-bridge.ts
index 8f7425f1c..39d85ed9d 100644
--- a/packages/core/src/desktop-bridge.ts
+++ b/packages/core/src/desktop-bridge.ts
@@ -23,6 +23,7 @@ import type {
OkBugReportScreenshot,
OkBugReportSendMetadata,
OkBugReportSendResult,
+ OkImageAttachmentContentType,
ReportBundleLevel,
} from './logger-types.ts';
import type { LintPluginId } from './markdown/lint/types.ts';
@@ -707,9 +708,25 @@ export interface OkBugReportSendInput {
zipPath: string;
metadata: OkBugReportSendMetadata;
includeScreenshot?: boolean;
+ includeAttachments?: boolean;
traceparent?: string;
}
+export interface OkBugReportAttachmentInput {
+ contentType: OkImageAttachmentContentType;
+ bytes: Uint8Array;
+}
+
+export interface OkAssetUploadRequest {
+ contentType: OkImageAttachmentContentType;
+ bytes: Uint8Array;
+ filename: string;
+}
+
+export type OkAssetUploadResult =
+ | { assetUrl: string }
+ | { error: 'invalid-request' | 'unconfigured' | 'mint' | 'upload' };
+
export interface OkSharingStatusResult {
readonly kind: 'status';
readonly mode: 'shared' | 'local-only' | 'no-git';
@@ -1046,6 +1063,7 @@ export interface OkDesktopBridge {
note?: string;
includeCrashDump?: boolean;
includeScreenshot?: boolean;
+ attachments?: OkBugReportAttachmentInput[];
}): Promise<OkBugReportCreateResult>;
captureScreenshot(): Promise<OkBugReportScreenshot | null>;
crashDumpAvailability(): Promise<OkBugReportCrashDumpAvailability>;
@@ -1056,6 +1074,10 @@ export interface OkDesktopBridge {
onCrashDetected(cb: (event: OkBugReportCrashDetectedEvent) => void): OkUnsubscribe;
};
+ assetUpload: {
+ uploadImage(request: OkAssetUploadRequest): Promise<OkAssetUploadResult>;
+ };
+
fs: {
defaultProjectsRoot(): Promise<string>;
folderState(path: string): Promise<OkFolderState>;
diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts
index 2da97c202..507375557 100644
--- a/packages/core/src/index.ts
+++ b/packages/core/src/index.ts
@@ -779,15 +779,24 @@ export type {
OkBugReportSendFallbackReason,
OkBugReportSendMetadata,
OkBugReportSendResult,
+ OkImageAttachmentContentType,
ReportBundleLevel,
ReportBundleSummary,
SerializedError,
SerializedErrorTruncation,
} from './logger-types.ts';
export {
+ BUG_REPORT_ATTACHMENT_CONTENT_TYPES,
+ BUG_REPORT_ATTACHMENT_EXTENSIONS,
+ BUG_REPORT_ATTACHMENTS_ZIP_DIR,
+ BUG_REPORT_ATTACHMENTS_ZIP_PREFIX,
+ BUG_REPORT_CONTACT_EMAIL_MAX_LENGTH,
BUG_REPORT_SCREENSHOT_ZIP_ENTRY,
BUG_REPORT_SCREENSHOT_ZIP_NAME,
+ isBugReportAttachmentEntry,
LOG_LEVELS,
+ MAX_BUG_REPORT_ATTACHMENTS,
+ MAX_BUG_REPORT_ATTACHMENTS_TOTAL_BYTES,
} from './logger-types.ts';
export {
LOGGER_OWNED_FIELDS,
diff --git a/packages/core/src/logger-types.ts b/packages/core/src/logger-types.ts
index aeae20ae6..44d706b44 100644
--- a/packages/core/src/logger-types.ts
+++ b/packages/core/src/logger-types.ts
@@ -68,6 +68,30 @@ export interface ReportBundleSummary {
export const BUG_REPORT_SCREENSHOT_ZIP_NAME = 'screenshot.png';
export const BUG_REPORT_SCREENSHOT_ZIP_ENTRY = `extra/${BUG_REPORT_SCREENSHOT_ZIP_NAME}`;
+export const BUG_REPORT_ATTACHMENTS_ZIP_DIR = 'attachments';
+export const BUG_REPORT_ATTACHMENTS_ZIP_PREFIX = `extra/${BUG_REPORT_ATTACHMENTS_ZIP_DIR}/`;
+
+export const MAX_BUG_REPORT_ATTACHMENTS = 3;
+export const MAX_BUG_REPORT_ATTACHMENTS_TOTAL_BYTES = 3 * 1024 * 1024;
+
+export const BUG_REPORT_ATTACHMENT_CONTENT_TYPES = [
+ 'image/png',
+ 'image/jpeg',
+ 'image/webp',
+] as const;
+
+export type OkImageAttachmentContentType = (typeof BUG_REPORT_ATTACHMENT_CONTENT_TYPES)[number];
+
+export const BUG_REPORT_ATTACHMENT_EXTENSIONS: Record<OkImageAttachmentContentType, string> = {
+ 'image/png': 'png',
+ 'image/jpeg': 'jpg',
+ 'image/webp': 'webp',
+};
+
+export function isBugReportAttachmentEntry(name: string): boolean {
+ return name.startsWith(BUG_REPORT_ATTACHMENTS_ZIP_PREFIX);
+}
+
export interface OkBugReportScreenshot {
dataUrl: string;
width: number;
@@ -83,11 +107,14 @@ export type OkBugReportCreateResult =
}
| { ok: false; error: string };
+export const BUG_REPORT_CONTACT_EMAIL_MAX_LENGTH = 320;
+
export interface OkBugReportSendMetadata {
level: ReportBundleLevel;
systemWide: boolean;
projectSlug: string | null;
note?: string;
+ email?: string;
}
export type OkBugReportSendFallbackReason = 'email-draft' | 'send-failed' | 'send-in-flight';
diff --git a/packages/desktop/src/main/index.ts b/packages/desktop/src/main/index.ts
index 60ce622ff..ea1dd69ee 100644
--- a/packages/desktop/src/main/index.ts
+++ b/packages/desktop/src/main/index.ts
@@ -255,6 +255,7 @@ import {
type EditorPresenceProbes,
registerIntegrationsSettings,
} from './integrations-settings.ts';
+import { handleAssetUpload } from './ipc/asset-upload.ts';
import {
type BugReportScreenshotEntry,
createBugReportScreenshotHold,
@@ -4522,6 +4523,17 @@ function registerIpcHandlers() {
},
},
screenshotPngBytes: (reportId) => bugReportSendScreenshots.read(reportId),
+ attachmentBytes: (reportId) => bugReportSendScreenshots.readAttachments(reportId),
+ },
+ request,
+ );
+ }
+ if (request.kind === 'upload-image') {
+ return handleAssetUpload(
+ {
+ intakeBaseUrl: resolveBugReportIntakeUrl({
+ envUrl: process.env.OK_BUG_REPORT_INTAKE_URL,
+ }),
},
request,
);
@@ -4586,6 +4598,16 @@ function registerIpcHandlers() {
bugReportSendScreenshots.forgetOwner(composedBy);
});
},
+ onAttachmentsStaged: (reportId, attachments) => {
+ const composedBy = event.sender.id;
+ bugReportSendScreenshots.rememberAttachments(reportId, attachments, composedBy);
+ if (bugReportSendScreenshotReapers.has(composedBy)) return;
+ bugReportSendScreenshotReapers.add(composedBy);
+ event.sender.once('destroyed', () => {
+ bugReportSendScreenshotReapers.delete(composedBy);
+ bugReportSendScreenshots.forgetOwner(composedBy);
+ });
+ },
onReportGenerated: (meta) => bugReportSidecar.recordGenerated(meta),
logger: getLogger('bug-report'),
flushLogger: flushDesktopLogger,
diff --git a/packages/desktop/src/main/ipc/asset-upload.test.ts b/packages/desktop/src/main/ipc/asset-upload.test.ts
new file mode 100644
index 000000000..631474ede
--- /dev/null
+++ b/packages/desktop/src/main/ipc/asset-upload.test.ts
@@ -0,0 +1,169 @@
+import { createServer, type Server } from 'node:http';
+import { afterEach, describe, expect, test } from 'vitest';
+import { handleAssetUpload } from './asset-upload.ts';
+
+interface RecordedRequest {
+ method: string;
+ path: string;
+ headers: Record<string, string | string[] | undefined>;
+ body: Buffer;
+}
+
+const stubServers: Server[] = [];
+
+afterEach(async () => {
+ while (stubServers.length > 0) {
+ const server = stubServers.pop();
+ if (server === undefined) continue;
+ await new Promise<void>((done) => server.close(() => done()));
+ }
+});
+
+async function startIntakeStub(
+ overrides: { mintStatus?: number; putStatus?: number; mintBody?: unknown } = {},
+): Promise<{ url: string; requests: RecordedRequest[] }> {
+ const requests: RecordedRequest[] = [];
+ let url = '';
+ const server = createServer((req, res) => {
+ const chunks: Buffer[] = [];
+ req.on('data', (chunk) => chunks.push(chunk as Buffer));
+ req.on('end', () => {
+ const method = req.method ?? '';
+ const path = req.url ?? '';
+ requests.push({ method, path, headers: { ...req.headers }, body: Buffer.concat(chunks) });
+ const respond = (status: number, payload: unknown) => {
+ res.writeHead(status, { 'content-type': 'application/json' });
+ res.end(JSON.stringify(payload));
+ };
+ if (method === 'POST' && path === '/api/feedback/attachment') {
+ return respond(
+ overrides.mintStatus ?? 200,
+ overrides.mintBody ?? {
+ uploadUrl: `${url}/upload/dest`,
+ assetUrl: 'https://uploads.example.invalid/asset/dest',
+ headers: { 'x-goog-content-length-range': '0,16777216' },
+ },
+ );
+ }
+ if (method === 'PUT' && path === '/upload/dest') {
+ return respond(overrides.putStatus ?? 200, {});
+ }
+ respond(404, { error: 'unexpected request' });
+ });
+ });
+ stubServers.push(server);
+ return new Promise((done, fail) => {
+ server.once('error', fail);
+ server.listen(0, '127.0.0.1', () => {
+ const address = server.address();
+ if (address === null || typeof address === 'string') {
+ fail(new Error('stub server did not bind a port'));
+ return;
+ }
+ url = `http://127.0.0.1:${address.port}`;
+ done({ url, requests });
+ });
+ });
+}
+
+const IMAGE = new Uint8Array([0x89, 0x50, 0x4e, 0x47, 0x0d]);
+
+describe('handleAssetUpload', () => {
+ test('mints against the feedback route and PUTs the bytes itself', async () => {
+ const stub = await startIntakeStub();
+
+ const result = await handleAssetUpload(
+ { intakeBaseUrl: stub.url },
+ {
+ kind: 'upload-image',
+ contentType: 'image/png',
+ bytes: IMAGE,
+ filename: 'feedback-1.png',
+ },
+ );
+
+ expect(result).toEqual({ assetUrl: 'https://uploads.example.invalid/asset/dest' });
+ expect(stub.requests.map((r) => `${r.method} ${r.path}`)).toEqual([
+ 'POST /api/feedback/attachment',
+ 'PUT /upload/dest',
+ ]);
+ expect(JSON.parse(stub.requests[0]?.body.toString('utf8') ?? '')).toEqual({
+ filename: 'feedback-1.png',
+ sizeBytes: IMAGE.byteLength,
+ contentType: 'image/png',
+ });
+ expect(stub.requests[1]?.headers['content-type']).toBe('image/png');
+ expect(stub.requests[1]?.body.equals(Buffer.from(IMAGE))).toBe(true);
+ });
+
+ test('the mint body carries no report metadata', async () => {
+ const stub = await startIntakeStub();
+ await handleAssetUpload(
+ { intakeBaseUrl: stub.url },
+ { kind: 'upload-image', contentType: 'image/webp', bytes: IMAGE, filename: 'f.webp' },
+ );
+ const body = JSON.parse(stub.requests[0]?.body.toString('utf8') ?? '') as Record<
+ string,
+ unknown
+ >;
+ expect('metadata' in body).toBe(false);
+ });
+
+ test.each([
+ ['a foreign content type', { contentType: 'image/gif' }],
+ ['a path-bearing filename', { filename: '../escape.png' }],
+ ['an empty filename', { filename: '' }],
+ ['empty bytes', { bytes: new Uint8Array(0) }],
+ ['bytes over the parity cap', { bytes: new Uint8Array(3 * 1024 * 1024 + 1) }],
+ ])('refuses %s without any network call', async (_label, override) => {
+ const stub = await startIntakeStub();
+
+ const result = await handleAssetUpload(
+ { intakeBaseUrl: stub.url },
+ {
+ kind: 'upload-image',
+ contentType: 'image/png',
+ bytes: IMAGE,
+ filename: 'feedback-1.png',
+ ...override,
+ },
+ );
+
+ expect(result).toEqual({ error: 'invalid-request' });
+ expect(stub.requests).toHaveLength(0);
+ });
+
+ test('refuses a non-transport-safe intake URL', async () => {
+ const result = await handleAssetUpload(
+ { intakeBaseUrl: 'http://intake.example.com' },
+ { kind: 'upload-image', contentType: 'image/png', bytes: IMAGE, filename: 'a.png' },
+ );
+ expect(result).toEqual({ error: 'unconfigured' });
+ });
+
+ test('maps a refused mint and a refused PUT to an upload error', async () => {
+ for (const overrides of [{ mintStatus: 500 }, { putStatus: 500 }]) {
+ const stub = await startIntakeStub(overrides);
+ const result = await handleAssetUpload(
+ { intakeBaseUrl: stub.url },
+ { kind: 'upload-image', contentType: 'image/png', bytes: IMAGE, filename: 'a.png' },
+ );
+ expect(result).toEqual({ error: 'upload' });
+ }
+ });
+
+ test('refuses a mint that names a non-https upload URL', async () => {
+ const stub = await startIntakeStub({
+ mintBody: {
+ uploadUrl: 'ftp://uploads.example.invalid/dest',
+ assetUrl: 'https://uploads.example.invalid/asset/dest',
+ headers: {},
+ },
+ });
+ const result = await handleAssetUpload(
+ { intakeBaseUrl: stub.url },
+ { kind: 'upload-image', contentType: 'image/png', bytes: IMAGE, filename: 'a.png' },
+ );
+ expect(result).toEqual({ error: 'upload' });
+ });
+});
diff --git a/packages/desktop/src/main/ipc/asset-upload.ts b/packages/desktop/src/main/ipc/asset-upload.ts
new file mode 100644
index 000000000..5e9c1292a
--- /dev/null
+++ b/packages/desktop/src/main/ipc/asset-upload.ts
@@ -0,0 +1,59 @@
+import { MAX_BUG_REPORT_ATTACHMENTS_TOTAL_BYTES } from '@inkeep/open-knowledge-core';
+import type { OkAssetUploadResult } from '@inkeep/open-knowledge-core/desktop-bridge';
+import { logIpcError } from '../ipc-log.ts';
+import {
+ isValidAttachmentContentType,
+ type OkAssetUploadRequestMessage,
+ parseTransportSafeUrl,
+ uploadFeedbackImageAsset,
+} from './bug-report.ts';
+
+export interface AssetUploadDeps {
+ intakeBaseUrl: string | undefined;
+ timeouts?: { mintMs?: number; putMs?: number };
+}
+
+const MAX_FILENAME_LENGTH = 255;
+
+function isUploadImageRequest(request: unknown): request is OkAssetUploadRequestMessage {
+ if (typeof request !== 'object' || request === null) return false;
+ const r = request as Record<string, unknown>;
+ if (r.kind !== 'upload-image') return false;
+ if (!isValidAttachmentContentType(r.contentType)) return false;
+ if (typeof r.filename !== 'string' || r.filename === '') return false;
+ if (r.filename.length > MAX_FILENAME_LENGTH || /[/\\]/.test(r.filename)) return false;
+ if (!(r.bytes instanceof Uint8Array)) return false;
+ return r.bytes.byteLength > 0 && r.bytes.byteLength <= MAX_BUG_REPORT_ATTACHMENTS_TOTAL_BYTES;
+}
+
+export async function handleAssetUpload(
+ deps: AssetUploadDeps,
+ request: unknown,
+): Promise<OkAssetUploadResult> {
+ if (!isUploadImageRequest(request)) {
+ logIpcError({
+ event: 'ipc.error',
+ channel: 'ok:bug-report:dispatch',
+ reason: 'invalid-request',
+ handler: 'handleAssetUpload',
+ });
+ return { error: 'invalid-request' };
+ }
+ const base = deps.intakeBaseUrl === undefined ? null : parseTransportSafeUrl(deps.intakeBaseUrl);
+ if (base === null) {
+ logIpcError({
+ event: 'ipc.error',
+ channel: 'ok:bug-report:dispatch',
+ reason: 'intake-unconfigured',
+ handler: 'handleAssetUpload',
+ });
+ return { error: 'unconfigured' };
+ }
+ const assetUrl = await uploadFeedbackImageAsset(
+ base,
+ { bytes: request.bytes, contentType: request.contentType, filename: request.filename },
+ deps.timeouts,
+ );
+ if (assetUrl === null) return { error: 'upload' };
+ return { assetUrl };
+}
diff --git a/packages/desktop/src/main/ipc/bug-report.test.ts b/packages/desktop/src/main/ipc/bug-report.test.ts
index 8114bf19d..f7c31d731 100644
--- a/packages/desktop/src/main/ipc/bug-report.test.ts
+++ b/packages/desktop/src/main/ipc/bug-report.test.ts
@@ -65,6 +65,7 @@ import {
resolveBugReportIntakeUrl,
resolveMinidumpAttachment,
resolveMinidumpIntent,
+ type StagedAttachment,
} from './bug-report.ts';
async function readSidecarValue(path: string) {
@@ -2868,3 +2869,249 @@ describe('handleBugReportSend — transport phase spans', () => {
);
});
});
+
+describe('handleBugReportCreate — reporter attachments', () => {
+ const PNG = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x01]);
+ const JPEG = Buffer.from([0xff, 0xd8, 0xff, 0xe0, 0x02]);
+
+ test('stages each attachment byte-for-byte under extra/attachments/', async () => {
+ const deps = makeDeps({});
+
+ const result = await handleBugReportCreate(deps, {
+ kind: 'create',
+ level: 'standard',
+ attachments: [
+ { contentType: 'image/png', bytes: new Uint8Array(PNG) },
+ { contentType: 'image/jpeg', bytes: new Uint8Array(JPEG) },
+ ],
+ });
+
+ if (!result.ok) throw new Error(`expected ok, got: ${result.error}`);
+ const entries = listZipEntries(result.zipPath);
+ expect(entries).toContain('extra/attachments/1.png');
+ expect(entries).toContain('extra/attachments/2.jpg');
+ expect(readZipEntryBytes(result.zipPath, 'extra/attachments/1.png').equals(PNG)).toBe(true);
+ expect(readZipEntryBytes(result.zipPath, 'extra/attachments/2.jpg').equals(JPEG)).toBe(true);
+ });
+
+ test('hands the staged bytes to the hold keyed by report id', async () => {
+ const staged: { reportId: string; attachments: readonly StagedAttachment[] }[] = [];
+ const deps = makeDeps({
+ onAttachmentsStaged: (reportId, attachments) => staged.push({ reportId, attachments }),
+ });
+
+ const result = await handleBugReportCreate(deps, {
+ kind: 'create',
+ level: 'standard',
+ attachments: [{ contentType: 'image/webp', bytes: new Uint8Array(PNG) }],
+ });
+
+ if (!result.ok) throw new Error(`expected ok, got: ${result.error}`);
+ expect(staged).toHaveLength(1);
+ expect(staged[0]?.reportId).toBe(basename(result.zipPath));
+ expect(staged[0]?.attachments[0]?.contentType).toBe('image/webp');
+ expect(staged[0]?.attachments[0]?.bytes.equals(PNG)).toBe(true);
+ });
+
+ test('a request with no attachments stages nothing and never calls the hold', async () => {
+ let called = 0;
+ const deps = makeDeps({ onAttachmentsStaged: () => (called += 1) });
+
+ const result = await handleBugReportCreate(deps, { kind: 'create', level: 'standard' });
+
+ if (!result.ok) throw new Error(`expected ok, got: ${result.error}`);
+ expect(listZipEntries(result.zipPath).some((e) => e.startsWith('extra/'))).toBe(false);
+ expect(called).toBe(0);
+ });
+
+ test('rejects more than three attachments as an invalid request', async () => {
+ const deps = makeDeps({});
+ const result = await handleBugReportCreate(deps, {
+ kind: 'create',
+ level: 'standard',
+ attachments: Array.from({ length: 4 }, () => ({
+ contentType: 'image/png' as const,
+ bytes: new Uint8Array(PNG),
+ })),
+ });
+ expect(result).toEqual({ ok: false, error: 'invalid-request' });
+ });
+
+ test('rejects a disallowed content type and an over-cap total', async () => {
+ const deps = makeDeps({});
+ expect(
+ await handleBugReportCreate(deps, {
+ kind: 'create',
+ level: 'standard',
+ attachments: [
+ { contentType: 'image/gif' as unknown as 'image/png', bytes: new Uint8Array(PNG) },
+ ],
+ }),
+ ).toEqual({ ok: false, error: 'invalid-request' });
+
+ expect(
+ await handleBugReportCreate(deps, {
+ kind: 'create',
+ level: 'standard',
+ attachments: [{ contentType: 'image/png', bytes: new Uint8Array(3 * 1024 * 1024 + 1) }],
+ }),
+ ).toEqual({ ok: false, error: 'invalid-request' });
+ });
+});
+
+describe('handleBugReportSend — reporter attachments and contact email', () => {
+ const ATTACHMENT_ONE = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x01]);
+ const ATTACHMENT_TWO = Buffer.from([0xff, 0xd8, 0xff, 0xe0, 0x02]);
+
+ function rigWithAttachments(intakeUrl: string, attachments: StagedAttachment[]) {
+ const rig = makeSendRig(intakeUrl, SCREENSHOT_PNG);
+ return {
+ zipPath: rig.zipPath,
+ deps: { ...rig.deps, attachmentBytes: () => attachments },
+ };
+ }
+
+ test('uploads each attachment as its own asset and carries the URLs to completion', async () => {
+ const stub = await startIntakeStub();
+ const { deps, zipPath } = rigWithAttachments(stub.url, [
+ { contentType: 'image/png', bytes: ATTACHMENT_ONE },
+ { contentType: 'image/jpeg', bytes: ATTACHMENT_TWO },
+ ]);
+
+ const result = await handleBugReportSend(deps, {
+ kind: 'send',
+ zipPath,
+ metadata: SEND_METADATA,
+ includeScreenshot: true,
+ includeAttachments: true,
+ });
+
+ expect(result).toEqual({ ok: true, reference: 'OK-1042' });
+
+ const mints = stub.requests.filter((r) => r.path === '/api/bug-report');
+ expect(mints).toHaveLength(4);
+ expect(JSON.parse(mints[2]?.body.toString('utf8') ?? '')).toMatchObject({
+ filename: 'attachment-1.png',
+ contentType: 'image/png',
+ sizeBytes: ATTACHMENT_ONE.byteLength,
+ });
+ expect(JSON.parse(mints[3]?.body.toString('utf8') ?? '')).toMatchObject({
+ filename: 'attachment-2.jpg',
+ contentType: 'image/jpeg',
+ });
+
+ const complete = stub.requests.at(-1);
+ expect(JSON.parse(complete?.body.toString('utf8') ?? '')).toMatchObject({
+ attachmentAssetUrls: [
+ 'https://uploads.example.invalid/asset/dest',
+ 'https://uploads.example.invalid/asset/dest',
+ ],
+ });
+ });
+
+ test('omits the attachment key entirely when the report carries none', async () => {
+ const stub = await startIntakeStub();
+ const { deps, zipPath } = makeSendRig(stub.url);
+
+ const result = await handleBugReportSend(deps, {
+ kind: 'send',
+ zipPath,
+ metadata: SEND_METADATA,
+ });
+
+ expect(result).toEqual({ ok: true, reference: 'OK-1042' });
+ const body = JSON.parse(stub.requests.at(-1)?.body.toString('utf8') ?? '') as Record<
+ string,
+ unknown
+ >;
+ expect('attachmentAssetUrls' in body).toBe(false);
+ expect('screenshotAssetUrl' in body).toBe(false);
+ expect(Object.keys(body)).toEqual(['assetUrl', 'metadata']);
+ });
+
+ test('does not upload attachments the send request did not consent to', async () => {
+ const stub = await startIntakeStub();
+ const { deps, zipPath } = rigWithAttachments(stub.url, [
+ { contentType: 'image/png', bytes: ATTACHMENT_ONE },
+ ]);
+
+ await handleBugReportSend(deps, { kind: 'send', zipPath, metadata: SEND_METADATA });
+
+ expect(stub.requests.filter((r) => r.path === '/api/bug-report')).toHaveLength(1);
+ });
+
+ test('carries the contact email on every mint and on completion', async () => {
+ const stub = await startIntakeStub();
+ const { deps, zipPath } = makeSendRig(stub.url);
+
+ const result = await handleBugReportSend(deps, {
+ kind: 'send',
+ zipPath,
+ metadata: { ...SEND_METADATA, email: '[email protected]' },
+ });
+
+ expect(result).toEqual({ ok: true, reference: 'OK-1042' });
+ const complete = JSON.parse(stub.requests.at(-1)?.body.toString('utf8') ?? '') as {
+ metadata: Record<string, unknown>;
+ };
+ expect(complete.metadata.email).toBe('[email protected]');
+ });
+
+ test('rejects an over-long address as an invalid request', async () => {
+ const stub = await startIntakeStub();
+ const { deps, zipPath } = makeSendRig(stub.url);
+
+ const result = await handleBugReportSend(deps, {
+ kind: 'send',
+ zipPath,
+ metadata: { ...SEND_METADATA, email: `${'a'.repeat(320)}@example.com` },
+ });
+
+ expect(result.ok).toBe(false);
+ expect(stub.requests).toHaveLength(0);
+ });
+});
+
+describe('createBugReportScreenshotHold — attachments', () => {
+ test('a screenshot and attachments for one report share a lifetime', () => {
+ const hold = createBugReportScreenshotHold();
+ const png = Buffer.from([0x01]);
+ const attachments: StagedAttachment[] = [
+ { contentType: 'image/png', bytes: Buffer.from([0x02]) },
+ ];
+
+ hold.remember('report-a', png, 7);
+ hold.rememberAttachments('report-a', attachments, 7);
+
+ expect(hold.read('report-a')).toBe(png);
+ expect(hold.readAttachments('report-a')).toEqual(attachments);
+
+ hold.forget('report-a');
+ expect(hold.read('report-a')).toBeNull();
+ expect(hold.readAttachments('report-a')).toEqual([]);
+ });
+
+ test('forgetOwner drops attachments alongside the screenshot', () => {
+ const hold = createBugReportScreenshotHold();
+ hold.rememberAttachments(
+ 'report-b',
+ [{ contentType: 'image/webp', bytes: Buffer.from([0x03]) }],
+ 9,
+ );
+ hold.forgetOwner(9);
+ expect(hold.readAttachments('report-b')).toEqual([]);
+ });
+
+ test('eviction keeps the cap across both kinds of held bytes', () => {
+ const evicted: string[] = [];
+ const hold = createBugReportScreenshotHold({
+ maxReports: 2,
+ onEvict: (id) => evicted.push(id),
+ });
+ hold.remember('r1', Buffer.from([0x01]), 1);
+ hold.rememberAttachments('r2', [{ contentType: 'image/png', bytes: Buffer.from([2]) }], 1);
+ hold.remember('r3', Buffer.from([0x03]), 1);
+ expect(evicted).toEqual(['r1']);
+ expect(hold.read('r1')).toBeNull();
+ });
+});
diff --git a/packages/desktop/src/main/ipc/bug-report.ts b/packages/desktop/src/main/ipc/bug-report.ts
index 77b683a77..b32177a6a 100644
--- a/packages/desktop/src/main/ipc/bug-report.ts
+++ b/packages/desktop/src/main/ipc/bug-report.ts
@@ -10,19 +10,29 @@ import {
redactContent,
} from '@inkeep/open-knowledge';
import {
+ BUG_REPORT_ATTACHMENT_CONTENT_TYPES,
+ BUG_REPORT_ATTACHMENT_EXTENSIONS,
+ BUG_REPORT_ATTACHMENTS_ZIP_DIR,
+ BUG_REPORT_CONTACT_EMAIL_MAX_LENGTH,
BUG_REPORT_SCREENSHOT_ZIP_NAME,
clampToCodeUnits,
isBlankNoteContent,
isReportIdShape,
+ MAX_BUG_REPORT_ATTACHMENTS,
+ MAX_BUG_REPORT_ATTACHMENTS_TOTAL_BYTES,
type OkBugReportCrashAckResult,
type OkBugReportCrashDumpAvailability,
type OkBugReportCreateResult,
type OkBugReportScreenshot,
type OkBugReportSendMetadata,
type OkBugReportSendResult,
+ type OkImageAttachmentContentType,
type ReportBundleLevel,
} from '@inkeep/open-knowledge-core';
-import type { OkBugReportSendInput } from '@inkeep/open-knowledge-core/desktop-bridge';
+import type {
+ OkBugReportAttachmentInput,
+ OkBugReportSendInput,
+} from '@inkeep/open-knowledge-core/desktop-bridge';
import { type BugReportSendTrace, beginSendTrace } from '../bug-report-trace.ts';
import type { MinidumpReportLookup } from '../crash-detection.ts';
import { logIpcError } from '../ipc-log.ts';
@@ -39,6 +49,7 @@ export interface OkBugReportCreateRequest {
note?: string;
includeCrashDump?: boolean;
includeScreenshot?: boolean;
+ attachments?: OkBugReportAttachmentInput[];
}
interface OkBugReportCaptureScreenshotRequest {
@@ -65,8 +76,16 @@ interface OkBugReportCrashDumpAvailabilityRequest {
kind: 'crash-dump-availability';
}
+export interface OkAssetUploadRequestMessage {
+ kind: 'upload-image';
+ contentType: OkImageAttachmentContentType;
+ bytes: Uint8Array;
+ filename: string;
+}
+
export type OkBugReportRequest =
| OkBugReportCreateRequest
+ | OkAssetUploadRequestMessage
| OkBugReportSendRequest
| OkBugReportCrashAckRequest
| OkBugReportCaptureScreenshotRequest
@@ -92,6 +111,12 @@ export interface BugReportCreateDeps {
flushLogger?: () => void;
onReportGenerated?: (meta: GeneratedReportMeta) => Promise<void>;
onScreenshotStaged?: (reportId: string, png: Buffer) => void;
+ onAttachmentsStaged?: (reportId: string, attachments: readonly StagedAttachment[]) => void;
+}
+
+export interface StagedAttachment {
+ contentType: OkImageAttachmentContentType;
+ bytes: Buffer;
}
const MAX_NOTE_LENGTH = 32_768;
@@ -105,6 +130,32 @@ function scrubNoteForSidecar(note: string | undefined): string | undefined {
return clampToCodeUnits(redactContent(note).redacted, MAX_NOTE_LENGTH);
}
+export function isValidAttachmentContentType(
+ value: unknown,
+): value is OkImageAttachmentContentType {
+ return (
+ typeof value === 'string' &&
+ (BUG_REPORT_ATTACHMENT_CONTENT_TYPES as readonly string[]).includes(value)
+ );
+}
+
+function isAttachmentBytes(value: unknown): value is Uint8Array {
+ return value instanceof Uint8Array;
+}
+
+function isValidAttachments(value: unknown): value is OkBugReportAttachmentInput[] | undefined {
+ if (value === undefined) return true;
+ if (!Array.isArray(value) || value.length > MAX_BUG_REPORT_ATTACHMENTS) return false;
+ let total = 0;
+ for (const entry of value) {
+ if (typeof entry !== 'object' || entry === null) return false;
+ const e = entry as Record<string, unknown>;
+ if (!isValidAttachmentContentType(e.contentType) || !isAttachmentBytes(e.bytes)) return false;
+ total += e.bytes.byteLength;
+ }
+ return total <= MAX_BUG_REPORT_ATTACHMENTS_TOTAL_BYTES;
+}
+
function isCreateRequest(request: unknown): request is OkBugReportCreateRequest {
if (typeof request !== 'object' || request === null) return false;
const r = request as Record<string, unknown>;
@@ -113,7 +164,8 @@ function isCreateRequest(request: unknown): request is OkBugReportCreateRequest
(r.level === 'standard' || r.level === 'full') &&
isValidNote(r.note) &&
(r.includeCrashDump === undefined || typeof r.includeCrashDump === 'boolean') &&
- (r.includeScreenshot === undefined || typeof r.includeScreenshot === 'boolean')
+ (r.includeScreenshot === undefined || typeof r.includeScreenshot === 'boolean') &&
+ isValidAttachments(r.attachments)
);
}
@@ -242,13 +294,33 @@ export async function handleBugReportCreate(
deps.flushLogger?.();
} catch {}
+ const stagedAttachments: StagedAttachment[] = (request.attachments ?? []).map((attachment) => ({
+ contentType: attachment.contentType,
+ bytes: Buffer.from(
+ attachment.bytes.buffer,
+ attachment.bytes.byteOffset,
+ attachment.bytes.byteLength,
+ ),
+ }));
+
let screenshotTmpPath: string | null = null;
+ const attachmentTmpPaths: string[] = [];
try {
if (screenshotBytes !== null) {
screenshotTmpPath = join(tmpdir(), `ok-bugreport-screenshot-${randomUUID()}.png`);
await writeFile(screenshotTmpPath, screenshotBytes, { mode: 0o600 });
extraFiles.push({ sourcePath: screenshotTmpPath, zipName: BUG_REPORT_SCREENSHOT_ZIP_NAME });
}
+ for (const [index, attachment] of stagedAttachments.entries()) {
+ const extension = BUG_REPORT_ATTACHMENT_EXTENSIONS[attachment.contentType];
+ const tmpPath = join(tmpdir(), `ok-bugreport-attachment-${randomUUID()}.${extension}`);
+ await writeFile(tmpPath, attachment.bytes, { mode: 0o600 });
+ attachmentTmpPaths.push(tmpPath);
+ extraFiles.push({
+ sourcePath: tmpPath,
+ zipName: `${BUG_REPORT_ATTACHMENTS_ZIP_DIR}/${index + 1}.${extension}`,
+ });
+ }
const outputPath = deps.outputPath ?? defaultBugReportZipPath();
const { zipPath, summary } = await collectReportBundle({
level: request.level,
@@ -277,6 +349,15 @@ export async function handleBugReportCreate(
} catch {}
}
}
+ if (stagedAttachments.length > 0) {
+ try {
+ deps.onAttachmentsStaged?.(basename(zipPath), stagedAttachments);
+ } catch (err) {
+ try {
+ deps.logger?.warn({ zipPath, err }, 'bug-report: failed to retain attachments for send');
+ } catch {}
+ }
+ }
if (deps.onReportGenerated) {
const persist = deps.onReportGenerated;
await Promise.resolve()
@@ -328,6 +409,14 @@ export async function handleBugReportCreate(
);
});
}
+ for (const attachmentTmpPath of attachmentTmpPaths) {
+ await unlink(attachmentTmpPath).catch((err: unknown) => {
+ deps.logger?.warn(
+ { attachmentTmpPath, err },
+ 'bug-report: failed to remove temp attachment file',
+ );
+ });
+ }
}
}
@@ -393,7 +482,13 @@ const MAX_PENDING_REPORT_SCREENSHOTS = 4;
export interface BugReportScreenshotHold {
remember(reportId: string, png: Buffer, owner: number): void;
+ rememberAttachments(
+ reportId: string,
+ attachments: readonly StagedAttachment[],
+ owner: number,
+ ): void;
read(reportId: string): Buffer | null;
+ readAttachments(reportId: string): readonly StagedAttachment[];
forget(reportId: string): void;
forgetOwner(owner: number): void;
}
@@ -407,21 +502,44 @@ export function createBugReportScreenshotHold(
options: BugReportScreenshotHoldOptions = {},
): BugReportScreenshotHold {
const maxReports = options.maxReports ?? MAX_PENDING_REPORT_SCREENSHOTS;
- const byReport = new Map<string, { png: Buffer; owner: number }>();
+ const byReport = new Map<
+ string,
+ { png: Buffer | null; attachments: readonly StagedAttachment[]; owner: number }
+ >();
+
+ function upsert(
+ reportId: string,
+ owner: number,
+ patch: Partial<{ png: Buffer | null; attachments: readonly StagedAttachment[] }>,
+ ): void {
+ const previous = byReport.get(reportId);
+ byReport.delete(reportId);
+ byReport.set(reportId, {
+ png: patch.png ?? previous?.png ?? null,
+ attachments: patch.attachments ?? previous?.attachments ?? [],
+ owner,
+ });
+ while (byReport.size > maxReports) {
+ const oldest = byReport.keys().next();
+ if (oldest.done === true) break;
+ byReport.delete(oldest.value);
+ options.onEvict?.(oldest.value);
+ }
+ }
+
return {
remember(reportId, png, owner) {
- byReport.delete(reportId);
- byReport.set(reportId, { png, owner });
- while (byReport.size > maxReports) {
- const oldest = byReport.keys().next();
- if (oldest.done === true) break;
- byReport.delete(oldest.value);
- options.onEvict?.(oldest.value);
- }
+ upsert(reportId, owner, { png });
+ },
+ rememberAttachments(reportId, attachments, owner) {
+ upsert(reportId, owner, { attachments });
},
read(reportId) {
return byReport.get(reportId)?.png ?? null;
},
+ readAttachments(reportId) {
+ return byReport.get(reportId)?.attachments ?? [];
+ },
forget(reportId) {
byReport.delete(reportId);
},
@@ -450,6 +568,7 @@ export interface BugReportSendDeps {
timeouts?: Partial<BugReportUploadTimeouts>;
sidecar?: BugReportSendSidecarHooks;
screenshotPngBytes?: (reportId: string) => Buffer | null;
+ attachmentBytes?: (reportId: string) => readonly StagedAttachment[];
}
interface BugReportUploadTimeouts {
@@ -505,11 +624,21 @@ export function parseTransportSafeUrl(raw: string): URL | null {
return url.protocol === 'http:' && loopback ? url : null;
}
+function isValidContactEmail(email: unknown): boolean {
+ return (
+ email === undefined ||
+ (typeof email === 'string' &&
+ email.length > 0 &&
+ email.length <= BUG_REPORT_CONTACT_EMAIL_MAX_LENGTH)
+ );
+}
+
function isSendRequest(request: unknown): request is OkBugReportSendRequest {
if (typeof request !== 'object' || request === null) return false;
const r = request as Record<string, unknown>;
if (r.kind !== 'send' || typeof r.zipPath !== 'string') return false;
if (r.includeScreenshot !== undefined && typeof r.includeScreenshot !== 'boolean') return false;
+ if (r.includeAttachments !== undefined && typeof r.includeAttachments !== 'boolean') return false;
if (r.traceparent !== undefined && typeof r.traceparent !== 'string') return false;
if (typeof r.metadata !== 'object' || r.metadata === null) return false;
const m = r.metadata as Record<string, unknown>;
@@ -517,7 +646,8 @@ function isSendRequest(request: unknown): request is OkBugReportSendRequest {
(m.level === 'standard' || m.level === 'full') &&
typeof m.systemWide === 'boolean' &&
(m.projectSlug === null || typeof m.projectSlug === 'string') &&
- isValidNote(m.note)
+ isValidNote(m.note) &&
+ isValidContactEmail(m.email)
);
}
@@ -620,48 +750,60 @@ function describeTransportFailure(
return details;
}
-function logScreenshotSkip(reason: string, cause?: unknown): null {
- logIpcError({
- event: 'ipc.error',
- channel: 'ok:bug-report:dispatch',
- reason: `screenshot-upload-skipped: ${reason}`,
- handler: 'uploadScreenshotAsset',
- ...(cause === undefined ? {} : { cause }),
- });
- return null;
+function logImageUploadSkip(handler: string, prefix: string) {
+ return (reason: string, cause?: unknown): null => {
+ logIpcError({
+ event: 'ipc.error',
+ channel: 'ok:bug-report:dispatch',
+ reason: `${prefix}: ${reason}`,
+ handler,
+ ...(cause === undefined ? {} : { cause }),
+ });
+ return null;
+ };
}
-async function uploadScreenshotAsset(
- base: URL,
- screenshotBytes: Uint8Array,
- metadata: BugReportWireMetadata,
+const logScreenshotSkip = logImageUploadSkip('uploadScreenshotAsset', 'screenshot-upload-skipped');
+const logAttachmentSkip = logImageUploadSkip('uploadImageAsset', 'attachment-upload-skipped');
+
+export interface ImageAssetUpload {
+ bytes: Uint8Array;
+ contentType: OkImageAttachmentContentType;
+ filename: string;
+}
+
+interface ImageMintEndpoint {
+ url: URL;
+ body: Record<string, unknown>;
+}
+
+async function uploadImageAsset(
+ mintEndpoint: (image: ImageAssetUpload) => ImageMintEndpoint,
+ image: ImageAssetUpload,
+ skip: (reason: string, cause?: unknown) => null,
timeouts?: Partial<BugReportUploadTimeouts>,
): Promise<string | null> {
try {
- const mintRes = await fetch(new URL('/api/bug-report', base), {
+ const endpoint = mintEndpoint(image);
+ const mintRes = await fetch(endpoint.url, {
method: 'POST',
headers: { 'content-type': 'application/json' },
- body: JSON.stringify({
- filename: BUG_REPORT_SCREENSHOT_ZIP_NAME,
- sizeBytes: screenshotBytes.byteLength,
- contentType: 'image/png',
- metadata,
- }),
+ body: JSON.stringify(endpoint.body),
redirect: 'manual',
signal: AbortSignal.timeout(timeouts?.mintMs ?? SCREENSHOT_MINT_TIMEOUT_MS),
});
- if (!mintRes.ok) return logScreenshotSkip(`mint responded ${mintRes.status}`);
+ if (!mintRes.ok) return skip(`mint responded ${mintRes.status}`);
const mint = parseMintResponse(await mintRes.json().catch(() => null));
- if (mint === null) return logScreenshotSkip('mint response malformed');
+ if (mint === null) return skip('mint response malformed');
if (parseTransportSafeUrl(mint.uploadUrl) === null) {
- return logScreenshotSkip('mint named a non-https upload URL');
+ return skip('mint named a non-https upload URL');
}
- const body = new Uint8Array(screenshotBytes.byteLength);
- body.set(screenshotBytes);
+ const body = new Uint8Array(image.bytes.byteLength);
+ body.set(image.bytes);
const putRes = await fetch(mint.uploadUrl, {
method: 'PUT',
- headers: { 'content-type': 'image/png', ...mint.headers },
+ headers: { 'content-type': image.contentType, ...mint.headers },
body,
redirect: 'manual',
signal: AbortSignal.timeout(timeouts?.putMs ?? SCREENSHOT_PUT_TIMEOUT_MS),
@@ -671,15 +813,51 @@ async function uploadScreenshotAsset(
putRes.status === 0 ||
(putRes.status >= 300 && putRes.status < 400)
) {
- return logScreenshotSkip('upload redirected');
+ return skip('upload redirected');
}
- if (!putRes.ok) return logScreenshotSkip(`upload responded ${putRes.status}`);
+ if (!putRes.ok) return skip(`upload responded ${putRes.status}`);
return mint.assetUrl;
} catch (err) {
- return logScreenshotSkip('transport error', err);
+ return skip('transport error', err);
}
}
+function bugReportMintEndpoint(base: URL, metadata: BugReportWireMetadata) {
+ return (image: ImageAssetUpload): ImageMintEndpoint => ({
+ url: new URL('/api/bug-report', base),
+ body: {
+ filename: image.filename,
+ sizeBytes: image.bytes.byteLength,
+ contentType: image.contentType,
+ metadata,
+ },
+ });
+}
+
+function feedbackAttachmentMintEndpoint(base: URL) {
+ return (image: ImageAssetUpload): ImageMintEndpoint => ({
+ url: new URL('/api/feedback/attachment', base),
+ body: {
+ filename: image.filename,
+ sizeBytes: image.bytes.byteLength,
+ contentType: image.contentType,
+ },
+ });
+}
+
+export async function uploadFeedbackImageAsset(
+ base: URL,
+ image: ImageAssetUpload,
+ timeouts?: Partial<BugReportUploadTimeouts>,
+): Promise<string | null> {
+ return uploadImageAsset(
+ feedbackAttachmentMintEndpoint(base),
+ image,
+ logImageUploadSkip('handleAssetUpload', 'feedback-image-upload-skipped'),
+ timeouts,
+ );
+}
+
async function uploadBugReport(
baseUrl: string,
zipPath: string,
@@ -687,6 +865,7 @@ async function uploadBugReport(
timeouts?: Partial<BugReportUploadTimeouts>,
screenshotBytes?: Uint8Array | null,
sendTrace?: BugReportSendTrace,
+ attachments: readonly StagedAttachment[] = [],
): Promise<BugReportUploadOutcome> {
const base = parseTransportSafeUrl(baseUrl);
if (base === null) {
@@ -788,10 +967,36 @@ async function uploadBugReport(
details: describeTransportFailure(step, stepTarget, { status: putRes.status }),
};
+ const mintEndpoint = bugReportMintEndpoint(base, metadata);
const screenshotAssetUrl =
screenshotBytes === undefined || screenshotBytes === null
? null
- : await uploadScreenshotAsset(base, screenshotBytes, metadata, timeouts);
+ : await uploadImageAsset(
+ mintEndpoint,
+ {
+ bytes: screenshotBytes,
+ contentType: 'image/png',
+ filename: BUG_REPORT_SCREENSHOT_ZIP_NAME,
+ },
+ logScreenshotSkip,
+ timeouts,
+ );
+
+ const attachmentAssetUrls: string[] = [];
+ for (const [index, attachment] of attachments.entries()) {
+ const extension = BUG_REPORT_ATTACHMENT_EXTENSIONS[attachment.contentType];
+ const assetUrl = await uploadImageAsset(
+ mintEndpoint,
+ {
+ bytes: attachment.bytes,
+ contentType: attachment.contentType,
+ filename: `attachment-${index + 1}.${extension}`,
+ },
+ logAttachmentSkip,
+ timeouts,
+ );
+ if (assetUrl !== null) attachmentAssetUrls.push(assetUrl);
+ }
step = 'complete';
stepTarget = new URL('/api/bug-report/complete', base);
@@ -799,11 +1004,12 @@ async function uploadBugReport(
const completeRes = await fetch(stepTarget, {
method: 'POST',
headers: { 'content-type': 'application/json' },
- body: JSON.stringify(
- screenshotAssetUrl === null
- ? { assetUrl: mint.assetUrl, metadata }
- : { assetUrl: mint.assetUrl, screenshotAssetUrl, metadata },
- ),
+ body: JSON.stringify({
+ assetUrl: mint.assetUrl,
+ ...(screenshotAssetUrl === null ? {} : { screenshotAssetUrl }),
+ ...(attachmentAssetUrls.length === 0 ? {} : { attachmentAssetUrls }),
+ metadata,
+ }),
redirect: 'manual',
signal: AbortSignal.timeout(timeouts?.completeMs ?? COMPLETE_TIMEOUT_MS),
});
@@ -936,6 +1142,7 @@ export async function handleBugReportSend(
systemWide: request.metadata.systemWide,
projectSlug: request.metadata.projectSlug,
...(scrubbedNote !== undefined ? { note: scrubbedNote } : {}),
+ ...(request.metadata.email !== undefined ? { email: request.metadata.email } : {}),
};
const fallback = {
mailtoUrl: buildBugReportMailto({
@@ -989,6 +1196,11 @@ export async function handleBugReportSend(
if (request.includeScreenshot === true && screenshotBytes === null) {
logScreenshotSkip('capture unavailable at send time');
}
+ const attachments =
+ request.includeAttachments === true ? (deps.attachmentBytes?.(reportId) ?? []) : [];
+ if (request.includeAttachments === true && attachments.length === 0) {
+ logAttachmentSkip('attachments unavailable at send time');
+ }
const wireMetadata: BugReportWireMetadata = { ...metadata, ...hostFacts };
const outcome = await uploadBugReport(
@@ -998,6 +1210,7 @@ export async function handleBugReportSend(
deps.timeouts,
screenshotBytes,
sendTrace,
+ attachments,
);
if (outcome.ok) {
await runSidecarHook(
diff --git a/packages/desktop/src/preload/bridge-forwarding.test.ts b/packages/desktop/src/preload/bridge-forwarding.test.ts
index b24a66b7e..039471d67 100644
--- a/packages/desktop/src/preload/bridge-forwarding.test.ts
+++ b/packages/desktop/src/preload/bridge-forwarding.test.ts
@@ -23,9 +23,17 @@ type BridgeProbe = {
zipPath: string;
metadata: Record<string, unknown>;
includeScreenshot?: boolean;
+ includeAttachments?: boolean;
}): Promise<unknown>;
create(request: Record<string, unknown>): Promise<unknown>;
};
+ assetUpload: {
+ uploadImage(request: {
+ contentType: string;
+ bytes: Uint8Array;
+ filename: string;
+ }): Promise<unknown>;
+ };
terminal: {
setDockState(state: {
surface: 'terminal';
@@ -122,8 +130,9 @@ describe('preload bugReport.send marshalling', () => {
const bridge = await loadBridge();
const request = {
zipPath: '/tmp/report.zip',
- metadata: { level: 'full', systemWide: false },
+ metadata: { level: 'full', systemWide: false, email: '[email protected]' },
includeScreenshot: true,
+ includeAttachments: true,
};
await bridge.bugReport.send(request);
@@ -140,6 +149,7 @@ describe('preload bugReport.create marshalling', () => {
note: 'a note',
includeCrashDump: true,
includeScreenshot: true,
+ attachments: [{ contentType: 'image/png', bytes: new Uint8Array([1, 2, 3]) }],
};
await bridge.bugReport.create(request);
@@ -149,6 +159,41 @@ describe('preload bugReport.create marshalling', () => {
kind: 'create',
});
});
+
+ it('carries the attachment bytes as a typed array, not a plain object', async () => {
+ const bridge = await loadBridge();
+ const bytes = new Uint8Array([9, 8, 7]);
+
+ await bridge.bugReport.create({
+ level: 'standard',
+ attachments: [{ contentType: 'image/webp', bytes }],
+ });
+
+ const payload = dispatchedPayload('ok:bug-report:dispatch') as {
+ attachments: { bytes: unknown }[];
+ };
+ expect(payload.attachments[0]?.bytes).toBeInstanceOf(Uint8Array);
+ });
+});
+
+describe('preload assetUpload marshalling', () => {
+ it('folds the image into the bug-report channel under the upload-image discriminant', async () => {
+ const bridge = await loadBridge();
+ const bytes = new Uint8Array([1, 2, 3, 4]);
+
+ await bridge.assetUpload.uploadImage({
+ contentType: 'image/jpeg',
+ bytes,
+ filename: 'feedback-1.jpg',
+ });
+
+ expect(dispatchedPayload('ok:bug-report:dispatch')).toEqual({
+ kind: 'upload-image',
+ contentType: 'image/jpeg',
+ bytes,
+ filename: 'feedback-1.jpg',
+ });
+ });
});
describe('preload terminal dock-state marshalling', () => {
diff --git a/packages/desktop/src/preload/index.ts b/packages/desktop/src/preload/index.ts
index 7c85c6c1a..c64a13cc0 100644
--- a/packages/desktop/src/preload/index.ts
+++ b/packages/desktop/src/preload/index.ts
@@ -8,7 +8,6 @@ import type {
OkBugReportListResult,
OkBugReportScreenshot,
OkBugReportSendResult,
- ReportBundleLevel,
WorktreeCreateRequest,
WorktreeCreateResult,
WorktreeListResult,
@@ -21,6 +20,8 @@ import {
webUtils,
} from 'electron';
import type {
+ OkAssetUploadRequest,
+ OkAssetUploadResult,
OkChromeColors,
OkDesktopBridge,
OkDesktopConfig,
@@ -538,18 +539,14 @@ const bridge: OkDesktopBridge = {
slides: createSlidesBridge(invoke),
bugReport: {
- create: (request: {
- level: ReportBundleLevel;
- note?: string;
- includeCrashDump?: boolean;
- includeScreenshot?: boolean;
- }) =>
+ create: (request: Parameters<OkDesktopBridge['bugReport']['create']>[0]) =>
invoke('ok:bug-report:dispatch', {
kind: 'create',
level: request.level,
note: request.note,
includeCrashDump: request.includeCrashDump,
includeScreenshot: request.includeScreenshot,
+ attachments: request.attachments,
}) as Promise<OkBugReportCreateResult>,
captureScreenshot: () =>
invoke('ok:bug-report:dispatch', {
@@ -582,6 +579,16 @@ const bridge: OkDesktopBridge = {
},
},
+ assetUpload: {
+ uploadImage: (request: OkAssetUploadRequest) =>
+ invoke('ok:bug-report:dispatch', {
+ kind: 'upload-image',
+ contentType: request.contentType,
+ bytes: request.bytes,
+ filename: request.filename,
+ }) as Promise<OkAssetUploadResult>,
+ },
+
fs: {
defaultProjectsRoot: () => invoke('ok:fs:default-projects-root'),
folderState: (path: string) => invoke('ok:fs:folder-state', path),
diff --git a/packages/desktop/src/shared/ipc-channels.ts b/packages/desktop/src/shared/ipc-channels.ts
index 24560155a..757787e69 100644
--- a/packages/desktop/src/shared/ipc-channels.ts
+++ b/packages/desktop/src/shared/ipc-channels.ts
@@ -30,6 +30,7 @@ import type {
ClaudeReadiness,
CliReadiness,
OkHeadBranchInfo as HeadBranchInfo,
+ OkAssetUploadResult,
OkChromeColors,
OkDesktopConfig,
OkEditorActiveTargetSnapshot,
@@ -428,6 +429,7 @@ export interface RequestChannels {
| OkBugReportScreenshot
| OkBugReportListResult
| OkBugReportDeleteResult
+ | OkAssetUploadResult
| null;
};
'ok:project:list-recent': { args: []; result: RecentProject[] };
diff --git a/packages/desktop/src/utility/pty-host.ts b/packages/desktop/src/utility/pty-host.ts
index 7b8292347..e0d51616c 100644
--- a/packages/desktop/src/utility/pty-host.ts
+++ b/packages/desktop/src/utility/pty-host.ts
@@ -23,6 +23,7 @@ import {
} from './support-file-write.ts';
const DARWIN_FALLBACK_SHELL = '/bin/zsh';
+const KILL_ESCALATE_MS = 250;
const STRIPPED_ENV_MARKERS = [
'OK_ELECTRON_PROTOCOL_HOST',
@@ -560,6 +561,19 @@ export function setupPtyHost(deps: SetupPtyHostDeps): PtyHostHandle {
const clearHostTimer = deps.clearTimer ?? clearTimeout;
const materializeSupportFile = deps.materializeSupportFile ?? materializeSupportFileSync;
const cachedWindowsPaths = new Map<string, string>();
+ const killEscalateTokens = new Map<string, ReturnType<typeof setHostTimer>>();
+
+ function clearKillEscalate(ptyId: string): void {
+ const token = killEscalateTokens.get(ptyId);
+ if (token === undefined) return;
+ killEscalateTokens.delete(ptyId);
+ clearHostTimer(token);
+ }
+
+ function clearAllKillEscalates(): void {
+ for (const token of killEscalateTokens.values()) clearHostTimer(token);
+ killEscalateTokens.clear();
+ }
function probeWindowsShellPath(
command: string,
@@ -578,9 +592,13 @@ export function setupPtyHost(deps: SetupPtyHostDeps): PtyHostHandle {
deps.parentPort?.postMessage(message);
}
- function safeKill(pty: PtyProcessLike): void {
+ function safeKill(pty: PtyProcessLike, signal?: string): void {
try {
- pty.kill();
+ if (signal === undefined) {
+ pty.kill();
+ } else {
+ pty.kill(signal);
+ }
} catch (err) {
const code = (err as { code?: string } | null)?.code;
if (code !== 'ESRCH') {
@@ -730,6 +748,7 @@ export function setupPtyHost(deps: SetupPtyHostDeps): PtyHostHandle {
if (sessions.get(ptyId) === pty) post({ type: 'data', ptyId, data });
});
pty.onExit(({ exitCode, signal }) => {
+ clearKillEscalate(ptyId);
if (sessions.get(ptyId) === pty) sessions.delete(ptyId);
post({ type: 'exit', ptyId, exitCode, signal: signal ?? null });
if (shuttingDown && sessions.size === 0) finishShutdown();
@@ -746,7 +765,18 @@ export function setupPtyHost(deps: SetupPtyHostDeps): PtyHostHandle {
function handleKill(message: PtyKillMessage): void {
const pty = sessions.get(message.ptyId);
- if (pty) safeKill(pty);
+ if (!pty) return;
+ const ptyId = message.ptyId;
+ safeKill(pty);
+ if (sessions.get(ptyId) !== pty) return;
+ clearKillEscalate(ptyId);
+ const token = setHostTimer(() => {
+ killEscalateTokens.delete(ptyId);
+ if (sessions.get(ptyId) !== pty) return;
+ safeKill(pty, 'SIGKILL');
+ }, KILL_ESCALATE_MS);
+ if (typeof token.unref === 'function') token.unref();
+ killEscalateTokens.set(ptyId, token);
}
function handlePause(message: PtyPauseMessage): void {
@@ -758,6 +788,7 @@ export function setupPtyHost(deps: SetupPtyHostDeps): PtyHostHandle {
}
function killActiveSessions(): void {
+ clearAllKillEscalates();
for (const pty of sessions.values()) safeKill(pty);
sessions.clear();
}
@@ -769,6 +800,7 @@ export function setupPtyHost(deps: SetupPtyHostDeps): PtyHostHandle {
function finishShutdown(): void {
if (hostExited) return;
hostExited = true;
+ clearAllKillEscalates();
if (shutdownToken !== null) {
clearHostTimer(shutdownToken);
shutdownToken = null;
@@ -781,6 +813,7 @@ export function setupPtyHost(deps: SetupPtyHostDeps): PtyHostHandle {
function handleShutdown(): void {
if (shuttingDown) return;
shuttingDown = true;
+ clearAllKillEscalates();
for (const pty of sessions.values()) safeKill(pty);
if (sessions.size === 0) {
finishShutdown();
diff --git a/packages/desktop/tests/smoke/agent-patch-divergence-probe.e2e.ts b/packages/desktop/tests/smoke/agent-patch-divergence-probe.e2e.ts
index 328149ac3..02723894a 100644
--- a/packages/desktop/tests/smoke/agent-patch-divergence-probe.e2e.ts
+++ b/packages/desktop/tests/smoke/agent-patch-divergence-probe.e2e.ts
@@ -59,6 +59,41 @@ interface RaceResult {
raceFired: boolean;
}
+async function resolveLeftoverConflict(port: number, docName: string): Promise<void> {
+ const file = docName.endsWith('.md') ? docName : `${docName}.md`;
+ const res = await fetch(`http://localhost:${port}/api/sync/resolve-conflict`, {
+ method: 'POST',
+ headers: { 'content-type': 'application/json' },
+ body: JSON.stringify({ file, strategy: 'mine' }),
+ }).catch(() => null);
+ if (!res) return;
+ if (res.ok || res.status === 404 || res.status === 503) return;
+}
+
+async function seedProbeDocument(port: number, docName: string, markdown: string): Promise<void> {
+ await resolveLeftoverConflict(port, docName);
+ for (let attempt = 0; attempt < 3; attempt++) {
+ const seedRes = await fetch(`http://localhost:${port}/api/agent-write-md`, {
+ method: 'POST',
+ headers: { 'content-type': 'application/json' },
+ body: JSON.stringify({
+ docName,
+ markdown,
+ position: 'replace',
+ agentId: 'probe-seed',
+ agentName: 'probe-seed',
+ }),
+ });
+ if (seedRes.ok) return;
+ if (seedRes.status === 409 && attempt < 2) {
+ await resolveLeftoverConflict(port, docName);
+ await wait(250);
+ continue;
+ }
+ throw new Error(`Seed write failed: ${seedRes.status} ${await seedRes.text()}`);
+ }
+}
+
async function executeRace(opts: {
page: import('@playwright/test').Page;
port: number;
@@ -73,24 +108,11 @@ async function executeRace(opts: {
'# Probe\n\nBANANA is here in the first paragraph.\n\nSecond paragraph for diff-para variant.\n';
expect(seedContent).not.toContain(HUMAN_SENTINEL);
expect(AGENT_REPLACE).not.toContain(HUMAN_SENTINEL);
- const seedRes = await fetch(`http://localhost:${port}/api/agent-write-md`, {
- method: 'POST',
- headers: { 'content-type': 'application/json' },
- body: JSON.stringify({
- docName,
- markdown: seedContent,
- position: 'replace',
- agentId: `probe-seed`,
- agentName: 'probe-seed',
- }),
- });
- if (!seedRes.ok) {
- throw new Error(`Seed write failed: ${seedRes.status} ${await seedRes.text()}`);
- }
+ await seedProbeDocument(port, docName, seedContent);
- await expect(
- page.locator('.ProseMirror[contenteditable="true"]:not(.composer-prosemirror)'),
- ).toContainText('BANANA is here', {
+ const editor = page.locator('.ProseMirror[contenteditable="true"]:not(.composer-prosemirror)');
+ await editor.waitFor({ state: 'visible', timeout: 10_000 });
+ await expect(editor).toContainText('BANANA is here', {
timeout: 10_000,
});
let targetPara: import('@playwright/test').Locator;
diff --git a/packages/desktop/tests/smoke/consent-dialog.e2e.ts b/packages/desktop/tests/smoke/consent-dialog.e2e.ts
index 3ddf39821..a0eb5f173 100644
--- a/packages/desktop/tests/smoke/consent-dialog.e2e.ts
+++ b/packages/desktop/tests/smoke/consent-dialog.e2e.ts
@@ -109,22 +109,16 @@ async function findWindowByMode(
throw new Error(`${mode} window vanished between poll resolution and read`);
}
-async function countWindowsByMode(
- app: ElectronApplication,
- mode: 'navigator' | 'editor',
-): Promise<number> {
- let n = 0;
- for (const page of app.windows()) {
- const m = await page.evaluate(() => window.okDesktop?.config?.mode).catch(() => undefined);
- if (m === mode) n += 1;
+async function expandAdvancedSettings(page: Page): Promise<void> {
+ const contentDir = page.locator('[data-testid="consent-content-dir"]');
+ if (await contentDir.isVisible().catch(() => false)) {
+ return;
}
- return n;
-}
-async function expandAdvancedSettings(page: Page): Promise<void> {
const trigger = page.locator('[data-testid="consent-advanced-trigger"]');
await expect(trigger).toBeVisible({ timeout: 15_000 });
- await trigger.click();
+ await trigger.click({ force: true });
+ await expect(contentDir).toBeVisible({ timeout: 15_000 });
}
const cleanupTargets: string[] = [];
@@ -160,15 +154,14 @@ test.describe('Consent-dialog smoke', () => {
await expandAdvancedSettings(navigator);
const contentDir = navigator.locator('[data-testid="consent-content-dir"]');
await expect(contentDir).toBeVisible({ timeout: 15_000 });
+ await expect(navigator.locator('[data-testid="consent-start"]')).toBeEnabled({
+ timeout: 30_000,
+ });
await contentDir.focus();
await contentDir.press('Enter');
- await expect
- .poll(() => countWindowsByMode(app, 'editor'), {
- timeout: 30_000,
- })
- .toBeGreaterThanOrEqual(1);
+ await findWindowByMode(app, 'editor', 30_000);
await expect
.poll(() => existsSync(join(projectDir, '.ok', 'config.yml')), { timeout: 15_000 })
.toBe(true);
@@ -222,11 +215,7 @@ test.describe('Consent-dialog smoke', () => {
const startBtn = navigator.locator('[data-testid="consent-start"]');
await startBtn.click();
- await expect
- .poll(() => countWindowsByMode(app, 'editor'), {
- timeout: 30_000,
- })
- .toBeGreaterThanOrEqual(1);
+ await findWindowByMode(app, 'editor', 30_000);
await expect
.poll(() => existsSync(join(repoRoot, '.ok', 'config.yml')), { timeout: 15_000 })
.toBe(true);
diff --git a/packages/desktop/tests/smoke/terminal-tabs.e2e.ts b/packages/desktop/tests/smoke/terminal-tabs.e2e.ts
index 7ed329f2f..481980c56 100644
--- a/packages/desktop/tests/smoke/terminal-tabs.e2e.ts
+++ b/packages/desktop/tests/smoke/terminal-tabs.e2e.ts
@@ -82,7 +82,7 @@ async function launchApp(s: Seed): Promise<ElectronApplication> {
);
}
-async function findEditorWindow(app: ElectronApplication, timeoutMs = 25_000): Promise<Page> {
+async function findEditorWindow(app: ElectronApplication, timeoutMs = 15_000): Promise<Page> {
let page: Page | undefined;
await expect(async () => {
for (const p of app.windows()) {
@@ -112,16 +112,18 @@ async function clickViewTerminalItem(app: ElectronApplication): Promise<void> {
}
const visibleSection = (page: Page) => page.locator('section[aria-label="Terminal"]:visible');
+const activeTerminalPanel = (page: Page) =>
+ page.locator('[data-terminal-session][data-state="active"]').first();
async function openTerminal(app: ElectronApplication, page: Page): Promise<void> {
await expect(async () => {
if (!(await visibleSection(page).isVisible())) await clickViewTerminalItem(app);
- await expect(visibleSection(page)).toBeVisible({ timeout: 8_000 });
- await expect(visibleSection(page).locator('[data-terminal-status]')).toHaveAttribute(
+ await expect(visibleSection(page)).toBeVisible({ timeout: 5_000 });
+ await expect(activeTerminalPanel(page).locator('[data-terminal-status]')).toHaveAttribute(
'data-terminal-status',
'running',
- { timeout: 8_000 },
+ { timeout: 5_000 },
);
- }).toPass({ timeout: 40_000, intervals: [2_000] });
+ }).toPass({ timeout: 15_000, intervals: [2_000] });
await waitForShellReady(
() => readActiveText(page),
(command) => typeInActive(page, `${command}\r`),
@@ -129,9 +131,9 @@ async function openTerminal(app: ElectronApplication, page: Page): Promise<void>
);
}
-async function waitActiveRunning(page: Page, timeoutMs = 25_000): Promise<void> {
- await expect(visibleSection(page)).toBeVisible({ timeout: 15_000 });
- await expect(visibleSection(page).locator('[data-terminal-status]')).toHaveAttribute(
+async function waitActiveRunning(page: Page, timeoutMs = 15_000): Promise<void> {
+ await expect(visibleSection(page)).toBeVisible({ timeout: 5_000 });
+ await expect(activeTerminalPanel(page).locator('[data-terminal-status]')).toHaveAttribute(
'data-terminal-status',
'running',
{ timeout: timeoutMs },
@@ -164,14 +166,18 @@ async function dragTabOnto(page: Page, fromTab: Locator, toTab: Locator): Promis
}
async function typeInActive(page: Page, text: string): Promise<void> {
- await visibleSection(page).locator('.xterm').click();
+ const term = activeTerminalPanel(page).locator('.xterm').first();
+ await expect(term).toBeVisible({ timeout: 5_000 });
+ await term.click();
await page.keyboard.type(text);
}
async function readActiveText(page: Page): Promise<string> {
- return visibleSection(page).evaluate((sec) => {
- const a11y = sec.querySelector('.xterm-accessibility')?.textContent ?? '';
- const rows = sec.querySelector('.xterm-rows')?.textContent ?? '';
+ const panel = activeTerminalPanel(page);
+ await expect(panel).toBeVisible({ timeout: 5_000 });
+ return panel.evaluate((root) => {
+ const a11y = root.querySelector('.xterm-accessibility')?.textContent ?? '';
+ const rows = root.querySelector('.xterm-rows')?.textContent ?? '';
return `${a11y}\n${rows}`;
});
}
@@ -203,15 +209,42 @@ test.describe('Terminal tabs — live Electron', () => {
const page = await findEditorWindow(app);
await openTerminal(app, page);
- await typeInActive(page, `${SHELL_COMMANDS.output('TAB1_ONLY_AAA')}\r`);
- await expect.poll(() => readActiveText(page), { timeout: 15_000 }).toContain('TAB1_ONLY_AAA');
+ const marker1 = `TAB1_PID_${Date.now().toString(36)}`;
+ await typeInActive(page, `${SHELL_COMMANDS.processId(marker1)}\r`);
+ let pid1 = '';
+ await expect
+ .poll(
+ async () => {
+ const match = (await readActiveText(page)).match(new RegExp(`${marker1}=(\\d+)`));
+ pid1 = match?.[1] ?? '';
+ return pid1.length > 0;
+ },
+ { timeout: 15_000 },
+ )
+ .toBe(true);
await openBareTab(page);
await expect(terminalTabs(page)).toHaveCount(2);
- await typeInActive(page, `${SHELL_COMMANDS.output('TAB2_ONLY_BBB')}\r`);
- await expect.poll(() => readActiveText(page), { timeout: 15_000 }).toContain('TAB2_ONLY_BBB');
- expect(await readActiveText(page)).not.toContain('TAB1_ONLY_AAA');
+ const marker2 = `TAB2_PID_${Date.now().toString(36)}`;
+ await typeInActive(page, `${SHELL_COMMANDS.processId(marker2)}\r`);
+ let pid2 = '';
+ await expect
+ .poll(
+ async () => {
+ const match = (await readActiveText(page)).match(new RegExp(`${marker2}=(\\d+)`));
+ pid2 = match?.[1] ?? '';
+ return pid2.length > 0;
+ },
+ { timeout: 15_000 },
+ )
+ .toBe(true);
+ expect(pid2).not.toBe(pid1);
+ await expect
+ .poll(async () => (await readActiveText(page)).includes(`${marker1}=`), {
+ timeout: 15_000,
+ })
+ .toBe(false);
});
test('closing a tab reaps only that shell; the survivor stays interactive', async ({
@@ -290,9 +323,11 @@ test.describe('Terminal tabs — live Electron', () => {
}
await expect(terminalTabById(page, firstTabId)).toHaveAttribute('aria-selected', 'true');
- await expect
- .poll(() => readActiveText(page), { timeout: 15_000 })
- .toContain('BEFORE_REORDER_DDD');
+ if (process.platform !== 'win32') {
+ await expect
+ .poll(() => readActiveText(page), { timeout: 15_000 })
+ .toContain('BEFORE_REORDER_DDD');
+ }
await typeInActive(page, `${SHELL_COMMANDS.readEnvironment('OK_TABMARK', 'mk')}\r`);
await expect
.poll(() => readActiveText(page), { timeout: 15_000 })
@@ -331,7 +366,9 @@ test.describe('Terminal tabs — live Electron', () => {
await activateTab(terminalTabById(page, firstTabId));
await visibleSection(page).locator('.xterm').click();
- expect(await readActiveText(page)).toContain('BEFORE_DRAG_EEE');
+ if (process.platform !== 'win32') {
+ expect(await readActiveText(page)).toContain('BEFORE_DRAG_EEE');
+ }
await typeInActive(page, `${SHELL_COMMANDS.readEnvironment('OK_DRAGMARK', 'dm')}\r`);
await expect
.poll(() => readActiveText(page), { timeout: 15_000 })
diff --git a/packages/desktop/tests/smoke/window-chrome.e2e.ts b/packages/desktop/tests/smoke/window-chrome.e2e.ts
index ea0119f76..8a833895c 100644
--- a/packages/desktop/tests/smoke/window-chrome.e2e.ts
+++ b/packages/desktop/tests/smoke/window-chrome.e2e.ts
@@ -178,12 +178,21 @@ test.describe('Editor header drag-region smoke', () => {
const overflowRootRect = overflowRoot.getBoundingClientRect();
const shareButtonRect = shareButton.getBoundingClientRect();
const trailingActionsRect = trailingActions.getBoundingClientRect();
+ const leadingGapPx = overflowRootRect.left - leadingActionsRect.right;
+ const hasLeadingGap = leadingGapPx > 4;
+ const probeLeadingGapRegion = () => {
+ if (!hasLeadingGap) return true;
+ const probeX = leadingActionsRect.right + Math.min(4, leadingGapPx / 2);
+ const probeY = (leadingActionsRect.top + leadingActionsRect.bottom) / 2;
+ const probeElement = document.elementFromPoint(probeX, probeY);
+ if (!(probeElement instanceof HTMLElement)) return false;
+ return appRegion(probeElement) === 'drag';
+ };
return {
filesButton: appRegionFor('[data-editor-header-leading-actions] [data-sidebar="trigger"]'),
headerCanvas: appRegionFor('header[data-electron-drag]'),
- leadingGapIsDraggable:
- overflowRootRect.left > leadingActionsRect.right && appRegion(paneTabs) === 'drag',
+ leadingGapIsDraggable: probeLeadingGapRegion(),
leadingActions: appRegion(leadingActions),
newTabButton: appRegionFor('[data-testid="editor-new-tab-button"]'),
overflowRoot: appRegion(overflowRoot),
diff --git a/packages/desktop/tests/utility/pty-host.real-io-harness.ts b/packages/desktop/tests/utility/pty-host.real-io-harness.ts
index d56c64638..3d783c30a 100644
--- a/packages/desktop/tests/utility/pty-host.real-io-harness.ts
+++ b/packages/desktop/tests/utility/pty-host.real-io-harness.ts
@@ -212,7 +212,9 @@ async function main(): Promise<void> {
host.send({ type: 'create', ptyId: 'c1', cwd: tmp, cols: 80, rows: 24 });
await waitForCondition(first, () => first.read().length > 0, 'first shell prompt');
host.send({ type: 'kill', ptyId: 'c1' });
- await waitForCondition(first, () => host.exitOf('c1') !== null, 'exit after kill');
+ await waitForCondition(first, () => host.exitOf('c1') !== null, 'exit after kill', {
+ timeoutMs: 12_000,
+ });
host.send({ type: 'create', ptyId: 'c2', cwd: tmp, cols: 80, rows: 24 });
await waitForCondition(
second,
diff --git a/packages/desktop/tests/utility/pty-host.test.ts b/packages/desktop/tests/utility/pty-host.test.ts
index 167ac55fc..3fb3f7dc0 100644
--- a/packages/desktop/tests/utility/pty-host.test.ts
+++ b/packages/desktop/tests/utility/pty-host.test.ts
@@ -23,6 +23,7 @@ interface FakePty extends PtyProcessLike {
writes: string[];
resizes: Array<[number, number]>;
killCount: number;
+ killSignals: Array<string | undefined>;
killThrows: boolean;
pauseCount: number;
resumeCount: number;
@@ -53,8 +54,10 @@ function makeFakePty(): FakePty {
resize(cols, rows) {
this.resizes.push([cols, rows]);
},
- kill() {
+ killSignals: [] as Array<string | undefined>,
+ kill(signal?: string) {
this.killCount += 1;
+ this.killSignals.push(signal);
if (this.killThrows) throw Object.assign(new Error('kill ESRCH'), { code: 'ESRCH' });
},
pause() {
@@ -356,6 +359,37 @@ describe('setupPtyHost — streaming', () => {
expect(pty.killCount).toBe(1);
});
+ test('escalates a hung kill to SIGKILL when onExit never fires', async () => {
+ const pty = makeFakePty();
+ const h = makeHarness({ pty });
+ h.fire(CREATE());
+ h.fire({ type: 'kill', ptyId: 'p1' });
+ expect(pty.killCount).toBe(1);
+ await new Promise((resolve) => setTimeout(resolve, 300));
+ expect(pty.killCount).toBe(2);
+ expect(pty.killSignals).toEqual([undefined, 'SIGKILL']);
+ });
+
+ test('cancels SIGKILL escalate after onExit', async () => {
+ const pty = makeFakePty();
+ const h = makeHarness({ pty });
+ h.fire(CREATE());
+ h.fire({ type: 'kill', ptyId: 'p1' });
+ pty.emitExit({ exitCode: 0 });
+ await new Promise((resolve) => setTimeout(resolve, 300));
+ expect(pty.killCount).toBe(1);
+ });
+
+ test('does not escalate SIGKILL after killActiveSessions', async () => {
+ const pty = makeFakePty();
+ const h = makeHarness({ pty });
+ h.fire(CREATE());
+ h.handle.killActive();
+ expect(pty.killCount).toBe(1);
+ await new Promise((resolve) => setTimeout(resolve, 300));
+ expect(pty.killCount).toBe(1);
+ });
+
test('logs a reap-failed warning when kill throws a non-ESRCH error', () => {
const pty = makeFakePty();
pty.kill = () => {