Merge branch 'feat/do-attach-recent' into feat/desktop-offline

This commit is contained in:
Linus Rath
2026-11-04 18:19:52 +01:00
43 changed files with 1040 additions and 5 deletions
@@ -0,0 +1,401 @@
import { render, screen, fireEvent, act, waitFor, within } from '@testing-library/react';
import { describe, it, expect, vi, afterEach } from 'vitest';
import React from 'react';
import { EmailComposer } from '../email-composer';
import { useAuthStore } from '@/stores/auth-store';
import { DEFAULT_POLICY_SNAPSHOT, type PolicySnapshot } from '@/lib/desktop/policy-schema';
import type { BulwarkDesktopBridge, DesktopRecentFile } from '@/lib/desktop/types';
// Recent files in the Attach menu, in the desktop app: the shell's side is
// repos/desktop's test/recent-files.spec.ts; here the bridge is a stub.
const hoisted = vi.hoisted(() => ({
picked: [] as unknown[],
beforeAttachmentUpload: vi.fn(async (_info: { name: string }) => true),
toastError: vi.fn(),
}));
vi.mock('@/components/files/file-picker-dialog', () => ({
FilePickerDialog: ({ onPick }: { onPick: (nodes: unknown[]) => void }) =>
React.createElement(
'button',
{ type: 'button', 'data-testid': 'fake-file-picker', onClick: () => onPick(hoisted.picked) },
'pick',
),
}));
// ─── Heavy component mocks (mirrors composer-plugin-attachment-source.test.tsx) ─
vi.mock('@/components/email/rich-text-editor', () => ({
RichTextEditor: () => React.createElement('div', { 'data-testid': 'rich-text-editor' }),
}));
vi.mock('@/components/plugins/plugin-slot', () => ({ PluginSlot: () => null }));
vi.mock('@/components/identity/sub-address-helper', () => ({ SubAddressHelper: () => null }));
vi.mock('@/components/templates/template-picker', () => ({ TemplatePicker: () => null }));
vi.mock('@/components/templates/template-form', () => ({ TemplateForm: () => null }));
vi.mock('@/components/files/file-preview-modal', () => ({ FilePreviewModal: () => null }));
vi.mock('@/hooks/use-focus-trap', () => ({
useFocusTrap: () => ({ current: null }),
}));
vi.mock('@/hooks/use-pro-multi-account-identities', () => ({
useProMultiAccountIdentities: () => ({ enabled: false, groups: [], allIdentities: [] }),
stripCrossAccountIdentityPrefix: (id: string) => ({ localAccountId: null, rawId: id }),
}));
// ─── Store mocks ──────────────────────────────────────────────────────────────
vi.mock('@/stores/auth-store', () => {
const state = {
client: null,
identities: [],
primaryIdentity: null,
isAuthenticated: false,
isDemoMode: false,
activeAccountId: null,
connectionLost: false,
getClientForAccount: () => undefined,
getAllConnectedClients: () => new Map(),
syncIdentities: () => {},
refreshIdentities: async () => {},
};
const hook = (sel?: (s: typeof state) => unknown) =>
typeof sel === 'function' ? sel(state) : state;
hook.getState = () => state;
hook.setState = (p: Partial<typeof state>) => Object.assign(state, p);
return { useAuthStore: hook };
});
vi.mock('@/stores/identity-store', () => {
const state = {
identities: [{ id: 'id-me', email: 'me@example.com', name: 'Me' }],
defaultIdentityId: 'id-me',
};
const hook = (sel?: (s: typeof state) => unknown) =>
typeof sel === 'function' ? sel(state) : state;
hook.getState = () => state;
hook.setState = (p: Partial<typeof state>) => Object.assign(state, p);
return { useIdentityStore: hook };
});
vi.mock('@/stores/account-store', () => {
const state = { accounts: [], getAccountById: () => undefined };
const hook = (sel?: (s: typeof state) => unknown) =>
typeof sel === 'function' ? sel(state) : state;
hook.getState = () => state;
hook.setState = (p: Partial<typeof state>) => Object.assign(state, p);
return { useAccountStore: hook };
});
vi.mock('@/stores/email-store', () => {
const state = {
draftSaveEnabled: false,
sendRawEmail: async () => ({ sent: true }),
};
const hook = (sel?: (s: typeof state) => unknown) =>
typeof sel === 'function' ? sel(state) : state;
hook.getState = () => state;
hook.setState = (p: Partial<typeof state>) => Object.assign(state, p);
return { useEmailStore: hook };
});
vi.mock('@/stores/settings-store', () => {
const state = {
timeFormat: '24h',
plainTextMode: false,
subAddressDelimiter: '+',
autoSelectReplyIdentity: true,
attachmentReminderEnabled: false,
attachmentReminderKeywords: [],
emptySubjectWarningEnabled: true,
sendDelaySeconds: 0,
signaturePosition: 'above_quote',
signatureSeparatorEnabled: false,
requestReadReceiptDefault: false,
addTrustedSender: () => {},
trustedSendersAddressBook: null,
updateSetting: () => {},
};
const hook = (sel?: (s: typeof state) => unknown) =>
typeof sel === 'function' ? sel(state) : state;
hook.getState = () => state;
hook.setState = (p: Partial<typeof state>) => Object.assign(state, p);
return { useSettingsStore: hook };
});
vi.mock('@/stores/contact-store', () => {
const state = {
contacts: [],
getAutocomplete: async () => [],
addToTrustedSendersBook: async () => {},
};
const hook = (sel?: (s: typeof state) => unknown) =>
typeof sel === 'function' ? sel(state) : state;
hook.getState = () => state;
hook.setState = (p: Partial<typeof state>) => Object.assign(state, p);
return { useContactStore: hook };
});
vi.mock('@/stores/template-store', () => {
const state = { templates: [], addTemplate: async () => {} };
const hook = (sel?: (s: typeof state) => unknown) =>
typeof sel === 'function' ? sel(state) : state;
hook.getState = () => state;
hook.setState = (p: Partial<typeof state>) => Object.assign(state, p);
return { useTemplateStore: hook };
});
// ─── Misc dependency mocks ────────────────────────────────────────────────────
vi.mock('@/stores/toast-store', () => ({
toast: { info: () => {}, error: hoisted.toastError, success: () => {} },
}));
vi.mock('@/lib/plugin-hooks', () => ({
identityHooks: {
onSignatureRender: { size: 0, transform: async (value: unknown) => value },
onIdentitySelect: { size: 0, emit: async () => {} },
},
templateHooks: {
onTemplateRender: { size: 0, transform: async (value: unknown) => value },
onTemplateApply: { size: 0, emit: async () => {} },
},
emailHooks: {
onComposerOpen: { call: async () => [] },
onRecipientChange: { call: async () => [] },
getRecipientSuggestions: { call: async () => [] },
onRecipientChipsChange: { transform: async (chips: unknown) => chips },
onDraftChange: { emit: () => {} },
onBeforeDraftAutoSave: { transform: async (draft: unknown) => draft },
onBeforeEmailSend: { intercept: async () => true, interceptOutcome: async () => 'allowed' },
onBeforeAttachmentUpload: { intercept: hoisted.beforeAttachmentUpload },
onComposeSend: { takeOver: async () => 'default' },
onTransformOutgoingEmail: { transform: async (email: unknown) => email },
},
contactHooks: {
search: { call: async () => [] },
onProvideRecipientSuggestions: { transform: async (initial: unknown) => initial },
},
}));
vi.mock('@/lib/email-sanitization', () => ({
sanitizeSignatureHtml: (v: string) => v,
sanitizeEmailHtml: (v: string) => v,
parseHtmlSafely: (html: string) => new DOMParser().parseFromString(html, 'text/html'),
}));
vi.mock('@/lib/email-threading', () => ({
computeReplyThreadingHeaders: () => ({ inReplyTo: [], references: [] }),
}));
vi.mock('@/lib/signature-utils', () => ({
appendPlainTextSignature: (body: string) => body,
getPlainTextSignature: () => '',
plainTextBodyHasSignature: () => false,
plainTextBodyWithoutSignature: (body: string) => body,
}));
vi.mock('@/lib/sub-addressing', () => ({ generateSubAddress: () => '' }));
vi.mock('@/lib/debug', () => ({ debug: { log: () => {}, warn: () => {}, error: () => {} } }));
vi.mock('@/components/email/quoted-html', () => ({
buildQuotedHtmlBlock: () => '',
serializeEditorContent: () => '',
}));
vi.mock('@/lib/template-utils', () => ({ substitutePlaceholders: (s: string) => s }));
// ─── Tests ────────────────────────────────────────────────────────────────────
const NOW = Date.now();
const RECENT: DesktopRecentFile[] = [
{ id: 'id-report', name: 'Quarterly report.docx', folder: '\\\\files\\team\\Reports', path: '\\\\files\\team\\Reports\\Quarterly report.docx', usedAt: NOW - 5 * 60_000, icon: 'data:image/png;base64,iVBORw0KGgo=' },
{ id: 'id-budget', name: 'Budget 2027.xlsx', folder: 'C:\\Users\\me\\Documents', path: 'C:\\Users\\me\\Documents\\Budget 2027.xlsx', usedAt: NOW - 3 * 60 * 60_000 },
];
interface DesktopOptions {
files?: DesktopRecentFile[];
policyOff?: boolean;
/** The shell's native menus: the Attach menu must stay HTML all the same. */
popup?: ReturnType<typeof vi.fn>;
}
function desktop({ files = RECENT, policyOff = false, popup }: DesktopOptions = {}) {
const snapshot: PolicySnapshot = {
...DEFAULT_POLICY_SNAPSHOT,
...(policyOff ? { RecentFilesInAttach: { value: false, source: 'forced-machine', locked: true } } : {}),
} as PolicySnapshot;
const list = vi.fn(async () => ({ ok: true as const, files }));
const attach = vi.fn(async (id: string) => {
const file = files.find((f) => f.id === id);
return file
? { ok: true as const, file: { name: file.name, data: new TextEncoder().encode(`bytes of ${file.name}`) } }
: { ok: false as const, reason: 'unknown' as const };
});
window.bulwarkDesktop = {
version: 1,
platform: 'win32',
policy: { get: () => snapshot, onChange: () => () => {} },
recentFiles: { list, attach },
...(popup ? { menu: { popup, setState: () => {}, onCommand: () => () => {} } } : {}),
} as unknown as BulwarkDesktopBridge;
return { list, attach };
}
function client(overrides: Record<string, unknown> = {}) {
return {
createDraft: vi.fn().mockResolvedValue('draft-1'),
getEmail: vi.fn(),
hasDelayedSend: () => false,
getMaxDelayedSend: () => 0,
// No Files, no plugins: in a browser, Attach is a plain button.
supportsFiles: () => false,
getMaxSizeAttachmentsPerEmail: () => 0,
getMaxSizeUpload: () => 0,
uploadBlob: vi.fn(() => new Promise(() => {})),
...overrides,
};
}
const rows = () => screen.queryAllByTestId('composer-recent-file');
async function openMenu() {
fireEvent.click(screen.getByTestId('composer-attach-menu'));
await act(async () => {});
}
describe('recent files in the Attach menu', () => {
afterEach(() => {
window.bulwarkDesktop = undefined;
useAuthStore.setState({ client: null });
vi.clearAllMocks();
hoisted.beforeAttachmentUpload.mockImplementation(async () => true);
});
it('in a browser the paperclip is the plain button it was', () => {
useAuthStore.setState({ client: client() as never });
render(<EmailComposer onClose={vi.fn()} />);
expect(screen.queryByTestId('composer-attach-menu')).toBeNull();
expect(screen.getByRole('button', { name: 'attach' })).toBeInTheDocument();
});
it('in the desktop app the paperclip opens a menu: recent files first, then the file dialog', async () => {
const { list } = desktop();
useAuthStore.setState({ client: client() as never });
render(<EmailComposer onClose={vi.fn()} />);
expect(list).not.toHaveBeenCalled();
await openMenu();
expect(list).toHaveBeenCalledTimes(1);
const menu = screen.getByRole('menu');
const items = within(menu).getAllByRole('menuitem');
expect(items.map((item) => item.getAttribute('data-testid'))).toEqual(['composer-recent-file', 'composer-recent-file', 'composer-attach-from-device']);
expect(within(menu).getByText('heading')).toBeInTheDocument();
expect(items[2]).toHaveTextContent('browse');
const [report, budget] = rows();
expect(report).toHaveTextContent('Quarterly report.docx');
expect(report).toHaveTextContent('\\\\files\\team\\Reports');
expect(report).toHaveTextContent('5 minutes ago');
expect(report).toHaveAttribute('title', '\\\\files\\team\\Reports\\Quarterly report.docx');
expect(report.querySelector('img')).toHaveAttribute('src', RECENT[0].icon);
// No icon from the shell: the app's own for the type.
expect(budget.querySelector('img')).toBeNull();
expect(budget.querySelector('svg')).not.toBeNull();
expect(budget).toHaveTextContent('3 hours ago');
});
it('one click attaches that file through the composer\'s own checks and closes the menu', async () => {
const { attach } = desktop();
useAuthStore.setState({ client: client() as never });
render(<EmailComposer onClose={vi.fn()} />);
await openMenu();
fireEvent.click(rows()[1]);
expect(screen.queryByRole('menu')).toBeNull();
expect(attach).toHaveBeenCalledWith('id-budget');
expect(await screen.findByText('Budget 2027.xlsx')).toBeInTheDocument();
expect(hoisted.beforeAttachmentUpload).toHaveBeenCalledWith(expect.objectContaining({ name: 'Budget 2027.xlsx', size: 'bytes of Budget 2027.xlsx'.length }));
});
it('a plugin can refuse it, as it can a file from the dialog', async () => {
hoisted.beforeAttachmentUpload.mockImplementation(async (info) => info.name !== 'Budget 2027.xlsx');
desktop();
useAuthStore.setState({ client: client() as never });
render(<EmailComposer onClose={vi.fn()} />);
await openMenu();
fireEvent.click(rows()[1]);
await act(async () => {});
expect(hoisted.beforeAttachmentUpload).toHaveBeenCalled();
expect(screen.queryByText('Budget 2027.xlsx')).toBeNull();
});
it('the server\'s size limit applies too', async () => {
desktop();
useAuthStore.setState({ client: client({ getMaxSizeUpload: () => 5 }) as never });
render(<EmailComposer onClose={vi.fn()} />);
await openMenu();
fireEvent.click(rows()[0]);
await act(async () => {});
expect(hoisted.toastError).toHaveBeenCalledWith('attachment_too_large');
expect(screen.queryByText('Quarterly report.docx')).toBeNull();
});
it('says so when the file is gone or too large for the app', async () => {
const { attach } = desktop();
useAuthStore.setState({ client: client() as never });
render(<EmailComposer onClose={vi.fn()} />);
attach.mockResolvedValueOnce({ ok: false, reason: 'missing' } as never);
await openMenu();
fireEvent.click(rows()[0]);
await act(async () => {});
expect(hoisted.toastError).toHaveBeenLastCalledWith('missing');
attach.mockResolvedValueOnce({ ok: false, reason: 'too-large' } as never);
await openMenu();
fireEvent.click(rows()[0]);
await act(async () => {});
expect(hoisted.toastError).toHaveBeenLastCalledWith('too_large');
});
it('with nothing recent the menu has only its other entries', async () => {
desktop({ files: [] });
useAuthStore.setState({ client: client() as never });
render(<EmailComposer onClose={vi.fn()} />);
await openMenu();
const menu = screen.getByRole('menu');
expect(within(menu).queryByText('heading')).toBeNull();
expect(within(menu).queryByRole('separator')).toBeNull();
expect(within(menu).getAllByRole('menuitem').map((item) => item.getAttribute('data-testid'))).toEqual(['composer-attach-from-device']);
});
it('with the policy off there\'s no list, and Attach is what it was', async () => {
const { list } = desktop({ policyOff: true });
useAuthStore.setState({ client: client() as never });
render(<EmailComposer onClose={vi.fn()} />);
expect(screen.queryByTestId('composer-attach-menu')).toBeNull();
fireEvent.click(screen.getByRole('button', { name: 'attach' }));
await act(async () => {});
expect(list).not.toHaveBeenCalled();
});
it('keys: the first file has the focus, arrows move, Escape closes', async () => {
desktop();
useAuthStore.setState({ client: client() as never });
render(<EmailComposer onClose={vi.fn()} />);
await openMenu();
await waitFor(() => expect(document.activeElement).toBe(rows()[0]), { timeout: 5000 });
fireEvent.keyDown(document.activeElement!, { key: 'ArrowDown' });
expect(document.activeElement).toBe(rows()[1]);
fireEvent.keyDown(document.activeElement!, { key: 'ArrowDown' });
expect(document.activeElement).toHaveAttribute('data-testid', 'composer-attach-from-device');
fireEvent.keyDown(document.activeElement!, { key: 'Escape' });
expect(screen.queryByRole('menu')).toBeNull();
});
it('stays an HTML menu where the shell would draw it natively', async () => {
const popup = vi.fn(async () => null);
desktop({ popup });
useAuthStore.setState({ client: client() as never });
render(<EmailComposer onClose={vi.fn()} />);
await openMenu();
await act(async () => { await new Promise((resolve) => setTimeout(resolve, 300)); });
expect(popup).not.toHaveBeenCalled();
expect(rows()).toHaveLength(2);
});
});
+27 -4
View File
@@ -188,7 +188,10 @@ import { fileStorage } from "@/lib/plugin-storage";
import { usePolicyStore } from "@/stores/policy-store";
import { isAppLockedNow } from "@/lib/app-lock/state";
import { registerComposeFlush, registerComposeSnapshot } from "@/lib/compose-flush-registry";
import { getDesktopBridge } from "@/lib/desktop/bridge";
import { getDesktopBridge, isDesktopApp } from "@/lib/desktop/bridge";
import { readRecentFile, RECENT_FILE_MAX_BYTES, useRecentFilesOffered } from "@/lib/desktop/recent-files";
import type { DesktopRecentFile } from "@/lib/desktop/types";
import { RecentFilesMenuSection } from "@/components/email/recent-files-menu-section";
import { useDesktopCommands } from "@/lib/desktop/commands";
import { noteComposerLanguage } from "@/lib/desktop/languages";
import { noteOpenDraft } from "@/lib/desktop/window-restore";
@@ -650,6 +653,7 @@ export function EmailComposer({
const tEdit = useTranslations('desktopEdit');
const tOfflineDrafts = useTranslations('offlineDrafts');
const tOffline = useTranslations('offline');
const tRecent = useTranslations('desktopAttachRecent');
const tOfflineNotes = useTranslations('offlineConflicts');
const tSendGuards = useTranslations('send_guards');
const tWords = useTranslations('compose_words');
@@ -2778,6 +2782,20 @@ export function EmailComposer({
void addFiles(initialFiles, { handedIn: true });
}, [client, initialFiles, addFiles]);
// The Attach menu's recent files, in the desktop app (lib/desktop/recent-files.ts). The
// shell reads the file; from there it's a file like one from the file dialog.
const recentOffered = useRecentFilesOffered();
const attachRecentFile = useCallback(async (file: DesktopRecentFile) => {
const result = await readRecentFile(file.id);
if (result.ok) {
await addFiles([result.file]);
return;
}
if (result.reason === 'missing') toast.error(tRecent('missing', { name: file.name }));
else if (result.reason === 'too-large') toast.error(tRecent('too_large', { name: file.name, max: formatFileSize(RECENT_FILE_MAX_BYTES) }));
else if (result.reason === 'failed') toast.error(tRecent('failed', { name: file.name }));
}, [addFiles, tRecent]);
const handleFileSelect = async (event: React.ChangeEvent<HTMLInputElement>) => {
if (!event.target.files) return;
await addFiles(Array.from(event.target.files));
@@ -5941,14 +5959,19 @@ export function EmailComposer({
className="hidden"
accept="*/*"
/>
{(filesEnabled && composerClient?.supportsFiles?.()) || hasAttachMenuActions ? (
{recentOffered || (filesEnabled && composerClient?.supportsFiles?.()) || hasAttachMenuActions ? (
<ComposerToolbarMenu icon={Paperclip} label={t('attach')} testId="composer-attach-menu">
{(close) => <>
{/* As Outlook's: the recent files first, one click attaches one and closes. */}
{recentOffered && (
<RecentFilesMenuSection onPick={(file) => { close(); void attachRecentFile(file); }} />
)}
<ComposerToolbarMenuItem
icon={Upload}
onSelect={() => { close(); fileInputRef.current?.click(); }}
testId="composer-attach-from-device"
>
{t('attach_from_device')}
{isDesktopApp() ? tRecent('browse') : t('attach_from_device')}
</ComposerToolbarMenuItem>
{filesEnabled && composerClient?.supportsFiles?.() && (
<ComposerToolbarMenuItem
@@ -5956,7 +5979,7 @@ export function EmailComposer({
onSelect={() => { close(); setFilesPicker({ client: composerClient, accountId: composerAccountId }); }}
testId="composer-attach-from-files"
>
{t('attach_from_files')}
{isDesktopApp() ? tRecent('from_files') : t('attach_from_files')}
</ComposerToolbarMenuItem>
)}
<ComposerPluginMenuItems surface="composer-attach-menu" context={composerActionContext} onSelect={close} separator />
@@ -0,0 +1,88 @@
"use client";
import { useEffect, useLayoutEffect, useRef, useState } from "react";
import { useLocale, useTranslations } from "next-intl";
import { CONTEXT_MENU_ITEM_CLASS, menuLevelItems } from "@/components/ui/context-menu";
import { attachmentIcon } from "@/components/email/attachment-chips";
import { listRecentFiles, recentWhen, shortFolder } from "@/lib/desktop/recent-files";
import type { DesktopRecentFile } from "@/lib/desktop/types";
import { cn } from "@/lib/utils";
/** Only an icon the shell made: a PNG as a data: URL. */
const ICON_URL = /^data:image\/png;base64,[A-Za-z0-9+/=]+$/;
/**
* The top of the composer's Attach menu in the desktop app: the files the OS says were
* used last, as Outlook lists them. Mounted when the menu opens, from that click, which is
* what the shell asks for. Until the list is there, and when it's empty, it takes no room.
* It stays an HTML menu (data-native-menu): a native one can't show the icons and folders.
*/
export function RecentFilesMenuSection({ onPick }: { onPick: (file: DesktopRecentFile) => void }) {
const t = useTranslations("desktopAttachRecent");
const locale = useLocale();
const [files, setFiles] = useState<DesktopRecentFile[] | null>(null);
// One request per opening, also when a strict-mode remount runs the effect twice.
const request = useRef<Promise<DesktopRecentFile[]> | null>(null);
const rootRef = useRef<HTMLDivElement>(null);
useEffect(() => {
let cancelled = false;
request.current ??= listRecentFiles();
void request.current.then((list) => {
if (!cancelled) setFiles(list);
});
return () => {
cancelled = true;
};
}, []);
// The menu put the focus on its first entry before the list came. If it's still
// there, the first file takes it: the list is what comes first.
useLayoutEffect(() => {
const root = rootRef.current;
const menu = root?.closest<HTMLElement>('[role="menu"]');
if (!root || !menu || !files?.length) return;
const active = document.activeElement;
const others = menuLevelItems(menu).filter((item) => !root.contains(item));
if (active && active === others[0]) root.querySelector<HTMLElement>('[role="menuitem"]')?.focus({ preventScroll: true });
}, [files]);
const now = Date.now();
return (
<div ref={rootRef} data-native-menu="html" data-testid="composer-recent-files" hidden={!files?.length}>
{files && files.length > 0 && (
<>
<div role="presentation" className="px-3 pb-1 pt-1.5 text-xs font-medium text-muted-foreground">
{t("heading")}
</div>
{files.map((file) => {
const Fallback = attachmentIcon(null, file.name).icon;
return (
<button
key={file.id}
type="button"
role="menuitem"
title={file.path}
onClick={() => onPick(file)}
data-testid="composer-recent-file"
className={cn(CONTEXT_MENU_ITEM_CLASS, "w-[min(24rem,calc(100vw-3rem))] gap-2.5")}
>
{file.icon && ICON_URL.test(file.icon) ? (
<img src={file.icon} alt="" aria-hidden="true" draggable={false} className="h-4 w-4 shrink-0" />
) : (
<Fallback className="h-4 w-4 shrink-0 text-muted-foreground" aria-hidden="true" />
)}
<span className="min-w-0 flex-1">
<span className="block truncate">{file.name}</span>
<span className="block truncate text-xs text-muted-foreground">{shortFolder(file.folder)}</span>
</span>
<span className="shrink-0 self-start pt-0.5 text-xs text-muted-foreground">{recentWhen(file.usedAt, now, locale)}</span>
</button>
);
})}
<div role="separator" className="my-1 h-px bg-border" />
</>
)}
</div>
);
}
+6
View File
@@ -224,5 +224,11 @@
<decimal id="DeveloperToolsAvailability_Value" valueName="DeveloperToolsAvailability" required="true" minValue="0" maxValue="2"/>
</elements>
</policy>
<policy name="RecentFilesInAttach" class="Both" displayName="$(string.RecentFilesInAttach)" explainText="$(string.RecentFilesInAttach_Explain)" key="Software\Policies\Bulwark\Desktop" valueName="RecentFilesInAttach">
<parentCategory ref="Bulwark_Desktop_privacy"/>
<supportedOn ref="SUPPORTED_Bulwark_Desktop"/>
<enabledValue><decimal value="1"/></enabledValue>
<disabledValue><decimal value="0"/></disabledValue>
</policy>
</policies>
</policyDefinitions>
+2
View File
@@ -67,6 +67,8 @@
<string id="OpenWithEnabled_Explain">Wenn aktiviert oder nicht konfiguriert, trägt sich die App unter Windows in die Liste „Öffnen mit“ für gängige Dokumente und Bilder und in das Menü „Senden an“ ein, damit Benutzer eine Datei aus dem Dateimanager an eine neue Nachricht anhängen können. Sie wird nie zum Standardprogramm für diese Dateien. Wenn deaktiviert, entfernt die App diese Einträge für den Benutzer. Mail-Links und .eml-, .ics- und .vcf-Dateien sind nicht betroffen.</string>
<string id="DeveloperToolsAvailability">Entwicklertools</string>
<string id="DeveloperToolsAvailability_Explain">Dieselben Werte wie die gleichnamige Richtlinie von Chrome. 2: Die Entwicklertools sind aus und die Einstellung ist gesperrt. 0 oder 1 oder nicht konfiguriert: Benutzer können sie nach einer Warnung in den Einstellungen einschalten. Mit den Entwicklertools kann jeder an der Tastatur alles lesen, was die App enthält, auch E-Mails und Passwörter im Speicher.</string>
<string id="RecentFilesInAttach">Zuletzt verwendete Dateien im Menü „Anfügen“ anzeigen</string>
<string id="RecentFilesInAttach_Explain">Wenn aktiviert oder nicht konfiguriert, listet die Schaltfläche „Anfügen“ in einer neuen Nachricht die Dateien auf, die der Benutzer zuletzt geöffnet hat, so wie das Betriebssystem sie erfasst. Ein Klick fügt eine davon an. Die Liste wird beim Öffnen des Menüs gelesen und bleibt auf dem Gerät. Wenn deaktiviert, fehlt die Liste und die App lehnt es ab, sie zu lesen. Das Anfügen über den Dateidialog ist nicht betroffen.</string>
</stringTable>
<presentationTable>
<presentation id="InstanceUrl"><textBox refId="InstanceUrl_Value"><label>Adresse des Bulwark-Servers</label></textBox></presentation>
+2
View File
@@ -67,6 +67,8 @@
<string id="OpenWithEnabled_Explain">When enabled or not configured, the app adds itself to the &quot;Open with&quot; list for common documents and pictures and to the &quot;Send to&quot; menu on Windows, so people can attach a file to a new message from the file manager. It never becomes the default program for those files. When disabled, the app removes these entries for the user. Mail links and .eml, .ics and .vcf files are not affected.</string>
<string id="DeveloperToolsAvailability">Developer tools</string>
<string id="DeveloperToolsAvailability_Explain">The same values as Chrome&apos;s policy of this name. 2: developer tools are off and the setting is locked. 0 or 1, or not configured: people can turn them on under Settings, after a warning. Developer tools let anyone at the keyboard read everything the app holds, mail and passwords in memory included.</string>
<string id="RecentFilesInAttach">Show recent files in the Attach menu</string>
<string id="RecentFilesInAttach_Explain">When enabled or not configured, the Attach button in a new message lists the files the user opened recently, as the operating system records them, so one click attaches one. The list is read when the menu opens and stays on the device. When disabled, the list is gone and the app refuses to read it. Attaching through the file dialog is not affected.</string>
</stringTable>
<presentationTable>
<presentation id="InstanceUrl"><textBox refId="InstanceUrl_Value"><label>Address of the Bulwark server</label></textBox></presentation>
@@ -69,6 +69,8 @@
<true/>
<key>DeveloperToolsAvailability</key>
<integer>2</integer>
<key>RecentFilesInAttach</key>
<true/>
<key>Recommended</key>
<dict>
<key>UpdateChannel</key>
+1
View File
@@ -29,6 +29,7 @@
"BrowserSignIn": true,
"OpenWithEnabled": true,
"DeveloperToolsAvailability": 2,
"RecentFilesInAttach": true,
"Recommended": {
"UpdateChannel": "stable"
}
+8 -1
View File
@@ -32,7 +32,7 @@ describe('the schema', () => {
'PluginsMode', 'PluginAllowlist', 'OfflineEnabled', 'AppLockRequired', 'AppLockTimeoutMinutes', 'TelemetryAllowed',
'CrashReportsAllowed', 'QuickComposeShortcut', 'AuthServerAllowlist', 'AuthNegotiateDelegateAllowlist',
'AutoSelectCertificateForUrls', 'KeystoreEnabled', 'KeystoreAllowedOrigins', 'BrowserSignIn', 'WipeOfflineData',
'OpenWithEnabled', 'DeveloperToolsAvailability',
'OpenWithEnabled', 'DeveloperToolsAvailability', 'RecentFilesInAttach',
]);
for (const key of POLICY_KEYS) {
const { title, description } = POLICY_SCHEMA[key];
@@ -56,6 +56,13 @@ describe('developer tools and Open with', () => {
expect(resolvePolicies(layers({ forcedMachine: { OpenWithEnabled: 0 } })).OpenWithEnabled).toMatchObject({ value: false, locked: true });
expect(resolvePolicies(layers({ forcedMachine: { OpenWithEnabled: 'maybe' } })).OpenWithEnabled).toMatchObject({ value: false, locked: true });
});
it('hide recent files in the Attach menu only by force, and a value nobody can read hides them', () => {
expect(resolvePolicies(layers({})).RecentFilesInAttach).toMatchObject({ value: true, locked: false });
expect(resolvePolicies(layers({ recommendedMachine: { RecentFilesInAttach: 0 } })).RecentFilesInAttach).toMatchObject({ value: true, locked: false });
expect(resolvePolicies(layers({ forcedUser: { RecentFilesInAttach: 0 } })).RecentFilesInAttach).toMatchObject({ value: false, locked: true });
expect(resolvePolicies(layers({ forcedMachine: { RecentFilesInAttach: 'yes please' } })).RecentFilesInAttach).toMatchObject({ value: false, locked: true });
});
});
describe('precedence', () => {
+109
View File
@@ -0,0 +1,109 @@
import { afterEach, describe, expect, it, vi } from 'vitest';
import { DEFAULT_POLICY_SNAPSHOT, type PolicySnapshot } from '../policy-schema';
import type { BulwarkDesktopBridge, DesktopRecentFilesBridge } from '../types';
import { createElement } from 'react';
import { renderToString } from 'react-dom/server';
import { listRecentFiles, readRecentFile, recentFilesOffered, recentWhen, shortFolder, useRecentFilesOffered } from '../recent-files';
describe('shortFolder', () => {
it('keeps the drive or share and the folders nearest the file, and drops the middle', () => {
expect(shortFolder('C:\\Users\\me\\Documents')).toBe('C:\\Users\\me\\Documents');
expect(shortFolder('C:\\Users\\me\\AppData\\Local\\Temp\\bw-shots-gnIFSO\\Documents\\Reports'))
.toBe('C:\\…\\Temp\\bw-shots-gnIFSO\\Documents\\Reports');
expect(shortFolder('\\\\fileserver\\departments\\Finance\\Controlling\\2026\\Quarterly\\Board'))
.toBe('\\\\fileserver\\departments\\…\\Quarterly\\Board');
expect(shortFolder('/home/me/projects/customer-a/2026/contracts/signed/final')).toBe('/…/customer-a/2026/contracts/signed/final');
// One long name: nothing to drop, the line's ellipsis does the rest.
const long = `C:\\${'x'.repeat(60)}`;
expect(shortFolder(long)).toBe(long);
});
});
function setBridge(recentFiles?: Partial<DesktopRecentFilesBridge>, policy: Partial<PolicySnapshot> = {}) {
const snapshot = { ...DEFAULT_POLICY_SNAPSHOT, ...policy };
window.bulwarkDesktop = {
version: 1,
platform: 'win32',
policy: { get: () => snapshot, onChange: () => () => {} },
...(recentFiles ? { recentFiles: recentFiles as DesktopRecentFilesBridge } : {}),
} as BulwarkDesktopBridge;
}
const off = { RecentFilesInAttach: { value: false, source: 'forced-machine', locked: true } } as Partial<PolicySnapshot>;
afterEach(() => {
window.bulwarkDesktop = undefined;
});
describe('whether the Attach menu lists recent files', () => {
it('not in a browser, not under a shell without the list, not when the policy says no', () => {
expect(recentFilesOffered()).toBe(false);
setBridge();
expect(recentFilesOffered()).toBe(false);
setBridge({ list: vi.fn(), attach: vi.fn() });
expect(recentFilesOffered()).toBe(true);
setBridge({ list: vi.fn(), attach: vi.fn() }, off);
expect(recentFilesOffered()).toBe(false);
});
it("says no in the server's render, so the page's first render matches it", () => {
setBridge({ list: vi.fn(), attach: vi.fn() });
const Probe = () => createElement('span', null, useRecentFilesOffered() ? 'menu' : 'button');
expect(renderToString(createElement(Probe))).toBe('<span>button</span>');
});
});
describe('listRecentFiles', () => {
it('gives the files, and nothing when main says no or fails', async () => {
const file = { id: 'a', name: 'a.pdf', folder: 'C:\\Docs', path: 'C:\\Docs\\a.pdf', usedAt: 1 };
setBridge({ list: vi.fn(async () => ({ ok: true as const, files: [file] })) });
expect(await listRecentFiles()).toEqual([file]);
setBridge({ list: vi.fn(async () => ({ ok: false as const, reason: 'gesture' as const })) });
expect(await listRecentFiles()).toEqual([]);
setBridge({ list: vi.fn(async () => { throw new Error('gone'); }) });
expect(await listRecentFiles()).toEqual([]);
window.bulwarkDesktop = undefined;
expect(await listRecentFiles()).toEqual([]);
});
});
describe('readRecentFile', () => {
it('turns the bytes into a File with the name main gave', async () => {
const attach = vi.fn(async () => ({ ok: true as const, file: { name: 'Report.docx', data: new TextEncoder().encode('hello') } }));
setBridge({ attach });
const result = await readRecentFile('id-1');
expect(attach).toHaveBeenCalledWith('id-1');
expect(result.ok).toBe(true);
if (!result.ok) return;
expect(result.file.name).toBe('Report.docx');
expect(await result.file.text()).toBe('hello');
});
it('says what the user can act on, and keeps quiet about a lock or a policy', async () => {
const answer = (reason: string) => {
setBridge({ attach: vi.fn(async () => ({ ok: false, reason }) as never) });
return readRecentFile('x');
};
expect(await answer('missing')).toEqual({ ok: false, reason: 'missing' });
expect(await answer('too-large')).toEqual({ ok: false, reason: 'too-large' });
expect(await answer('unknown')).toEqual({ ok: false, reason: 'failed' });
expect(await answer('gesture')).toEqual({ ok: false, reason: 'failed' });
expect(await answer('locked')).toEqual({ ok: false, reason: 'quiet' });
expect(await answer('policy')).toEqual({ ok: false, reason: 'quiet' });
});
});
describe('recentWhen', () => {
const now = new Date(2026, 10, 4, 15, 0).getTime();
it('counts minutes and hours today, calendar days this week, then weeks and months', () => {
expect(recentWhen(now - 20_000, now, 'en')).toBe('now');
expect(recentWhen(now - 5 * 60_000, now, 'en')).toBe('5 minutes ago');
expect(recentWhen(now - 3 * 60 * 60_000, now, 'en')).toBe('3 hours ago');
// Last night at 23:00, 16 hours ago: yesterday.
expect(recentWhen(new Date(2026, 10, 3, 23, 0).getTime(), now, 'en')).toBe('yesterday');
expect(recentWhen(new Date(2026, 10, 1, 9, 0).getTime(), now, 'en')).toBe('3 days ago');
expect(recentWhen(now - 15 * 24 * 60 * 60_000, now, 'en')).toBe('2 weeks ago');
expect(recentWhen(now - 70 * 24 * 60 * 60_000, now, 'en')).toBe('2 months ago');
expect(recentWhen(now - 3 * 60 * 60_000, now, 'de')).toBe('vor 3 Stunden');
});
});
+16
View File
@@ -82,6 +82,7 @@ export interface PolicyValues {
WipeOfflineData: string | null;
OpenWithEnabled: boolean;
DeveloperToolsAvailability: number | null;
RecentFilesInAttach: boolean;
}
export type PolicyKey = keyof PolicyValues;
@@ -466,6 +467,19 @@ export const POLICY_SCHEMA: Record<PolicyKey, PolicyDefinition> = {
de: 'Dieselben Werte wie die gleichnamige Richtlinie von Chrome. 2: Die Entwicklertools sind aus und die Einstellung ist gesperrt. 0 oder 1 oder nicht konfiguriert: Benutzer können sie nach einer Warnung in den Einstellungen einschalten. Mit den Entwicklertools kann jeder an der Tastatur alles lesen, was die App enthält, auch E-Mails und Passwörter im Speicher.',
},
},
RecentFilesInAttach: {
category: 'privacy',
type: 'boolean',
default: true,
onInvalid: false,
forcedOnly: true,
sample: true,
title: { en: 'Show recent files in the Attach menu', de: 'Zuletzt verwendete Dateien im Menü „Anfügen“ anzeigen' },
description: {
en: 'When enabled or not configured, the Attach button in a new message lists the files the user opened recently, as the operating system records them, so one click attaches one. The list is read when the menu opens and stays on the device. When disabled, the list is gone and the app refuses to read it. Attaching through the file dialog is not affected.',
de: 'Wenn aktiviert oder nicht konfiguriert, listet die Schaltfläche „Anfügen“ in einer neuen Nachricht die Dateien auf, die der Benutzer zuletzt geöffnet hat, so wie das Betriebssystem sie erfasst. Ein Klick fügt eine davon an. Die Liste wird beim Öffnen des Menüs gelesen und bleibt auf dem Gerät. Wenn deaktiviert, fehlt die Liste und die App lehnt es ab, sie zu lesen. Das Anfügen über den Dateidialog ist nicht betroffen.',
},
},
};
export const POLICY_KEYS = Object.keys(POLICY_SCHEMA) as PolicyKey[];
@@ -916,6 +930,7 @@ const PAGE_POLICY_KEYS: readonly PolicyKey[] = [
'AppLockRequired',
'AppLockTimeoutMinutes',
'CrashReportsAllowed',
'RecentFilesInAttach',
];
/**
@@ -965,6 +980,7 @@ export const POLICY_CONSUMERS: Record<PolicyKey, PolicyConsumer> = {
BrowserSignIn: { repo: 'shell', file: 'src/main/features/browser-sign-in.ts' },
OpenWithEnabled: { repo: 'shell', file: 'src/main/features/os-default-app.ts' },
DeveloperToolsAvailability: { repo: 'shell', file: 'src/main/features/dev-tools.ts' },
RecentFilesInAttach: { repo: 'shell', file: 'src/main/features/os-recent.ts' },
};
/** The part the embedded server enforces. Sent to it by message. */
+103
View File
@@ -0,0 +1,103 @@
/**
* Recent files in the composer's Attach menu, in the desktop app only. The shell reads the
* OS's list when the menu opens and hands over what the menu shows; attaching sends back an
* id, and the bytes come back as a File for the composer's own checks, as a file from the
* file dialog does. In a browser there's no bridge, and nothing here offers anything.
*/
import { useSyncExternalStore } from 'react';
import { getDesktopBridge } from './bridge';
import { getDesktopPolicy, onDesktopPolicyChange } from './policy';
import type { PolicySnapshot } from './policy-schema';
import type { DesktopRecentFile } from './types';
/** The shell's limit for one file, the same as for a file from "Open with" (HANDOFF_MAX_BYTES). */
export const RECENT_FILE_MAX_BYTES = 100 * 1024 * 1024;
/** The shell has the list and the RecentFilesInAttach policy doesn't hide it. */
export function recentFilesOffered(policy: PolicySnapshot = getDesktopPolicy()): boolean {
return !!getDesktopBridge()?.recentFiles && policy.RecentFilesInAttach?.value !== false;
}
/** recentFilesOffered, live. False in the server's render, so the first render in the page matches it. */
export function useRecentFilesOffered(): boolean {
return useSyncExternalStore(onDesktopPolicyChange, () => recentFilesOffered(), () => false);
}
/** Straight from the click that opened the menu: main wants one. Empty when there's nothing to show. */
export async function listRecentFiles(): Promise<DesktopRecentFile[]> {
const bridge = getDesktopBridge()?.recentFiles;
if (!bridge) return [];
try {
const result = await bridge.list();
return result.ok ? result.files : [];
} catch {
return [];
}
}
export type RecentFileAttach =
| { ok: true; file: File }
| { ok: false; reason: 'missing' | 'too-large' | 'failed' | 'quiet' };
/** Straight from the click on the row. `quiet`: nothing worth telling the user (locked, or switched off). */
export async function readRecentFile(id: string): Promise<RecentFileAttach> {
const bridge = getDesktopBridge()?.recentFiles;
if (!bridge) return { ok: false, reason: 'quiet' };
try {
const result = await bridge.attach(id);
if (result.ok) return { ok: true, file: new File([new Uint8Array(result.file.data)], result.file.name) };
if (result.reason === 'missing' || result.reason === 'too-large') return { ok: false, reason: result.reason };
// Locked or switched off since the menu opened: the page shows that itself.
if (result.reason === 'locked' || result.reason === 'policy') return { ok: false, reason: 'quiet' };
// An id from a list a newer one replaced, or a click main didn't see: worth another try.
return { ok: false, reason: 'failed' };
} catch {
return { ok: false, reason: 'failed' };
}
}
/**
* A long folder as its start and its end, which tell it apart: the drive or the share, then
* the folders nearest the file. The middle goes, where a path's end would under an ellipsis.
*/
export function shortFolder(folder: string, max = 44): string {
if (folder.length <= max) return folder;
const sep = folder.includes('\\') ? '\\' : '/';
const parts = folder.split(sep);
// \\server\share, or C:, or the empty start of /home.
const rootCount = folder.startsWith('\\\\') ? 4 : 1;
if (parts.length <= rootCount + 1) return folder;
const root = parts.slice(0, rootCount).join(sep);
let tail = parts.slice(rootCount);
while (tail.length > 1 && `${root}${sep}…${sep}${tail.join(sep)}`.length > max) tail = tail.slice(1);
return `${root}${sep}…${sep}${tail.join(sep)}`;
}
const UNITS: [Intl.RelativeTimeFormatUnit, number][] = [
['year', 365 * 24 * 60 * 60_000],
['month', 30 * 24 * 60 * 60_000],
['week', 7 * 24 * 60 * 60_000],
['day', 24 * 60 * 60_000],
['hour', 60 * 60_000],
['minute', 60_000],
];
/** "5 minutes ago", "yesterday", "3 weeks ago", in the UI's language. Under a minute: "now". */
export function recentWhen(usedAt: number, now: number, locale: string): string {
const format = new Intl.RelativeTimeFormat(locale, { numeric: 'auto' });
const ago = Math.max(0, now - usedAt);
// Whole days by the calendar, so something from last night is "yesterday", not "10 hours ago".
if (ago >= 12 * 60 * 60_000 && ago < 7 * 24 * 60 * 60_000) {
const day = (time: number) => {
const date = new Date(time);
return Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()) / (24 * 60 * 60_000);
};
const days = day(now) - day(usedAt);
if (days >= 1) return format.format(-days, 'day');
}
for (const [unit, size] of UNITS) {
if (ago >= size) return format.format(-Math.floor(ago / size), unit);
}
return format.format(0, 'second');
}
+35
View File
@@ -752,6 +752,39 @@ export interface DesktopDevToolsBridge {
onChange: (listener: (state: DesktopDevToolsState) => void) => () => void;
}
/** One of the user's recently used files, as the Attach menu shows it. Nothing more of it reaches the page. */
export interface DesktopRecentFile {
/** Opaque. `attach` takes it, from the window that listed it, until that window lists again. */
id: string;
name: string;
/** The folder it's in, for display. */
folder: string;
/** The whole path, for a tooltip. */
path: string;
/** When it was last used, in milliseconds since 1970. */
usedAt: number;
/** A small icon as a data: URL, when the OS gave one in time. */
icon?: string;
}
/** `gesture`: no click or key press just now. `policy`: RecentFilesInAttach is off. */
export type DesktopRecentFilesResult =
| { ok: true; files: DesktopRecentFile[] }
| { ok: false; reason: 'policy' | 'locked' | 'gesture' };
export type DesktopRecentFileAttachResult =
| { ok: true; file: DesktopOsFile }
| { ok: false; reason: 'policy' | 'locked' | 'gesture' | 'unknown' | 'missing' | 'too-large' | 'failed' };
/**
* The files the OS says were used last, for the composer's Attach menu. Main wants a click
* or key press of its own for each call, reads only a file it just listed, and never logs.
*/
export interface DesktopRecentFilesBridge {
list: () => Promise<DesktopRecentFilesResult>;
attach: (id: string) => Promise<DesktopRecentFileAttachResult>;
}
/** An attachment copied to a private folder and open in its default program. */
export interface DesktopEditSession {
id: string;
@@ -874,6 +907,8 @@ export interface BulwarkDesktopBridge {
edit?: DesktopEditBridge;
/** Absent on older shells. */
devTools?: DesktopDevToolsBridge;
/** Absent on older shells. */
recentFiles?: DesktopRecentFilesBridge;
}
declare global {
+8
View File
@@ -7665,6 +7665,14 @@
"types_character": "تكتب هذه المفاتيح حرفًا على لوحة مفاتيحك، وسيتوقف عن العمل في كل التطبيقات. جرّب مفاتيح أخرى.",
"reserved": "يستخدم النظام أو معظم التطبيقات هذه المفاتيح. جرّب مفاتيح أخرى."
},
"desktopAttachRecent": {
"heading": "الملفات الأخيرة",
"browse": "استعراض هذا الكمبيوتر…",
"from_files": "من الملفات…",
"missing": "\"{name}\" لم يعد موجودًا.",
"too_large": "\"{name}\" أكبر من {max} ولا يمكن إرفاقه.",
"failed": "تعذّر إرفاق \"{name}\". حاول مرة أخرى."
},
"compose_windows": {
"more_formatting": "مزيد من التنسيق",
"offline": "دون اتصال",
+8
View File
@@ -7665,6 +7665,14 @@
"types_character": "Aquestes tecles escriuen un caràcter al teu teclat, i deixaria de funcionar a totes les aplicacions. Prova altres tecles.",
"reserved": "El sistema o la majoria d'aplicacions fan servir aquestes tecles. Prova altres tecles."
},
"desktopAttachRecent": {
"heading": "Fitxers recents",
"browse": "Explora aquest ordinador…",
"from_files": "Des de Fitxers…",
"missing": "«{name}» ja no hi és.",
"too_large": "«{name}» supera {max} i no es pot adjuntar.",
"failed": "No s'ha pogut adjuntar «{name}». Torneu-ho a provar."
},
"compose_windows": {
"more_formatting": "Més format",
"offline": "Sense connexió",
+8
View File
@@ -7665,6 +7665,14 @@
"types_character": "Tyto klávesy na vaší klávesnici píší znak, který by pak nefungoval v žádné aplikaci. Zkuste jiné klávesy.",
"reserved": "Tyto klávesy používá systém nebo většina aplikací. Zkuste jiné klávesy."
},
"desktopAttachRecent": {
"heading": "Poslední soubory",
"browse": "Procházet tento počítač…",
"from_files": "Ze Souborů…",
"missing": "„{name}“ už neexistuje.",
"too_large": "„{name}“ je větší než {max} a nelze ho připojit.",
"failed": "„{name}“ se nepodařilo připojit. Zkuste to znovu."
},
"compose_windows": {
"more_formatting": "Další formátování",
"offline": "Offline",
+8
View File
@@ -7665,6 +7665,14 @@
"types_character": "Disse taster skriver et tegn på dit tastatur, og det ville holde op med at virke i alle apps. Prøv andre taster.",
"reserved": "Dit system eller de fleste apps bruger disse taster. Prøv andre taster."
},
"desktopAttachRecent": {
"heading": "Seneste filer",
"browse": "Gennemse denne computer…",
"from_files": "Fra Filer…",
"missing": "\"{name}\" findes ikke længere.",
"too_large": "\"{name}\" er større end {max} og kan ikke vedhæftes.",
"failed": "\"{name}\" kunne ikke vedhæftes. Prøv igen."
},
"compose_windows": {
"more_formatting": "Mere formatering",
"offline": "Offline",
+8
View File
@@ -7665,6 +7665,14 @@
"types_character": "Diese Tasten erzeugen auf Ihrer Tastatur ein Zeichen, das dann in keiner App mehr funktionieren würde. Versuchen Sie andere Tasten.",
"reserved": "Ihr System oder die meisten Apps verwenden diese Tasten. Versuchen Sie andere Tasten."
},
"desktopAttachRecent": {
"heading": "Zuletzt verwendete Dateien",
"browse": "Diesen Computer durchsuchen…",
"from_files": "Aus Dateien…",
"missing": "\"{name}\" ist nicht mehr vorhanden.",
"too_large": "\"{name}\" ist größer als {max} und kann nicht angehängt werden.",
"failed": "\"{name}\" konnte nicht angehängt werden. Versuchen Sie es erneut."
},
"compose_windows": {
"more_formatting": "Weitere Formatierung",
"offline": "Offline",
+8
View File
@@ -7665,6 +7665,14 @@
"types_character": "These keys type a character on your keyboard, and it would stop working in every app. Try other keys.",
"reserved": "Your system or most apps use these keys. Try other keys."
},
"desktopAttachRecent": {
"heading": "Recent files",
"browse": "Browse this computer…",
"from_files": "From Files…",
"missing": "\"{name}\" isn't there any more.",
"too_large": "\"{name}\" is larger than {max} and can't be attached.",
"failed": "\"{name}\" couldn't be attached. Try again."
},
"compose_windows": {
"more_formatting": "More formatting",
"offline": "Offline",
+8
View File
@@ -7665,6 +7665,14 @@
"types_character": "Estas teclas escriben un carácter en tu teclado, y dejaría de funcionar en todas las aplicaciones. Prueba otras teclas.",
"reserved": "Tu sistema o la mayoría de las aplicaciones usan estas teclas. Prueba otras teclas."
},
"desktopAttachRecent": {
"heading": "Archivos recientes",
"browse": "Examinar este equipo…",
"from_files": "Desde Archivos…",
"missing": "\"{name}\" ya no existe.",
"too_large": "\"{name}\" supera {max} y no se puede adjuntar.",
"failed": "No se pudo adjuntar \"{name}\". Inténtalo de nuevo."
},
"compose_windows": {
"more_formatting": "Más formato",
"offline": "Sin conexión",
+8
View File
@@ -7665,6 +7665,14 @@
"types_character": "Need klahvid kirjutavad teie klaviatuuril märgi, mis lakkaks kõigis rakendustes töötamast. Proovige teisi klahve.",
"reserved": "Neid klahve kasutab süsteem või enamik rakendusi. Proovige teisi klahve."
},
"desktopAttachRecent": {
"heading": "Viimati kasutatud failid",
"browse": "Sirvi seda arvutit…",
"from_files": "Failidest…",
"missing": "„{name}” pole enam olemas.",
"too_large": "„{name}” on suurem kui {max} ja seda ei saa lisada.",
"failed": "Faili „{name}” ei saanud lisada. Proovi uuesti."
},
"compose_windows": {
"more_formatting": "Rohkem vormindust",
"offline": "Võrguta",
+8
View File
@@ -7665,6 +7665,14 @@
"types_character": "این کلیدها روی صفحه‌کلید شما نویسه‌ای می‌نویسند و آن نویسه دیگر در هیچ برنامه‌ای کار نمی‌کند. کلیدهای دیگری را امتحان کنید.",
"reserved": "سیستم یا بیشتر برنامه‌ها از این کلیدها استفاده می‌کنند. کلیدهای دیگری را امتحان کنید."
},
"desktopAttachRecent": {
"heading": "فایل‌های اخیر",
"browse": "مرور این رایانه…",
"from_files": "از فایل‌ها…",
"missing": "«{name}» دیگر وجود ندارد.",
"too_large": "«{name}» بزرگ‌تر از {max} است و نمی‌توان آن را پیوست کرد.",
"failed": "پیوست «{name}» ممکن نشد. دوباره امتحان کنید."
},
"compose_windows": {
"more_formatting": "قالب‌بندی بیشتر",
"offline": "آفلاین",
+8
View File
@@ -7665,6 +7665,14 @@
"types_character": "Ces touches produisent un caractère sur votre clavier, et il ne fonctionnerait plus dans aucune application. Essayez d'autres touches.",
"reserved": "Votre système ou la plupart des applications utilisent ces touches. Essayez d'autres touches."
},
"desktopAttachRecent": {
"heading": "Fichiers récents",
"browse": "Parcourir cet ordinateur…",
"from_files": "Depuis Fichiers…",
"missing": "« {name} » n'existe plus.",
"too_large": "« {name} » dépasse {max} et ne peut pas être joint.",
"failed": "Impossible de joindre « {name} ». Réessayez."
},
"compose_windows": {
"more_formatting": "Plus de mise en forme",
"offline": "Hors ligne",
+8
View File
@@ -7666,6 +7666,14 @@
"types_character": "המקשים האלה מקלידים תו במקלדת שלכם, והוא יפסיק לעבוד בכל האפליקציות. נסו מקשים אחרים.",
"reserved": "המערכת או רוב האפליקציות משתמשות במקשים האלה. נסו מקשים אחרים."
},
"desktopAttachRecent": {
"heading": "קבצים אחרונים",
"browse": "עיון במחשב הזה…",
"from_files": "מקבצים…",
"missing": "\"{name}\" כבר לא קיים.",
"too_large": "\"{name}\" גדול מ־{max} ולא ניתן לצרף אותו.",
"failed": "לא ניתן היה לצרף את \"{name}\". נסו שוב."
},
"compose_windows": {
"more_formatting": "עוד עיצוב",
"offline": "אין חיבור",
+8
View File
@@ -7665,6 +7665,14 @@
"types_character": "Ezek a billentyűk karaktert írnak az Ön billentyűzetén, amely többé egyik alkalmazásban sem működne. Próbáljon más billentyűket.",
"reserved": "Ezeket a billentyűket a rendszer vagy a legtöbb alkalmazás használja. Próbáljon más billentyűket."
},
"desktopAttachRecent": {
"heading": "Legutóbbi fájlok",
"browse": "A számítógép tallózása…",
"from_files": "A Fájlokból…",
"missing": "A(z) „{name}” már nem létezik.",
"too_large": "A(z) „{name}” nagyobb, mint {max}, ezért nem csatolható.",
"failed": "A(z) „{name}” csatolása nem sikerült. Próbálja újra."
},
"compose_windows": {
"more_formatting": "További formázás",
"offline": "Offline",
+8
View File
@@ -7665,6 +7665,14 @@
"types_character": "Questi tasti scrivono un carattere sulla tua tastiera, che smetterebbe di funzionare in tutte le app. Prova altri tasti.",
"reserved": "Il sistema o la maggior parte delle app usano questi tasti. Prova altri tasti."
},
"desktopAttachRecent": {
"heading": "File recenti",
"browse": "Sfoglia questo computer…",
"from_files": "Da File…",
"missing": "\"{name}\" non esiste più.",
"too_large": "\"{name}\" supera {max} e non può essere allegato.",
"failed": "Impossibile allegare \"{name}\". Riprova."
},
"compose_windows": {
"more_formatting": "Altre opzioni di formattazione",
"offline": "Offline",
+8
View File
@@ -7665,6 +7665,14 @@
"types_character": "このキーはお使いのキーボードで文字を入力します。割り当てると、すべてのアプリでその文字を入力できなくなります。別のキーをお試しください。",
"reserved": "このキーはシステムまたは多くのアプリが使用しています。別のキーをお試しください。"
},
"desktopAttachRecent": {
"heading": "最近使ったファイル",
"browse": "このコンピューターを参照…",
"from_files": "ファイルから…",
"missing": "「{name}」はもうありません。",
"too_large": "「{name}」は {max} を超えているため添付できません。",
"failed": "「{name}」を添付できませんでした。もう一度お試しください。"
},
"compose_windows": {
"more_formatting": "その他の書式",
"offline": "オフライン",
+8
View File
@@ -7665,6 +7665,14 @@
"types_character": "이 키는 사용 중인 키보드에서 문자를 입력하며, 지정하면 모든 앱에서 그 문자를 입력할 수 없게 됩니다. 다른 키를 사용해 보세요.",
"reserved": "시스템 또는 대부분의 앱이 이 키를 사용합니다. 다른 키를 사용해 보세요."
},
"desktopAttachRecent": {
"heading": "최근 파일",
"browse": "이 컴퓨터 찾아보기…",
"from_files": "파일에서…",
"missing": "\"{name}\"이(가) 더 이상 없어요.",
"too_large": "\"{name}\"이(가) {max}보다 커서 첨부할 수 없어요.",
"failed": "\"{name}\"을(를) 첨부하지 못했어요. 다시 시도해 주세요."
},
"compose_windows": {
"more_formatting": "추가 서식",
"offline": "오프라인",
+8
View File
@@ -7665,6 +7665,14 @@
"types_character": "Šie taustiņi jūsu tastatūrā raksta rakstzīmi, kas pārstātu darboties visās lietotnēs. Izmēģiniet citus taustiņus.",
"reserved": "Šos taustiņus izmanto sistēma vai lielākā daļa lietotņu. Izmēģiniet citus taustiņus."
},
"desktopAttachRecent": {
"heading": "Nesen izmantotie faili",
"browse": "Pārlūkot šo datoru…",
"from_files": "No Failiem…",
"missing": "“{name}” vairs nav pieejams.",
"too_large": "“{name}” ir lielāks par {max}, un to nevar pievienot.",
"failed": "Neizdevās pievienot “{name}”. Mēģiniet vēlreiz."
},
"compose_windows": {
"more_formatting": "Vairāk formatēšanas",
"offline": "Bezsaistē",
+8
View File
@@ -7665,6 +7665,14 @@
"types_character": "Эдгээр товч таны гар дээр тэмдэгт бичдэг тул тэр тэмдэгт бүх аппад ажиллахаа болино. Өөр товч туршина уу.",
"reserved": "Систем эсвэл ихэнх апп эдгээр товчийг ашигладаг. Өөр товч туршина уу."
},
"desktopAttachRecent": {
"heading": "Сүүлийн файлууд",
"browse": "Энэ компьютерээс хайх…",
"from_files": "Файлаас…",
"missing": "\"{name}\" байхгүй болсон байна.",
"too_large": "\"{name}\" {max}-аас том тул хавсаргах боломжгүй.",
"failed": "\"{name}\"-г хавсаргаж чадсангүй. Дахин оролдоно уу."
},
"compose_windows": {
"more_formatting": "Бусад хэлбэржүүлэлт",
"offline": "Офлайн",
+8
View File
@@ -7665,6 +7665,14 @@
"types_character": "Disse tastene skriver et tegn på tastaturet ditt, og det ville slutte å virke i alle apper. Prøv andre taster.",
"reserved": "Systemet ditt eller de fleste apper bruker disse tastene. Prøv andre taster."
},
"desktopAttachRecent": {
"heading": "Nylige filer",
"browse": "Bla gjennom denne datamaskinen…",
"from_files": "Fra Filer…",
"missing": "«{name}» finnes ikke lenger.",
"too_large": "«{name}» er større enn {max} og kan ikke legges ved.",
"failed": "Kunne ikke legge ved «{name}». Prøv igjen."
},
"compose_windows": {
"more_formatting": "Mer formatering",
"offline": "Frakoblet",
+8
View File
@@ -7665,6 +7665,14 @@
"types_character": "Deze toetsen typen een teken op je toetsenbord, en dat zou in geen enkele app meer werken. Probeer andere toetsen.",
"reserved": "Je systeem of de meeste apps gebruiken deze toetsen. Probeer andere toetsen."
},
"desktopAttachRecent": {
"heading": "Recente bestanden",
"browse": "Deze computer doorzoeken…",
"from_files": "Uit Bestanden…",
"missing": "\"{name}\" bestaat niet meer.",
"too_large": "\"{name}\" is groter dan {max} en kan niet worden bijgevoegd.",
"failed": "\"{name}\" kon niet worden bijgevoegd. Probeer het opnieuw."
},
"compose_windows": {
"more_formatting": "Meer opmaak",
"offline": "Offline",
+8
View File
@@ -7665,6 +7665,14 @@
"types_character": "Te klawisze wpisują znak na Twojej klawiaturze i przestałby on działać we wszystkich aplikacjach. Wypróbuj inne klawisze.",
"reserved": "Te klawisze są używane przez system lub większość aplikacji. Wypróbuj inne klawisze."
},
"desktopAttachRecent": {
"heading": "Ostatnie pliki",
"browse": "Przeglądaj ten komputer…",
"from_files": "Z Plików…",
"missing": "„{name}” już nie istnieje.",
"too_large": "„{name}” jest większy niż {max} i nie można go dołączyć.",
"failed": "Nie udało się dołączyć „{name}”. Spróbuj ponownie."
},
"compose_windows": {
"more_formatting": "Więcej formatowania",
"offline": "Offline",
+8
View File
@@ -7665,6 +7665,14 @@
"types_character": "Estas teclas escrevem um carácter no seu teclado, e ele deixaria de funcionar em todas as aplicações. Experimente outras teclas.",
"reserved": "O seu sistema ou a maioria das aplicações usam estas teclas. Experimente outras teclas."
},
"desktopAttachRecent": {
"heading": "Arquivos recentes",
"browse": "Procurar neste computador…",
"from_files": "De Arquivos…",
"missing": "\"{name}\" não existe mais.",
"too_large": "\"{name}\" é maior que {max} e não pode ser anexado.",
"failed": "Não foi possível anexar \"{name}\". Tente novamente."
},
"compose_windows": {
"more_formatting": "Mais formatação",
"offline": "Offline",
+8
View File
@@ -7665,6 +7665,14 @@
"types_character": "Aceste taste scriu un caracter pe tastatura ta, iar el n-ar mai funcționa în nicio aplicație. Încearcă alte taste.",
"reserved": "Sistemul sau majoritatea aplicațiilor folosesc aceste taste. Încearcă alte taste."
},
"desktopAttachRecent": {
"heading": "Fișiere recente",
"browse": "Răsfoiește acest computer…",
"from_files": "Din Fișiere…",
"missing": "„{name}” nu mai există.",
"too_large": "„{name}” depășește {max} și nu poate fi atașat.",
"failed": "„{name}” nu a putut fi atașat. Încearcă din nou."
},
"compose_windows": {
"more_formatting": "Mai multe opțiuni de formatare",
"offline": "Offline",
+8
View File
@@ -7665,6 +7665,14 @@
"types_character": "На вашей клавиатуре эти клавиши вводят символ, и он перестал бы работать во всех приложениях. Попробуйте другие клавиши.",
"reserved": "Эти клавиши использует система или большинство приложений. Попробуйте другие клавиши."
},
"desktopAttachRecent": {
"heading": "Недавние файлы",
"browse": "Обзор этого компьютера…",
"from_files": "Из Файлов…",
"missing": "«{name}» больше не существует.",
"too_large": "«{name}» больше {max}, его нельзя прикрепить.",
"failed": "Не удалось прикрепить «{name}». Попробуйте ещё раз."
},
"compose_windows": {
"more_formatting": "Дополнительное форматирование",
"offline": "Не в сети",
+8
View File
@@ -7665,6 +7665,14 @@
"types_character": "Tieto klávesy na vašej klávesnici píšu znak, ktorý by potom nefungoval v žiadnej aplikácii. Skúste iné klávesy.",
"reserved": "Tieto klávesy používa systém alebo väčšina aplikácií. Skúste iné klávesy."
},
"desktopAttachRecent": {
"heading": "Nedávne súbory",
"browse": "Prehľadávať tento počítač…",
"from_files": "Zo Súborov…",
"missing": "„{name}“ už neexistuje.",
"too_large": "„{name}“ je väčší ako {max} a nedá sa priložiť.",
"failed": "„{name}“ sa nepodarilo priložiť. Skúste to znova."
},
"compose_windows": {
"more_formatting": "Ďalšie formátovanie",
"offline": "Offline",
+8
View File
@@ -7673,6 +7673,14 @@
"types_character": "ปุ่มเหล่านี้พิมพ์อักขระบนแป้นพิมพ์ของคุณ และอักขระนั้นจะใช้ไม่ได้ในทุกแอป ลองใช้ปุ่มอื่น",
"reserved": "ระบบหรือแอปส่วนใหญ่ใช้ปุ่มเหล่านี้ ลองใช้ปุ่มอื่น"
},
"desktopAttachRecent": {
"heading": "ไฟล์ล่าสุด",
"browse": "เรียกดูคอมพิวเตอร์เครื่องนี้…",
"from_files": "จากไฟล์…",
"missing": "“{name}” ไม่มีอยู่แล้ว",
"too_large": "“{name}” มีขนาดใหญ่กว่า {max} จึงแนบไม่ได้",
"failed": "แนบ “{name}” ไม่สำเร็จ ลองอีกครั้ง"
},
"compose_windows": {
"more_formatting": "การจัดรูปแบบเพิ่มเติม",
"offline": "ออฟไลน์",
+8
View File
@@ -7665,6 +7665,14 @@
"types_character": "Bu tuşlar klavyenizde bir karakter yazar ve bu karakter hiçbir uygulamada çalışmaz olur. Başka tuşlar deneyin.",
"reserved": "Bu tuşları sisteminiz veya çoğu uygulama kullanıyor. Başka tuşlar deneyin."
},
"desktopAttachRecent": {
"heading": "Son dosyalar",
"browse": "Bu bilgisayara göz at…",
"from_files": "Dosyalar'dan…",
"missing": "\"{name}\" artık yok.",
"too_large": "\"{name}\" {max} boyutundan büyük ve eklenemez.",
"failed": "\"{name}\" eklenemedi. Yeniden deneyin."
},
"compose_windows": {
"more_formatting": "Daha fazla biçimlendirme",
"offline": "Çevrimdışı",
+8
View File
@@ -7665,6 +7665,14 @@
"types_character": "На вашій клавіатурі ці клавіші вводять символ, і він перестав би працювати в усіх застосунках. Спробуйте інші клавіші.",
"reserved": "Ці клавіші використовує система або більшість застосунків. Спробуйте інші клавіші."
},
"desktopAttachRecent": {
"heading": "Нещодавні файли",
"browse": "Огляд цього комп'ютера…",
"from_files": "З Файлів…",
"missing": "«{name}» більше не існує.",
"too_large": "«{name}» більший за {max}, його не можна прикріпити.",
"failed": "Не вдалося прикріпити «{name}». Спробуйте ще раз."
},
"compose_windows": {
"more_formatting": "Додаткове форматування",
"offline": "Не в мережі",
+8
View File
@@ -7677,6 +7677,14 @@
"types_character": "Các phím này gõ một ký tự trên bàn phím của bạn, và ký tự đó sẽ không dùng được trong mọi ứng dụng. Hãy thử phím khác.",
"reserved": "Hệ thống hoặc hầu hết ứng dụng dùng các phím này. Hãy thử phím khác."
},
"desktopAttachRecent": {
"heading": "Tệp gần đây",
"browse": "Duyệt máy tính này…",
"from_files": "Từ Tệp…",
"missing": "\"{name}\" không còn nữa.",
"too_large": "\"{name}\" lớn hơn {max} nên không thể đính kèm.",
"failed": "Không thể đính kèm \"{name}\". Hãy thử lại."
},
"compose_windows": {
"more_formatting": "Thêm định dạng",
"offline": "Ngoại tuyến",
+8
View File
@@ -7665,6 +7665,14 @@
"types_character": "這些鍵在您的鍵盤上會輸入一個字元,占用後該字元在所有應用程式中都無法輸入。請試試其他按鍵。",
"reserved": "系統或大多數應用程式正在使用這些鍵。請試試其他按鍵。"
},
"desktopAttachRecent": {
"heading": "最近的檔案",
"browse": "瀏覽這部電腦…",
"from_files": "從檔案…",
"missing": "「{name}」已不存在。",
"too_large": "「{name}」超過 {max},無法附加。",
"failed": "無法附加「{name}」。請再試一次。"
},
"compose_windows": {
"more_formatting": "更多格式",
"offline": "離線",
+8
View File
@@ -7665,6 +7665,14 @@
"types_character": "这些键在您的键盘上会输入一个字符,占用后该字符在所有应用中都无法输入。请试试其他按键。",
"reserved": "系统或大多数应用在使用这些键。请试试其他按键。"
},
"desktopAttachRecent": {
"heading": "最近的文件",
"browse": "浏览此电脑…",
"from_files": "从文件…",
"missing": "“{name}”已不存在。",
"too_large": "“{name}”超过 {max},无法添加为附件。",
"failed": "无法将“{name}”添加为附件。请重试。"
},
"compose_windows": {
"more_formatting": "更多格式",
"offline": "离线",