Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

Add {{filename}} attachment folders and make them default (PRD-8647) (#6419)

Dimitri POSTOLOV3fe95aec0285
diff --git a/.changeset/attachment-folder-variables.md b/.changeset/attachment-folder-variables.md
new file mode 100644
index 000000000..fbf9eb6c8
--- /dev/null
+++ b/.changeset/attachment-folder-variables.md
@@ -0,0 +1,5 @@
+---
+"@inkeep/open-knowledge": patch
+---
+
+Pasted and dropped files now go to a folder per document by default, `./{{filename}}.assets`, and the attachment setting is one path field. Update collaborators first: 0.86.18 and earlier reject `/folder` values.
diff --git a/docs/content/features/assets-and-embeds.mdx b/docs/content/features/assets-and-embeds.mdx
index a91845d7c..5bfc0dcac 100644
--- a/docs/content/features/assets-and-embeds.mdx
+++ b/docs/content/features/assets-and-embeds.mdx
@@ -8,10 +8,32 @@ OpenKnowledge treats assets (images, PDFs, video, audio) as first-class content
## Adding files
-Drag files into the editor or paste them — screenshots paste straight from the clipboard, and any file type is accepted. The file uploads into the project and the matching block is inserted. Uploads land beside the document by default; point [`content.attachmentFolderPath`](/docs/reference/configuration) at a different folder to change that. A configured attachment folder is also a sync scope: in shared projects, linkable files inside it auto-sync to teammates even when no document sits beside them. Dropping a file whose bytes already exist in the target folder reuses the existing file rather than writing a duplicate. You can also insert an image, video, or audio block from the `/` insert menu and upload from its settings.
+Drag files into the editor or paste them. Screenshots paste straight from the clipboard, and any file type is accepted. The file uploads into the project, and the matching block is inserted. You can also insert an image, video, or audio block from the `/` insert menu and upload from its settings.
+
+If the target folder already has a file with the same bytes, OpenKnowledge reuses it instead of writing a duplicate.
AI agents add assets through the MCP [`write`](/docs/reference/mcp) tool's `asset` target, passing exactly one of `content` (the bytes as base64, for small files) or `source` (a local filesystem path the server reads — use it for large files).
+### Attachment folder
+
+By default, each document gets its own upload folder beside it: a file added to `notes/meeting.md` goes to `notes/meeting.assets/`. Files uploaded earlier stay where they are. To change this, set **Settings → This project → Preferences → Attachments**, or [`content.attachmentFolderPath`](/docs/reference/configuration) in `.ok/config.yml`.
+
+The path must start with `./`, relative to the document, or `/`, relative to the content root. The settings field rejects a bare name such as `attachments`: write `/attachments` instead. A bare name in an existing config keeps working and is read as `/attachments`. Version 0.86.18 and earlier reject `/attachments`, so update every collaborator before you save it.
+
+| Value | Where files go |
+| --- | --- |
+| `./{{filename}}.assets` (default) | A folder per document, named after it |
+| `./` | Next to the document |
+| `./assets` | A folder next to the document |
+| `/` | The content root |
+| `/attachments` | One folder at the content root |
+
+- `{{filename}}` is the document name without its extension. It is the only variable.
+- The settings field marks an unknown variable, such as `{{FILENAME}}`, and does not save it. If one is in `.ok/config.yml`, uploads are refused until you fix it.
+- Links to these files are content-root paths. They work inside the project, but not in a copy of the document outside it.
+- Renaming or moving a document does not rename its folder, and its links keep working.
+- In shared projects, linkable files in the attachment folder sync to teammates, even when no document sits beside them.
+
## How assets render
- **Images render inline** with click-to-zoom. Select one to align it left / center / right from the bubble menu, or set alt text and dimensions in its settings.
diff --git a/docs/content/migrate/obsidian.mdx b/docs/content/migrate/obsidian.mdx
index 9b761baa1..f53d71d08 100644
--- a/docs/content/migrate/obsidian.mdx
+++ b/docs/content/migrate/obsidian.mdx
@@ -57,7 +57,7 @@ A handful of Obsidian features are not supported, or behave differently. None of
| **Canvas (`.canvas`) and Bases (`.base`)** | Open in a read-only text view rather than as interactive canvases or bases. They're still indexed and linkable from your notes. |
<Callout type="info">
- OpenKnowledge's defaults match Obsidian's defaults — wiki links and attachments stored alongside your notes — so a standard vault works as-is. There's no migration step today; if you have a vault with heavily non-default settings, [let us know](https://github.com/inkeep/open-knowledge/issues).
+ OpenKnowledge reads a standard vault as-is, wiki links included. One default differs: a file you paste or drop goes to a folder named after the note, such as `notes/meeting.assets/`, while Obsidian puts it at the vault root. To keep your vault's layout, set the [attachment folder](/docs/features/assets-and-embeds#attachment-folder): `/` matches Obsidian's "Vault folder", `./` its "Same folder as current file", `/folder` "In the folder specified below", and `./folder` "In subfolder under current folder". There's no migration step today; if you have a vault with heavily non-default settings, [let us know](https://github.com/inkeep/open-knowledge/issues).
</Callout>
## Agent skills, built in
diff --git a/docs/content/reference/configuration.mdx b/docs/content/reference/configuration.mdx
index 74ea51e82..f714a908c 100644
--- a/docs/content/reference/configuration.mdx
+++ b/docs/content/reference/configuration.mdx
@@ -34,7 +34,7 @@ A key set in a file more specific than its scope (a user-scope key in `.ok/confi
| Field | Type | Default | Scope | Description |
| --- | --- | --- | --- | --- |
| `content.dir` | string | `"."` | project | Content directory, relative to project root. Defaults to `.` (the project root) even when `.ok/` is scaffolded at the git working-tree root from a sub-folder, so opened folder and content scope align by default. To narrow scope to a sub-folder, pass `--content-dir <dir>` to `ok init`, or uncomment `content.dir` in `.ok/config.yml` post-init. Excluded paths live in `.okignore`; see [Ignore patterns](/docs/features/ignore-patterns). |
-| `content.attachmentFolderPath` | string | `"./"` | project | Where pasted and dropped assets, and MCP `write` assets given a bare file name, are stored. `"./"` colocates beside the current document; `"/"` targets the content root; `"./subdir"` targets a subfolder under the current folder; `"folder"` targets a fixed folder under the content root. A configured folder also widens what counts as content: linkable files inside it (images, PDFs, media) are treated as project content without needing a Markdown document beside them, so in shared projects they auto-sync to teammates. The default `"./"` keeps the historical rule (assets sync only beside a document). |
+| `content.attachmentFolderPath` | string | `"./{{filename}}.assets"` | project | Where pasted and dropped files, and MCP `write` assets given a bare file name, are stored. Start the path with `"./"` (next to the document) or `"/"` (the content root), for example `"./assets"` or `"/attachments"`. `{{filename}}` is the document name without its extension. A bare `"folder"` is read as `"/folder"`. Version 0.86.18 and earlier reject `"/folder"`: Desktop uses default settings and `ok` commands stop with an error, so update every collaborator first. See [Attachment folder](/docs/features/assets-and-embeds#attachment-folder). |
| `contentRules.markdownlint.enabled` | boolean | `false` | project | Enable the [markdownlint](/docs/advanced/content-rules/markdownlint) content-rules plugin for this project (shared via git). Off by default — turn it on in **Settings → This project → Plugins**. The rules themselves live in your native `.markdownlint.*` file, not here. |
| `contentRules.frontmatter.enabled` | boolean | `false` | project | Enable the [Frontmatter schemas](/docs/advanced/content-rules/frontmatter) content-rules plugin for this project (shared via git). Off by default — turn it on in **Settings → This project → Plugins**. |
| `contentRules.frontmatter.schemas` | array | `[]` | project | Frontmatter schema mappings: each entry scopes one JSON Schema file to a set of docs — `file` (project-root-relative path), optional `appliesTo` (glob or list; leading `!` excludes; absent means every doc), optional `enabled: false` to park a mapping. Schema content lives in the mapped files, not here. See [Frontmatter schemas](/docs/advanced/content-rules/frontmatter). |
diff --git a/docs/content/reference/mcp.mdx b/docs/content/reference/mcp.mdx
index 7d5776ef3..eb5cc6d9b 100644
--- a/docs/content/reference/mcp.mdx
+++ b/docs/content/reference/mcp.mdx
@@ -27,7 +27,7 @@ To point an MCP client at this server, locally or over a tunnel from another mac
| `palette` | Markdown-native authoring forms, themed `html preview` embed starters, and theme tokens. Pass `components` for the canonical components' full JSX prop schemas |
| `preview_url` | Resolve the browser-reachable preview URL. Targets a `document`, `folder`, or `skill` in the current project, or — via `file`, an absolute path — a markdown file outside it (resolved through the session serving that file). Per-response `previewUrl` fields elsewhere are route-only (`/#/<doc>`); call this when you need the full openable URL |
| `share_link` | Build a GitHub-substrate share URL for a doc or folder to send to a teammate (`kind` disambiguates; `path: ""` with `kind: "folder"` shares the content root). Responses carry a `freshness` verdict — `current`, `stale` (unpushed changes), or `absent` (never pushed), omitted when the probe can't run — and prepend a matching warning to relay with the link. Read-only against `.git/`; never publishes |
-| `write` | Create or overwrite a `document`, `folder`, `template`, `skill`, or `asset`. For a document: `{ path, content }`, or `{ path, template }` to instantiate from a folder template. `position` selects `replace` (full rewrite; the only mode that touches frontmatter), `append`, or `prepend`. An `append` or `prepend` to a path with no document creates it, and the response opens with `Created new document`. A replace is refused if another writer changed the document in the last few seconds: wait and retry, or use `append`, `prepend`, or `edit`, which bypass concurrent-overwrite protection but still require valid input. `extension` selects `.md` (default) or `.mdx` for a new document; an existing doc keeps its extension (the MCP cannot change it). An `asset` takes exactly one of `content` (base64, for small files) or `source` (a local path the server reads, for large files). An asset `path` with a folder lands in that folder; a bare file name goes to the attachment folder ([`content.attachmentFolderPath`](/docs/reference/configuration), by default the content root) |
+| `write` | Create or overwrite a `document`, `folder`, `template`, `skill`, or `asset`. For a document: `{ path, content }`, or `{ path, template }` to instantiate from a folder template. `position` selects `replace` (full rewrite; the only mode that touches frontmatter), `append`, or `prepend`. An `append` or `prepend` to a path with no document creates it, and the response opens with `Created new document`. A replace is refused if another writer changed the document in the last few seconds: wait and retry, or use `append`, `prepend`, or `edit`, which bypass concurrent-overwrite protection but still require valid input. `extension` selects `.md` (default) or `.mdx` for a new document; an existing doc keeps its extension (the MCP cannot change it). An `asset` takes exactly one of `content` (base64, for small files) or `source` (a local path the server reads, for large files). An asset `path` with a folder lands in that folder; a bare file name goes to the attachment folder ([`content.attachmentFolderPath`](/docs/reference/configuration), by default the content root; a bare file name has no parent document, so a setting that uses `{{filename}}` puts it in the content root) |
| `edit` | Modify a `document` (body find/replace **or** a frontmatter merge-patch), a `folder` (frontmatter merge-patch), a `template`, or a `skill`. Body edits take `{ path, find, replace, occurrence? }`; `occurrence` selects which match (1 = first). A document `edit` changes only an existing document; a path with no document is refused and nothing is created |
| `delete` | Delete a `document` (one path or an array), `folder`, `template`, `skill`, or `asset` |
| `move` | Move or rename a `document`, `folder`, `asset`, `template`, or `skill`. Links to the moved document keep pointing to it. The old path stops existing; no redirect or stub is left behind. The move can also edit referring documents to preserve their existing link targets, including links to documents that did not move when the new path would otherwise take precedence. Correctly resolving shorthand stays unchanged; necessary wiki rewrites preserve displayed text, aliases and headings. Renaming or moving a page in the app's sidebar rewrites links the same way, so the old name stays visible as link text. A skill also moves between Project and Global scope via `scope` + `toScope`: history does not transfer; the editor locations the destination level can host are re-projected there, while everything else (the `agents` hub, custom roots, and any editor with no skills root at that level) is removed at the source and not re-created at the destination. The removed locations come back as `droppedLocations`; re-add the ones that level can place with `install`. That only holds on a success: on a failed move the same field lists source-side placements the call had already removed, so installing them at the destination would spread a retained copy instead of restoring anything |
diff --git a/knip.config.ts b/knip.config.ts
index e04bf5228..fac2580fe 100644
--- a/knip.config.ts
+++ b/knip.config.ts
@@ -157,11 +157,15 @@ export default {
'src/shadow-fixture-launch.test-helper.mjs',
],
project: 'src/**',
- ignoreDependencies: ['@types/shell-quote'],
+ ignoreDependencies: [
+ '@types/shell-quote',
+ ],
},
'packages/cli': {
entry: ['src/**/*.test.ts', 'scripts/*.ts', 'tests/**/*.ts', 'src/parse-worker.ts'],
- ignoreDependencies: ['yjs'],
+ ignoreDependencies: [
+ 'yjs',
+ ],
},
'packages/desktop': {
entry: [
diff --git a/packages/app/BUNDLE-SIZE.md b/packages/app/BUNDLE-SIZE.md
index a0c8b3d05..609f972df 100644
--- a/packages/app/BUNDLE-SIZE.md
+++ b/packages/app/BUNDLE-SIZE.md
@@ -121,3 +121,5 @@ Combined-chunks 9.16->9.17 MB for the quiet notice after a both-kept merge or a
Combined-chunks 9.17->9.18 MB for keeping the edited side of engine-less files, settings and skills (PRD-9771, #7203): the history and backup-folder notices in `DocChangeNotice`, the settings notices, the held-save message, and their new strings compiled into each of the 13 locale catalogs. Measured on one machine, `main` alone builds to 9,166,292 B and the branch to 9,175,290 B, so the branch adds 8,998 B and lands 5,290 B over the prior 9,170,000 B ceiling. The 10 kB ratchet to 9,180,000 B leaves 4,710 B of headroom over the branch build. No reclamation lever: the strings are the feature, and each reader downloads one catalog.
Combined-chunks 9.18->9.19 MB for moving docked chat history to either side of the conversation (#7294): the Agents strip's row menu with its Move chat history item, the palette's side-aware move commands, and their strings compiled into each of the 13 locale catalogs. Measured on one machine, `main` at `450b65e` alone builds to 9,178,809 B, 1,191 B under the 9,180,000 B ceiling, and the branch merged with it to 9,180,163 B, so the branch adds 1,354 B and lands 163 B over; the merge queue measured the same 9,180,163 B. The main app bundle went from 482.47 kB on `main` to 482.26 kB on the branch against its 487 kB limit, and CSS stayed at 8.36 kB against 59 kB, so the growth sits outside the main app bundle. The 10 kB ratchet to 9,190,000 B leaves 9,837 B of headroom over the branch build. No reclamation lever beyond the lazy-load levers above.
+
+Combined-chunks 9.19->9.20 MB for the attachment folder field with `{{filename}}`: one path input with its variable highlight, the live example and its errors, the zod input schema and per-document folder helpers that the field shares with the server, the translated upload refusal copy, and their strings compiled into every locale catalog. The chat-history entry above measured the tree before this field at 9,180,163 B. Merged with `main` at `33ac0b4`, the branch measures 9,191,157 B locally, 1,157 B over the 9.19 MB ceiling. The 10 kB ratchet leaves 8,843 B of headroom locally, or about 8.2 kB with the ~600 B that CI adds over a local build. The main app bundle measured 482.29 kB against its 487 kB limit and CSS 8.36 kB against 59 kB, because the settings dialog body is a lazy chunk. No reclamation lever beyond the lazy-load levers above.
diff --git a/packages/app/package.json b/packages/app/package.json
index 0a1924759..b0788694c 100644
--- a/packages/app/package.json
+++ b/packages/app/package.json
@@ -77,7 +77,7 @@
{
"name": "all JS chunks combined (gzipped)",
"path": "dist/assets/*.js",
- "limit": "9.19 MB",
+ "limit": "9.20 MB",
"gzip": true,
"running": false
},
diff --git a/packages/app/src/components/PageHeaderWidgets.tsx b/packages/app/src/components/PageHeaderWidgets.tsx
index 8358f9a04..dae358a69 100644
--- a/packages/app/src/components/PageHeaderWidgets.tsx
+++ b/packages/app/src/components/PageHeaderWidgets.tsx
@@ -9,7 +9,7 @@ import type { CommonWidgetProps } from '@/components/PropertyWidgets';
import { resolvePageCover, resolvePageIcon } from '@/components/page-header-utils';
import { Button } from '@/components/ui/button';
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';
-import { UploadFailedError } from '@/editor/image-upload/upload-failure';
+import { UploadFailedError, UploadRejectedError } from '@/editor/image-upload/upload-failure';
import { uploadFile } from '@/editor/image-upload/upload-file';
import { useSingleFileMode } from '@/lib/single-file-mode';
import { cn } from '@/lib/utils';
@@ -126,7 +126,9 @@ export function PageCoverWidget({ keyName, value, onCommit }: CommonWidgetProps<
} catch (err) {
if (!mountedRef.current) return;
const message =
- err instanceof UploadFailedError ? err.message : t`Upload failed — please try again`;
+ err instanceof UploadFailedError || err instanceof UploadRejectedError
+ ? err.message
+ : t`Upload failed — please try again`;
setUploadError(message);
setUploading(false);
}
diff --git a/packages/app/src/components/settings/AgentConnectionsSection.tsx b/packages/app/src/components/settings/AgentConnectionsSection.tsx
index 3da7e3a7f..42113a9b5 100644
--- a/packages/app/src/components/settings/AgentConnectionsSection.tsx
+++ b/packages/app/src/components/settings/AgentConnectionsSection.tsx
@@ -301,12 +301,7 @@ function RowActionButton({
return null;
case 'install':
return (
- <Button
- variant="link"
- size="sm"
- className="shrink-0 text-muted-foreground hover:text-foreground"
- asChild
- >
+ <Button variant="link" size="sm" className="shrink-0" asChild>
<a
href={action.url}
target="_blank"
@@ -321,12 +316,7 @@ function RowActionButton({
);
case 'setup-doc':
return (
- <Button
- variant="link"
- size="sm"
- className="shrink-0 text-muted-foreground hover:text-foreground"
- asChild
- >
+ <Button variant="link" size="sm" className="shrink-0" asChild>
<a
href={`https://openknowledge.ai/docs/integrations/${action.slug}`}
target="_blank"
diff --git a/packages/app/src/components/settings/AttachmentsSection.tsx b/packages/app/src/components/settings/AttachmentsSection.tsx
index 6dc34183e..5649703d4 100644
--- a/packages/app/src/components/settings/AttachmentsSection.tsx
+++ b/packages/app/src/components/settings/AttachmentsSection.tsx
@@ -1,19 +1,21 @@
import type { ConfigBinding } from '@inkeep/open-knowledge-core/config/bind-config-doc';
import { humanFormat } from '@inkeep/open-knowledge-core/config/errors';
-import { normalizeAttachmentFolderPath } from '@inkeep/open-knowledge-core/config/schema';
+import {
+ ATTACHMENT_FOLDER_PATH_VARIABLES,
+ type AttachmentFolderPathInputIssue,
+ type AttachmentFolderPathPart,
+ attachmentFolderForDocument,
+ attachmentFolderPathInputIssue,
+ canonicalAttachmentFolderPath,
+ parseAttachmentFolderPath,
+} from '@inkeep/open-knowledge-core/config/schema';
import { CONFIG_DOC_NAME_PROJECT } from '@inkeep/open-knowledge-core/constants/cc1';
import { DEFAULT_ATTACHMENT_FOLDER_PATH } from '@inkeep/open-knowledge-core/constants/upload';
import { Trans, useLingui } from '@lingui/react/macro';
import { useEffect, useRef, useState } from 'react';
import { toast } from 'sonner';
+import { Field, FieldError } from '@/components/ui/field';
import { Input } from '@/components/ui/input';
-import {
- Select,
- SelectContent,
- SelectItem,
- SelectTrigger,
- SelectValue,
-} from '@/components/ui/select';
import { useConfigContext } from '@/lib/config-provider';
import { subscribeToConfigValidationRejected } from '@/lib/config-validation-events';
import { cn } from '@/lib/utils';
@@ -21,48 +23,16 @@ import { firstIssuePath, SavedIndicator, SectionSkeleton } from './field-control
import { SettingsSectionHeader } from './SettingsSectionHeader';
import { pickFirstIssueForPath } from './use-config-form';
-type AttachmentPlacementMode =
- | 'same-folder'
- | 'content-root'
- | 'current-folder-subfolder'
- | 'content-root-folder';
-
const ATTACHMENT_FIELD_NAME = 'content.attachmentFolderPath';
-const ATTACHMENT_FALLBACK_FOLDER = 'attachments';
-
-function attachmentModeFromPath(path: string): AttachmentPlacementMode {
- const normalized = normalizeAttachmentFolderPath(path);
- if (normalized === DEFAULT_ATTACHMENT_FOLDER_PATH) return 'same-folder';
- if (normalized === '/') return 'content-root';
- if (normalized.startsWith('./')) return 'current-folder-subfolder';
- return 'content-root-folder';
-}
-
-function attachmentFolderTextFromPath(path: string): string {
- const normalized = normalizeAttachmentFolderPath(path);
- if (normalized === DEFAULT_ATTACHMENT_FOLDER_PATH || normalized === '/') {
- return ATTACHMENT_FALLBACK_FOLDER;
- }
- if (normalized.startsWith('./')) {
- return normalized.slice(2) || ATTACHMENT_FALLBACK_FOLDER;
- }
- return normalized;
-}
+const EXAMPLE_DOC_PATH = 'notes/meeting.md';
+const EXAMPLE_FILE_NAME = 'image.png';
-function normalizeAttachmentFolderInput(value: string): string {
- return value
- .trim()
- .replace(/^(?:\.\/)+/, '')
- .replace(/\/{2,}/g, '/')
- .replace(/\/+$/g, '');
-}
+const ATTACHMENTS_DOCS_URL =
+ 'https://openknowledge.ai/docs/features/assets-and-embeds#attachment-folder';
-function attachmentPathFromMode(mode: AttachmentPlacementMode, folderText: string): string {
- const folder = normalizeAttachmentFolderInput(folderText) || ATTACHMENT_FALLBACK_FOLDER;
- if (mode === 'same-folder') return DEFAULT_ATTACHMENT_FOLDER_PATH;
- if (mode === 'content-root') return '/';
- if (mode === 'current-folder-subfolder') return `./${folder}`;
- return folder;
+function exampleDestination(path: string): string {
+ const folder = attachmentFolderForDocument(path, EXAMPLE_DOC_PATH);
+ return folder === '' ? EXAMPLE_FILE_NAME : `${folder}/${EXAMPLE_FILE_NAME}`;
}
export function AttachmentsSection() {
@@ -70,22 +40,24 @@ export function AttachmentsSection() {
if (!projectBinding || !projectSynced || !projectConfig) {
return <SectionSkeleton />;
}
- const attachmentFolderPath =
- projectConfig.content.attachmentFolderPath ?? DEFAULT_ATTACHMENT_FOLDER_PATH;
- return (
- <AttachmentsSectionBody
- key={attachmentFolderPath}
- binding={projectBinding}
- value={attachmentFolderPath}
- />
+ const attachmentFolderPath = canonicalAttachmentFolderPath(
+ projectConfig.content.attachmentFolderPath ?? DEFAULT_ATTACHMENT_FOLDER_PATH,
);
+ return <AttachmentsSectionBody binding={projectBinding} value={attachmentFolderPath} />;
}
function AttachmentsSectionBody({ binding, value }: { binding: ConfigBinding; value: string }) {
const { t } = useLingui();
- const [mode, setMode] = useState<AttachmentPlacementMode>(() => attachmentModeFromPath(value));
- const [folderText, setFolderText] = useState(() => attachmentFolderTextFromPath(value));
- const [error, setError] = useState<string | null>(null);
+ const [draft, setDraft] = useState(value);
+ const [syncedValue, setSyncedValue] = useState(value);
+ const [commitAttempted, setCommitAttempted] = useState(false);
+ if (syncedValue !== value) {
+ setSyncedValue(value);
+ setDraft(value);
+ setCommitAttempted(false);
+ }
+ const [scrollLeft, setScrollLeft] = useState(0);
+ const [serverError, setServerError] = useState<string | null>(null);
const [savedTick, setSavedTick] = useState(false);
const [flashed, setFlashed] = useState(false);
const savedTickTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
@@ -105,12 +77,12 @@ function AttachmentsSectionBody({ binding, value }: { binding: ConfigBinding; va
if (firstIssuePath(event.error) !== ATTACHMENT_FIELD_NAME) return;
const issue = pickFirstIssueForPath(event.error, ATTACHMENT_FIELD_NAME);
toast.error(humanFormat(event.error), { duration: 8000 });
- setError(issue);
+ setServerError(issue);
setFlashed(true);
if (flashTimerRef.current) clearTimeout(flashTimerRef.current);
flashTimerRef.current = setTimeout(() => {
setFlashed(false);
- setError(null);
+ setServerError(null);
}, 600);
});
return unsubscribe;
@@ -122,137 +94,223 @@ function AttachmentsSectionBody({ binding, value }: { binding: ConfigBinding; va
savedTickTimerRef.current = setTimeout(() => setSavedTick(false), 1200);
};
- const commitPath = (nextPath: string) => {
- const result = binding.patch({ content: { attachmentFolderPath: nextPath } });
+ const edited = draft !== value;
+ const draftProblem = attachmentFolderPathInputIssue(draft);
+ const hasError = draftProblem !== null || serverError !== null;
+ const announceError = commitAttempted || serverError !== null;
+
+ const commitDraft = () => {
+ if (!edited) return;
+ if (draftProblem) {
+ setCommitAttempted(true);
+ return;
+ }
+ const result = binding.patch({ content: { attachmentFolderPath: draft } });
if (result.ok) {
- setError(null);
+ setServerError(null);
flashSavedTick();
return;
}
const detail = pickFirstIssueForPath(result.error, ATTACHMENT_FIELD_NAME);
- setError(detail);
+ setServerError(detail);
toast.error(t`Failed to update attachment location — ${detail}`);
};
- const onModeChange = (next: string) => {
- if (
- next !== 'same-folder' &&
- next !== 'content-root' &&
- next !== 'current-folder-subfolder' &&
- next !== 'content-root-folder'
- ) {
- return;
- }
- const nextMode = next as AttachmentPlacementMode;
- const nextFolderText =
- nextMode === 'current-folder-subfolder' || nextMode === 'content-root-folder'
- ? folderText || ATTACHMENT_FALLBACK_FOLDER
- : folderText;
- setMode(nextMode);
- setFolderText(nextFolderText);
- commitPath(attachmentPathFromMode(nextMode, nextFolderText));
- };
-
- const commitFolderText = () => {
- const nextPath = attachmentPathFromMode(mode, folderText);
- setFolderText(attachmentFolderTextFromPath(nextPath));
- commitPath(nextPath);
- };
-
- const showsFolderInput = mode === 'current-folder-subfolder' || mode === 'content-root-folder';
- const labelId = 'settings-attachments-location-label';
- const inputId = 'settings-attachments-folder-input';
+ const exampleDoc = EXAMPLE_DOC_PATH;
+ const exampleFile = exampleDestination(draft);
+ const titleId = 'settings-attachments-title';
+ const descriptionId = 'settings-attachments-description';
+ const exampleId = 'settings-attachments-path-example';
+ const errorId = 'settings-attachments-path-error';
+ const describedBy = `${descriptionId} ${hasError ? errorId : exampleId}`;
return (
<section
- aria-labelledby="settings-attachments-title"
- className="space-y-3"
+ aria-labelledby={titleId}
+ className="flex flex-col gap-3"
data-testid="settings-attachments"
>
<SettingsSectionHeader
- titleId="settings-attachments-title"
+ titleId={titleId}
title={<Trans>Attachments</Trans>}
scope="project"
level="block"
+ docUrl={ATTACHMENTS_DOCS_URL}
+ descriptionId={descriptionId}
>
- <Trans>Set where pasted and dropped files are stored for this project.</Trans>
+ <Trans>Set where pasted and dropped files are stored.</Trans>
</SettingsSectionHeader>
<div
- className={cn('rounded-md border p-3', flashed && 'animate-settings-flash')}
+ className={cn(flashed && 'animate-settings-flash')}
data-field={ATTACHMENT_FIELD_NAME}
data-scope="project"
>
- <div className="grid gap-3 sm:grid-cols-[minmax(0,1fr)_minmax(16rem,18rem)] sm:items-start">
- <div className="space-y-0.5">
- <div className="text-sm font-medium" id={labelId}>
- <Trans>Default location for new attachments</Trans>
- </div>
- <p className="text-muted-foreground text-1sm">
- <Trans>Where newly added attachments are placed.</Trans>
- </p>
- </div>
- <Select value={mode} onValueChange={onModeChange}>
- <SelectTrigger
- aria-labelledby={labelId}
- data-testid="settings-attachments-mode"
- size="sm"
- >
- <SelectValue />
- </SelectTrigger>
- <SelectContent>
- <SelectItem value="same-folder">
- <Trans>Same folder as current file</Trans>
- </SelectItem>
- <SelectItem value="content-root">
- <Trans>Content root</Trans>
- </SelectItem>
- <SelectItem value="current-folder-subfolder">
- <Trans>Subfolder under current folder</Trans>
- </SelectItem>
- <SelectItem value="content-root-folder">
- <Trans>Fixed folder in content root</Trans>
- </SelectItem>
- </SelectContent>
- </Select>
- </div>
-
- {showsFolderInput ? (
- <div className="mt-3 max-w-sm space-y-1">
- <label className="text-sm font-medium" htmlFor={inputId}>
- <Trans>Folder</Trans>
- </label>
+ <Field data-invalid={hasError} className="gap-2">
+ <div className="relative max-w-md">
<Input
- id={inputId}
- value={folderText}
- placeholder={t`e.g. assets/uploads`}
- onChange={(event) => setFolderText(event.target.value)}
- onBlur={commitFolderText}
+ aria-labelledby={titleId}
+ dir="ltr"
+ value={draft}
+ spellCheck={false}
+ autoComplete="off"
+ aria-invalid={hasError}
+ aria-describedby={describedBy}
+ onChange={(event) => {
+ setDraft(event.target.value);
+ setCommitAttempted(false);
+ setServerError(null);
+ setScrollLeft(event.target.scrollLeft);
+ }}
+ onScroll={(event) => setScrollLeft(event.currentTarget.scrollLeft)}
+ onSelect={(event) => setScrollLeft(event.currentTarget.scrollLeft)}
+ onBlur={commitDraft}
onKeyDown={(event) => {
- if (event.key === 'Enter') {
- event.preventDefault();
- commitFolderText();
- }
+ if (event.key !== 'Enter' || event.nativeEvent.isComposing) return;
+ event.preventDefault();
+ commitDraft();
}}
- className="h-8 text-sm"
- data-testid="settings-attachments-folder"
+ className="font-mono text-sm text-transparent caret-foreground md:text-sm"
+ data-testid="settings-attachments-path"
/>
+ <AttachmentPathHighlight value={draft} scrollLeft={scrollLeft} />
</div>
- ) : null}
-
- <div className="mt-2 flex min-h-5 items-center gap-2">
- {error ? (
- <p
- className="text-1sm text-destructive"
- data-field-error={ATTACHMENT_FIELD_NAME}
- role="alert"
- >
- {error}
- </p>
- ) : null}
- <SavedIndicator visible={savedTick} />
- </div>
+ <div className="flex min-h-5 items-center gap-2">
+ {hasError ? (
+ <FieldError
+ key={announceError ? 'announced' : 'typing'}
+ role={announceError ? 'alert' : undefined}
+ id={errorId}
+ data-field-error={ATTACHMENT_FIELD_NAME}
+ data-testid={errorId}
+ >
+ {draftProblem ? <DraftProblemMessage problem={draftProblem} /> : serverError}
+ </FieldError>
+ ) : (
+ <p
+ className="text-1sm text-muted-foreground"
+ id={exampleId}
+ data-testid="settings-attachments-preview"
+ >
+ <Trans>
+ Example: a file added to <code dir="ltr">{exampleDoc}</code> is saved as{' '}
+ <code dir="ltr">{exampleFile}</code>
+ </Trans>
+ </p>
+ )}
+ <SavedIndicator visible={savedTick} />
+ </div>
+ </Field>
</div>
</section>
);
}
+
+function DraftProblemMessage({ problem }: { problem: AttachmentFolderPathInputIssue }) {
+ const filenameVariable = <bdi dir="ltr">{'{{filename}}'}</bdi>;
+ switch (problem.kind) {
+ case 'empty':
+ case 'missing-prefix':
+ case 'outside-project': {
+ const documentPrefix = <bdi dir="ltr">./</bdi>;
+ const rootPrefix = <bdi dir="ltr">/</bdi>;
+ const parentFolder = <bdi dir="ltr">..</bdi>;
+ return (
+ <Trans>
+ Folder path must start with {documentPrefix} or {rootPrefix} and cannot contain{' '}
+ {parentFolder}
+ </Trans>
+ );
+ }
+ case 'reserved-character': {
+ const reserved = <bdi dir="ltr">{'< > : " \\ | ? *'}</bdi>;
+ return <Trans>Folder names cannot contain {reserved}.</Trans>;
+ }
+ case 'surrounding-space':
+ return <Trans>Remove the spaces at the start or end of the path.</Trans>;
+ case 'empty-folder-name':
+ return <Trans>Use one slash between folder names.</Trans>;
+ case 'trailing-slash':
+ return <Trans>Remove the slash at the end of the path.</Trans>;
+ case 'single-brace':
+ return <Trans>A variable needs two braces on each side, such as {filenameVariable}.</Trans>;
+ case 'unknown-variable': {
+ const unknownList = <bdi dir="ltr">{problem.variables.join(', ')}</bdi>;
+ const supportedVariables = (
+ <bdi dir="ltr">
+ {ATTACHMENT_FOLDER_PATH_VARIABLES.map((name) => `{{${name}}}`).join(', ')}
+ </bdi>
+ );
+ return (
+ <Trans>
+ Unknown variable {unknownList}. Available variables: {supportedVariables}.
+ </Trans>
+ );
+ }
+ case 'unclosed-braces': {
+ const open = <bdi dir="ltr">{'{{'}</bdi>;
+ const close = <bdi dir="ltr">{'}}'}</bdi>;
+ return (
+ <Trans>
+ Each {open} needs a matching {close}.
+ </Trans>
+ );
+ }
+ case 'repeated-variable':
+ return <Trans>Use {filenameVariable} at most once in each folder name.</Trans>;
+ default:
+ return assertNeverDraftProblem(problem);
+ }
+}
+
+function assertNeverDraftProblem(problem: never): never {
+ throw new Error(`unhandled attachment path problem: ${JSON.stringify(problem)}`);
+}
+
+function AttachmentPathHighlight({ value, scrollLeft }: { value: string; scrollLeft: number }) {
+ return (
+ <div
+ aria-hidden="true"
+ dir="ltr"
+ data-testid="settings-attachments-path-highlight"
+ className="pointer-events-none absolute inset-0 flex items-center overflow-hidden rounded-lg border border-transparent px-2.5 font-mono text-sm whitespace-pre forced-colors:hidden"
+ >
+ <span style={{ transform: `translateX(${-scrollLeft}px)` }}>
+ {parseAttachmentFolderPath(value).map((part) => (
+ <AttachmentPathPart key={part.start} part={part} />
+ ))}
+ </span>
+ </div>
+ );
+}
+
+function AttachmentPathPart({ part }: { part: AttachmentFolderPathPart }) {
+ switch (part.kind) {
+ case 'text':
+ return <span>{part.text}</span>;
+ case 'variable':
+ return (
+ <span
+ data-token="known"
+ className="rounded-sm bg-primary/15 text-foreground ring-1 ring-primary/40"
+ >
+ {part.text}
+ </span>
+ );
+ case 'unknown-variable':
+ return (
+ <span
+ data-token="unknown"
+ className="text-destructive underline decoration-destructive decoration-wavy underline-offset-4"
+ >
+ {part.text}
+ </span>
+ );
+ default:
+ return assertNeverPathPart(part);
+ }
+}
+
+function assertNeverPathPart(part: never): never {
+ throw new Error(`unhandled attachment path part: ${JSON.stringify(part)}`);
+}
diff --git a/packages/app/src/components/settings/CustomThemeEditor.tsx b/packages/app/src/components/settings/CustomThemeEditor.tsx
index b5484d6c0..71a970cf1 100644
--- a/packages/app/src/components/settings/CustomThemeEditor.tsx
+++ b/packages/app/src/components/settings/CustomThemeEditor.tsx
@@ -441,7 +441,7 @@ export function CustomThemeEditor({
rel="noopener noreferrer"
onClick={(e) => dispatchExternalLinkClick(e, SCHEMES_URL)}
onAuxClick={(e) => dispatchExternalLinkClick(e, SCHEMES_URL)}
- className="inline-flex items-center gap-0.5 underline-offset-2 hover:text-foreground hover:underline"
+ className="inline-flex items-center gap-0.5 text-primary underline-offset-2 hover:underline"
>
{t`Browse hundreds of themes`}
<ArrowUpRight aria-hidden className="size-3" />
diff --git a/packages/app/src/components/settings/LintingSection.tsx b/packages/app/src/components/settings/LintingSection.tsx
index 5cd4e090a..e388154e4 100644
--- a/packages/app/src/components/settings/LintingSection.tsx
+++ b/packages/app/src/components/settings/LintingSection.tsx
@@ -334,7 +334,7 @@ export function MarkdownlintPluginSection({
onAuxClick={(e) =>
dispatchExternalLinkClick(e, 'https://github.com/DavidAnson/markdownlint')
}
- className="inline-flex items-center gap-0.5 text-muted-foreground underline-offset-2 hover:text-foreground hover:underline"
+ className="inline-flex items-center gap-0.5 text-primary underline-offset-2 hover:underline"
>
markdownlint
<ArrowUpRight aria-hidden className="size-3" />
diff --git a/packages/app/src/components/settings/SettingsDialogBody.sections.dom.test.tsx b/packages/app/src/components/settings/SettingsDialogBody.sections.dom.test.tsx
index a5314ff97..93086078a 100644
--- a/packages/app/src/components/settings/SettingsDialogBody.sections.dom.test.tsx
+++ b/packages/app/src/components/settings/SettingsDialogBody.sections.dom.test.tsx
@@ -591,98 +591,6 @@ describe('SettingsDialogBody section runtime dispatch', () => {
);
});
- test('project preferences includes attachments controls mapped to content.attachmentFolderPath', async () => {
- projectConfig = {
- autoSync: { default: null },
- content: { attachmentFolderPath: './' },
- };
-
- await renderBody({ activeId: 'project-preferences' });
-
- const attachments = () => within(screen.getByTestId('settings-attachments'));
- expect(screen.getByTestId('settings-attachments')).not.toBeNull();
- expect(attachments().getByTestId('select-root').getAttribute('data-value')).toBe('same-folder');
-
- fireEvent.click(attachments().getByText('Fixed folder in content root'));
- expect(projectBindingPatchCalls.at(-1)).toEqual({
- content: { attachmentFolderPath: 'attachments' },
- });
- expect(screen.getByTestId('settings-attachments-folder')).not.toBeNull();
-
- fireEvent.change(screen.getByTestId('settings-attachments-folder'), {
- target: { value: 'assets/uploads' },
- });
- fireEvent.blur(screen.getByTestId('settings-attachments-folder'));
-
- expect(projectBindingPatchCalls.at(-1)).toEqual({
- content: { attachmentFolderPath: 'assets/uploads' },
- });
-
- fireEvent.click(attachments().getByText('Content root'));
- expect(projectBindingPatchCalls.at(-1)).toEqual({
- content: { attachmentFolderPath: '/' },
- });
- });
-
- test('project preferences round trips current-folder attachment subfolders', async () => {
- projectConfig = {
- autoSync: { default: null },
- content: { attachmentFolderPath: './attachments' },
- };
-
- await renderBody({ activeId: 'project-preferences' });
-
- expect(
- within(screen.getByTestId('settings-attachments'))
- .getByTestId('select-root')
- .getAttribute('data-value'),
- ).toBe('current-folder-subfolder');
- expect((screen.getByTestId('settings-attachments-folder') as HTMLInputElement).value).toBe(
- 'attachments',
- );
-
- fireEvent.change(screen.getByTestId('settings-attachments-folder'), {
- target: { value: 'media' },
- });
- fireEvent.blur(screen.getByTestId('settings-attachments-folder'));
-
- expect(projectBindingPatchCalls.at(-1)).toEqual({
- content: { attachmentFolderPath: './media' },
- });
- });
-
- test('fixed content-root folder strips leading dot slash to avoid remounting as current-folder mode', async () => {
- projectConfig = {
- autoSync: { default: null },
- content: { attachmentFolderPath: 'attachments' },
- };
-
- await renderBody({ activeId: 'project-preferences' });
-
- const attachmentsSelectValue = () =>
- within(screen.getByTestId('settings-attachments'))
- .getByTestId('select-root')
- .getAttribute('data-value');
- expect(attachmentsSelectValue()).toBe('content-root-folder');
- fireEvent.change(screen.getByTestId('settings-attachments-folder'), {
- target: { value: './media' },
- });
- fireEvent.blur(screen.getByTestId('settings-attachments-folder'));
-
- expect(projectBindingPatchCalls.at(-1)).toEqual({
- content: { attachmentFolderPath: 'media' },
- });
-
- projectConfig = {
- autoSync: { default: null },
- content: { attachmentFolderPath: 'media' },
- };
- cleanup();
- await renderBody({ activeId: 'project-preferences' });
-
- expect(attachmentsSelectValue()).toBe('content-root-folder');
- });
-
test('project preferences surfaces attachment patch failures inline', async () => {
projectConfig = {
autoSync: { default: null },
@@ -709,12 +617,12 @@ describe('SettingsDialogBody section runtime dispatch', () => {
await renderBody({ activeId: 'project-preferences' });
- fireEvent.click(
- within(screen.getByTestId('settings-attachments')).getByText('Fixed folder in content root'),
- );
+ const field = screen.getByTestId('settings-attachments-path');
+ fireEvent.change(field, { target: { value: '/attachments' } });
+ fireEvent.blur(field);
expect(projectBindingPatchCalls.at(-1)).toEqual({
- content: { attachmentFolderPath: 'attachments' },
+ content: { attachmentFolderPath: '/attachments' },
});
expect(within(screen.getByTestId('settings-attachments')).getByRole('alert').textContent).toBe(
'Folder must stay inside the content root',
diff --git a/packages/app/src/components/settings/SettingsSectionHeader.tsx b/packages/app/src/components/settings/SettingsSectionHeader.tsx
index fcc1bea47..c2f927e1b 100644
--- a/packages/app/src/components/settings/SettingsSectionHeader.tsx
+++ b/packages/app/src/components/settings/SettingsSectionHeader.tsx
@@ -14,6 +14,7 @@ export function SettingsSectionHeader({
beta,
adornment,
docUrl,
+ descriptionId,
children,
}: {
titleId?: string;
@@ -23,10 +24,28 @@ export function SettingsSectionHeader({
beta?: boolean;
adornment?: ReactNode;
docUrl?: string;
+ descriptionId?: string;
children?: ReactNode;
}) {
const { t } = useLingui();
const Heading = level === 'page' ? 'h3' : 'h4';
+ const docLink =
+ docUrl !== undefined ? (
+ // oxlint-disable-next-line jsx-a11y/anchor-ambiguous-text -- the accessible name comes from aria-label, which this rule only recognises as a string literal; the i18n directive requires the t macro.
+ <a
+ href={docUrl}
+ target="_blank"
+ rel="noopener noreferrer"
+ onClick={(e) => dispatchExternalLinkClick(e, docUrl)}
+ onAuxClick={(e) => dispatchExternalLinkClick(e, docUrl)}
+ aria-label={typeof title === 'string' ? t`Learn more about ${title}` : t`Learn more`}
+ className="inline-flex items-center gap-0.5 text-sm text-primary underline-offset-2 hover:underline"
+ data-testid={`${titleId}-docs-link`}
+ >
+ <Trans>Learn more</Trans>
+ <ArrowUpRight aria-hidden className="size-3" />
+ </a>
+ ) : null;
return (
<div className="space-y-1">
<div className="flex items-center gap-2">
@@ -40,23 +59,14 @@ export function SettingsSectionHeader({
{beta ? <PluginBetaBadge /> : null}
{scope ? <ScopeBadge scope={scope} /> : null}
</div>
- {children ? <p className="text-sm text-muted-foreground">{children}</p> : null}
- {docUrl !== undefined ? (
- // oxlint-disable-next-line jsx-a11y/anchor-ambiguous-text -- the accessible name comes from aria-label, which this rule only recognises as a string literal; the i18n directive requires the t macro.
- <a
- href={docUrl}
- target="_blank"
- rel="noopener noreferrer"
- onClick={(e) => dispatchExternalLinkClick(e, docUrl)}
- onAuxClick={(e) => dispatchExternalLinkClick(e, docUrl)}
- aria-label={typeof title === 'string' ? t`Learn more about ${title}` : t`Learn more`}
- className="inline-flex items-center gap-0.5 text-sm text-muted-foreground underline-offset-2 hover:text-foreground hover:underline"
- data-testid={`${titleId}-docs-link`}
- >
- <Trans>Learn more</Trans>
- <ArrowUpRight aria-hidden className="size-3" />
- </a>
- ) : null}
+ {children ? (
+ <p className="text-sm text-muted-foreground">
+ <span id={descriptionId}>{children}</span>
+ {docLink ? <> {docLink}</> : null}
+ </p>
+ ) : (
+ docLink
+ )}
</div>
);
}
diff --git a/packages/app/src/components/settings/SlidesPluginSection.tsx b/packages/app/src/components/settings/SlidesPluginSection.tsx
index 32343f6eb..990eb1632 100644
--- a/packages/app/src/components/settings/SlidesPluginSection.tsx
+++ b/packages/app/src/components/settings/SlidesPluginSection.tsx
@@ -152,7 +152,7 @@ function StatusRow({ availability }: { availability: Availability }) {
onClick={(e) => dispatchExternalLinkClick(e, SLIDEV_INSTALL_DOCS)}
onAuxClick={(e) => dispatchExternalLinkClick(e, SLIDEV_INSTALL_DOCS)}
aria-label={t`Other ways to install Slidev`}
- className="inline-flex items-center gap-0.5 text-xs text-muted-foreground underline-offset-2 hover:text-foreground hover:underline"
+ className="inline-flex items-center gap-0.5 text-xs text-primary underline-offset-2 hover:underline"
data-testid="slides-install-docs-link"
>
<Trans>Other ways to install</Trans>
diff --git a/packages/app/src/components/settings/SyncSection.tsx b/packages/app/src/components/settings/SyncSection.tsx
index 7d167329d..96fcd17c6 100644
--- a/packages/app/src/components/settings/SyncSection.tsx
+++ b/packages/app/src/components/settings/SyncSection.tsx
@@ -388,7 +388,7 @@ function SyncSectionContent({
href={status.remote.webUrl}
target="_blank"
rel="noopener noreferrer"
- className="text-foreground hover:text-primary hover:underline inline-flex items-center gap-0.5"
+ className="inline-flex items-center gap-0.5 text-primary underline-offset-2 hover:underline"
aria-label={t`Open ${status.remote.label} on GitHub (opens in a new tab)`}
data-testid="settings-sync-remote-link"
>
diff --git a/packages/app/src/components/settings/markdownlint-rule-browser.tsx b/packages/app/src/components/settings/markdownlint-rule-browser.tsx
index 82f579ad9..24f39afce 100644
--- a/packages/app/src/components/settings/markdownlint-rule-browser.tsx
+++ b/packages/app/src/components/settings/markdownlint-rule-browser.tsx
@@ -316,7 +316,7 @@ function RuleRow({
onClick={(e) => dispatchExternalLinkClick(e, rule.docUrl)}
onAuxClick={(e) => dispatchExternalLinkClick(e, rule.docUrl)}
aria-label={t`Documentation for ${rule.id} (opens in browser)`}
- className="inline-flex items-center gap-0.5 text-muted-foreground underline-offset-2 hover:text-foreground hover:underline"
+ className="inline-flex items-center gap-0.5 text-primary underline-offset-2 hover:underline"
>
<Trans>Documentation</Trans>
<ArrowUpRight aria-hidden className="size-3" />
diff --git a/packages/app/src/editor/components/PropPanel.tsx b/packages/app/src/editor/components/PropPanel.tsx
index 451dbc418..10f376315 100644
--- a/packages/app/src/editor/components/PropPanel.tsx
+++ b/packages/app/src/editor/components/PropPanel.tsx
@@ -21,7 +21,7 @@ import { Switch } from '@/components/ui/switch';
import { ColorPickerInput } from '@/editor/components/ColorPickerInput.tsx';
import { IconPickerInput } from '@/editor/components/IconPickerInput.tsx';
import { SrcAutocomplete } from '@/editor/components/SrcAutocomplete.tsx';
-import { UploadFailedError } from '@/editor/image-upload/upload-failure.ts';
+import { UploadFailedError, UploadRejectedError } from '@/editor/image-upload/upload-failure.ts';
import { uploadFile } from '@/editor/image-upload/upload-file.ts';
import type { JsxComponentDescriptor } from '@/editor/registry/types.ts';
import { getAutoFocusedPropName, humanizePropName } from '@/editor/utils/editor-strings.ts';
@@ -81,7 +81,7 @@ async function runUpload(
const { url } = await uploadFile(file, accept, { singleFile });
onUploaded(url);
} catch (err) {
- if (err instanceof UploadFailedError) {
+ if (err instanceof UploadFailedError || err instanceof UploadRejectedError) {
toast.error(err.message);
return;
}
diff --git a/packages/app/src/editor/image-upload/index.ts b/packages/app/src/editor/image-upload/index.ts
index d44ad17cf..6de6474a5 100644
--- a/packages/app/src/editor/image-upload/index.ts
+++ b/packages/app/src/editor/image-upload/index.ts
@@ -25,7 +25,11 @@ import { getEditorSingleFileMode } from '../extensions/editor-mode-context.ts';
import { buildUnresolvedWikiLinkAttrs } from '../extensions/wiki-link-helpers.ts';
import { HttpResponseParseError } from '../http-client.ts';
import { singleFileUploadMessage } from './upload-admission.ts';
-import { reportUploadFailure, type UploadFailureReport } from './upload-failure.ts';
+import {
+ attachmentFolderRefusalMessage,
+ reportUploadFailure,
+ type UploadFailureReport,
+} from './upload-failure.ts';
const uploadPluginKey = new PluginKey<UploadPluginState>('imageUpload');
@@ -291,7 +295,7 @@ export async function uploadAndInsert(
return;
}
console.error('[uploadAndInsert] Server error:', problem.data);
- showError(editor, uploadId, problem.data.title);
+ showError(editor, uploadId, attachmentFolderRefusalMessage(problem.data) ?? problem.data.title);
return;
}
diff --git a/packages/app/src/editor/image-upload/upload-failure.ts b/packages/app/src/editor/image-upload/upload-failure.ts
index 471d21e15..6c5b63cd3 100644
--- a/packages/app/src/editor/image-upload/upload-failure.ts
+++ b/packages/app/src/editor/image-upload/upload-failure.ts
@@ -1,3 +1,7 @@
+import {
+ AttachmentFolderUploadIssueSchema,
+ type ProblemDetails,
+} from '@inkeep/open-knowledge-core/schemas/api';
import { t } from '@lingui/core/macro';
import { singleFileUploadMessage } from './upload-admission.ts';
@@ -22,6 +26,13 @@ export class UploadFailedError extends Error {
}
}
+export class UploadRejectedError extends Error {
+ constructor(message: string) {
+ super(message);
+ this.name = 'UploadRejectedError';
+ }
+}
+
export async function probeFileReadable(
file: Blob,
sizeAtDrop: number,
@@ -53,6 +64,36 @@ export async function probeFileReadable(
}
}
+function leftToRight(text: string): string {
+ return `\u2066${text}\u2069`;
+}
+
+export function attachmentFolderRefusalMessage(problem: ProblemDetails): string | null {
+ const parsed = AttachmentFolderUploadIssueSchema.safeParse(problem.attachmentFolderIssue);
+ if (!parsed.success) return null;
+ const issue = parsed.data;
+ switch (issue.kind) {
+ case 'unknown-variable': {
+ const variables = leftToRight(issue.variables.join(', '));
+ return t`Couldn't upload the file. The attachment folder uses the unknown variable ${variables}. Fix it under Attachments in Settings.`;
+ }
+ case 'unclosed-braces': {
+ const open = leftToRight('{{');
+ const close = leftToRight('}}');
+ return t`Couldn't upload the file. The attachment folder has a ${open} or ${close} without its pair. Fix it under Attachments in Settings.`;
+ }
+ case 'repeated-variable': {
+ const filenameVariable = leftToRight('{{filename}}');
+ return t`Couldn't upload the file. The attachment folder uses ${filenameVariable} more than once in one folder name. Fix it under Attachments in Settings.`;
+ }
+ case 'invalid-config': {
+ const settingKey = leftToRight('content.attachmentFolderPath');
+ const configFile = leftToRight('.ok/config.yml');
+ return t`Couldn't upload the file. The ${settingKey} value in ${configFile} can't be used. Fix it in that file.`;
+ }
+ }
+}
+
export function classifyUploadFailure(probe: FileReadProbe): UploadFailureKind {
return probe.readable ? 'network' : 'file-unreadable';
}
diff --git a/packages/app/src/editor/image-upload/upload-file.test.ts b/packages/app/src/editor/image-upload/upload-file.test.ts
index 728601ac8..f12d51252 100644
--- a/packages/app/src/editor/image-upload/upload-file.test.ts
+++ b/packages/app/src/editor/image-upload/upload-file.test.ts
@@ -62,7 +62,7 @@ describe('uploadFile', () => {
expect(call?.init?.method).toBe('POST');
expect(call?.init?.body).toBeInstanceOf(FormData);
const fd = call?.init?.body as FormData;
- expect(fd.get('parentDocName')).toBe('docs/guide');
+ expect(fd.get('parentDocName')).toBe('docs/guide.md');
const sentFile = fd.get('file');
expect(sentFile).toBeInstanceOf(File);
expect((sentFile as File).name).toBe('screenshot.png');
diff --git a/packages/app/src/editor/image-upload/upload-file.ts b/packages/app/src/editor/image-upload/upload-file.ts
index 019c3a9c7..548c02c55 100644
--- a/packages/app/src/editor/image-upload/upload-file.ts
+++ b/packages/app/src/editor/image-upload/upload-file.ts
@@ -6,9 +6,11 @@ import { HttpResponseParseError } from '../http-client.ts';
import { getCurrentDocName } from './current-doc-name.ts';
import { singleFileUploadMessage } from './upload-admission.ts';
import {
+ attachmentFolderRefusalMessage,
reportUploadFailure,
UploadFailedError,
type UploadFailureReport,
+ UploadRejectedError,
} from './upload-failure.ts';
interface UploadFileResult {
@@ -40,7 +42,7 @@ export async function uploadFile(
const formData = new FormData();
formData.append('file', file);
- formData.append('parentDocName', docName);
+ formData.append('parentDocName', `${docName}.md`);
let res: Response;
try {
@@ -84,6 +86,8 @@ export async function uploadFile(
status: res.status,
});
}
+ const refusal = attachmentFolderRefusalMessage(problem.data);
+ if (refusal) throw new UploadRejectedError(refusal);
throw new Error(problem.data.title);
}
diff --git a/packages/app/src/locales/ar/messages.po b/packages/app/src/locales/ar/messages.po
index 23c25a245..6ec7a4470 100644
--- a/packages/app/src/locales/ar/messages.po
+++ b/packages/app/src/locales/ar/messages.po
@@ -1084,6 +1084,9 @@ msgstr "عنوان، وصف، وسوم — أي شيء يصف هذا المجل
msgid "A token added here only applies to HTTPS remotes, and this project's remote doesn't use HTTPS."
msgstr "الرمز المضاف هنا ينطبق فقط على المستودعات البعيدة عبر HTTPS، والمستودع البعيد لهذا المشروع لا يستخدم HTTPS."
+msgid "A variable needs two braces on each side, such as {filenameVariable}."
+msgstr "يحتاج المتغير إلى قوسين معقوفين على كل جانب، مثل {filenameVariable}."
+
msgid "A worktree folder for {shareBranch} already exists."
msgstr "يوجد بالفعل مجلد شجرة عمل للفرع {shareBranch}."
@@ -2671,9 +2674,6 @@ msgstr "مجلد المحتوى"
msgid "Content directory must be inside the project"
msgstr "يجب أن يكون مجلد المحتوى داخل المشروع"
-msgid "Content root"
-msgstr "جذر المحتوى"
-
msgid "Content rules"
msgstr "قواعد المحتوى"
@@ -3307,6 +3307,18 @@ msgstr "تعذّر تحديث {subRoot}: {0}"
msgid "Couldn't update from {0}: {1}"
msgstr "تعذّر التحديث من {0}: {1}"
+msgid "Couldn't upload the file. The {settingKey} value in {configFile} can't be used. Fix it in that file."
+msgstr "تعذّر رفع الملف. لا يمكن استخدام قيمة {settingKey} في {configFile}. أصلحها في ذلك الملف."
+
+msgid "Couldn't upload the file. The attachment folder has a {open} or {close} without its pair. Fix it under Attachments in Settings."
+msgstr "تعذّر رفع الملف. يحتوي مجلد المرفقات على {open} أو {close} دون نظيره. أصلحه ضمن المرفقات في الإعدادات."
+
+msgid "Couldn't upload the file. The attachment folder uses {filenameVariable} more than once in one folder name. Fix it under Attachments in Settings."
+msgstr "تعذّر رفع الملف. يستخدم مجلد المرفقات {filenameVariable} أكثر من مرة في اسم مجلد واحد. أصلحه ضمن المرفقات في الإعدادات."
+
+msgid "Couldn't upload the file. The attachment folder uses the unknown variable {variables}. Fix it under Attachments in Settings."
+msgstr "تعذّر رفع الملف. يستخدم مجلد المرفقات المتغير غير المعروف {variables}. أصلحه ضمن المرفقات في الإعدادات."
+
msgid "Couldn't verify that {displayName} ({bin}) is available, so this is a plain shell. You can still run {bin} yourself."
msgstr "تعذر التحقق من توفر {displayName} ({bin})، لذا هذه جلسة shell عادية. لا يزال بإمكانك تشغيل {bin} بنفسك."
@@ -3487,9 +3499,6 @@ msgstr "التاريخ"
msgid "Default"
msgstr "الافتراضي"
-msgid "Default location for new attachments"
-msgstr "الموقع الافتراضي للمرفقات الجديدة"
-
msgid "Default properties"
msgstr "الخصائص الافتراضية"
@@ -3895,9 +3904,6 @@ msgstr "تم التكرار إلى «{0}»"
msgid "Duplicates dropped"
msgstr "إسقاط المكرر"
-msgid "e.g. assets/uploads"
-msgstr "مثال: assets/uploads"
-
msgid "e.g. drafts/ or *.draft.md"
msgstr "مثال: drafts/ أو *.draft.md"
@@ -3910,6 +3916,9 @@ msgstr "مثال: تبديل المشاريع أثناء تشغيل مزامنة
msgid "e.g. The editor froze after I pasted a large table"
msgstr "مثال: تجمّد المحرر بعد لصق جدول كبير"
+msgid "Each {open} needs a matching {close}."
+msgstr "كل {open} يحتاج إلى {close} مطابق."
+
#. Says what symlinking two skill folders together buys the user, before any button names it
msgid "Each AI tool reads skills from its own folder. Point one folder at another and both tools see the same skills — add a skill once instead of copying it into every tool."
msgstr "تقرأ كل أداة ذكاء اصطناعي المهارات من مجلدها الخاص. وجّه مجلدًا إلى آخر لترى الأداتان المهارات نفسها — أضف المهارة مرة واحدة بدلًا من نسخها إلى كل أداة."
@@ -4267,6 +4276,9 @@ msgstr "كل ما تحت مجلدات {0}/ داخل {1}/"
msgid "everything under any {0}/ folder"
msgstr "كل ما تحت أي مجلد {0}/"
+msgid "Example: a file added to <0>{exampleDoc}</0> is saved as <1>{exampleFile}</1>"
+msgstr "مثال: الملف المضاف إلى <0>{exampleDoc}</0> يُحفظ في <1>{exampleFile}</1>"
+
msgid "Excalidraw board"
msgstr "لوحة Excalidraw"
@@ -4751,9 +4763,6 @@ msgstr "ثابت"
msgid "Fixed {total, plural, one {# file} other {# files}}."
msgstr "{total, plural, zero {لم يتم إصلاح أي ملف} one {تم إصلاح ملف واحد} two {تم إصلاح ملفين} few {تم إصلاح # ملفات} many {تم إصلاح # ملفًا} other {تم إصلاح # ملف}}."
-msgid "Fixed folder in content root"
-msgstr "مجلد ثابت في جذر المحتوى"
-
msgid "Fixed port number"
msgstr "رقم المنفذ الثابت"
@@ -4790,6 +4799,12 @@ msgstr "اسم المجلد"
msgid "Folder name: {detail}"
msgstr "اسم المجلد: {detail}"
+msgid "Folder names cannot contain {reserved}."
+msgstr "لا يمكن أن تحتوي أسماء المجلدات على {reserved}."
+
+msgid "Folder path must start with {documentPrefix} or {rootPrefix} and cannot contain {parentFolder}"
+msgstr "يجب أن يبدأ مسار المجلد بـ {documentPrefix} أو {rootPrefix} ولا يمكن أن يحتوي على {parentFolder}"
+
msgid "Folder properties"
msgstr "خصائص المجلد"
@@ -8589,6 +8604,12 @@ msgstr "إزالة التحديد"
msgid "Remove the parent <0>.git</0> folder"
msgstr "إزالة مجلد <0>.git</0> الأب"
+msgid "Remove the slash at the end of the path."
+msgstr "احذف الشرطة المائلة في نهاية المسار."
+
+msgid "Remove the spaces at the start or end of the path."
+msgstr "احذف المسافات في بداية المسار أو نهايته."
+
msgid "Removed"
msgstr "أُزيل"
@@ -9019,9 +9040,6 @@ msgstr "تجري مراجعة المشروع"
msgid "Runs a shell command"
msgstr "يشغّل أمر shell"
-msgid "Same folder as current file"
-msgstr "المجلد نفسه للملف الحالي"
-
msgid "Sample image"
msgstr "صورة نموذجية"
@@ -9463,8 +9481,8 @@ msgstr "إعداد تكاملات OpenKnowledge…"
msgid "Set up syncing"
msgstr "إعداد المزامنة"
-msgid "Set where pasted and dropped files are stored for this project."
-msgstr "اضبط مكان تخزين الملفات الملصوقة والمفلَتة لهذا المشروع."
+msgid "Set where pasted and dropped files are stored."
+msgstr "اضبط مكان تخزين الملفات الملصوقة والمفلَتة."
msgid "Setting up"
msgstr "يجري الإعداد"
@@ -10115,9 +10133,6 @@ msgstr "subagents"
msgid "Subfolder name"
msgstr "اسم المجلد الفرعي"
-msgid "Subfolder under current folder"
-msgstr "مجلد فرعي تحت المجلد الحالي"
-
msgid "Subscribe"
msgstr "اشتراك"
@@ -11530,6 +11545,9 @@ msgstr "تاريخ غير معروف"
msgid "Unknown error"
msgstr "خطأ غير معروف"
+msgid "Unknown variable {unknownList}. Available variables: {supportedVariables}."
+msgstr "متغير غير معروف {unknownList}. المتغيرات المتاحة: {supportedVariables}."
+
msgid "unlink"
msgstr "فك الارتباط"
@@ -11699,6 +11717,9 @@ msgstr "استخدام {0} للوضع الفاتح النشط"
msgid "Use {editor} version"
msgstr "استخدام نسخة {editor}"
+msgid "Use {filenameVariable} at most once in each folder name."
+msgstr "استخدم {filenameVariable} مرة واحدة على الأكثر في كل اسم مجلد."
+
msgid "Use <0>{copyShortcut}</0> to copy the link below, or open OK in the desktop app."
msgstr "استخدم <0>{copyShortcut}</0> لنسخ الرابط أدناه، أو افتح OK في تطبيق سطح المكتب."
@@ -11738,6 +11759,9 @@ msgstr "استخدم الحروف الصغيرة والأرقام و<0>-</0> ف
msgid "Use lowercase letters, numbers, and hyphens only"
msgstr "استخدم الحروف الصغيرة والأرقام والشرطات فقط"
+msgid "Use one slash between folder names."
+msgstr "استخدم شرطة مائلة واحدة بين أسماء المجلدات."
+
msgid "Use their version"
msgstr "استخدام نسختهم"
@@ -11965,9 +11989,6 @@ msgstr "عند تثبيتك مهارة منشورة، أخبر دليل المه
msgid "Where"
msgstr "أين"
-msgid "Where newly added attachments are placed."
-msgstr "أين توضع المرفقات المضافة حديثًا."
-
msgid "Where should it live?"
msgstr "أين ينبغي أن يعيش؟"
diff --git a/packages/app/src/locales/bn/messages.po b/packages/app/src/locales/bn/messages.po
index 6c154d6b1..42d8b4541 100644
--- a/packages/app/src/locales/bn/messages.po
+++ b/packages/app/src/locales/bn/messages.po
@@ -1080,6 +1080,9 @@ msgstr "একটি শিরোনাম, বিবরণ, ট্যাগ —
msgid "A token added here only applies to HTTPS remotes, and this project's remote doesn't use HTTPS."
msgstr "এখানে যোগ করা টোকেন শুধু HTTPS রিমোটে প্রযোজ্য, আর এই প্রকল্পের রিমোট HTTPS ব্যবহার করে না।"
+msgid "A variable needs two braces on each side, such as {filenameVariable}."
+msgstr "একটি ভেরিয়েবলের প্রতিটি পাশে দুটি বন্ধনী লাগে, যেমন {filenameVariable}।"
+
msgid "A worktree folder for {shareBranch} already exists."
msgstr "{shareBranch}-এর জন্য একটি ওয়ার্কট্রি ফোল্ডার আগে থেকেই আছে।"
@@ -2667,9 +2670,6 @@ msgstr "বিষয়বস্তুর ডিরেক্টরি"
msgid "Content directory must be inside the project"
msgstr "বিষয়বস্তুর ডিরেক্টরি প্রকল্পের ভেতরে হতে হবে"
-msgid "Content root"
-msgstr "বিষয়বস্তুর রুট"
-
msgid "Content rules"
msgstr "বিষয়বস্তুর নিয়ম"
@@ -3303,6 +3303,18 @@ msgstr "{subRoot} হালনাগাদ করা যায়নি: {0}"
msgid "Couldn't update from {0}: {1}"
msgstr "{0} থেকে আপডেট করা যায়নি: {1}"
+msgid "Couldn't upload the file. The {settingKey} value in {configFile} can't be used. Fix it in that file."
+msgstr "ফাইলটি আপলোড করা যায়নি। {configFile}-এর {settingKey} মানটি ব্যবহার করা যাচ্ছে না। ওই ফাইলে এটি ঠিক করুন।"
+
+msgid "Couldn't upload the file. The attachment folder has a {open} or {close} without its pair. Fix it under Attachments in Settings."
+msgstr "ফাইলটি আপলোড করা যায়নি। সংযুক্তি ফোল্ডারে জোড়া ছাড়া {open} বা {close} আছে। সেটিং-এর সংযুক্তি অংশে এটি ঠিক করুন।"
+
+msgid "Couldn't upload the file. The attachment folder uses {filenameVariable} more than once in one folder name. Fix it under Attachments in Settings."
+msgstr "ফাইলটি আপলোড করা যায়নি। সংযুক্তি ফোল্ডারে একটি ফোল্ডারের নামে {filenameVariable} একাধিকবার ব্যবহার করা হয়েছে। সেটিং-এর সংযুক্তি অংশে এটি ঠিক করুন।"
+
+msgid "Couldn't upload the file. The attachment folder uses the unknown variable {variables}. Fix it under Attachments in Settings."
+msgstr "ফাইলটি আপলোড করা যায়নি। সংযুক্তি ফোল্ডারে অজানা ভেরিয়েবল {variables} ব্যবহার করা হয়েছে। সেটিং-এর সংযুক্তি অংশে এটি ঠিক করুন।"
+
msgid "Couldn't verify that {displayName} ({bin}) is available, so this is a plain shell. You can still run {bin} yourself."
msgstr "{displayName} ({bin}) উপলব্ধ কি না তা যাচাই করা যায়নি, তাই এটি একটি সাধারণ শেল। আপনি এখনও নিজে {bin} চালাতে পারেন।"
@@ -3483,9 +3495,6 @@ msgstr "তারিখ"
msgid "Default"
msgstr "ডিফল্ট"
-msgid "Default location for new attachments"
-msgstr "নতুন সংযুক্তির ডিফল্ট জায়গা"
-
msgid "Default properties"
msgstr "ডিফল্ট প্রপার্টি"
@@ -3891,9 +3900,6 @@ msgstr "\"{0}\"-এ প্রতিলিপি করা হয়েছে"
msgid "Duplicates dropped"
msgstr "ডুপ্লিকেট বাদ"
-msgid "e.g. assets/uploads"
-msgstr "যেমন assets/uploads"
-
msgid "e.g. drafts/ or *.draft.md"
msgstr "যেমন drafts/ বা *.draft.md"
@@ -3906,6 +3912,9 @@ msgstr "যেমন সিঙ্ক চলার সময় প্রকল
msgid "e.g. The editor froze after I pasted a large table"
msgstr "যেমন একটি বড় টেবিল পেস্ট করার পর সম্পাদক জমে গিয়েছিল"
+msgid "Each {open} needs a matching {close}."
+msgstr "প্রতিটি {open}-এর জন্য একটি মিলে যাওয়া {close} দরকার।"
+
#. Says what symlinking two skill folders together buys the user, before any button names it
msgid "Each AI tool reads skills from its own folder. Point one folder at another and both tools see the same skills — add a skill once instead of copying it into every tool."
msgstr "প্রতিটি AI টুল নিজের ফোল্ডার থেকে স্কিল পড়ে। একটি ফোল্ডারকে আরেকটির দিকে নির্দেশ করুন, তখন দুটি টুলই একই স্কিল দেখবে — প্রতিটি টুলে কপি করার বদলে স্কিল একবারই যোগ করুন।"
@@ -4263,6 +4272,9 @@ msgstr "{1}/-এর ভেতরের {0}/ ফোল্ডারগুলোর
msgid "everything under any {0}/ folder"
msgstr "যেকোনো {0}/ ফোল্ডারের নিচের সবকিছু"
+msgid "Example: a file added to <0>{exampleDoc}</0> is saved as <1>{exampleFile}</1>"
+msgstr "উদাহরণ: <0>{exampleDoc}</0>-এ যোগ করা ফাইল <1>{exampleFile}</1>-এ সংরক্ষিত হয়"
+
msgid "Excalidraw board"
msgstr "Excalidraw বোর্ড"
@@ -4747,9 +4759,6 @@ msgstr "নির্দিষ্ট"
msgid "Fixed {total, plural, one {# file} other {# files}}."
msgstr "{total, plural, one {# টি ফাইল ঠিক করা হয়েছে} other {# টি ফাইল ঠিক করা হয়েছে}}।"
-msgid "Fixed folder in content root"
-msgstr "বিষয়বস্তুর রুটে নির্দিষ্ট ফোল্ডার"
-
msgid "Fixed port number"
msgstr "নির্দিষ্ট পোর্ট নম্বর"
@@ -4786,6 +4795,12 @@ msgstr "ফোল্ডারের নাম"
msgid "Folder name: {detail}"
msgstr "ফোল্ডারের নাম: {detail}"
+msgid "Folder names cannot contain {reserved}."
+msgstr "ফোল্ডারের নামে {reserved} থাকতে পারে না।"
+
+msgid "Folder path must start with {documentPrefix} or {rootPrefix} and cannot contain {parentFolder}"
+msgstr "ফোল্ডারের পাথ {documentPrefix} বা {rootPrefix} দিয়ে শুরু হতে হবে এবং এতে {parentFolder} থাকতে পারবে না।"
+
msgid "Folder properties"
msgstr "ফোল্ডার প্রপার্টি"
@@ -8585,6 +8600,12 @@ msgstr "নির্বাচন সরান"
msgid "Remove the parent <0>.git</0> folder"
msgstr "মূল <0>.git</0> ফোল্ডারটি সরান"
+msgid "Remove the slash at the end of the path."
+msgstr "পাথের শেষের স্ল্যাশটি সরান।"
+
+msgid "Remove the spaces at the start or end of the path."
+msgstr "পাথের শুরু বা শেষের ফাঁকা জায়গা সরান।"
+
msgid "Removed"
msgstr "সরানো হয়েছে"
@@ -9015,9 +9036,6 @@ msgstr "প্রকল্প নিরীক্ষা চালানো হচ
msgid "Runs a shell command"
msgstr "একটি শেল কমান্ড চালায়"
-msgid "Same folder as current file"
-msgstr "বর্তমান ফাইলের একই ফোল্ডার"
-
msgid "Sample image"
msgstr "নমুনা ছবি"
@@ -9459,8 +9477,8 @@ msgstr "OpenKnowledge সংযুক্তি সেট আপ করুন…"
msgid "Set up syncing"
msgstr "সিঙ্ক সেট আপ করুন"
-msgid "Set where pasted and dropped files are stored for this project."
-msgstr "এই প্রকল্পের জন্য পেস্ট করা ও ফেলে দেওয়া ফাইল কোথায় রাখা হবে তা নির্ধারণ করুন।"
+msgid "Set where pasted and dropped files are stored."
+msgstr "পেস্ট করা ও ফেলে দেওয়া ফাইল কোথায় রাখা হবে তা নির্ধারণ করুন।"
msgid "Setting up"
msgstr "সেট আপ করা হচ্ছে"
@@ -10111,9 +10129,6 @@ msgstr "উপ-এজেন্ট"
msgid "Subfolder name"
msgstr "উপ-ফোল্ডারের নাম"
-msgid "Subfolder under current folder"
-msgstr "বর্তমান ফোল্ডারের নিচে উপ-ফোল্ডার"
-
msgid "Subscribe"
msgstr "সদস্য হোন"
@@ -11526,6 +11541,9 @@ msgstr "অজানা তারিখ"
msgid "Unknown error"
msgstr "অজানা ত্রুটি"
+msgid "Unknown variable {unknownList}. Available variables: {supportedVariables}."
+msgstr "অজানা ভেরিয়েবল {unknownList}। উপলব্ধ ভেরিয়েবল: {supportedVariables}।"
+
msgid "unlink"
msgstr "আনলিংক করুন"
@@ -11695,6 +11713,9 @@ msgstr "সক্রিয় হালকা মোডের জন্য {0}
msgid "Use {editor} version"
msgstr "{editor} সংস্করণ ব্যবহার করুন"
+msgid "Use {filenameVariable} at most once in each folder name."
+msgstr "প্রতিটি ফোল্ডারের নামে {filenameVariable} সর্বোচ্চ একবার ব্যবহার করুন।"
+
msgid "Use <0>{copyShortcut}</0> to copy the link below, or open OK in the desktop app."
msgstr "নিচের লিংকটি কপি করতে <0>{copyShortcut}</0> ব্যবহার করুন, নয়তো OK ডেস্কটপ অ্যাপে খুলুন।"
@@ -11734,6 +11755,9 @@ msgstr "কেবল ছোট হাতের অক্ষর, অঙ্ক ও
msgid "Use lowercase letters, numbers, and hyphens only"
msgstr "কেবল ছোট হাতের অক্ষর, সংখ্যা ও হাইফেন ব্যবহার করুন"
+msgid "Use one slash between folder names."
+msgstr "ফোল্ডারের নামের মাঝে একটি স্ল্যাশ ব্যবহার করুন।"
+
msgid "Use their version"
msgstr "তাদের সংস্করণ ব্যবহার করুন"
@@ -11961,9 +11985,6 @@ msgstr "আপনি কোনো প্রকাশিত স্কিল ই
msgid "Where"
msgstr "কোথায়"
-msgid "Where newly added attachments are placed."
-msgstr "নতুন যোগ করা সংযুক্তি কোথায় রাখা হয়।"
-
msgid "Where should it live?"
msgstr "এটি কোথায় থাকবে?"
diff --git a/packages/app/src/locales/en/messages.po b/packages/app/src/locales/en/messages.po
index 0c9137697..d56b5df66 100644
--- a/packages/app/src/locales/en/messages.po
+++ b/packages/app/src/locales/en/messages.po
@@ -1084,6 +1084,9 @@ msgstr "A title, description, tags — anything that describes this folder."
msgid "A token added here only applies to HTTPS remotes, and this project's remote doesn't use HTTPS."
msgstr "A token added here only applies to HTTPS remotes, and this project's remote doesn't use HTTPS."
+msgid "A variable needs two braces on each side, such as {filenameVariable}."
+msgstr "A variable needs two braces on each side, such as {filenameVariable}."
+
msgid "A worktree folder for {shareBranch} already exists."
msgstr "A worktree folder for {shareBranch} already exists."
@@ -2671,9 +2674,6 @@ msgstr "Content directory"
msgid "Content directory must be inside the project"
msgstr "Content directory must be inside the project"
-msgid "Content root"
-msgstr "Content root"
-
msgid "Content rules"
msgstr "Content rules"
@@ -3307,6 +3307,18 @@ msgstr "Couldn't update {subRoot}: {0}"
msgid "Couldn't update from {0}: {1}"
msgstr "Couldn't update from {0}: {1}"
+msgid "Couldn't upload the file. The {settingKey} value in {configFile} can't be used. Fix it in that file."
+msgstr "Couldn't upload the file. The {settingKey} value in {configFile} can't be used. Fix it in that file."
+
+msgid "Couldn't upload the file. The attachment folder has a {open} or {close} without its pair. Fix it under Attachments in Settings."
+msgstr "Couldn't upload the file. The attachment folder has a {open} or {close} without its pair. Fix it under Attachments in Settings."
+
+msgid "Couldn't upload the file. The attachment folder uses {filenameVariable} more than once in one folder name. Fix it under Attachments in Settings."
+msgstr "Couldn't upload the file. The attachment folder uses {filenameVariable} more than once in one folder name. Fix it under Attachments in Settings."
+
+msgid "Couldn't upload the file. The attachment folder uses the unknown variable {variables}. Fix it under Attachments in Settings."
+msgstr "Couldn't upload the file. The attachment folder uses the unknown variable {variables}. Fix it under Attachments in Settings."
+
msgid "Couldn't verify that {displayName} ({bin}) is available, so this is a plain shell. You can still run {bin} yourself."
msgstr "Couldn't verify that {displayName} ({bin}) is available, so this is a plain shell. You can still run {bin} yourself."
@@ -3487,9 +3499,6 @@ msgstr "Date"
msgid "Default"
msgstr "Default"
-msgid "Default location for new attachments"
-msgstr "Default location for new attachments"
-
msgid "Default properties"
msgstr "Default properties"
@@ -3895,9 +3904,6 @@ msgstr "Duplicated to \"{0}\""
msgid "Duplicates dropped"
msgstr "Duplicates dropped"
-msgid "e.g. assets/uploads"
-msgstr "e.g. assets/uploads"
-
msgid "e.g. drafts/ or *.draft.md"
msgstr "e.g. drafts/ or *.draft.md"
@@ -3910,6 +3916,9 @@ msgstr "e.g. Switching projects while a sync was running"
msgid "e.g. The editor froze after I pasted a large table"
msgstr "e.g. The editor froze after I pasted a large table"
+msgid "Each {open} needs a matching {close}."
+msgstr "Each {open} needs a matching {close}."
+
#. Says what symlinking two skill folders together buys the user, before any button names it
msgid "Each AI tool reads skills from its own folder. Point one folder at another and both tools see the same skills — add a skill once instead of copying it into every tool."
msgstr "Each AI tool reads skills from its own folder. Point one folder at another and both tools see the same skills — add a skill once instead of copying it into every tool."
@@ -4267,6 +4276,9 @@ msgstr "everything under {0}/ folders inside {1}/"
msgid "everything under any {0}/ folder"
msgstr "everything under any {0}/ folder"
+msgid "Example: a file added to <0>{exampleDoc}</0> is saved as <1>{exampleFile}</1>"
+msgstr "Example: a file added to <0>{exampleDoc}</0> is saved as <1>{exampleFile}</1>"
+
msgid "Excalidraw board"
msgstr "Excalidraw board"
@@ -4751,9 +4763,6 @@ msgstr "Fixed"
msgid "Fixed {total, plural, one {# file} other {# files}}."
msgstr "Fixed {total, plural, one {# file} other {# files}}."
-msgid "Fixed folder in content root"
-msgstr "Fixed folder in content root"
-
msgid "Fixed port number"
msgstr "Fixed port number"
@@ -4790,6 +4799,12 @@ msgstr "Folder name"
msgid "Folder name: {detail}"
msgstr "Folder name: {detail}"
+msgid "Folder names cannot contain {reserved}."
+msgstr "Folder names cannot contain {reserved}."
+
+msgid "Folder path must start with {documentPrefix} or {rootPrefix} and cannot contain {parentFolder}"
+msgstr "Folder path must start with {documentPrefix} or {rootPrefix} and cannot contain {parentFolder}"
+
msgid "Folder properties"
msgstr "Folder properties"
@@ -8589,6 +8604,12 @@ msgstr "Remove selection"
msgid "Remove the parent <0>.git</0> folder"
msgstr "Remove the parent <0>.git</0> folder"
+msgid "Remove the slash at the end of the path."
+msgstr "Remove the slash at the end of the path."
+
+msgid "Remove the spaces at the start or end of the path."
+msgstr "Remove the spaces at the start or end of the path."
+
msgid "Removed"
msgstr "Removed"
@@ -9019,9 +9040,6 @@ msgstr "Running project audit"
msgid "Runs a shell command"
msgstr "Runs a shell command"
-msgid "Same folder as current file"
-msgstr "Same folder as current file"
-
msgid "Sample image"
msgstr "Sample image"
@@ -9463,8 +9481,8 @@ msgstr "Set up OpenKnowledge integrations…"
msgid "Set up syncing"
msgstr "Set up syncing"
-msgid "Set where pasted and dropped files are stored for this project."
-msgstr "Set where pasted and dropped files are stored for this project."
+msgid "Set where pasted and dropped files are stored."
+msgstr "Set where pasted and dropped files are stored."
msgid "Setting up"
msgstr "Setting up"
@@ -10115,9 +10133,6 @@ msgstr "subagents"
msgid "Subfolder name"
msgstr "Subfolder name"
-msgid "Subfolder under current folder"
-msgstr "Subfolder under current folder"
-
msgid "Subscribe"
msgstr "Subscribe"
@@ -11530,6 +11545,9 @@ msgstr "Unknown date"
msgid "Unknown error"
msgstr "Unknown error"
+msgid "Unknown variable {unknownList}. Available variables: {supportedVariables}."
+msgstr "Unknown variable {unknownList}. Available variables: {supportedVariables}."
+
msgid "unlink"
msgstr "unlink"
@@ -11699,6 +11717,9 @@ msgstr "Use {0} for the active light mode"
msgid "Use {editor} version"
msgstr "Use {editor} version"
+msgid "Use {filenameVariable} at most once in each folder name."
+msgstr "Use {filenameVariable} at most once in each folder name."
+
msgid "Use <0>{copyShortcut}</0> to copy the link below, or open OK in the desktop app."
msgstr "Use <0>{copyShortcut}</0> to copy the link below, or open OK in the desktop app."
@@ -11738,6 +11759,9 @@ msgstr "Use lowercase letters, digits, and <0>-</0> only."
msgid "Use lowercase letters, numbers, and hyphens only"
msgstr "Use lowercase letters, numbers, and hyphens only"
+msgid "Use one slash between folder names."
+msgstr "Use one slash between folder names."
+
msgid "Use their version"
msgstr "Use their version"
@@ -11965,9 +11989,6 @@ msgstr "When you install a published skill, tell the skill directory (skills.sh)
msgid "Where"
msgstr "Where"
-msgid "Where newly added attachments are placed."
-msgstr "Where newly added attachments are placed."
-
msgid "Where should it live?"
msgstr "Where should it live?"
diff --git a/packages/app/src/locales/es/messages.po b/packages/app/src/locales/es/messages.po
index 3f70631a2..74f270ffa 100644
--- a/packages/app/src/locales/es/messages.po
+++ b/packages/app/src/locales/es/messages.po
@@ -1084,6 +1084,9 @@ msgstr "Un título, una descripción, etiquetas: cualquier cosa que describa est
msgid "A token added here only applies to HTTPS remotes, and this project's remote doesn't use HTTPS."
msgstr "Un token añadido aquí solo se aplica a remotos HTTPS, y el remoto de este proyecto no usa HTTPS."
+msgid "A variable needs two braces on each side, such as {filenameVariable}."
+msgstr "Una variable necesita dos llaves a cada lado, como {filenameVariable}."
+
msgid "A worktree folder for {shareBranch} already exists."
msgstr "Ya existe una carpeta de worktree para {shareBranch}."
@@ -2671,9 +2674,6 @@ msgstr "Directorio de contenido"
msgid "Content directory must be inside the project"
msgstr "El directorio de contenido debe estar dentro del proyecto"
-msgid "Content root"
-msgstr "Raíz del contenido"
-
msgid "Content rules"
msgstr "Reglas de contenido"
@@ -3307,6 +3307,18 @@ msgstr "No se pudo actualizar {subRoot}: {0}"
msgid "Couldn't update from {0}: {1}"
msgstr "No se pudo actualizar desde {0}: {1}"
+msgid "Couldn't upload the file. The {settingKey} value in {configFile} can't be used. Fix it in that file."
+msgstr "No se pudo subir el archivo. El valor de {settingKey} en {configFile} no se puede usar. Corrígelo en ese archivo."
+
+msgid "Couldn't upload the file. The attachment folder has a {open} or {close} without its pair. Fix it under Attachments in Settings."
+msgstr "No se pudo subir el archivo. La carpeta de adjuntos tiene un {open} o {close} sin su par. Corrígela en Adjuntos, en Ajustes."
+
+msgid "Couldn't upload the file. The attachment folder uses {filenameVariable} more than once in one folder name. Fix it under Attachments in Settings."
+msgstr "No se pudo subir el archivo. La carpeta de adjuntos usa {filenameVariable} más de una vez en un nombre de carpeta. Corrígela en Adjuntos, en Ajustes."
+
+msgid "Couldn't upload the file. The attachment folder uses the unknown variable {variables}. Fix it under Attachments in Settings."
+msgstr "No se pudo subir el archivo. La carpeta de adjuntos usa la variable desconocida {variables}. Corrígela en Adjuntos, en Ajustes."
+
msgid "Couldn't verify that {displayName} ({bin}) is available, so this is a plain shell. You can still run {bin} yourself."
msgstr "No se pudo verificar que {displayName} ({bin}) esté disponible, así que este es un shell normal. Aún puedes ejecutar {bin} tú mismo."
@@ -3487,9 +3499,6 @@ msgstr "Fecha"
msgid "Default"
msgstr "Predeterminado"
-msgid "Default location for new attachments"
-msgstr "Ubicación por defecto de los adjuntos nuevos"
-
msgid "Default properties"
msgstr "Propiedades por defecto"
@@ -3895,9 +3904,6 @@ msgstr "Se duplicó en \"{0}\""
msgid "Duplicates dropped"
msgstr "Duplicados descartados"
-msgid "e.g. assets/uploads"
-msgstr "p. ej. assets/uploads"
-
msgid "e.g. drafts/ or *.draft.md"
msgstr "p. ej. drafts/ o *.draft.md"
@@ -3910,6 +3916,9 @@ msgstr "p. ej. Cambiar de proyecto mientras se sincronizaba"
msgid "e.g. The editor froze after I pasted a large table"
msgstr "p. ej. El editor se quedó bloqueado al pegar una tabla grande"
+msgid "Each {open} needs a matching {close}."
+msgstr "Cada {open} necesita su {close} correspondiente."
+
#. Says what symlinking two skill folders together buys the user, before any button names it
msgid "Each AI tool reads skills from its own folder. Point one folder at another and both tools see the same skills — add a skill once instead of copying it into every tool."
msgstr "Cada herramienta de IA lee las habilidades desde su propia carpeta. Apunta una carpeta a otra y ambas herramientas verán las mismas habilidades: añade una habilidad una sola vez en lugar de copiarla en cada herramienta."
@@ -4267,6 +4276,9 @@ msgstr "todo lo que hay en las carpetas {0}/ dentro de {1}/"
msgid "everything under any {0}/ folder"
msgstr "todo lo que hay en cualquier carpeta {0}/"
+msgid "Example: a file added to <0>{exampleDoc}</0> is saved as <1>{exampleFile}</1>"
+msgstr "Ejemplo: un archivo añadido a <0>{exampleDoc}</0> se guarda en <1>{exampleFile}</1>"
+
msgid "Excalidraw board"
msgstr "Pizarra de Excalidraw"
@@ -4751,9 +4763,6 @@ msgstr "Fijo"
msgid "Fixed {total, plural, one {# file} other {# files}}."
msgstr "{total, plural, one {Se corrigió # archivo} many {Se corrigieron # archivos} other {Se corrigieron # archivos}}."
-msgid "Fixed folder in content root"
-msgstr "Carpeta fija en la raíz del contenido"
-
msgid "Fixed port number"
msgstr "Número de puerto fijo"
@@ -4790,6 +4799,12 @@ msgstr "Nombre de la carpeta"
msgid "Folder name: {detail}"
msgstr "Nombre de la carpeta: {detail}"
+msgid "Folder names cannot contain {reserved}."
+msgstr "Los nombres de carpeta no pueden contener {reserved}."
+
+msgid "Folder path must start with {documentPrefix} or {rootPrefix} and cannot contain {parentFolder}"
+msgstr "La ruta de la carpeta debe empezar con {documentPrefix} o {rootPrefix} y no puede contener {parentFolder}"
+
msgid "Folder properties"
msgstr "Propiedades de la carpeta"
@@ -8589,6 +8604,12 @@ msgstr "Quitar la selección"
msgid "Remove the parent <0>.git</0> folder"
msgstr "Eliminar la carpeta <0>.git</0> superior"
+msgid "Remove the slash at the end of the path."
+msgstr "Quita la barra del final de la ruta."
+
+msgid "Remove the spaces at the start or end of the path."
+msgstr "Quita los espacios al principio o al final de la ruta."
+
msgid "Removed"
msgstr "Eliminado"
@@ -9019,9 +9040,6 @@ msgstr "Ejecutando la auditoría del proyecto"
msgid "Runs a shell command"
msgstr "Ejecuta un comando de shell"
-msgid "Same folder as current file"
-msgstr "La misma carpeta que el archivo actual"
-
msgid "Sample image"
msgstr "Imagen de ejemplo"
@@ -9463,8 +9481,8 @@ msgstr "Configurar las integraciones de OpenKnowledge…"
msgid "Set up syncing"
msgstr "Configurar la sincronización"
-msgid "Set where pasted and dropped files are stored for this project."
-msgstr "Define dónde se guardan en este proyecto los archivos pegados y soltados."
+msgid "Set where pasted and dropped files are stored."
+msgstr "Define dónde se guardan los archivos pegados y soltados."
msgid "Setting up"
msgstr "Configurando"
@@ -10115,9 +10133,6 @@ msgstr "subagentes"
msgid "Subfolder name"
msgstr "Nombre de la subcarpeta"
-msgid "Subfolder under current folder"
-msgstr "Subcarpeta dentro de la carpeta actual"
-
msgid "Subscribe"
msgstr "Suscribirse"
@@ -11530,6 +11545,9 @@ msgstr "Fecha desconocida"
msgid "Unknown error"
msgstr "Error desconocido"
+msgid "Unknown variable {unknownList}. Available variables: {supportedVariables}."
+msgstr "Variable desconocida {unknownList}. Variables disponibles: {supportedVariables}."
+
msgid "unlink"
msgstr "desenlazar"
@@ -11699,6 +11717,9 @@ msgstr "Usar {0} para el modo claro activo"
msgid "Use {editor} version"
msgstr "Usar la versión de {editor}"
+msgid "Use {filenameVariable} at most once in each folder name."
+msgstr "Usa {filenameVariable} como máximo una vez en cada nombre de carpeta."
+
msgid "Use <0>{copyShortcut}</0> to copy the link below, or open OK in the desktop app."
msgstr "Usa <0>{copyShortcut}</0> para copiar el enlace de abajo, o abre OK en la aplicación de escritorio."
@@ -11738,6 +11759,9 @@ msgstr "Usa solo letras minúsculas, dígitos y <0>-</0>."
msgid "Use lowercase letters, numbers, and hyphens only"
msgstr "Usa solo letras minúsculas, números y guiones"
+msgid "Use one slash between folder names."
+msgstr "Usa una sola barra entre los nombres de carpeta."
+
msgid "Use their version"
msgstr "Usar su versión"
@@ -11965,9 +11989,6 @@ msgstr "Cuando instalas una habilidad publicada, se avisa al directorio de habil
msgid "Where"
msgstr "Dónde"
-msgid "Where newly added attachments are placed."
-msgstr "Dónde se colocan los adjuntos recién añadidos."
-
msgid "Where should it live?"
msgstr "¿Dónde debería vivir?"
diff --git a/packages/app/src/locales/fr/messages.po b/packages/app/src/locales/fr/messages.po
index 7bb586121..19e1f5059 100644
--- a/packages/app/src/locales/fr/messages.po
+++ b/packages/app/src/locales/fr/messages.po
@@ -1084,6 +1084,9 @@ msgstr "Un titre, une description, des étiquettes — tout ce qui décrit ce do
msgid "A token added here only applies to HTTPS remotes, and this project's remote doesn't use HTTPS."
msgstr "Un jeton ajouté ici ne s'applique qu'aux dépôts distants HTTPS, et le dépôt distant de ce projet n'utilise pas HTTPS."
+msgid "A variable needs two braces on each side, such as {filenameVariable}."
+msgstr "Une variable a besoin de deux accolades de chaque côté, comme {filenameVariable}."
+
msgid "A worktree folder for {shareBranch} already exists."
msgstr "Un dossier de worktree pour {shareBranch} existe déjà."
@@ -2671,9 +2674,6 @@ msgstr "Répertoire de contenu"
msgid "Content directory must be inside the project"
msgstr "Le répertoire de contenu doit se trouver dans le projet"
-msgid "Content root"
-msgstr "Racine du contenu"
-
msgid "Content rules"
msgstr "Règles de contenu"
@@ -3307,6 +3307,18 @@ msgstr "Impossible de mettre à jour {subRoot} : {0}"
msgid "Couldn't update from {0}: {1}"
msgstr "Impossible de mettre à jour depuis {0} : {1}"
+msgid "Couldn't upload the file. The {settingKey} value in {configFile} can't be used. Fix it in that file."
+msgstr "Impossible d'envoyer le fichier. La valeur de {settingKey} dans {configFile} est inutilisable. Corrigez-la dans ce fichier."
+
+msgid "Couldn't upload the file. The attachment folder has a {open} or {close} without its pair. Fix it under Attachments in Settings."
+msgstr "Impossible d'envoyer le fichier. Le dossier des pièces jointes contient un {open} ou un {close} sans son pendant. Corrigez-le dans Pièces jointes, dans les Paramètres."
+
+msgid "Couldn't upload the file. The attachment folder uses {filenameVariable} more than once in one folder name. Fix it under Attachments in Settings."
+msgstr "Impossible d'envoyer le fichier. Le dossier des pièces jointes utilise {filenameVariable} plusieurs fois dans un même nom de dossier. Corrigez-le dans Pièces jointes, dans les Paramètres."
+
+msgid "Couldn't upload the file. The attachment folder uses the unknown variable {variables}. Fix it under Attachments in Settings."
+msgstr "Impossible d'envoyer le fichier. Le dossier des pièces jointes utilise la variable inconnue {variables}. Corrigez-le dans Pièces jointes, dans les Paramètres."
+
msgid "Couldn't verify that {displayName} ({bin}) is available, so this is a plain shell. You can still run {bin} yourself."
msgstr "Impossible de vérifier que {displayName} ({bin}) est disponible, ceci est donc un shell ordinaire. Vous pouvez toujours lancer {bin} vous-même."
@@ -3487,9 +3499,6 @@ msgstr "Date"
msgid "Default"
msgstr "Par defaut"
-msgid "Default location for new attachments"
-msgstr "Emplacement par défaut des nouvelles pièces jointes"
-
msgid "Default properties"
msgstr "Propriétés par défaut"
@@ -3895,9 +3904,6 @@ msgstr "Dupliqué sous « {0} »"
msgid "Duplicates dropped"
msgstr "Doublons écartés"
-msgid "e.g. assets/uploads"
-msgstr "par ex. assets/uploads"
-
msgid "e.g. drafts/ or *.draft.md"
msgstr "par ex. drafts/ ou *.draft.md"
@@ -3910,6 +3916,9 @@ msgstr "par ex. Changement de projet pendant une synchronisation"
msgid "e.g. The editor froze after I pasted a large table"
msgstr "par ex. L'éditeur s'est figé après avoir collé un grand tableau"
+msgid "Each {open} needs a matching {close}."
+msgstr "Chaque {open} doit avoir un {close} correspondant."
+
#. Says what symlinking two skill folders together buys the user, before any button names it
msgid "Each AI tool reads skills from its own folder. Point one folder at another and both tools see the same skills — add a skill once instead of copying it into every tool."
msgstr "Chaque outil IA lit les compétences depuis son propre dossier. Pointez un dossier vers un autre et les deux outils verront les mêmes compétences : ajoutez une compétence une seule fois au lieu de la copier dans chaque outil."
@@ -4267,6 +4276,9 @@ msgstr "tout ce qui se trouve sous les dossiers {0}/ à l'intérieur de {1}/"
msgid "everything under any {0}/ folder"
msgstr "tout ce qui se trouve sous n'importe quel dossier {0}/"
+msgid "Example: a file added to <0>{exampleDoc}</0> is saved as <1>{exampleFile}</1>"
+msgstr "Exemple : un fichier ajouté à <0>{exampleDoc}</0> est enregistré dans <1>{exampleFile}</1>"
+
msgid "Excalidraw board"
msgstr "Tableau Excalidraw"
@@ -4751,9 +4763,6 @@ msgstr "Fixe"
msgid "Fixed {total, plural, one {# file} other {# files}}."
msgstr "{total, plural, one {# fichier corrigé} many {# fichiers corrigés} other {# fichiers corrigés}}."
-msgid "Fixed folder in content root"
-msgstr "Dossier fixe dans la racine du contenu"
-
msgid "Fixed port number"
msgstr "Numéro de port fixe"
@@ -4790,6 +4799,12 @@ msgstr "Nom du dossier"
msgid "Folder name: {detail}"
msgstr "Nom du dossier : {detail}"
+msgid "Folder names cannot contain {reserved}."
+msgstr "Les noms de dossier ne peuvent pas contenir {reserved}."
+
+msgid "Folder path must start with {documentPrefix} or {rootPrefix} and cannot contain {parentFolder}"
+msgstr "Le chemin du dossier doit commencer par {documentPrefix} ou {rootPrefix} et ne peut pas contenir {parentFolder}"
+
msgid "Folder properties"
msgstr "Propriétés du dossier"
@@ -8589,6 +8604,12 @@ msgstr "Retirer la sélection"
msgid "Remove the parent <0>.git</0> folder"
msgstr "Supprimer le dossier <0>.git</0> parent"
+msgid "Remove the slash at the end of the path."
+msgstr "Supprimez la barre oblique à la fin du chemin."
+
+msgid "Remove the spaces at the start or end of the path."
+msgstr "Supprimez les espaces au début ou à la fin du chemin."
+
msgid "Removed"
msgstr "Supprimé"
@@ -9019,9 +9040,6 @@ msgstr "Audit du projet en cours"
msgid "Runs a shell command"
msgstr "Exécute une commande shell"
-msgid "Same folder as current file"
-msgstr "Même dossier que le fichier actuel"
-
msgid "Sample image"
msgstr "Image d'exemple"
@@ -9463,8 +9481,8 @@ msgstr "Configurer les intégrations OpenKnowledge…"
msgid "Set up syncing"
msgstr "Configurer la synchronisation"
-msgid "Set where pasted and dropped files are stored for this project."
-msgstr "Définissez où sont stockés les fichiers collés et déposés pour ce projet."
+msgid "Set where pasted and dropped files are stored."
+msgstr "Définissez où sont stockés les fichiers collés et déposés."
msgid "Setting up"
msgstr "Configuration en cours"
@@ -10115,9 +10133,6 @@ msgstr "sous-agents"
msgid "Subfolder name"
msgstr "Nom du sous-dossier"
-msgid "Subfolder under current folder"
-msgstr "Sous-dossier du dossier actuel"
-
msgid "Subscribe"
msgstr "S'abonner"
@@ -11530,6 +11545,9 @@ msgstr "Date inconnue"
msgid "Unknown error"
msgstr "Erreur inconnue"
+msgid "Unknown variable {unknownList}. Available variables: {supportedVariables}."
+msgstr "Variable inconnue {unknownList}. Variables disponibles : {supportedVariables}."
+
msgid "unlink"
msgstr "dissocier"
@@ -11699,6 +11717,9 @@ msgstr "Utiliser {0} pour le mode clair actif"
msgid "Use {editor} version"
msgstr "Utiliser la version {editor}"
+msgid "Use {filenameVariable} at most once in each folder name."
+msgstr "Utilisez {filenameVariable} au plus une fois dans chaque nom de dossier."
+
msgid "Use <0>{copyShortcut}</0> to copy the link below, or open OK in the desktop app."
msgstr "Utilisez <0>{copyShortcut}</0> pour copier le lien ci-dessous, ou ouvrez OK dans l'application de bureau."
@@ -11738,6 +11759,9 @@ msgstr "Utilisez uniquement des lettres minuscules, des chiffres et <0>-</0>."
msgid "Use lowercase letters, numbers, and hyphens only"
msgstr "Utilisez uniquement des lettres minuscules, des chiffres et des traits d'union"
+msgid "Use one slash between folder names."
+msgstr "Utilisez une seule barre oblique entre les noms de dossier."
+
msgid "Use their version"
msgstr "Utiliser leur version"
@@ -11965,9 +11989,6 @@ msgstr "Quand vous installez une compétence publiée, en informer l'annuaire de
msgid "Where"
msgstr "Où"
-msgid "Where newly added attachments are placed."
-msgstr "Où sont placées les pièces jointes nouvellement ajoutées."
-
msgid "Where should it live?"
msgstr "Où doit-elle résider ?"
diff --git a/packages/app/src/locales/hi/messages.po b/packages/app/src/locales/hi/messages.po
index 2db275589..2aef19608 100644
--- a/packages/app/src/locales/hi/messages.po
+++ b/packages/app/src/locales/hi/messages.po
@@ -1080,6 +1080,9 @@ msgstr "एक शीर्षक, विवरण, टैग — कुछ भ
msgid "A token added here only applies to HTTPS remotes, and this project's remote doesn't use HTTPS."
msgstr "यहाँ जोड़ा गया टोकन केवल HTTPS रिमोट पर लागू होता है, और इस प्रोजेक्ट का रिमोट HTTPS का उपयोग नहीं करता।"
+msgid "A variable needs two braces on each side, such as {filenameVariable}."
+msgstr "किसी वेरिएबल के हर तरफ़ दो कोष्ठक चाहिए, जैसे {filenameVariable}।"
+
msgid "A worktree folder for {shareBranch} already exists."
msgstr "{shareBranch} के लिए एक वर्कट्री फ़ोल्डर पहले से मौजूद है।"
@@ -2667,9 +2670,6 @@ msgstr "सामग्री निर्देशिका"
msgid "Content directory must be inside the project"
msgstr "सामग्री निर्देशिका प्रोजेक्ट के भीतर होनी चाहिए"
-msgid "Content root"
-msgstr "सामग्री रूट"
-
msgid "Content rules"
msgstr "सामग्री नियम"
@@ -3303,6 +3303,18 @@ msgstr "{subRoot} अपडेट नहीं किया जा सका: {0
msgid "Couldn't update from {0}: {1}"
msgstr "{0} से अपडेट नहीं किया जा सका: {1}"
+msgid "Couldn't upload the file. The {settingKey} value in {configFile} can't be used. Fix it in that file."
+msgstr "फ़ाइल अपलोड नहीं हो सकी। {configFile} में {settingKey} का मान इस्तेमाल नहीं किया जा सकता। इसे उसी फ़ाइल में ठीक करें।"
+
+msgid "Couldn't upload the file. The attachment folder has a {open} or {close} without its pair. Fix it under Attachments in Settings."
+msgstr "फ़ाइल अपलोड नहीं हो सकी। संलग्नक फ़ोल्डर में बिना जोड़ी का {open} या {close} है। इसे सेटिंग में संलग्नक के अंतर्गत ठीक करें।"
+
+msgid "Couldn't upload the file. The attachment folder uses {filenameVariable} more than once in one folder name. Fix it under Attachments in Settings."
+msgstr "फ़ाइल अपलोड नहीं हो सकी। संलग्नक फ़ोल्डर एक फ़ोल्डर नाम में {filenameVariable} का एक से ज़्यादा बार उपयोग करता है। इसे सेटिंग में संलग्नक के अंतर्गत ठीक करें।"
+
+msgid "Couldn't upload the file. The attachment folder uses the unknown variable {variables}. Fix it under Attachments in Settings."
+msgstr "फ़ाइल अपलोड नहीं हो सकी। संलग्नक फ़ोल्डर अज्ञात वेरिएबल {variables} का उपयोग करता है। इसे सेटिंग में संलग्नक के अंतर्गत ठीक करें।"
+
msgid "Couldn't verify that {displayName} ({bin}) is available, so this is a plain shell. You can still run {bin} yourself."
msgstr "यह सत्यापित नहीं हो सका कि {displayName} ({bin}) उपलब्ध है, इसलिए यह एक सादा शेल है। आप फिर भी {bin} स्वयं चला सकते हैं।"
@@ -3483,9 +3495,6 @@ msgstr "तारीख़"
msgid "Default"
msgstr "डिफ़ॉल्ट"
-msgid "Default location for new attachments"
-msgstr "नए संलग्नकों का डिफ़ॉल्ट स्थान"
-
msgid "Default properties"
msgstr "डिफ़ॉल्ट प्रॉपर्टी"
@@ -3891,9 +3900,6 @@ msgstr "\"{0}\" में नकल बनाई गई"
msgid "Duplicates dropped"
msgstr "डुप्लिकेट हटाए गए"
-msgid "e.g. assets/uploads"
-msgstr "जैसे assets/uploads"
-
msgid "e.g. drafts/ or *.draft.md"
msgstr "जैसे drafts/ या *.draft.md"
@@ -3906,6 +3912,9 @@ msgstr "जैसे सिंक चलते समय प्रोजेक
msgid "e.g. The editor froze after I pasted a large table"
msgstr "जैसे एक बड़ी तालिका चिपकाने के बाद संपादक जम गया"
+msgid "Each {open} needs a matching {close}."
+msgstr "हर {open} के लिए मेल खाता {close} चाहिए।"
+
#. Says what symlinking two skill folders together buys the user, before any button names it
msgid "Each AI tool reads skills from its own folder. Point one folder at another and both tools see the same skills — add a skill once instead of copying it into every tool."
msgstr "हर AI टूल स्किल अपने ही फ़ोल्डर से पढ़ता है। एक फ़ोल्डर को दूसरे की ओर इंगित करें, तब दोनों टूल एक ही स्किल देखेंगे — हर टूल में कॉपी करने के बजाय स्किल एक ही बार जोड़ें।"
@@ -4263,6 +4272,9 @@ msgstr "{1}/ के भीतर मौजूद {0}/ फ़ोल्डरो
msgid "everything under any {0}/ folder"
msgstr "किसी भी {0}/ फ़ोल्डर के अंतर्गत सब कुछ"
+msgid "Example: a file added to <0>{exampleDoc}</0> is saved as <1>{exampleFile}</1>"
+msgstr "उदाहरण: <0>{exampleDoc}</0> में जोड़ी गई फ़ाइल <1>{exampleFile}</1> में सहेजी जाती है"
+
msgid "Excalidraw board"
msgstr "Excalidraw बोर्ड"
@@ -4747,9 +4759,6 @@ msgstr "निश्चित"
msgid "Fixed {total, plural, one {# file} other {# files}}."
msgstr "{total, plural, one {# फ़ाइल ठीक की गई} other {# फ़ाइलें ठीक की गईं}}।"
-msgid "Fixed folder in content root"
-msgstr "सामग्री रूट में निश्चित फ़ोल्डर"
-
msgid "Fixed port number"
msgstr "निश्चित port संख्या"
@@ -4786,6 +4795,12 @@ msgstr "फ़ोल्डर का नाम"
msgid "Folder name: {detail}"
msgstr "फ़ोल्डर का नाम: {detail}"
+msgid "Folder names cannot contain {reserved}."
+msgstr "फ़ोल्डर नामों में {reserved} नहीं हो सकते।"
+
+msgid "Folder path must start with {documentPrefix} or {rootPrefix} and cannot contain {parentFolder}"
+msgstr "फ़ोल्डर पथ {documentPrefix} या {rootPrefix} से शुरू होना चाहिए और उसमें {parentFolder} नहीं हो सकता।"
+
msgid "Folder properties"
msgstr "फ़ोल्डर प्रॉपर्टी"
@@ -8585,6 +8600,12 @@ msgstr "चयन हटाएँ"
msgid "Remove the parent <0>.git</0> folder"
msgstr "मूल <0>.git</0> फ़ोल्डर हटाएँ"
+msgid "Remove the slash at the end of the path."
+msgstr "पथ के अंत का स्लैश हटाएँ।"
+
+msgid "Remove the spaces at the start or end of the path."
+msgstr "पथ के शुरू या अंत की खाली जगह हटाएँ।"
+
msgid "Removed"
msgstr "हटाया गया"
@@ -9015,9 +9036,6 @@ msgstr "प्रोजेक्ट ऑडिट चलाया जा रह
msgid "Runs a shell command"
msgstr "एक शेल कमांड चलाता है"
-msgid "Same folder as current file"
-msgstr "मौजूदा फ़ाइल वाला ही फ़ोल्डर"
-
msgid "Sample image"
msgstr "नमूना छवि"
@@ -9459,8 +9477,8 @@ msgstr "OpenKnowledge एकीकरण सेट अप करें…"
msgid "Set up syncing"
msgstr "सिंक सेट अप करें"
-msgid "Set where pasted and dropped files are stored for this project."
-msgstr "तय करें कि इस प्रोजेक्ट के लिए चिपकाई और छोड़ी गई फ़ाइलें कहाँ सहेजी जाएँ।"
+msgid "Set where pasted and dropped files are stored."
+msgstr "तय करें कि चिपकाई और छोड़ी गई फ़ाइलें कहाँ सहेजी जाएँ।"
msgid "Setting up"
msgstr "सेट अप किया जा रहा है"
@@ -10111,9 +10129,6 @@ msgstr "उप-एजेंट"
msgid "Subfolder name"
msgstr "उप-फ़ोल्डर का नाम"
-msgid "Subfolder under current folder"
-msgstr "मौजूदा फ़ोल्डर के अंतर्गत उप-फ़ोल्डर"
-
msgid "Subscribe"
msgstr "सदस्यता लें"
@@ -11526,6 +11541,9 @@ msgstr "अज्ञात तारीख़"
msgid "Unknown error"
msgstr "अज्ञात त्रुटि"
+msgid "Unknown variable {unknownList}. Available variables: {supportedVariables}."
+msgstr "अज्ञात वेरिएबल {unknownList}। उपलब्ध वेरिएबल: {supportedVariables}।"
+
msgid "unlink"
msgstr "अनलिंक करें"
@@ -11695,6 +11713,9 @@ msgstr "सक्रिय हल्के मोड के लिए {0} का
msgid "Use {editor} version"
msgstr "{editor} संस्करण उपयोग करें"
+msgid "Use {filenameVariable} at most once in each folder name."
+msgstr "हर फ़ोल्डर नाम में {filenameVariable} ज़्यादा से ज़्यादा एक बार इस्तेमाल करें।"
+
msgid "Use <0>{copyShortcut}</0> to copy the link below, or open OK in the desktop app."
msgstr "नीचे दिया लिंक कॉपी करने के लिए <0>{copyShortcut}</0> का उपयोग करें, या OK को डेस्कटॉप ऐप में खोलें।"
@@ -11734,6 +11755,9 @@ msgstr "केवल छोटे अक्षर, अंक और <0>-</0> उ
msgid "Use lowercase letters, numbers, and hyphens only"
msgstr "केवल छोटे अक्षर, अंक और हाइफ़न उपयोग करें"
+msgid "Use one slash between folder names."
+msgstr "फ़ोल्डर नामों के बीच एक स्लैश का उपयोग करें।"
+
msgid "Use their version"
msgstr "उनका संस्करण लें"
@@ -11961,9 +11985,6 @@ msgstr "जब आप कोई प्रकाशित स्किल इं
msgid "Where"
msgstr "कहाँ"
-msgid "Where newly added attachments are placed."
-msgstr "नए जोड़े गए संलग्नक कहाँ रखे जाते हैं।"
-
msgid "Where should it live?"
msgstr "यह कहाँ रहना चाहिए?"
diff --git a/packages/app/src/locales/id/messages.po b/packages/app/src/locales/id/messages.po
index c2d18aa9a..2815d6d03 100644
--- a/packages/app/src/locales/id/messages.po
+++ b/packages/app/src/locales/id/messages.po
@@ -1080,6 +1080,9 @@ msgstr "Judul, deskripsi, tag — apa saja yang menggambarkan folder ini."
msgid "A token added here only applies to HTTPS remotes, and this project's remote doesn't use HTTPS."
msgstr "Token yang ditambahkan di sini hanya berlaku untuk remote HTTPS, dan remote proyek ini tidak memakai HTTPS."
+msgid "A variable needs two braces on each side, such as {filenameVariable}."
+msgstr "Variabel memerlukan dua kurung kurawal di setiap sisi, seperti {filenameVariable}."
+
msgid "A worktree folder for {shareBranch} already exists."
msgstr "Folder worktree untuk {shareBranch} sudah ada."
@@ -2667,9 +2670,6 @@ msgstr "Direktori konten"
msgid "Content directory must be inside the project"
msgstr "Direktori konten harus berada di dalam proyek"
-msgid "Content root"
-msgstr "Akar konten"
-
msgid "Content rules"
msgstr "Aturan konten"
@@ -3303,6 +3303,18 @@ msgstr "{subRoot} tidak bisa diperbarui: {0}"
msgid "Couldn't update from {0}: {1}"
msgstr "Tidak dapat memperbarui dari {0}: {1}"
+msgid "Couldn't upload the file. The {settingKey} value in {configFile} can't be used. Fix it in that file."
+msgstr "Tidak dapat mengunggah berkas. Nilai {settingKey} di {configFile} tidak dapat dipakai. Perbaiki di berkas itu."
+
+msgid "Couldn't upload the file. The attachment folder has a {open} or {close} without its pair. Fix it under Attachments in Settings."
+msgstr "Tidak dapat mengunggah berkas. Folder lampiran memiliki {open} atau {close} tanpa pasangannya. Perbaiki di Lampiran, di Pengaturan."
+
+msgid "Couldn't upload the file. The attachment folder uses {filenameVariable} more than once in one folder name. Fix it under Attachments in Settings."
+msgstr "Tidak dapat mengunggah berkas. Folder lampiran memakai {filenameVariable} lebih dari sekali dalam satu nama folder. Perbaiki di Lampiran, di Pengaturan."
+
+msgid "Couldn't upload the file. The attachment folder uses the unknown variable {variables}. Fix it under Attachments in Settings."
+msgstr "Tidak dapat mengunggah berkas. Folder lampiran memakai variabel tak dikenal {variables}. Perbaiki di Lampiran, di Pengaturan."
+
msgid "Couldn't verify that {displayName} ({bin}) is available, so this is a plain shell. You can still run {bin} yourself."
msgstr "Tidak dapat memverifikasi bahwa {displayName} ({bin}) tersedia, jadi ini adalah shell biasa. Anda tetap dapat menjalankan {bin} sendiri."
@@ -3483,9 +3495,6 @@ msgstr "Tanggal"
msgid "Default"
msgstr "Bawaan"
-msgid "Default location for new attachments"
-msgstr "Lokasi bawaan untuk lampiran baru"
-
msgid "Default properties"
msgstr "Properti bawaan"
@@ -3891,9 +3900,6 @@ msgstr "Digandakan menjadi \"{0}\""
msgid "Duplicates dropped"
msgstr "Duplikat dibuang"
-msgid "e.g. assets/uploads"
-msgstr "mis. assets/uploads"
-
msgid "e.g. drafts/ or *.draft.md"
msgstr "mis. drafts/ atau *.draft.md"
@@ -3906,6 +3912,9 @@ msgstr "mis. Berpindah proyek saat sinkronisasi sedang berjalan"
msgid "e.g. The editor froze after I pasted a large table"
msgstr "mis. Penyunting membeku setelah saya menempelkan tabel besar"
+msgid "Each {open} needs a matching {close}."
+msgstr "Setiap {open} perlu {close} pasangannya."
+
#. Says what symlinking two skill folders together buys the user, before any button names it
msgid "Each AI tool reads skills from its own folder. Point one folder at another and both tools see the same skills — add a skill once instead of copying it into every tool."
msgstr "Setiap alat AI membaca keterampilan dari foldernya sendiri. Arahkan satu folder ke folder lain dan kedua alat akan melihat keterampilan yang sama — tambahkan keterampilan sekali saja alih-alih menyalinnya ke setiap alat."
@@ -4263,6 +4272,9 @@ msgstr "semua yang ada di folder {0}/ di dalam {1}/"
msgid "everything under any {0}/ folder"
msgstr "semua yang ada di folder {0}/ mana pun"
+msgid "Example: a file added to <0>{exampleDoc}</0> is saved as <1>{exampleFile}</1>"
+msgstr "Contoh: berkas yang ditambahkan ke <0>{exampleDoc}</0> disimpan di <1>{exampleFile}</1>"
+
msgid "Excalidraw board"
msgstr "Papan Excalidraw"
@@ -4747,9 +4759,6 @@ msgstr "Tetap"
msgid "Fixed {total, plural, one {# file} other {# files}}."
msgstr "{total, plural, other {# berkas diperbaiki}}."
-msgid "Fixed folder in content root"
-msgstr "Folder tetap di akar konten"
-
msgid "Fixed port number"
msgstr "Nomor port tetap"
@@ -4786,6 +4795,12 @@ msgstr "Nama folder"
msgid "Folder name: {detail}"
msgstr "Nama folder: {detail}"
+msgid "Folder names cannot contain {reserved}."
+msgstr "Nama folder tidak boleh berisi {reserved}."
+
+msgid "Folder path must start with {documentPrefix} or {rootPrefix} and cannot contain {parentFolder}"
+msgstr "Jalur folder harus diawali {documentPrefix} atau {rootPrefix} dan tidak boleh berisi {parentFolder}"
+
msgid "Folder properties"
msgstr "Properti folder"
@@ -8585,6 +8600,12 @@ msgstr "Hapus pilihan"
msgid "Remove the parent <0>.git</0> folder"
msgstr "Hapus folder <0>.git</0> induknya"
+msgid "Remove the slash at the end of the path."
+msgstr "Hapus garis miring di akhir jalur."
+
+msgid "Remove the spaces at the start or end of the path."
+msgstr "Hapus spasi di awal atau akhir jalur."
+
msgid "Removed"
msgstr "Dihapus"
@@ -9015,9 +9036,6 @@ msgstr "Menjalankan audit proyek"
msgid "Runs a shell command"
msgstr "Menjalankan perintah shell"
-msgid "Same folder as current file"
-msgstr "Folder yang sama dengan berkas saat ini"
-
msgid "Sample image"
msgstr "Contoh gambar"
@@ -9459,8 +9477,8 @@ msgstr "Siapkan integrasi OpenKnowledge…"
msgid "Set up syncing"
msgstr "Siapkan sinkronisasi"
-msgid "Set where pasted and dropped files are stored for this project."
-msgstr "Tentukan tempat berkas yang ditempel dan dijatuhkan disimpan untuk proyek ini."
+msgid "Set where pasted and dropped files are stored."
+msgstr "Tentukan tempat berkas yang ditempel dan dijatuhkan disimpan."
msgid "Setting up"
msgstr "Menyiapkan"
@@ -10111,9 +10129,6 @@ msgstr "subagen"
msgid "Subfolder name"
msgstr "Nama subfolder"
-msgid "Subfolder under current folder"
-msgstr "Subfolder di bawah folder saat ini"
-
msgid "Subscribe"
msgstr "Berlangganan"
@@ -11526,6 +11541,9 @@ msgstr "Tanggal tidak diketahui"
msgid "Unknown error"
msgstr "Galat tidak diketahui"
+msgid "Unknown variable {unknownList}. Available variables: {supportedVariables}."
+msgstr "Variabel tidak dikenal {unknownList}. Variabel yang tersedia: {supportedVariables}."
+
msgid "unlink"
msgstr "lepas tautan"
@@ -11695,6 +11713,9 @@ msgstr "Pakai {0} untuk mode terang yang aktif"
msgid "Use {editor} version"
msgstr "Pakai versi {editor}"
+msgid "Use {filenameVariable} at most once in each folder name."
+msgstr "Gunakan {filenameVariable} paling banyak sekali di setiap nama folder."
+
msgid "Use <0>{copyShortcut}</0> to copy the link below, or open OK in the desktop app."
msgstr "Gunakan <0>{copyShortcut}</0> untuk menyalin tautan di bawah, atau buka OK di aplikasi desktop."
@@ -11734,6 +11755,9 @@ msgstr "Pakai hanya huruf kecil, angka, dan <0>-</0>."
msgid "Use lowercase letters, numbers, and hyphens only"
msgstr "Pakai hanya huruf kecil, angka, dan tanda hubung"
+msgid "Use one slash between folder names."
+msgstr "Gunakan satu garis miring di antara nama folder."
+
msgid "Use their version"
msgstr "Pakai versi mereka"
@@ -11961,9 +11985,6 @@ msgstr "Ketika Anda memasang keterampilan yang diterbitkan, direktori keterampil
msgid "Where"
msgstr "Di mana"
-msgid "Where newly added attachments are placed."
-msgstr "Tempat lampiran yang baru ditambahkan diletakkan."
-
msgid "Where should it live?"
msgstr "Di mana ia sebaiknya berada?"
diff --git a/packages/app/src/locales/ko/messages.po b/packages/app/src/locales/ko/messages.po
index 91049c58a..c51263c79 100644
--- a/packages/app/src/locales/ko/messages.po
+++ b/packages/app/src/locales/ko/messages.po
@@ -1084,6 +1084,9 @@ msgstr "이 폴더를 설명하는 제목, 설명, 태그 등입니다."
msgid "A token added here only applies to HTTPS remotes, and this project's remote doesn't use HTTPS."
msgstr "여기에 추가한 토큰은 HTTPS 원격 저장소에만 적용되며, 이 프로젝트의 원격 저장소는 HTTPS를 사용하지 않습니다."
+msgid "A variable needs two braces on each side, such as {filenameVariable}."
+msgstr "변수는 양쪽에 중괄호가 두 개씩 필요합니다(예: {filenameVariable})."
+
msgid "A worktree folder for {shareBranch} already exists."
msgstr "{shareBranch}용 워크트리 폴더가 이미 있습니다."
@@ -2671,9 +2674,6 @@ msgstr "콘텐츠 디렉터리"
msgid "Content directory must be inside the project"
msgstr "콘텐츠 디렉터리는 프로젝트 내부에 있어야 합니다"
-msgid "Content root"
-msgstr "콘텐츠 루트"
-
msgid "Content rules"
msgstr "콘텐츠 규칙"
@@ -3307,6 +3307,18 @@ msgstr "{subRoot} 업데이트 실패: {0}"
msgid "Couldn't update from {0}: {1}"
msgstr "{0}에서 업데이트할 수 없습니다: {1}"
+msgid "Couldn't upload the file. The {settingKey} value in {configFile} can't be used. Fix it in that file."
+msgstr "파일을 업로드할 수 없습니다. {configFile}의 {settingKey} 값을 사용할 수 없습니다. 그 파일에서 수정하세요."
+
+msgid "Couldn't upload the file. The attachment folder has a {open} or {close} without its pair. Fix it under Attachments in Settings."
+msgstr "파일을 업로드할 수 없습니다. 첨부 파일 폴더에 짝이 없는 {open} 또는 {close}가 있습니다. 설정의 첨부 파일에서 수정하세요."
+
+msgid "Couldn't upload the file. The attachment folder uses {filenameVariable} more than once in one folder name. Fix it under Attachments in Settings."
+msgstr "파일을 업로드할 수 없습니다. 첨부 파일 폴더의 한 폴더 이름에 {filenameVariable}가 두 번 이상 있습니다. 설정의 첨부 파일에서 수정하세요."
+
+msgid "Couldn't upload the file. The attachment folder uses the unknown variable {variables}. Fix it under Attachments in Settings."
+msgstr "파일을 업로드할 수 없습니다. 첨부 파일 폴더에 알 수 없는 변수 {variables}가 있습니다. 설정의 첨부 파일에서 수정하세요."
+
msgid "Couldn't verify that {displayName} ({bin}) is available, so this is a plain shell. You can still run {bin} yourself."
msgstr "{displayName}({bin})이(가) 사용 가능한지 확인할 수 없어 일반 셸이 열렸습니다. 직접 {bin}을(를) 실행할 수 있습니다."
@@ -3487,9 +3499,6 @@ msgstr "날짜"
msgid "Default"
msgstr "기본값"
-msgid "Default location for new attachments"
-msgstr "새 첨부 파일의 기본 위치"
-
msgid "Default properties"
msgstr "기본 속성"
@@ -3895,9 +3904,6 @@ msgstr "\"{0}\"에 복제됨"
msgid "Duplicates dropped"
msgstr "중복 항목 정리"
-msgid "e.g. assets/uploads"
-msgstr "예: assets/uploads"
-
msgid "e.g. drafts/ or *.draft.md"
msgstr "예: drafts/ 또는 *.draft.md"
@@ -3910,6 +3916,9 @@ msgstr "예: 동기화 중 프로젝트 전환"
msgid "e.g. The editor froze after I pasted a large table"
msgstr "예: 큰 표를 붙여넣은 후 편집기가 멈춤"
+msgid "Each {open} needs a matching {close}."
+msgstr "각 {open}에는 짝이 되는 {close}가 필요합니다."
+
#. Says what symlinking two skill folders together buys the user, before any button names it
msgid "Each AI tool reads skills from its own folder. Point one folder at another and both tools see the same skills — add a skill once instead of copying it into every tool."
msgstr "각 AI 도구는 자체 폴더에서 스킬을 읽습니다. 한 폴더를 다른 폴더로 연결하면 두 도구가 같은 스킬을 봅니다. 모든 도구에 복사하는 대신 스킬을 한 번만 추가하세요."
@@ -4267,6 +4276,9 @@ msgstr "{0}/ 폴더가 {1}/ 안에 있는 모든 항목"
msgid "everything under any {0}/ folder"
msgstr "모든 {0}/ 폴더 아래의 항목"
+msgid "Example: a file added to <0>{exampleDoc}</0> is saved as <1>{exampleFile}</1>"
+msgstr "예: <0>{exampleDoc}</0>에 추가한 파일은 <1>{exampleFile}</1>에 저장됩니다"
+
msgid "Excalidraw board"
msgstr "Excalidraw 보드"
@@ -4751,9 +4763,6 @@ msgstr "고정"
msgid "Fixed {total, plural, one {# file} other {# files}}."
msgstr "{total, plural, other {파일 #개}}를 수정했습니다."
-msgid "Fixed folder in content root"
-msgstr "콘텐츠 루트의 고정 폴더"
-
msgid "Fixed port number"
msgstr "고정 포트 번호"
@@ -4790,6 +4799,12 @@ msgstr "폴더 이름"
msgid "Folder name: {detail}"
msgstr "폴더 이름: {detail}"
+msgid "Folder names cannot contain {reserved}."
+msgstr "폴더 이름에는 {reserved}를 사용할 수 없습니다."
+
+msgid "Folder path must start with {documentPrefix} or {rootPrefix} and cannot contain {parentFolder}"
+msgstr "폴더 경로는 {documentPrefix} 또는 {rootPrefix}로 시작해야 하며, {parentFolder}는 포함할 수 없습니다."
+
msgid "Folder properties"
msgstr "폴더 속성"
@@ -8589,6 +8604,12 @@ msgstr "선택 영역 제거"
msgid "Remove the parent <0>.git</0> folder"
msgstr "상위 <0>.git</0> 폴더 제거"
+msgid "Remove the slash at the end of the path."
+msgstr "경로 끝의 슬래시를 지우세요."
+
+msgid "Remove the spaces at the start or end of the path."
+msgstr "경로 앞이나 뒤의 공백을 지우세요."
+
msgid "Removed"
msgstr "제거됨"
@@ -9019,9 +9040,6 @@ msgstr "프로젝트 감사 실행 중"
msgid "Runs a shell command"
msgstr "셸 명령을 실행합니다"
-msgid "Same folder as current file"
-msgstr "현재 파일과 같은 폴더"
-
msgid "Sample image"
msgstr "샘플 이미지"
@@ -9463,8 +9481,8 @@ msgstr "OpenKnowledge 통합 설정…"
msgid "Set up syncing"
msgstr "동기화 설정"
-msgid "Set where pasted and dropped files are stored for this project."
-msgstr "이 프로젝트에서 붙여넣거나 드롭한 파일의 저장 위치를 설정합니다."
+msgid "Set where pasted and dropped files are stored."
+msgstr "붙여넣거나 드롭한 파일의 저장 위치를 설정합니다."
msgid "Setting up"
msgstr "설정 중"
@@ -10115,9 +10133,6 @@ msgstr "서브에이전트"
msgid "Subfolder name"
msgstr "하위 폴더 이름"
-msgid "Subfolder under current folder"
-msgstr "현재 폴더의 하위 폴더"
-
msgid "Subscribe"
msgstr "구독"
@@ -11530,6 +11545,9 @@ msgstr "알 수 없는 날짜"
msgid "Unknown error"
msgstr "알 수 없는 오류"
+msgid "Unknown variable {unknownList}. Available variables: {supportedVariables}."
+msgstr "알 수 없는 변수 {unknownList}. 사용할 수 있는 변수: {supportedVariables}."
+
msgid "unlink"
msgstr "링크 해제"
@@ -11699,6 +11717,9 @@ msgstr "현재 밝은 모드로 {0} 사용"
msgid "Use {editor} version"
msgstr "{editor} 버전 사용"
+msgid "Use {filenameVariable} at most once in each folder name."
+msgstr "각 폴더 이름에는 {filenameVariable}을(를) 한 번만 사용하세요."
+
msgid "Use <0>{copyShortcut}</0> to copy the link below, or open OK in the desktop app."
msgstr "아래 링크 복사에는 <0>{copyShortcut}</0> 사용, 또는 데스크톱 앱에서 OK 열기"
@@ -11738,6 +11759,9 @@ msgstr "소문자, 숫자, <0>-</0>만 사용하세요."
msgid "Use lowercase letters, numbers, and hyphens only"
msgstr "소문자, 숫자, 하이픈만 사용하세요"
+msgid "Use one slash between folder names."
+msgstr "폴더 이름 사이에는 슬래시를 하나만 쓰세요."
+
msgid "Use their version"
msgstr "상대 버전 사용"
@@ -11965,9 +11989,6 @@ msgstr "게시된 스킬을 설치하면 skills.sh에 알려 설치 횟수가
msgid "Where"
msgstr "위치"
-msgid "Where newly added attachments are placed."
-msgstr "새로 추가한 첨부 파일의 위치"
-
msgid "Where should it live?"
msgstr "어디에 둘까요?"
diff --git a/packages/app/src/locales/pl/messages.po b/packages/app/src/locales/pl/messages.po
index a94888947..4ae903499 100644
--- a/packages/app/src/locales/pl/messages.po
+++ b/packages/app/src/locales/pl/messages.po
@@ -1084,6 +1084,9 @@ msgstr "Tytuł, opis, tagi — wszystko, co opisuje ten folder."
msgid "A token added here only applies to HTTPS remotes, and this project's remote doesn't use HTTPS."
msgstr "Token dodany tutaj dotyczy tylko zdalnych repozytoriów HTTPS, a zdalne repozytorium tego projektu nie używa HTTPS."
+msgid "A variable needs two braces on each side, such as {filenameVariable}."
+msgstr "Zmienna potrzebuje dwóch nawiasów klamrowych z każdej strony, na przykład {filenameVariable}."
+
msgid "A worktree folder for {shareBranch} already exists."
msgstr "Folder worktree dla {shareBranch} już istnieje."
@@ -2671,9 +2674,6 @@ msgstr "Katalog zawartości"
msgid "Content directory must be inside the project"
msgstr "Katalog zawartości musi znajdować się w projekcie"
-msgid "Content root"
-msgstr "Główny katalog zawartości"
-
msgid "Content rules"
msgstr "Zasady treści"
@@ -3307,6 +3307,18 @@ msgstr "Nie udało się zaktualizować {subRoot}: {0}"
msgid "Couldn't update from {0}: {1}"
msgstr "Nie udało się zaktualizować z {0}: {1}"
+msgid "Couldn't upload the file. The {settingKey} value in {configFile} can't be used. Fix it in that file."
+msgstr "Nie udało się przesłać pliku. Wartości {settingKey} w {configFile} nie można użyć. Popraw ją w tym pliku."
+
+msgid "Couldn't upload the file. The attachment folder has a {open} or {close} without its pair. Fix it under Attachments in Settings."
+msgstr "Nie udało się przesłać pliku. Folder załączników ma {open} lub {close} bez pary. Popraw to w sekcji Załączniki w Ustawieniach."
+
+msgid "Couldn't upload the file. The attachment folder uses {filenameVariable} more than once in one folder name. Fix it under Attachments in Settings."
+msgstr "Nie udało się przesłać pliku. Folder załączników używa {filenameVariable} więcej niż raz w jednej nazwie folderu. Popraw to w sekcji Załączniki w Ustawieniach."
+
+msgid "Couldn't upload the file. The attachment folder uses the unknown variable {variables}. Fix it under Attachments in Settings."
+msgstr "Nie udało się przesłać pliku. Folder załączników używa nieznanej zmiennej {variables}. Popraw to w sekcji Załączniki w Ustawieniach."
+
msgid "Couldn't verify that {displayName} ({bin}) is available, so this is a plain shell. You can still run {bin} yourself."
msgstr "Nie udało się potwierdzić, że {displayName} ({bin}) jest dostępne, więc to zwykła powłoka. Nadal możesz uruchomić {bin} samodzielnie."
@@ -3487,9 +3499,6 @@ msgstr "Data"
msgid "Default"
msgstr "Domyślny"
-msgid "Default location for new attachments"
-msgstr "Domyślna lokalizacja nowych załączników"
-
msgid "Default properties"
msgstr "Domyślne właściwości"
@@ -3895,9 +3904,6 @@ msgstr "Zduplikowano do \"{0}\""
msgid "Duplicates dropped"
msgstr "Duplikaty odrzucone"
-msgid "e.g. assets/uploads"
-msgstr "np. assets/uploads"
-
msgid "e.g. drafts/ or *.draft.md"
msgstr "np. drafts/ lub *.draft.md"
@@ -3910,6 +3916,9 @@ msgstr "np. Przełączanie projektów podczas trwającej synchronizacji"
msgid "e.g. The editor froze after I pasted a large table"
msgstr "np. Edytor zawiesił się po wklejeniu dużej tabeli"
+msgid "Each {open} needs a matching {close}."
+msgstr "Każde {open} wymaga pasującego {close}."
+
#. Says what symlinking two skill folders together buys the user, before any button names it
msgid "Each AI tool reads skills from its own folder. Point one folder at another and both tools see the same skills — add a skill once instead of copying it into every tool."
msgstr "Każde narzędzie AI czyta umiejętności z własnego folderu. Skieruj jeden folder na drugi, a oba narzędzia zobaczą te same umiejętności — dodaj umiejętność raz, zamiast kopiować ją do każdego narzędzia."
@@ -4267,6 +4276,9 @@ msgstr "wszystko w folderach {0}/ wewnątrz {1}/"
msgid "everything under any {0}/ folder"
msgstr "wszystko w dowolnym folderze {0}/"
+msgid "Example: a file added to <0>{exampleDoc}</0> is saved as <1>{exampleFile}</1>"
+msgstr "Przykład: plik dodany do <0>{exampleDoc}</0> zostanie zapisany jako <1>{exampleFile}</1>"
+
msgid "Excalidraw board"
msgstr "Tablica Excalidraw"
@@ -4751,9 +4763,6 @@ msgstr "Stały"
msgid "Fixed {total, plural, one {# file} other {# files}}."
msgstr "Naprawiono {total, plural, one {# plik} few {# pliki} many {# plików} other {# pliku}}."
-msgid "Fixed folder in content root"
-msgstr "Stały folder w katalogu głównym treści"
-
msgid "Fixed port number"
msgstr "Stały numer portu"
@@ -4790,6 +4799,12 @@ msgstr "Nazwa folderu"
msgid "Folder name: {detail}"
msgstr "Nazwa folderu: {detail}"
+msgid "Folder names cannot contain {reserved}."
+msgstr "Nazwy folderów nie mogą zawierać {reserved}."
+
+msgid "Folder path must start with {documentPrefix} or {rootPrefix} and cannot contain {parentFolder}"
+msgstr "Ścieżka folderu musi zaczynać się od {documentPrefix} lub {rootPrefix} i nie może zawierać {parentFolder}"
+
msgid "Folder properties"
msgstr "Właściwości folderu"
@@ -8589,6 +8604,12 @@ msgstr "Usuń zaznaczenie"
msgid "Remove the parent <0>.git</0> folder"
msgstr "Usuń nadrzędny folder <0>.git</0>"
+msgid "Remove the slash at the end of the path."
+msgstr "Usuń ukośnik na końcu ścieżki."
+
+msgid "Remove the spaces at the start or end of the path."
+msgstr "Usuń spacje na początku lub na końcu ścieżki."
+
msgid "Removed"
msgstr "Usunięto"
@@ -9019,9 +9040,6 @@ msgstr "Audyt projektu w toku"
msgid "Runs a shell command"
msgstr "Uruchamia polecenie powłoki"
-msgid "Same folder as current file"
-msgstr "Ten sam folder, co bieżący plik"
-
msgid "Sample image"
msgstr "Obraz przykładowy"
@@ -9463,8 +9481,8 @@ msgstr "Konfiguruj integracje OpenKnowledge…"
msgid "Set up syncing"
msgstr "Skonfiguruj synchronizację"
-msgid "Set where pasted and dropped files are stored for this project."
-msgstr "Ustaw, gdzie przechowywane są wklejone i upuszczane pliki w tym projekcie."
+msgid "Set where pasted and dropped files are stored."
+msgstr "Ustaw, gdzie przechowywane są wklejone i upuszczane pliki."
msgid "Setting up"
msgstr "Konfigurowanie"
@@ -10115,9 +10133,6 @@ msgstr "podagenty"
msgid "Subfolder name"
msgstr "Nazwa podfolderu"
-msgid "Subfolder under current folder"
-msgstr "Podfolder w bieżącym folderze"
-
msgid "Subscribe"
msgstr "Subskrybuj"
@@ -11530,6 +11545,9 @@ msgstr "Nieznana data"
msgid "Unknown error"
msgstr "Nieznany błąd"
+msgid "Unknown variable {unknownList}. Available variables: {supportedVariables}."
+msgstr "Nieznana zmienna {unknownList}. Dostępne zmienne: {supportedVariables}."
+
msgid "unlink"
msgstr "odłącz"
@@ -11699,6 +11717,9 @@ msgstr "Użyj {0} dla aktywnego trybu jasnego"
msgid "Use {editor} version"
msgstr "Użyj wersji {editor}"
+msgid "Use {filenameVariable} at most once in each folder name."
+msgstr "Używaj {filenameVariable} najwyżej raz w każdej nazwie folderu."
+
msgid "Use <0>{copyShortcut}</0> to copy the link below, or open OK in the desktop app."
msgstr "Użyj <0>{copyShortcut}</0>, aby skopiować poniższy link, lub otwórz OK w aplikacji desktopowej."
@@ -11738,6 +11759,9 @@ msgstr "Używaj wyłącznie małych liter, cyfr oraz <0>-</0>."
msgid "Use lowercase letters, numbers, and hyphens only"
msgstr "Używaj wyłącznie małych liter, cyfr i myślników"
+msgid "Use one slash between folder names."
+msgstr "Między nazwami folderów użyj jednego ukośnika."
+
msgid "Use their version"
msgstr "Użyj ich wersji"
@@ -11965,9 +11989,6 @@ msgstr "Instalując opublikowaną umiejętność, powiadom katalog umiejętnośc
msgid "Where"
msgstr "Gdzie"
-msgid "Where newly added attachments are placed."
-msgstr "Gdzie umieszczane są nowo dodane załączniki."
-
msgid "Where should it live?"
msgstr "Gdzie ma się znajdować?"
diff --git a/packages/app/src/locales/pt-BR/messages.po b/packages/app/src/locales/pt-BR/messages.po
index fc99c30a5..56302a140 100644
--- a/packages/app/src/locales/pt-BR/messages.po
+++ b/packages/app/src/locales/pt-BR/messages.po
@@ -1080,6 +1080,9 @@ msgstr "Um título, uma descrição, tags — qualquer coisa que descreva esta p
msgid "A token added here only applies to HTTPS remotes, and this project's remote doesn't use HTTPS."
msgstr "Um token adicionado aqui só se aplica a remotos HTTPS, e o remoto deste projeto não usa HTTPS."
+msgid "A variable needs two braces on each side, such as {filenameVariable}."
+msgstr "Uma variável precisa de duas chaves de cada lado, como {filenameVariable}."
+
msgid "A worktree folder for {shareBranch} already exists."
msgstr "Já existe uma pasta de worktree para {shareBranch}."
@@ -2667,9 +2670,6 @@ msgstr "Diretório de conteúdo"
msgid "Content directory must be inside the project"
msgstr "O diretório de conteúdo precisa ficar dentro do projeto"
-msgid "Content root"
-msgstr "Raiz do conteúdo"
-
msgid "Content rules"
msgstr "Regras de conteúdo"
@@ -3303,6 +3303,18 @@ msgstr "Não deu para atualizar {subRoot}: {0}"
msgid "Couldn't update from {0}: {1}"
msgstr "Não foi possível atualizar de {0}: {1}"
+msgid "Couldn't upload the file. The {settingKey} value in {configFile} can't be used. Fix it in that file."
+msgstr "Não foi possível enviar o arquivo. O valor de {settingKey} em {configFile} não pode ser usado. Corrija nesse arquivo."
+
+msgid "Couldn't upload the file. The attachment folder has a {open} or {close} without its pair. Fix it under Attachments in Settings."
+msgstr "Não foi possível enviar o arquivo. A pasta de anexos tem um {open} ou {close} sem o par. Corrija em Anexos, nas Configurações."
+
+msgid "Couldn't upload the file. The attachment folder uses {filenameVariable} more than once in one folder name. Fix it under Attachments in Settings."
+msgstr "Não foi possível enviar o arquivo. A pasta de anexos usa {filenameVariable} mais de uma vez em um nome de pasta. Corrija em Anexos, nas Configurações."
+
+msgid "Couldn't upload the file. The attachment folder uses the unknown variable {variables}. Fix it under Attachments in Settings."
+msgstr "Não foi possível enviar o arquivo. A pasta de anexos usa a variável desconhecida {variables}. Corrija em Anexos, nas Configurações."
+
msgid "Couldn't verify that {displayName} ({bin}) is available, so this is a plain shell. You can still run {bin} yourself."
msgstr "Não foi possível verificar se {displayName} ({bin}) está disponível, então este é um shell comum. Você ainda pode executar {bin} por conta própria."
@@ -3483,9 +3495,6 @@ msgstr "Data"
msgid "Default"
msgstr "Padrao"
-msgid "Default location for new attachments"
-msgstr "Local padrão para novos anexos"
-
msgid "Default properties"
msgstr "Propriedades padrão"
@@ -3891,9 +3900,6 @@ msgstr "Duplicado em \"{0}\""
msgid "Duplicates dropped"
msgstr "Duplicatas descartadas"
-msgid "e.g. assets/uploads"
-msgstr "ex.: assets/uploads"
-
msgid "e.g. drafts/ or *.draft.md"
msgstr "ex.: drafts/ ou *.draft.md"
@@ -3906,6 +3912,9 @@ msgstr "ex.: Trocar de projeto enquanto uma sincronização rodava"
msgid "e.g. The editor froze after I pasted a large table"
msgstr "ex.: O editor travou depois que colei uma tabela grande"
+msgid "Each {open} needs a matching {close}."
+msgstr "Cada {open} precisa de um {close} correspondente."
+
#. Says what symlinking two skill folders together buys the user, before any button names it
msgid "Each AI tool reads skills from its own folder. Point one folder at another and both tools see the same skills — add a skill once instead of copying it into every tool."
msgstr "Cada ferramenta de IA lê as habilidades da sua própria pasta. Aponte uma pasta para outra e as duas ferramentas verão as mesmas habilidades: adicione uma habilidade uma vez em vez de copiá-la para cada ferramenta."
@@ -4263,6 +4272,9 @@ msgstr "tudo dentro das pastas {0}/ que estão em {1}/"
msgid "everything under any {0}/ folder"
msgstr "tudo dentro de qualquer pasta {0}/"
+msgid "Example: a file added to <0>{exampleDoc}</0> is saved as <1>{exampleFile}</1>"
+msgstr "Exemplo: um arquivo adicionado a <0>{exampleDoc}</0> é salvo em <1>{exampleFile}</1>"
+
msgid "Excalidraw board"
msgstr "Quadro do Excalidraw"
@@ -4747,9 +4759,6 @@ msgstr "Fixa"
msgid "Fixed {total, plural, one {# file} other {# files}}."
msgstr "{total, plural, one {# arquivo corrigido} many {# arquivos corrigidos} other {# arquivos corrigidos}}."
-msgid "Fixed folder in content root"
-msgstr "Pasta fixa na raiz do conteúdo"
-
msgid "Fixed port number"
msgstr "Número de porta fixa"
@@ -4786,6 +4795,12 @@ msgstr "Nome da pasta"
msgid "Folder name: {detail}"
msgstr "Nome da pasta: {detail}"
+msgid "Folder names cannot contain {reserved}."
+msgstr "Nomes de pasta não podem conter {reserved}."
+
+msgid "Folder path must start with {documentPrefix} or {rootPrefix} and cannot contain {parentFolder}"
+msgstr "O caminho da pasta deve começar com {documentPrefix} ou {rootPrefix} e não pode conter {parentFolder}"
+
msgid "Folder properties"
msgstr "Propriedades da pasta"
@@ -8585,6 +8600,12 @@ msgstr "Remover a seleção"
msgid "Remove the parent <0>.git</0> folder"
msgstr "Excluir a pasta <0>.git</0> acima"
+msgid "Remove the slash at the end of the path."
+msgstr "Remova a barra no fim do caminho."
+
+msgid "Remove the spaces at the start or end of the path."
+msgstr "Remova os espaços no início ou no fim do caminho."
+
msgid "Removed"
msgstr "Removido"
@@ -9015,9 +9036,6 @@ msgstr "Rodando a auditoria do projeto"
msgid "Runs a shell command"
msgstr "Executa um comando de shell"
-msgid "Same folder as current file"
-msgstr "Mesma pasta do arquivo atual"
-
msgid "Sample image"
msgstr "Imagem de exemplo"
@@ -9459,8 +9477,8 @@ msgstr "Configurar as integrações do OpenKnowledge…"
msgid "Set up syncing"
msgstr "Configurar a sincronização"
-msgid "Set where pasted and dropped files are stored for this project."
-msgstr "Defina onde os arquivos colados e soltos ficam guardados neste projeto."
+msgid "Set where pasted and dropped files are stored."
+msgstr "Defina onde os arquivos colados e soltos ficam guardados."
msgid "Setting up"
msgstr "Configurando"
@@ -10111,9 +10129,6 @@ msgstr "subagentes"
msgid "Subfolder name"
msgstr "Nome da subpasta"
-msgid "Subfolder under current folder"
-msgstr "Subpasta dentro da pasta atual"
-
msgid "Subscribe"
msgstr "Assinar"
@@ -11526,6 +11541,9 @@ msgstr "Data desconhecida"
msgid "Unknown error"
msgstr "Erro desconhecido"
+msgid "Unknown variable {unknownList}. Available variables: {supportedVariables}."
+msgstr "Variável desconhecida {unknownList}. Variáveis disponíveis: {supportedVariables}."
+
msgid "unlink"
msgstr "desvincular"
@@ -11695,6 +11713,9 @@ msgstr "Usar {0} no modo claro ativo"
msgid "Use {editor} version"
msgstr "Usar a versão do {editor}"
+msgid "Use {filenameVariable} at most once in each folder name."
+msgstr "Use {filenameVariable} no máximo uma vez em cada nome de pasta."
+
msgid "Use <0>{copyShortcut}</0> to copy the link below, or open OK in the desktop app."
msgstr "Use <0>{copyShortcut}</0> para copiar o link abaixo, ou abra o OK no app de desktop."
@@ -11734,6 +11755,9 @@ msgstr "Use apenas letras minúsculas, dígitos e <0>-</0>."
msgid "Use lowercase letters, numbers, and hyphens only"
msgstr "Use apenas letras minúsculas, números e hifens"
+msgid "Use one slash between folder names."
+msgstr "Use uma única barra entre os nomes de pasta."
+
msgid "Use their version"
msgstr "Usar a versão deles"
@@ -11961,9 +11985,6 @@ msgstr "Quando você instala uma habilidade publicada, o diretório de habilidad
msgid "Where"
msgstr "Onde"
-msgid "Where newly added attachments are placed."
-msgstr "Onde os anexos recém-adicionados são colocados."
-
msgid "Where should it live?"
msgstr "Onde ela deve ficar?"
diff --git a/packages/app/src/locales/ur/messages.po b/packages/app/src/locales/ur/messages.po
index 7b9be9a6e..a1927d492 100644
--- a/packages/app/src/locales/ur/messages.po
+++ b/packages/app/src/locales/ur/messages.po
@@ -1084,6 +1084,9 @@ msgstr "عنوان، تفصیل، ٹیگز — کوئی بھی چیز جو اس
msgid "A token added here only applies to HTTPS remotes, and this project's remote doesn't use HTTPS."
msgstr "یہاں شامل کیا گیا ٹوکن صرف HTTPS ریموٹس پر لاگو ہوتا ہے، اور اس پروجیکٹ کا ریموٹ HTTPS استعمال نہیں کرتا۔"
+msgid "A variable needs two braces on each side, such as {filenameVariable}."
+msgstr "متغیر کے ہر طرف دو قوسین درکار ہیں، جیسے {filenameVariable}۔"
+
msgid "A worktree folder for {shareBranch} already exists."
msgstr "{shareBranch} کے لیے ورک ٹری فولڈر پہلے سے موجود ہے۔"
@@ -2671,9 +2674,6 @@ msgstr "مواد کی ڈائریکٹری"
msgid "Content directory must be inside the project"
msgstr "مواد کی ڈائریکٹری پروجیکٹ کے اندر ہونی چاہیے"
-msgid "Content root"
-msgstr "مواد کی جڑ"
-
msgid "Content rules"
msgstr "مواد کے قواعد"
@@ -3307,6 +3307,18 @@ msgstr "{subRoot} تازہ نہیں ہو سکا: {0}"
msgid "Couldn't update from {0}: {1}"
msgstr "{0} سے اپ ڈیٹ نہیں ہو سکا: {1}"
+msgid "Couldn't upload the file. The {settingKey} value in {configFile} can't be used. Fix it in that file."
+msgstr "فائل اپ لوڈ نہیں ہو سکی۔ {configFile} میں {settingKey} کی قدر استعمال نہیں ہو سکتی۔ اسے اسی فائل میں درست کریں۔"
+
+msgid "Couldn't upload the file. The attachment folder has a {open} or {close} without its pair. Fix it under Attachments in Settings."
+msgstr "فائل اپ لوڈ نہیں ہو سکی۔ منسلکات کے فولڈر میں جوڑے کے بغیر {open} یا {close} ہے۔ اسے ترتیبات میں منسلکات کے تحت درست کریں۔"
+
+msgid "Couldn't upload the file. The attachment folder uses {filenameVariable} more than once in one folder name. Fix it under Attachments in Settings."
+msgstr "فائل اپ لوڈ نہیں ہو سکی۔ منسلکات کا فولڈر ایک فولڈر کے نام میں {filenameVariable} ایک سے زیادہ بار استعمال کرتا ہے۔ اسے ترتیبات میں منسلکات کے تحت درست کریں۔"
+
+msgid "Couldn't upload the file. The attachment folder uses the unknown variable {variables}. Fix it under Attachments in Settings."
+msgstr "فائل اپ لوڈ نہیں ہو سکی۔ منسلکات کا فولڈر نامعلوم متغیر {variables} استعمال کرتا ہے۔ اسے ترتیبات میں منسلکات کے تحت درست کریں۔"
+
msgid "Couldn't verify that {displayName} ({bin}) is available, so this is a plain shell. You can still run {bin} yourself."
msgstr "تصدیق نہیں ہو سکی کہ {displayName} ({bin}) دستیاب ہے، اس لیے یہ ایک سادہ شیل ہے۔ آپ پھر بھی خود {bin} چلا سکتے ہیں۔"
@@ -3487,9 +3499,6 @@ msgstr "تاریخ"
msgid "Default"
msgstr "ڈیفالٹ"
-msgid "Default location for new attachments"
-msgstr "نئے منسلکات کے لیے طے شدہ مقام"
-
msgid "Default properties"
msgstr "طے شدہ خصوصیات"
@@ -3895,9 +3904,6 @@ msgstr "«{0}» پر نقل بن گئی"
msgid "Duplicates dropped"
msgstr "نقول ہٹا دی گئیں"
-msgid "e.g. assets/uploads"
-msgstr "مثلاً assets/uploads"
-
msgid "e.g. drafts/ or *.draft.md"
msgstr "مثلاً drafts/ یا *.draft.md"
@@ -3910,6 +3916,9 @@ msgstr "مثلاً مطابقت پذیری کے دوران پروجیکٹ بدل
msgid "e.g. The editor froze after I pasted a large table"
msgstr "مثلاً بڑا ٹیبل چسپاں کرنے کے بعد ایڈیٹر جم گیا"
+msgid "Each {open} needs a matching {close}."
+msgstr "ہر {open} کے لیے مماثل {close} ضروری ہے۔"
+
#. Says what symlinking two skill folders together buys the user, before any button names it
msgid "Each AI tool reads skills from its own folder. Point one folder at another and both tools see the same skills — add a skill once instead of copying it into every tool."
msgstr "ہر AI ٹول مہارتیں اپنے فولڈر سے پڑھتا ہے۔ ایک فولڈر کو دوسرے کی طرف اشارہ کریں تو دونوں ٹولز ایک ہی مہارتیں دیکھیں گے — ہر ٹول میں نقل کرنے کے بجائے مہارت ایک بار شامل کریں۔"
@@ -4267,6 +4276,9 @@ msgstr "{1}/ کے اندر {0}/ فولڈرز کے تحت سب کچھ"
msgid "everything under any {0}/ folder"
msgstr "کسی بھی {0}/ فولڈر کے تحت سب کچھ"
+msgid "Example: a file added to <0>{exampleDoc}</0> is saved as <1>{exampleFile}</1>"
+msgstr "مثال: <0>{exampleDoc}</0> میں شامل کی گئی فائل <1>{exampleFile}</1> میں محفوظ ہوتی ہے"
+
msgid "Excalidraw board"
msgstr "Excalidraw بورڈ"
@@ -4751,9 +4763,6 @@ msgstr "مقررہ"
msgid "Fixed {total, plural, one {# file} other {# files}}."
msgstr "{total, plural, one {# فائل درست کی گئی} other {# فائلیں درست کی گئیں}}۔"
-msgid "Fixed folder in content root"
-msgstr "مواد کی جڑ میں مقررہ فولڈر"
-
msgid "Fixed port number"
msgstr "مقررہ پورٹ نمبر"
@@ -4790,6 +4799,12 @@ msgstr "فولڈر کا نام"
msgid "Folder name: {detail}"
msgstr "فولڈر کا نام: {detail}"
+msgid "Folder names cannot contain {reserved}."
+msgstr "فولڈر کے ناموں میں {reserved} نہیں ہو سکتے۔"
+
+msgid "Folder path must start with {documentPrefix} or {rootPrefix} and cannot contain {parentFolder}"
+msgstr "فولڈر کا راستہ {documentPrefix} یا {rootPrefix} سے شروع ہونا چاہیے اور اس میں {parentFolder} نہیں ہو سکتا۔"
+
msgid "Folder properties"
msgstr "فولڈر کی خصوصیات"
@@ -8589,6 +8604,12 @@ msgstr "انتخاب ہٹائیں"
msgid "Remove the parent <0>.git</0> folder"
msgstr "والد <0>.git</0> فولڈر ہٹائیں"
+msgid "Remove the slash at the end of the path."
+msgstr "راستے کے آخر سے سلیش ہٹا دیں۔"
+
+msgid "Remove the spaces at the start or end of the path."
+msgstr "راستے کے شروع یا آخر کی خالی جگہیں ہٹا دیں۔"
+
msgid "Removed"
msgstr "ہٹا دیا گیا"
@@ -9019,9 +9040,6 @@ msgstr "پروجیکٹ کا آڈٹ چل رہا ہے"
msgid "Runs a shell command"
msgstr "ایک شیل کمانڈ چلاتا ہے"
-msgid "Same folder as current file"
-msgstr "موجودہ فائل والا ہی فولڈر"
-
msgid "Sample image"
msgstr "نمونہ تصویر"
@@ -9463,8 +9481,8 @@ msgstr "OpenKnowledge کے انضمامات ترتیب دیں…"
msgid "Set up syncing"
msgstr "مطابقت پذیری ترتیب دیں"
-msgid "Set where pasted and dropped files are stored for this project."
-msgstr "مقرر کریں کہ اس پروجیکٹ کے لیے چسپاں اور چھوڑی گئی فائلیں کہاں محفوظ ہوں۔"
+msgid "Set where pasted and dropped files are stored."
+msgstr "مقرر کریں کہ چسپاں اور چھوڑی گئی فائلیں کہاں محفوظ ہوں۔"
msgid "Setting up"
msgstr "ترتیب دیا جا رہا ہے"
@@ -10115,9 +10133,6 @@ msgstr "subagents"
msgid "Subfolder name"
msgstr "ذیلی فولڈر کا نام"
-msgid "Subfolder under current folder"
-msgstr "موجودہ فولڈر کے تحت ذیلی فولڈر"
-
msgid "Subscribe"
msgstr "رکن بنیں"
@@ -11530,6 +11545,9 @@ msgstr "نامعلوم تاریخ"
msgid "Unknown error"
msgstr "نامعلوم خرابی"
+msgid "Unknown variable {unknownList}. Available variables: {supportedVariables}."
+msgstr "نامعلوم متغیر {unknownList}۔ دستیاب متغیرات: {supportedVariables}۔"
+
msgid "unlink"
msgstr "لنک ختم کریں"
@@ -11699,6 +11717,9 @@ msgstr "فعال روشن موڈ کے لیے {0} استعمال کریں"
msgid "Use {editor} version"
msgstr "{editor} والا ورژن استعمال کریں"
+msgid "Use {filenameVariable} at most once in each folder name."
+msgstr "ہر فولڈر کے نام میں {filenameVariable} زیادہ سے زیادہ ایک بار استعمال کریں۔"
+
msgid "Use <0>{copyShortcut}</0> to copy the link below, or open OK in the desktop app."
msgstr "نیچے دیا گیا لنک نقل کرنے کے لیے <0>{copyShortcut}</0> استعمال کریں، یا OK کو ڈیسک ٹاپ ایپ میں کھولیں۔"
@@ -11738,6 +11759,9 @@ msgstr "صرف چھوٹے حروف، ہندسے اور <0>-</0> استعمال
msgid "Use lowercase letters, numbers, and hyphens only"
msgstr "صرف چھوٹے حروف، اعداد اور ڈیش استعمال کریں"
+msgid "Use one slash between folder names."
+msgstr "فولڈر کے ناموں کے درمیان ایک سلیش استعمال کریں۔"
+
msgid "Use their version"
msgstr "ان کا ورژن لیں"
@@ -11965,9 +11989,6 @@ msgstr "جب آپ کوئی شائع شدہ مہارت نصب کریں تو مہ
msgid "Where"
msgstr "کہاں"
-msgid "Where newly added attachments are placed."
-msgstr "نئے شامل ہونے والے منسلکات کہاں رکھے جاتے ہیں۔"
-
msgid "Where should it live?"
msgstr "یہ کہاں رہنا چاہیے؟"
diff --git a/packages/app/src/locales/zh-Hans/messages.po b/packages/app/src/locales/zh-Hans/messages.po
index 436f9b8d4..cdea9f1b2 100644
--- a/packages/app/src/locales/zh-Hans/messages.po
+++ b/packages/app/src/locales/zh-Hans/messages.po
@@ -1084,6 +1084,9 @@ msgstr "标题、描述、标签——任何能描述这个文件夹的信息。
msgid "A token added here only applies to HTTPS remotes, and this project's remote doesn't use HTTPS."
msgstr "在此添加的令牌只适用于 HTTPS 远程仓库,而此项目的远程仓库不使用 HTTPS。"
+msgid "A variable needs two braces on each side, such as {filenameVariable}."
+msgstr "变量两侧各需要两个花括号,例如 {filenameVariable}。"
+
msgid "A worktree folder for {shareBranch} already exists."
msgstr "{shareBranch} 的 worktree 文件夹已存在。"
@@ -2671,9 +2674,6 @@ msgstr "内容目录"
msgid "Content directory must be inside the project"
msgstr "内容目录必须位于项目内部"
-msgid "Content root"
-msgstr "内容根目录"
-
msgid "Content rules"
msgstr "内容规则"
@@ -3307,6 +3307,18 @@ msgstr "无法更新 {subRoot}:{0}"
msgid "Couldn't update from {0}: {1}"
msgstr "无法从 {0} 更新:{1}"
+msgid "Couldn't upload the file. The {settingKey} value in {configFile} can't be used. Fix it in that file."
+msgstr "无法上传文件。{configFile} 中的 {settingKey} 值无法使用。请在该文件中修正。"
+
+msgid "Couldn't upload the file. The attachment folder has a {open} or {close} without its pair. Fix it under Attachments in Settings."
+msgstr "无法上传文件。附件文件夹中有未成对的 {open} 或 {close}。请在设置的“附件”中修正。"
+
+msgid "Couldn't upload the file. The attachment folder uses {filenameVariable} more than once in one folder name. Fix it under Attachments in Settings."
+msgstr "无法上传文件。附件文件夹的同一个文件夹名称中多次使用了 {filenameVariable}。请在设置的“附件”中修正。"
+
+msgid "Couldn't upload the file. The attachment folder uses the unknown variable {variables}. Fix it under Attachments in Settings."
+msgstr "无法上传文件。附件文件夹使用了未知变量 {variables}。请在设置的“附件”中修正。"
+
msgid "Couldn't verify that {displayName} ({bin}) is available, so this is a plain shell. You can still run {bin} yourself."
msgstr "无法确认 {displayName}({bin})是否可用,因此这是一个普通 shell。你仍然可以自行运行 {bin}。"
@@ -3487,9 +3499,6 @@ msgstr "日期"
msgid "Default"
msgstr "默认"
-msgid "Default location for new attachments"
-msgstr "新附件的默认位置"
-
msgid "Default properties"
msgstr "默认属性"
@@ -3895,9 +3904,6 @@ msgstr "已创建副本 \"{0}\""
msgid "Duplicates dropped"
msgstr "丢弃重复项"
-msgid "e.g. assets/uploads"
-msgstr "例如 assets/uploads"
-
msgid "e.g. drafts/ or *.draft.md"
msgstr "例如 drafts/ 或 *.draft.md"
@@ -3910,6 +3916,9 @@ msgstr "例如:同步过程中切换了项目"
msgid "e.g. The editor froze after I pasted a large table"
msgstr "例如:粘贴一个很大的表格后编辑器卡住了"
+msgid "Each {open} needs a matching {close}."
+msgstr "每个 {open} 都需要一个对应的 {close}。"
+
#. Says what symlinking two skill folders together buys the user, before any button names it
msgid "Each AI tool reads skills from its own folder. Point one folder at another and both tools see the same skills — add a skill once instead of copying it into every tool."
msgstr "每个 AI 工具都从各自的文件夹读取技能。将一个文件夹指向另一个,两个工具就会看到相同的技能——只需添加一次技能,而不必复制到每个工具。"
@@ -4267,6 +4276,9 @@ msgstr "{1}/ 中各个 {0}/ 文件夹下的所有内容"
msgid "everything under any {0}/ folder"
msgstr "任意 {0}/ 文件夹下的所有内容"
+msgid "Example: a file added to <0>{exampleDoc}</0> is saved as <1>{exampleFile}</1>"
+msgstr "示例:添加到 <0>{exampleDoc}</0> 的文件将保存为 <1>{exampleFile}</1>"
+
msgid "Excalidraw board"
msgstr "Excalidraw 画板"
@@ -4751,9 +4763,6 @@ msgstr "固定"
msgid "Fixed {total, plural, one {# file} other {# files}}."
msgstr "{total, plural, other {已修复 # 个文件}}。"
-msgid "Fixed folder in content root"
-msgstr "内容根目录中的固定文件夹"
-
msgid "Fixed port number"
msgstr "固定端口号"
@@ -4790,6 +4799,12 @@ msgstr "文件夹名"
msgid "Folder name: {detail}"
msgstr "文件夹名:{detail}"
+msgid "Folder names cannot contain {reserved}."
+msgstr "文件夹名称不能包含 {reserved}。"
+
+msgid "Folder path must start with {documentPrefix} or {rootPrefix} and cannot contain {parentFolder}"
+msgstr "文件夹路径必须以 {documentPrefix} 或 {rootPrefix} 开头,且不能包含 {parentFolder}。"
+
msgid "Folder properties"
msgstr "文件夹属性"
@@ -8589,6 +8604,12 @@ msgstr "移除选区"
msgid "Remove the parent <0>.git</0> folder"
msgstr "删除上层的 <0>.git</0> 文件夹"
+msgid "Remove the slash at the end of the path."
+msgstr "删除路径末尾的斜杠。"
+
+msgid "Remove the spaces at the start or end of the path."
+msgstr "删除路径开头或结尾的空格。"
+
msgid "Removed"
msgstr "已移除"
@@ -9019,9 +9040,6 @@ msgstr "正在运行项目审查"
msgid "Runs a shell command"
msgstr "运行 shell 命令"
-msgid "Same folder as current file"
-msgstr "与当前文件相同的文件夹"
-
msgid "Sample image"
msgstr "示例图片"
@@ -9463,8 +9481,8 @@ msgstr "设置 OpenKnowledge 集成…"
msgid "Set up syncing"
msgstr "设置同步"
-msgid "Set where pasted and dropped files are stored for this project."
-msgstr "设置这个项目中粘贴和拖入的文件保存在哪里。"
+msgid "Set where pasted and dropped files are stored."
+msgstr "设置粘贴和拖入的文件保存在哪里。"
msgid "Setting up"
msgstr "正在设置"
@@ -10115,9 +10133,6 @@ msgstr "子智能体"
msgid "Subfolder name"
msgstr "子文件夹名"
-msgid "Subfolder under current folder"
-msgstr "当前文件夹下的子文件夹"
-
msgid "Subscribe"
msgstr "订阅"
@@ -11530,6 +11545,9 @@ msgstr "日期未知"
msgid "Unknown error"
msgstr "未知错误"
+msgid "Unknown variable {unknownList}. Available variables: {supportedVariables}."
+msgstr "未知变量 {unknownList}。可用变量:{supportedVariables}。"
+
msgid "unlink"
msgstr "取消链接"
@@ -11699,6 +11717,9 @@ msgstr "将 {0} 用于当前的浅色模式"
msgid "Use {editor} version"
msgstr "使用 {editor} 的版本"
+msgid "Use {filenameVariable} at most once in each folder name."
+msgstr "每个文件夹名称中最多使用一次 {filenameVariable}。"
+
msgid "Use <0>{copyShortcut}</0> to copy the link below, or open OK in the desktop app."
msgstr "用 <0>{copyShortcut}</0> 复制下方的链接,或者在桌面应用中打开 OK。"
@@ -11738,6 +11759,9 @@ msgstr "只能使用小写字母、数字和 <0>-</0>。"
msgid "Use lowercase letters, numbers, and hyphens only"
msgstr "只能使用小写字母、数字和连字符"
+msgid "Use one slash between folder names."
+msgstr "文件夹名称之间只用一个斜杠。"
+
msgid "Use their version"
msgstr "使用对方的版本"
@@ -11965,9 +11989,6 @@ msgstr "当你安装一个已发布的技能时,会告知技能目录(skills
msgid "Where"
msgstr "位置"
-msgid "Where newly added attachments are placed."
-msgstr "新添加的附件放在哪里。"
-
msgid "Where should it live?"
msgstr "它应该保存在哪里?"
diff --git a/packages/app/src/locales/zh-Hant/messages.po b/packages/app/src/locales/zh-Hant/messages.po
index 3726b1985..817e3034b 100644
--- a/packages/app/src/locales/zh-Hant/messages.po
+++ b/packages/app/src/locales/zh-Hant/messages.po
@@ -1084,6 +1084,9 @@ msgstr "標題、描述、標籤——任何能描述這個資料夾的資訊。
msgid "A token added here only applies to HTTPS remotes, and this project's remote doesn't use HTTPS."
msgstr "在此新增的權杖只適用於 HTTPS 遠端儲存庫,而此專案的遠端儲存庫不使用 HTTPS。"
+msgid "A variable needs two braces on each side, such as {filenameVariable}."
+msgstr "變數兩側各需要兩個大括號,例如 {filenameVariable}。"
+
msgid "A worktree folder for {shareBranch} already exists."
msgstr "{shareBranch} 的 worktree 資料夾已存在。"
@@ -2671,9 +2674,6 @@ msgstr "內容目錄"
msgid "Content directory must be inside the project"
msgstr "內容目錄必須在專案裡面"
-msgid "Content root"
-msgstr "內容根目錄"
-
msgid "Content rules"
msgstr "內容規則"
@@ -3307,6 +3307,18 @@ msgstr "無法更新 {subRoot}:{0}"
msgid "Couldn't update from {0}: {1}"
msgstr "無法從 {0} 更新:{1}"
+msgid "Couldn't upload the file. The {settingKey} value in {configFile} can't be used. Fix it in that file."
+msgstr "無法上傳檔案。{configFile} 中的 {settingKey} 值無法使用。請在該檔案中修正。"
+
+msgid "Couldn't upload the file. The attachment folder has a {open} or {close} without its pair. Fix it under Attachments in Settings."
+msgstr "無法上傳檔案。附件資料夾中有未成對的 {open} 或 {close}。請在設定的「附件」中修正。"
+
+msgid "Couldn't upload the file. The attachment folder uses {filenameVariable} more than once in one folder name. Fix it under Attachments in Settings."
+msgstr "無法上傳檔案。附件資料夾的同一個資料夾名稱中多次使用了 {filenameVariable}。請在設定的「附件」中修正。"
+
+msgid "Couldn't upload the file. The attachment folder uses the unknown variable {variables}. Fix it under Attachments in Settings."
+msgstr "無法上傳檔案。附件資料夾使用了未知變數 {variables}。請在設定的「附件」中修正。"
+
msgid "Couldn't verify that {displayName} ({bin}) is available, so this is a plain shell. You can still run {bin} yourself."
msgstr "無法確認 {displayName}({bin})是否可用,因此這是一個一般 shell。你仍然可以自行執行 {bin}。"
@@ -3487,9 +3499,6 @@ msgstr "日期"
msgid "Default"
msgstr "預設"
-msgid "Default location for new attachments"
-msgstr "新附件的預設位置"
-
msgid "Default properties"
msgstr "預設屬性"
@@ -3895,9 +3904,6 @@ msgstr "已建立副本「{0}」"
msgid "Duplicates dropped"
msgstr "捨棄重複項"
-msgid "e.g. assets/uploads"
-msgstr "例如 assets/uploads"
-
msgid "e.g. drafts/ or *.draft.md"
msgstr "例如 drafts/ 或 *.draft.md"
@@ -3910,6 +3916,9 @@ msgstr "例如:同步進行到一半時切換了專案"
msgid "e.g. The editor froze after I pasted a large table"
msgstr "例如:貼上一個很大的表格之後編輯器卡住了"
+msgid "Each {open} needs a matching {close}."
+msgstr "每個 {open} 都需要一個對應的 {close}。"
+
#. Says what symlinking two skill folders together buys the user, before any button names it
msgid "Each AI tool reads skills from its own folder. Point one folder at another and both tools see the same skills — add a skill once instead of copying it into every tool."
msgstr "每個 AI 工具都從各自的資料夾讀取技能。將一個資料夾指向另一個,兩個工具就會看到相同的技能——只需新增一次技能,不必複製到每個工具。"
@@ -4267,6 +4276,9 @@ msgstr "{1}/ 裡各個 {0}/ 資料夾底下的所有內容"
msgid "everything under any {0}/ folder"
msgstr "任何 {0}/ 資料夾底下的所有內容"
+msgid "Example: a file added to <0>{exampleDoc}</0> is saved as <1>{exampleFile}</1>"
+msgstr "範例:新增到 <0>{exampleDoc}</0> 的檔案會儲存為 <1>{exampleFile}</1>"
+
msgid "Excalidraw board"
msgstr "Excalidraw 畫板"
@@ -4751,9 +4763,6 @@ msgstr "固定"
msgid "Fixed {total, plural, one {# file} other {# files}}."
msgstr "{total, plural, other {已修復 # 個檔案}}。"
-msgid "Fixed folder in content root"
-msgstr "內容根目錄中的固定資料夾"
-
msgid "Fixed port number"
msgstr "固定連接埠號碼"
@@ -4790,6 +4799,12 @@ msgstr "資料夾名稱"
msgid "Folder name: {detail}"
msgstr "資料夾名稱:{detail}"
+msgid "Folder names cannot contain {reserved}."
+msgstr "資料夾名稱不能包含 {reserved}。"
+
+msgid "Folder path must start with {documentPrefix} or {rootPrefix} and cannot contain {parentFolder}"
+msgstr "資料夾路徑必須以 {documentPrefix} 或 {rootPrefix} 開頭,且不能包含 {parentFolder}。"
+
msgid "Folder properties"
msgstr "資料夾屬性"
@@ -8589,6 +8604,12 @@ msgstr "移除選取範圍"
msgid "Remove the parent <0>.git</0> folder"
msgstr "刪除上層的 <0>.git</0> 資料夾"
+msgid "Remove the slash at the end of the path."
+msgstr "刪除路徑結尾的斜線。"
+
+msgid "Remove the spaces at the start or end of the path."
+msgstr "刪除路徑開頭或結尾的空格。"
+
msgid "Removed"
msgstr "已移除"
@@ -9019,9 +9040,6 @@ msgstr "正在執行專案稽核"
msgid "Runs a shell command"
msgstr "執行 shell 指令"
-msgid "Same folder as current file"
-msgstr "和目前檔案相同的資料夾"
-
msgid "Sample image"
msgstr "範例圖片"
@@ -9463,8 +9481,8 @@ msgstr "設定 OpenKnowledge 整合…"
msgid "Set up syncing"
msgstr "設定同步"
-msgid "Set where pasted and dropped files are stored for this project."
-msgstr "設定這個專案中貼上和拖入的檔案要存在哪裡。"
+msgid "Set where pasted and dropped files are stored."
+msgstr "設定貼上和拖入的檔案要存在哪裡。"
msgid "Setting up"
msgstr "正在設定"
@@ -10115,9 +10133,6 @@ msgstr "子代理"
msgid "Subfolder name"
msgstr "子資料夾名稱"
-msgid "Subfolder under current folder"
-msgstr "目前資料夾底下的子資料夾"
-
msgid "Subscribe"
msgstr "訂閱"
@@ -11530,6 +11545,9 @@ msgstr "日期不明"
msgid "Unknown error"
msgstr "未知的錯誤"
+msgid "Unknown variable {unknownList}. Available variables: {supportedVariables}."
+msgstr "未知的變數 {unknownList}。可用的變數:{supportedVariables}。"
+
msgid "unlink"
msgstr "取消連結"
@@ -11699,6 +11717,9 @@ msgstr "將 {0} 用於目前的淺色模式"
msgid "Use {editor} version"
msgstr "使用 {editor} 的版本"
+msgid "Use {filenameVariable} at most once in each folder name."
+msgstr "每個資料夾名稱中最多使用一次 {filenameVariable}。"
+
msgid "Use <0>{copyShortcut}</0> to copy the link below, or open OK in the desktop app."
msgstr "用 <0>{copyShortcut}</0> 複製下面的連結,或者在桌面應用程式中開啟 OK。"
@@ -11738,6 +11759,9 @@ msgstr "只能用小寫字母、數字和 <0>-</0>。"
msgid "Use lowercase letters, numbers, and hyphens only"
msgstr "只能用小寫字母、數字和連字號"
+msgid "Use one slash between folder names."
+msgstr "資料夾名稱之間只用一個斜線。"
+
msgid "Use their version"
msgstr "使用對方的版本"
@@ -11965,9 +11989,6 @@ msgstr "當你安裝一個已發布的技能時,會告知技能目錄(skills
msgid "Where"
msgstr "位置"
-msgid "Where newly added attachments are placed."
-msgstr "新加入的附件要放在哪裡。"
-
msgid "Where should it live?"
msgstr "它應該放在哪裡?"
diff --git a/packages/app/tests/integration/api-error-envelope/upload-asset.test.ts b/packages/app/tests/integration/api-error-envelope/upload-asset.test.ts
index 0a35577a3..152a6d8ee 100644
--- a/packages/app/tests/integration/api-error-envelope/upload-asset.test.ts
+++ b/packages/app/tests/integration/api-error-envelope/upload-asset.test.ts
@@ -48,7 +48,7 @@ describe('upload-asset envelope (RFC 9457)', () => {
expect(parsed.success).toBe(true);
if (parsed.success) {
expect(parsed.data.src).toBe('shot-success.png');
- expect(parsed.data.path).toBe('docs/shot-success.png');
+ expect(parsed.data.path).toBe('docs/guide.assets/shot-success.png');
expect(parsed.data.deduped).toBe(false);
}
diff --git a/packages/app/tests/integration/api-error-envelope/upload-filename-charset.test.ts b/packages/app/tests/integration/api-error-envelope/upload-filename-charset.test.ts
index 48427e30a..5aa6a6cc2 100644
--- a/packages/app/tests/integration/api-error-envelope/upload-filename-charset.test.ts
+++ b/packages/app/tests/integration/api-error-envelope/upload-filename-charset.test.ts
@@ -138,9 +138,9 @@ describe('multipart filename charset -- POST /api/upload', () => {
`sent U+ ${hexPointsOf(c.uploaded)}\nas string "${c.uploaded}" -> got "${body.src}"`,
).toBe(hexPointsOf(c.expected));
expect(body.src).toBe(c.expected);
- expect(body.path).toBe(`docs/${c.id}/${c.expected}`);
+ expect(body.path).toBe(`docs/${c.id}/guide.assets/${c.expected}`);
- const entries = readdirSync(join(server.contentDir, 'docs', c.id));
+ const entries = readdirSync(join(server.contentDir, 'docs', c.id, 'guide.assets'));
expect(entries.map((e) => e.normalize('NFC'))).toContain(c.expected.normalize('NFC'));
});
}
diff --git a/packages/app/tests/integration/api-error-envelope/upload-filename-reference-resolution.test.ts b/packages/app/tests/integration/api-error-envelope/upload-filename-reference-resolution.test.ts
index ce437756a..9a6e460fb 100644
--- a/packages/app/tests/integration/api-error-envelope/upload-filename-reference-resolution.test.ts
+++ b/packages/app/tests/integration/api-error-envelope/upload-filename-reference-resolution.test.ts
@@ -69,8 +69,9 @@ describe('uploaded asset names, from the wire to the reader', () => {
const body = (await res.json()) as { src: string; deduped: boolean };
expect(body.deduped).toBe(false);
- const entries = readdirSync(dir).filter((e) => e !== 'guide.md');
- expect(entries, `dir listing: ${JSON.stringify(readdirSync(dir))}`).toHaveLength(1);
+ const assetDir = join(dir, 'guide.assets');
+ const entries = readdirSync(assetDir);
+ expect(entries, `dir listing: ${JSON.stringify(entries)}`).toHaveLength(1);
const stored = entries[0] as string;
expect(hexOf(stored), `sent ${hexOf(SENT)} -> stored "${stored}"`).toBe(hexOf(EXPECTED));
expect(
@@ -78,7 +79,7 @@ describe('uploaded asset names, from the wire to the reader', () => {
`stored name still carries the latin1 mojibake: "${stored}"`,
).toBe(false);
- await agentWriteMd(server.port, `\n![shot](${body.src})\n`, {
+ await agentWriteMd(server.port, `\n![shot](guide.assets/${body.src})\n`, {
docName: `docs/${id}/guide`,
position: 'append',
});
@@ -89,7 +90,9 @@ describe('uploaded asset names, from the wire to the reader', () => {
expect(ref, `document was: ${JSON.stringify(doc)}`).toBeDefined();
const target = decodeURIComponent(ref as string);
- expect(hexOf(target), `reference "${target}" vs on-disk "${stored}"`).toBe(hexOf(stored));
+ expect(hexOf(target), `reference "${target}" vs on-disk "${stored}"`).toBe(
+ hexOf(`guide.assets/${stored}`),
+ );
expect(existsSync(join(dir, target)), `reference does not resolve: "${target}"`).toBe(true);
});
@@ -121,7 +124,7 @@ describe('uploaded asset names, from the wire to the reader', () => {
const parsed = JSON.parse(out?.bodyText ?? '{}') as { src: string; deduped: boolean };
expect(parsed.deduped).toBe(false);
expect(hexOf(parsed.src), `sent ${hexOf(sent)} -> got "${parsed.src}"`).toBe(hexOf(expected));
- expect(existsSync(join(dir, parsed.src))).toBe(true);
+ expect(existsSync(join(dir, 'guide.assets', parsed.src))).toBe(true);
},
);
});
diff --git a/packages/app/tests/integration/bug3-source-mode-writeback.test.ts b/packages/app/tests/integration/bug3-source-mode-writeback.test.ts
index a50b00123..4549c74b3 100644
--- a/packages/app/tests/integration/bug3-source-mode-writeback.test.ts
+++ b/packages/app/tests/integration/bug3-source-mode-writeback.test.ts
@@ -1,3 +1,4 @@
+
import { readFileSync } from 'node:fs';
import { join } from 'node:path';
import { setTimeout as wait } from 'node:timers/promises';
diff --git a/packages/app/tests/integration/indented-jsx-byte-sacred.test.ts b/packages/app/tests/integration/indented-jsx-byte-sacred.test.ts
index 6fcdc23f2..4fc2c11f9 100644
--- a/packages/app/tests/integration/indented-jsx-byte-sacred.test.ts
+++ b/packages/app/tests/integration/indented-jsx-byte-sacred.test.ts
@@ -1,3 +1,4 @@
+
import { setTimeout as wait } from 'node:timers/promises';
import { normalizeBridge } from '@inkeep/open-knowledge-core';
import { updateYFragment } from '@tiptap/y-tiptap';
diff --git a/packages/app/tests/integration/interior-edit-freshness.test.ts b/packages/app/tests/integration/interior-edit-freshness.test.ts
index 40b5cdfd6..9f2f6feb6 100644
--- a/packages/app/tests/integration/interior-edit-freshness.test.ts
+++ b/packages/app/tests/integration/interior-edit-freshness.test.ts
@@ -1,3 +1,4 @@
+
import { setTimeout as wait } from 'node:timers/promises';
import { updateYFragment, yXmlFragmentToProseMirrorRootNode } from '@tiptap/y-tiptap';
import { afterAll, beforeAll, describe, expect, test } from 'vitest';
diff --git a/packages/app/tests/integration/keystroke-cadence-danger-space.test.ts b/packages/app/tests/integration/keystroke-cadence-danger-space.test.ts
index 93666af70..2a085742b 100644
--- a/packages/app/tests/integration/keystroke-cadence-danger-space.test.ts
+++ b/packages/app/tests/integration/keystroke-cadence-danger-space.test.ts
@@ -1,3 +1,4 @@
+
import { setTimeout as wait } from 'node:timers/promises';
import { updateYFragment, yXmlFragmentToProseMirrorRootNode } from '@tiptap/y-tiptap';
import { afterAll, beforeAll, describe, expect, test } from 'vitest';
diff --git a/packages/app/tests/integration/producer-guard-wiring.test.ts b/packages/app/tests/integration/producer-guard-wiring.test.ts
index 867598d34..878d5196b 100644
--- a/packages/app/tests/integration/producer-guard-wiring.test.ts
+++ b/packages/app/tests/integration/producer-guard-wiring.test.ts
@@ -1,3 +1,4 @@
+
import { setTimeout as wait } from 'node:timers/promises';
import { updateYFragment, yXmlFragmentToProseMirrorRootNode } from '@tiptap/y-tiptap';
import { afterAll, beforeAll, describe, expect, test } from 'vitest';
diff --git a/packages/app/tests/integration/qa-039-reconciliation-counters-http.test.ts b/packages/app/tests/integration/qa-039-reconciliation-counters-http.test.ts
index 0970ac12f..4ada3cf26 100644
--- a/packages/app/tests/integration/qa-039-reconciliation-counters-http.test.ts
+++ b/packages/app/tests/integration/qa-039-reconciliation-counters-http.test.ts
@@ -1,3 +1,4 @@
+
import { randomUUID } from 'node:crypto';
import { afterEach, describe, expect, test } from 'vitest';
import { agentWriteMd, createTestServer, type TestServer } from './test-harness';
diff --git a/packages/app/tests/integration/qa-045-restore-after-gc.test.ts b/packages/app/tests/integration/qa-045-restore-after-gc.test.ts
index b632185e1..cbe2b705f 100644
--- a/packages/app/tests/integration/qa-045-restore-after-gc.test.ts
+++ b/packages/app/tests/integration/qa-045-restore-after-gc.test.ts
@@ -1,3 +1,4 @@
+
import { execFileSync } from 'node:child_process';
import { randomUUID } from 'node:crypto';
import { join } from 'node:path';
diff --git a/packages/app/tests/integration/qa-050-rollback-undo-shipped-path.test.ts b/packages/app/tests/integration/qa-050-rollback-undo-shipped-path.test.ts
index c530ce4ba..89bc9b4d9 100644
--- a/packages/app/tests/integration/qa-050-rollback-undo-shipped-path.test.ts
+++ b/packages/app/tests/integration/qa-050-rollback-undo-shipped-path.test.ts
@@ -1,3 +1,4 @@
+
import { randomUUID } from 'node:crypto';
import { afterAll, afterEach, beforeAll, describe, expect, test } from 'vitest';
import type * as Y from 'yjs';
diff --git a/packages/app/tests/integration/undo-after-rollback.test.ts b/packages/app/tests/integration/undo-after-rollback.test.ts
index d3767adc9..a78aeb0e4 100644
--- a/packages/app/tests/integration/undo-after-rollback.test.ts
+++ b/packages/app/tests/integration/undo-after-rollback.test.ts
@@ -1,3 +1,4 @@
+
import { ROLLBACK_ORIGIN } from '@inkeep/open-knowledge-server';
import { afterAll, beforeAll, describe, expect, test } from 'vitest';
import * as Y from 'yjs';
diff --git a/packages/app/tests/integration/undo-recycle-reset.test.ts b/packages/app/tests/integration/undo-recycle-reset.test.ts
index b076f955c..e7cc69c3f 100644
--- a/packages/app/tests/integration/undo-recycle-reset.test.ts
+++ b/packages/app/tests/integration/undo-recycle-reset.test.ts
@@ -1,3 +1,4 @@
+
import { writeFileSync } from 'node:fs';
import { join } from 'node:path';
import { setTimeout as wait } from 'node:timers/promises';
diff --git a/packages/app/tests/integration/undo-rederive-survival.test.ts b/packages/app/tests/integration/undo-rederive-survival.test.ts
index 7935e35f8..9ddcd0730 100644
--- a/packages/app/tests/integration/undo-rederive-survival.test.ts
+++ b/packages/app/tests/integration/undo-rederive-survival.test.ts
@@ -1,3 +1,4 @@
+
import { prependFrontmatter } from '@inkeep/open-knowledge-core';
import { Plugin, PluginKey } from '@tiptap/pm/state';
import { updateYFragment, yXmlFragmentToProseMirrorRootNode } from '@tiptap/y-tiptap';
diff --git a/packages/app/tests/stress/_helpers/index.ts b/packages/app/tests/stress/_helpers/index.ts
index f44eee4f5..10e65bfb0 100644
--- a/packages/app/tests/stress/_helpers/index.ts
+++ b/packages/app/tests/stress/_helpers/index.ts
@@ -131,6 +131,7 @@ export {
servedModuleRoute,
servedModuleUrl,
} from './prebuilt/served-modules.ts';
+export { openPropPanel } from './prop-panel.ts';
export {
installClockAfterSync,
type WaitForProviderOptions,
diff --git a/packages/app/tests/stress/_helpers/prop-panel.ts b/packages/app/tests/stress/_helpers/prop-panel.ts
new file mode 100644
index 000000000..5821f0779
--- /dev/null
+++ b/packages/app/tests/stress/_helpers/prop-panel.ts
@@ -0,0 +1,13 @@
+import type { Locator, Page } from '@playwright/test';
+
+export async function openPropPanel(page: Page): Promise<Locator> {
+ const wrapper = page.locator('[data-jsx-component]').first();
+ await wrapper.waitFor({ state: 'visible', timeout: 5000 });
+ await wrapper.hover();
+ const gear = wrapper.locator('button[aria-label*="properties"]').first();
+ await gear.waitFor({ state: 'visible', timeout: 5000 });
+ await gear.click({ force: true });
+ const panel = page.locator('[data-prop-panel]').first();
+ await panel.waitFor({ state: 'visible', timeout: 5000 });
+ return panel;
+}
diff --git a/packages/app/tests/stress/asset-click-dispatch.e2e.ts b/packages/app/tests/stress/asset-click-dispatch.e2e.ts
index 3f54488fa..41860e8c4 100644
--- a/packages/app/tests/stress/asset-click-dispatch.e2e.ts
+++ b/packages/app/tests/stress/asset-click-dispatch.e2e.ts
@@ -347,7 +347,7 @@ test.describe('asset-click dispatcher — P9 E2E scenarios (SPEC 2026-04-23)', (
.poll(async () => await getSourceText(page), { timeout: 30_000 })
.toContain(`![[${pdfName}]]`);
- const expectedHref = `/${subdirDoc.split('/').slice(0, -1).join('/')}/${pdfName}`;
+ const expectedHref = `/${subdirDoc}.assets/${pdfName}`;
const res = await page.request.get(expectedHref);
expect(res.status()).toBe(200);
@@ -413,13 +413,15 @@ test.describe('asset-click dispatcher — P9 E2E scenarios (SPEC 2026-04-23)', (
await expect.poll(async () => await getSourceText(page), { timeout: 5_000 }).toContain(m4vName);
const text = await getSourceText(page);
- expect(text).toMatch(new RegExp(`<video\\s+src="/docs/sub-[^/]+/${escapeRegExp(m4vName)}"`));
+ expect(text).toMatch(
+ new RegExp(`<video\\s+src="/docs/sub-[^/]+/notes\\.assets/${escapeRegExp(m4vName)}"`),
+ );
expect(text).not.toMatch(/controls(=|\s|\/>|>)/);
const videoEl = page.locator(`.ProseMirror video[src*="/${m4vName}"]`).first();
await videoEl.waitFor({ state: 'visible', timeout: 5_000 });
const src = await videoEl.getAttribute('src');
- expect(src).toMatch(new RegExp(`^/docs/sub-[^/]+/${escapeRegExp(m4vName)}$`));
+ expect(src).toMatch(new RegExp(`^/docs/sub-[^/]+/notes\\.assets/${escapeRegExp(m4vName)}$`));
const res = await page.request.get(src ?? '');
expect(res.status()).toBe(200);
diff --git a/packages/app/tests/stress/asset-embed-real-fidelity.e2e.ts b/packages/app/tests/stress/asset-embed-real-fidelity.e2e.ts
index 7566ec1bf..10d845bb9 100644
--- a/packages/app/tests/stress/asset-embed-real-fidelity.e2e.ts
+++ b/packages/app/tests/stress/asset-embed-real-fidelity.e2e.ts
@@ -87,10 +87,12 @@ async function waitForDiskFile(
test.describe('asset-embed — real-fidelity byte-identity (QA-001/002/003/004/005/006/010)', () => {
let runId: string;
+ let assetDir: string;
test.beforeEach(async ({ page, api }) => {
runId = randomUUID().slice(0, 8);
const docName = `real-${runId}`;
+ assetDir = `${docName}.assets`;
await api.createPage(`${docName}.md`);
await api.replaceDoc(docName, '# Real\n');
await page.goto(`/#/${docName}`);
@@ -116,7 +118,7 @@ test.describe('asset-embed — real-fidelity byte-identity (QA-001/002/003/004/0
.poll(async () => await getSourceText(page), { timeout: 10_000 })
.toContain(`![[${pdfName}]]`);
- const onDisk = await waitForDiskFile(workerServer.contentDir, pdfName);
+ const onDisk = await waitForDiskFile(workerServer.contentDir, `${assetDir}/${pdfName}`);
expect(onDisk.length).toBe(pdf.length);
expect(sha256(onDisk)).toBe(expectedSha);
@@ -136,10 +138,10 @@ test.describe('asset-embed — real-fidelity byte-identity (QA-001/002/003/004/0
await dropFileBytesIntoEditor(page, mp4, mp4Name, 'video/mp4');
await expect
.poll(async () => await getSourceText(page), { timeout: 10_000 })
- .toMatch(new RegExp(`<video\\s+src="/?${escapeRegExp(mp4Name)}"`));
+ .toMatch(new RegExp(`<video\\s+src="/?${escapeRegExp(`${assetDir}/${mp4Name}`)}"`));
const text = await getSourceText(page);
expect(text).not.toMatch(/controls(=|\s|\/>|>)/);
- const onDisk = await waitForDiskFile(workerServer.contentDir, mp4Name);
+ const onDisk = await waitForDiskFile(workerServer.contentDir, `${assetDir}/${mp4Name}`);
expect(sha256(onDisk)).toBe(expectedSha);
});
@@ -153,10 +155,10 @@ test.describe('asset-embed — real-fidelity byte-identity (QA-001/002/003/004/0
await dropFileBytesIntoEditor(page, mp3, mp3Name, 'audio/mpeg');
await expect
.poll(async () => await getSourceText(page), { timeout: 10_000 })
- .toMatch(new RegExp(`<audio\\s+src="/?${escapeRegExp(mp3Name)}"`));
+ .toMatch(new RegExp(`<audio\\s+src="/?${escapeRegExp(`${assetDir}/${mp3Name}`)}"`));
const text = await getSourceText(page);
expect(text).not.toMatch(/controls(=|\s|\/>|>)/);
- const onDisk = await waitForDiskFile(workerServer.contentDir, mp3Name);
+ const onDisk = await waitForDiskFile(workerServer.contentDir, `${assetDir}/${mp3Name}`);
expect(sha256(onDisk)).toBe(expectedSha);
});
@@ -173,7 +175,7 @@ test.describe('asset-embed — real-fidelity byte-identity (QA-001/002/003/004/0
.toContain(zipName);
const text = await getSourceText(page);
expect(text).toContain(`![[${zipName}]]`);
- const onDisk = await waitForDiskFile(workerServer.contentDir, zipName);
+ const onDisk = await waitForDiskFile(workerServer.contentDir, `${assetDir}/${zipName}`);
expect(sha256(onDisk)).toBe(expectedSha);
});
@@ -195,9 +197,9 @@ test.describe('asset-embed — real-fidelity byte-identity (QA-001/002/003/004/0
await dropFileBytesIntoEditor(page, svg, svgName, 'image/svg+xml');
await expect
.poll(async () => await getSourceText(page), { timeout: 10_000 })
- .toMatch(new RegExp(`<img\\s+src="/?${escapeRegExp(svgName)}"`));
+ .toMatch(new RegExp(`<img\\s+src="/?${escapeRegExp(`${assetDir}/${svgName}`)}"`));
- const onDisk = await waitForDiskFile(workerServer.contentDir, svgName);
+ const onDisk = await waitForDiskFile(workerServer.contentDir, `${assetDir}/${svgName}`);
expect(sha256(onDisk)).toBe(expectedSha);
const scriptCount = await page.locator('.ProseMirror script').count();
@@ -221,7 +223,7 @@ test.describe('asset-embed — real-fidelity byte-identity (QA-001/002/003/004/0
.toContain(csvName);
const text = await getSourceText(page);
expect(text).toContain(`![[${csvName}]]`);
- const onDisk = await waitForDiskFile(workerServer.contentDir, csvName);
+ const onDisk = await waitForDiskFile(workerServer.contentDir, `${assetDir}/${csvName}`);
expect(sha256(onDisk)).toBe(expectedSha);
expect(onDisk.toString('utf-8')).toBe('name,age,city\nAlice,30,NYC\nBob,25,LA\n');
});
@@ -255,7 +257,7 @@ test.describe('asset-embed — real-fidelity byte-identity (QA-001/002/003/004/0
expect(resultJson.elapsedMs).toBeLessThan(10_000);
- const onDisk = await waitForDiskFile(workerServer.contentDir, binName);
+ const onDisk = await waitForDiskFile(workerServer.contentDir, `${assetDir}/${binName}`);
expect(onDisk.length).toBe(payloadBytes);
console.log(
@@ -282,7 +284,7 @@ test.describe('asset-embed — real-fidelity byte-identity (QA-001/002/003/004/0
await dropFileBytesIntoEditor(page, png, pngName, 'image/png');
await expect
.poll(async () => await getSourceText(page), { timeout: 10_000 })
- .toMatch(new RegExp(`<img\\s+src="/?${escapeRegExp(pngName)}"`));
+ .toMatch(new RegExp(`<img\\s+src="/?${escapeRegExp(`${assetDir}/${pngName}`)}"`));
await dropFileBytesIntoEditor(page, png, pngName, 'image/png');
@@ -290,8 +292,11 @@ test.describe('asset-embed — real-fidelity byte-identity (QA-001/002/003/004/0
.poll(
async () => {
const t = await getSourceText(page);
- return (t.match(new RegExp(`<img\\s+[^>]*src="/?${escapeRegExp(pngName)}"`, 'g')) ?? [])
- .length;
+ return (
+ t.match(
+ new RegExp(`<img\\s+[^>]*src="/?${escapeRegExp(`${assetDir}/${pngName}`)}"`, 'g'),
+ ) ?? []
+ ).length;
},
{ timeout: 10_000 },
)
@@ -299,11 +304,11 @@ test.describe('asset-embed — real-fidelity byte-identity (QA-001/002/003/004/0
const text = await getSourceText(page);
expect(text).not.toContain(collisionName);
- const onDisk = await waitForDiskFile(workerServer.contentDir, pngName);
+ const onDisk = await waitForDiskFile(workerServer.contentDir, `${assetDir}/${pngName}`);
expect(sha256(onDisk)).toBe(expectedSha);
await expect(async () => {
- await waitForDiskFile(workerServer.contentDir, collisionName, 500);
+ await waitForDiskFile(workerServer.contentDir, `${assetDir}/${collisionName}`, 500);
}).rejects.toThrow(/not found/);
});
});
diff --git a/packages/app/tests/stress/asset-embed.e2e.ts b/packages/app/tests/stress/asset-embed.e2e.ts
index eed038d88..6c03e658e 100644
--- a/packages/app/tests/stress/asset-embed.e2e.ts
+++ b/packages/app/tests/stress/asset-embed.e2e.ts
@@ -63,6 +63,7 @@ test.describe('asset-embed — drop UX (SPEC §6 FR-1, FR-1a, FR-2, FR-8)', () =
let docName: string;
let runId: string;
let tinyPng: number[];
+ const assetSrc = (name: string) => escapeRegExp(`${docName}.assets/${name}`);
test.beforeEach(async ({ page, api }) => {
runId = randomUUID().slice(0, 8);
@@ -107,7 +108,7 @@ test.describe('asset-embed — drop UX (SPEC §6 FR-1, FR-1a, FR-2, FR-8)', () =
await dropFileIntoEditor(page, tinyPng, pngName, 'image/png');
await expect
.poll(async () => await getSourceText(page), { timeout: 5_000 })
- .toMatch(new RegExp(`<img\\s+src="/?${escapeRegExp(pngName)}"`));
+ .toMatch(new RegExp(`<img\\s+src="/?${assetSrc(pngName)}"`));
await dropFileIntoEditor(page, tinyPng, pngName, 'image/png');
@@ -115,9 +116,8 @@ test.describe('asset-embed — drop UX (SPEC §6 FR-1, FR-1a, FR-2, FR-8)', () =
.poll(
async () => {
const text = await getSourceText(page);
- return (
- text.match(new RegExp(`<img\\s+[^>]*src="/?${escapeRegExp(pngName)}"`, 'g')) ?? []
- ).length;
+ return (text.match(new RegExp(`<img\\s+[^>]*src="/?${assetSrc(pngName)}"`, 'g')) ?? [])
+ .length;
},
{ timeout: 5_000 },
)
@@ -152,7 +152,7 @@ test.describe('asset-embed — drop UX (SPEC §6 FR-1, FR-1a, FR-2, FR-8)', () =
await expect
.poll(async () => await getSourceText(page), { timeout: 5_000 })
- .toMatch(new RegExp(`<img\\s+src="/?${escapeRegExp(pngName)}"`));
+ .toMatch(new RegExp(`<img\\s+src="/?${assetSrc(pngName)}"`));
});
test('SVG drop emits as <img> JSX (image extension; NFR-3 sniff-fallback path)', async ({
@@ -165,6 +165,6 @@ test.describe('asset-embed — drop UX (SPEC §6 FR-1, FR-1a, FR-2, FR-8)', () =
await dropFileIntoEditor(page, svgBytes, svgName, 'image/svg+xml');
await expect
.poll(async () => await getSourceText(page), { timeout: 5_000 })
- .toMatch(new RegExp(`<img\\s+src="/?${escapeRegExp(svgName)}"`));
+ .toMatch(new RegExp(`<img\\s+src="/?${assetSrc(svgName)}"`));
});
});
diff --git a/packages/app/tests/stress/attachment-folder-tokens.e2e.ts b/packages/app/tests/stress/attachment-folder-tokens.e2e.ts
new file mode 100644
index 000000000..0d4802e5b
--- /dev/null
+++ b/packages/app/tests/stress/attachment-folder-tokens.e2e.ts
@@ -0,0 +1,441 @@
+import { randomUUID } from 'node:crypto';
+import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
+import { join } from 'node:path';
+import type { Page } from '@playwright/test';
+import {
+ createPngBuffer,
+ escapeRegExp,
+ expect,
+ openPropPanel,
+ openSettingsSection,
+ test,
+ uniqueAssetName,
+ waitForActiveProviderSynced,
+ waitForImageDecoded,
+} from './_helpers';
+
+const EDITOR = '.ProseMirror:not(.composer-prosemirror)';
+const PATH_START = 'Folder path must start with ./ or / and cannot contain ..';
+
+function writeProjectConfig(contentDir: string, body: string): void {
+ mkdirSync(join(contentDir, '.ok'), { recursive: true });
+ writeFileSync(join(contentDir, '.ok', 'config.yml'), body);
+}
+
+function readProjectConfig(contentDir: string): string {
+ const path = join(contentDir, '.ok', 'config.yml');
+ return existsSync(path) ? readFileSync(path, 'utf-8') : '';
+}
+
+async function flushConfigWrites(page: Page, contentDir: string): Promise<void> {
+ const before = readProjectConfig(contentDir);
+ await page.getByTestId('settings-content-rules-log-links').click();
+ await expect.poll(() => readProjectConfig(contentDir), { timeout: 10_000 }).not.toBe(before);
+}
+
+function writeAttachmentFolderPath(contentDir: string, attachmentFolderPath: string): void {
+ writeProjectConfig(contentDir, `content:\n attachmentFolderPath: '${attachmentFolderPath}'\n`);
+}
+
+function savedAttachmentFolderPath(attachmentFolderPath: string): RegExp {
+ return new RegExp(`attachmentFolderPath: ['"]?${escapeRegExp(attachmentFolderPath)}['"]?\\n`);
+}
+
+async function openDoc(page: Page, docName: string): Promise<void> {
+ await page.goto(`/#/${docName}`);
+ await page.waitForSelector(EDITOR);
+ await waitForActiveProviderSynced(page);
+}
+
+async function expectRefusalToast(page: Page): Promise<void> {
+ const toast = page
+ .locator('[data-sonner-toast]')
+ .filter({ hasText: "Couldn't upload the file." });
+ await expect(toast).toContainText('unknown variable \u2066{{FILENAME}}\u2069');
+ await expect(toast).toContainText('Fix it under Attachments in Settings.');
+ await expect(toast).not.toContainText('content.attachmentFolderPath');
+}
+
+async function dropPngIntoEditor(page: Page, bytes: Buffer, filename: string): Promise<void> {
+ await page.evaluate(
+ ({ b, name }) => {
+ const editor = document.querySelector<HTMLElement>('.ProseMirror:not(.composer-prosemirror)');
+ if (!editor) throw new Error('no editor');
+ const dt = new DataTransfer();
+ dt.items.add(new File([new Uint8Array(b)], name, { type: 'image/png' }));
+ const rect = editor.getBoundingClientRect();
+ const init = {
+ dataTransfer: dt,
+ bubbles: true,
+ cancelable: true,
+ clientX: rect.left + Math.floor(rect.width / 2),
+ clientY: rect.top + Math.floor(rect.height / 2),
+ };
+ editor.dispatchEvent(new DragEvent('dragover', init));
+ editor.dispatchEvent(new DragEvent('drop', init));
+ },
+ { b: Array.from(bytes), name: filename },
+ );
+}
+
+async function sourceText(page: Page): Promise<string> {
+ return page.evaluate(
+ () => window.__activeProvider?.document?.getText('source')?.toString() ?? '',
+ );
+}
+
+test.describe('Attachment folder path variables', () => {
+ let configBefore = '';
+
+ test.beforeEach(({ workerServer }) => {
+ configBefore = readProjectConfig(workerServer.contentDir);
+ });
+
+ test.afterEach(({ workerServer }) => {
+ writeProjectConfig(workerServer.contentDir, configBefore);
+ });
+
+ test('with no setting, a dropped image lands in a folder named after its document and renders', async ({
+ page,
+ api,
+ workerServer,
+ }) => {
+ const runId = randomUUID().slice(0, 8);
+ const folder = `tokens-${runId}`;
+ const docName = `${folder}/meeting`;
+ const assetName = uniqueAssetName('photo.png', runId);
+ await api.seedDocs([{ name: docName, markdown: 'Notes\n' }]);
+ writeProjectConfig(workerServer.contentDir, '');
+
+ await openDoc(page, docName);
+ await page.click(EDITOR);
+ await dropPngIntoEditor(page, createPngBuffer(runId), assetName);
+
+ await expect
+ .poll(() => sourceText(page), { timeout: 10_000 })
+ .toMatch(new RegExp(escapeRegExp(`meeting.assets/${assetName}`)));
+ expect(existsSync(join(workerServer.contentDir, folder, 'meeting.assets', assetName))).toBe(
+ true,
+ );
+ await waitForImageDecoded(page.locator(`${EDITOR} img`).first());
+ });
+
+ test('a drop under an unknown variable is refused with the problem named in the toast', async ({
+ page,
+ api,
+ workerServer,
+ }) => {
+ const runId = randomUUID().slice(0, 8);
+ const folder = `tokens-${runId}`;
+ const docName = `${folder}/meeting`;
+ const assetName = uniqueAssetName('photo.png', runId);
+ await api.seedDocs([{ name: docName, markdown: 'Notes\n' }]);
+ writeAttachmentFolderPath(workerServer.contentDir, './{{FILENAME}}.assets');
+
+ await openDoc(page, docName);
+ await page.click(EDITOR);
+ await dropPngIntoEditor(page, createPngBuffer(runId), assetName);
+
+ await expectRefusalToast(page);
+ expect(existsSync(join(workerServer.contentDir, folder, '{{FILENAME}}.assets'))).toBe(false);
+ expect(existsSync(join(workerServer.contentDir, folder, assetName))).toBe(false);
+ });
+
+ test('a cover upload under an unknown variable names the problem instead of asking for a retry', async ({
+ page,
+ api,
+ workerServer,
+ }) => {
+ const runId = randomUUID().slice(0, 8);
+ const folder = `tokens-${runId}`;
+ const docName = `${folder}/meeting`;
+ await api.seedDocs([{ name: docName, markdown: "---\ncover: ''\n---\n\nNotes\n" }]);
+ writeAttachmentFolderPath(workerServer.contentDir, './{{FILENAME}}.assets');
+
+ await openDoc(page, docName);
+ const upload = page.getByTestId('page-cover-upload');
+ await expect(upload).toBeVisible();
+ await upload
+ .locator('xpath=..')
+ .locator('input[type="file"]')
+ .setInputFiles({
+ name: uniqueAssetName('cover.png', runId),
+ mimeType: 'image/png',
+ buffer: createPngBuffer(runId),
+ });
+
+ const alert = upload.locator('xpath=../..').getByRole('alert');
+ await expect(alert).toContainText('\u2066{{FILENAME}}\u2069');
+ await expect(alert).toContainText('Fix it under Attachments in Settings.');
+ await expect(alert).not.toContainText('content.attachmentFolderPath');
+ await expect(alert).not.toContainText('try again');
+ expect(existsSync(join(workerServer.contentDir, folder, '{{FILENAME}}.assets'))).toBe(false);
+ });
+
+ test('a drop under a hand-edited value that is not a string points to the config file, not the schema reason', async ({
+ page,
+ api,
+ workerServer,
+ }) => {
+ const runId = randomUUID().slice(0, 8);
+ const docName = `tokens-${runId}/meeting`;
+ await api.seedDocs([{ name: docName, markdown: 'Notes\n' }]);
+ writeProjectConfig(workerServer.contentDir, 'content:\n attachmentFolderPath:\n');
+
+ await openDoc(page, docName);
+ await page.click(EDITOR);
+ await dropPngIntoEditor(page, createPngBuffer(runId), uniqueAssetName('photo.png', runId));
+
+ const toast = page
+ .locator('[data-sonner-toast]')
+ .filter({ hasText: "Couldn't upload the file." });
+ await expect(toast).toContainText(
+ "The \u2066content.attachmentFolderPath\u2069 value in \u2066.ok/config.yml\u2069 can't be used. Fix it in that file.",
+ );
+ await expect(toast).not.toContainText('Fix it under Attachments in Settings.');
+ await expect(toast).not.toContainText('expected string');
+ });
+
+ test('a property panel upload under an unknown variable names the problem in the toast', async ({
+ page,
+ api,
+ workerServer,
+ }) => {
+ const runId = randomUUID().slice(0, 8);
+ const folder = `tokens-${runId}`;
+ const docName = `${folder}/gallery`;
+ const assetName = uniqueAssetName('photo.png', runId);
+ await api.seedDocs([{ name: docName, markdown: '<img src="initial.png" alt="initial" />' }]);
+ writeAttachmentFolderPath(workerServer.contentDir, './{{FILENAME}}.assets');
+
+ await openDoc(page, docName);
+ const panel = await openPropPanel(page);
+ await panel
+ .locator('[data-prop-upload-input]')
+ .first()
+ .setInputFiles({ name: assetName, mimeType: 'image/png', buffer: createPngBuffer(runId) });
+
+ await expectRefusalToast(page);
+ expect(existsSync(join(workerServer.contentDir, folder, assetName))).toBe(false);
+ });
+
+ test('the settings field flags bad variables and saves typed paths', async ({
+ page,
+ api,
+ workerServer,
+ }) => {
+ await api.testReset();
+ writeAttachmentFolderPath(workerServer.contentDir, './');
+ await openSettingsSection(page, 'project-preferences', 'settings-attachments');
+
+ const field = page.getByTestId('settings-attachments-path');
+ const fieldError = page.getByTestId('settings-attachments-path-error');
+ await expect(field).toHaveValue('./');
+ await expect(field).toHaveAccessibleName('Attachments');
+ await expect(field).toHaveAccessibleDescription(
+ 'Set where pasted and dropped files are stored. Example: a file added to notes/meeting.md is saved as notes/image.png',
+ );
+ const docsLink = page.getByTestId('settings-attachments-title-docs-link');
+ await expect(docsLink).toHaveAttribute(
+ 'href',
+ 'https://openknowledge.ai/docs/features/assets-and-embeds#attachment-folder',
+ );
+ const description = await page
+ .getByText('Set where pasted and dropped files are stored.')
+ .boundingBox();
+ const linkBox = await docsLink.boundingBox();
+ if (!description || !linkBox)
+ throw new Error('The description and its docs link must both be visible.');
+ expect(Math.abs(linkBox.y - description.y)).toBeLessThan(4);
+ await field.click();
+ await field.press('End');
+ await field.pressSequentially('{{');
+ await expect(field).toHaveValue('./{{');
+ await expect(field).toBeFocused();
+ await expect(fieldError).toHaveText('Each {{ needs a matching }}.');
+ await expect(fieldError).not.toHaveAttribute('role', 'alert');
+ await expect(page.getByTestId('settings-attachments-preview')).toHaveCount(0);
+ await field.fill('./{{FILENAME}}.assets');
+ await expect(
+ page.getByTestId('settings-attachments-path-highlight').locator('[data-token="unknown"]'),
+ ).toHaveText('{{FILENAME}}');
+ await expect(fieldError).toContainText('{{FILENAME}}');
+ await field.fill('./{{filename}}-{{filename}}');
+ await expect(fieldError).toContainText('Use {{filename}} at most once in each folder name.');
+ await expect(fieldError).not.toHaveAttribute('role', 'alert');
+ await field.press('Enter');
+ await expect(fieldError).toContainText('Use {{filename}} at most once in each folder name.');
+ await expect(fieldError).toHaveAttribute('role', 'alert');
+
+ await page.getByTestId('settings-content-rules-log-links').click();
+ await expect
+ .poll(() => readProjectConfig(workerServer.contentDir), { timeout: 10_000 })
+ .toContain('suppressLogLinkAdvisories');
+ expect(readProjectConfig(workerServer.contentDir)).toMatch(savedAttachmentFolderPath('./'));
+
+ await field.fill('./{{filename}}.assets');
+ await field.press('Enter');
+ await expect(
+ page.getByTestId('settings-attachments-path-highlight').locator('[data-token="known"]'),
+ ).toHaveText('{{filename}}');
+ await expect(page.getByTestId('settings-attachments-preview')).toContainText(
+ 'notes/meeting.assets/',
+ );
+ await expect
+ .poll(() => readProjectConfig(workerServer.contentDir), { timeout: 10_000 })
+ .toMatch(savedAttachmentFolderPath('./{{filename}}.assets'));
+
+ await field.fill('/');
+ await field.press('Enter');
+ await expect
+ .poll(() => readProjectConfig(workerServer.contentDir), { timeout: 10_000 })
+ .toMatch(savedAttachmentFolderPath('/'));
+
+ await field.fill('attachments');
+ await field.press('Enter');
+ await expect(fieldError).toHaveText(PATH_START);
+ await expect(field).toHaveAccessibleDescription(
+ `Set where pasted and dropped files are stored. ${PATH_START}`,
+ );
+ await flushConfigWrites(page, workerServer.contentDir);
+ expect(readProjectConfig(workerServer.contentDir)).toMatch(savedAttachmentFolderPath('/'));
+ await field.fill('/attachments');
+ await field.press('Enter');
+ await expect
+ .poll(() => readProjectConfig(workerServer.contentDir), { timeout: 10_000 })
+ .toMatch(savedAttachmentFolderPath('/attachments'));
+
+ const RESERVED = 'Folder names cannot contain < > : " \\ | ? *.';
+ for (const [typed, message] of [
+ ['./a<b', RESERVED],
+ ['./a>b', RESERVED],
+ ['./a:b', RESERVED],
+ ['./a"b', RESERVED],
+ ['./a|b', RESERVED],
+ ['./a?b', RESERVED],
+ ['./a*b', RESERVED],
+ ['./a\\b', RESERVED],
+ ['../shared', PATH_START],
+ ['./../media', PATH_START],
+ ['./{/////', 'Use one slash between folder names.'],
+ ['./{', 'A variable needs two braces on each side, such as {{filename}}.'],
+ ['./media}', 'A variable needs two braces on each side, such as {{filename}}.'],
+ ['./media/', 'Remove the slash at the end of the path.'],
+ [' ./media', 'Remove the spaces at the start or end of the path.'],
+ ['', PATH_START],
+ ]) {
+ await field.fill(typed);
+ await expect(fieldError).toHaveText(message);
+ await expect(fieldError).not.toHaveAttribute('role', 'alert');
+ await expect(page.getByTestId('settings-attachments-preview')).toHaveCount(0);
+ await field.blur();
+ await expect(field).toHaveValue(typed);
+ await expect(fieldError).toHaveText(message);
+ await expect(fieldError).toHaveAttribute('role', 'alert');
+ }
+ await flushConfigWrites(page, workerServer.contentDir);
+ expect(readProjectConfig(workerServer.contentDir)).toMatch(
+ savedAttachmentFolderPath('/attachments'),
+ );
+
+ await field.fill('./media');
+ await field.blur();
+ await expect
+ .poll(() => readProjectConfig(workerServer.contentDir), { timeout: 10_000 })
+ .toMatch(savedAttachmentFolderPath('./media'));
+ });
+
+ test('a bare path saved by older versions shows with its leading slash, no error, and is not saved again on blur', async ({
+ page,
+ api,
+ workerServer,
+ }) => {
+ await api.testReset();
+ writeAttachmentFolderPath(workerServer.contentDir, 'attachments');
+ await openSettingsSection(page, 'project-preferences', 'settings-attachments');
+
+ const field = page.getByTestId('settings-attachments-path');
+ await expect(field).toHaveValue('/attachments');
+ await expect(page.getByTestId('settings-attachments-path-error')).toHaveCount(0);
+ await expect(page.getByTestId('settings-attachments-preview')).toContainText(
+ 'attachments/image.png',
+ );
+ await field.focus();
+ await field.blur();
+ await flushConfigWrites(page, workerServer.contentDir);
+ expect(readProjectConfig(workerServer.contentDir)).toMatch(
+ savedAttachmentFolderPath('attachments'),
+ );
+ });
+
+ test('a stored invalid path opens with its error and is not saved again on blur', async ({
+ page,
+ api,
+ workerServer,
+ }) => {
+ for (const [stored, message] of [
+ ['/<<<<<<', 'Folder names cannot contain < > : " \\ | ? *.'],
+ ['./media/', 'Remove the slash at the end of the path.'],
+ ['./assets{2024}', 'A variable needs two braces on each side, such as {{filename}}.'],
+ ['./notes//media', 'Use one slash between folder names.'],
+ ]) {
+ await api.testReset();
+ writeAttachmentFolderPath(workerServer.contentDir, stored);
+ await openSettingsSection(page, 'project-preferences', 'settings-attachments');
+
+ const field = page.getByTestId('settings-attachments-path');
+ const fieldError = page.getByTestId('settings-attachments-path-error');
+ await expect(field).toHaveValue(stored);
+ await expect(field).toHaveAttribute('aria-invalid', 'true');
+ await expect(fieldError).toHaveText(message);
+ await expect(fieldError).not.toHaveAttribute('role', 'alert');
+ await expect(page.getByTestId('settings-attachments-preview')).toHaveCount(0);
+ await field.focus();
+ await field.blur();
+ await expect(fieldError).toHaveText(message);
+ await expect(fieldError).not.toHaveAttribute('role', 'alert');
+
+ await flushConfigWrites(page, workerServer.contentDir);
+ expect(readProjectConfig(workerServer.contentDir)).toMatch(savedAttachmentFolderPath(stored));
+ }
+ });
+
+ test('on a right-to-left page the path, its variables and the examples stay left to right', async ({
+ page,
+ api,
+ workerServer,
+ }) => {
+ await api.testReset();
+ writeAttachmentFolderPath(workerServer.contentDir, './{{filename}}.assets');
+ await openSettingsSection(page, 'project-preferences', 'settings-attachments');
+ await expect
+ .poll(() => page.evaluate(() => localStorage.getItem('ok-language-v1')))
+ .not.toBeNull();
+ await page.evaluate(() => {
+ document.documentElement.dir = 'rtl';
+ });
+
+ const section = page.getByTestId('settings-attachments');
+ const field = page.getByTestId('settings-attachments-path');
+ const highlight = page.getByTestId('settings-attachments-path-highlight');
+ await expect(field).toHaveValue('./{{filename}}.assets');
+ const leadingText = await highlight.getByText('./', { exact: true }).boundingBox();
+ const variable = await highlight.locator('[data-token="known"]').boundingBox();
+ expect(leadingText?.x).toBeLessThan(variable?.x ?? 0);
+ await expect(field).toHaveCSS('direction', 'ltr');
+ expect(
+ await section
+ .locator('code')
+ .evaluateAll((codes) => codes.map((code) => getComputedStyle(code).direction)),
+ ).toEqual(['ltr', 'ltr']);
+
+ await field.fill('./{{filename');
+ await field.press('Enter');
+ const tokens = page.getByTestId('settings-attachments-path-error').locator('bdi');
+ await expect(tokens).toHaveText(['{{', '}}']);
+ expect(
+ await tokens.evaluateAll((nodes) => nodes.map((node) => getComputedStyle(node).direction)),
+ ).toEqual(['ltr', 'ltr']);
+ await expect(page.locator('html')).toHaveAttribute('dir', 'rtl');
+ });
+});
diff --git a/packages/app/tests/stress/prop-upload.e2e.ts b/packages/app/tests/stress/prop-upload.e2e.ts
index 45170a063..0ef5c90ad 100644
--- a/packages/app/tests/stress/prop-upload.e2e.ts
+++ b/packages/app/tests/stress/prop-upload.e2e.ts
@@ -7,23 +7,12 @@ import {
createMp4Buffer,
createPngBuffer,
expect,
+ openPropPanel,
test,
uniqueAssetName,
waitForActiveProviderSynced,
} from './_helpers';
-async function openPropPanel(page: Page): Promise<ReturnType<Page['locator']>> {
- const wrapper = page.locator('[data-jsx-component]').first();
- await wrapper.waitFor({ state: 'visible', timeout: 5000 });
- await wrapper.hover();
- const gear = wrapper.locator('button[aria-label*="properties"]').first();
- await gear.waitFor({ state: 'visible', timeout: 5000 });
- await gear.click({ force: true });
- const panel = page.locator('[data-prop-panel]').first();
- await panel.waitFor({ state: 'visible', timeout: 5000 });
- return panel;
-}
-
async function readSrc(page: Page, tag: 'img' | 'video' | 'audio'): Promise<string> {
return page.evaluate((sel) => {
const el = document.querySelector(sel) as HTMLMediaElement | HTMLImageElement | null;
diff --git a/packages/core/src/bridge/compose.ts b/packages/core/src/bridge/compose.ts
index f4cc8a286..2a597ec3d 100644
--- a/packages/core/src/bridge/compose.ts
+++ b/packages/core/src/bridge/compose.ts
@@ -1,3 +1,4 @@
+
import { prependFrontmatter, stripFrontmatter } from '../extensions/frontmatter.ts';
export type ComposeAdjustment = 'none' | 'body' | 'frontmatter' | 'unresolved';
diff --git a/packages/core/src/bridge/doc-boundary-space.ts b/packages/core/src/bridge/doc-boundary-space.ts
index e7e63f43d..ffd8fce06 100644
--- a/packages/core/src/bridge/doc-boundary-space.ts
+++ b/packages/core/src/bridge/doc-boundary-space.ts
@@ -1,3 +1,4 @@
+
import { FRONTMATTER_RE, stripFrontmatter } from '../extensions/frontmatter.ts';
import { carriedEdgeEmpties, type DocEdgeEmpties } from '../markdown/doc-edge-blank-runs.ts';
diff --git a/packages/core/src/config/schema.test.ts b/packages/core/src/config/schema.test.ts
index 44576e20f..fcc072372 100644
--- a/packages/core/src/config/schema.test.ts
+++ b/packages/core/src/config/schema.test.ts
@@ -2,6 +2,8 @@ import { describe, expect, test } from 'vitest';
import { z } from 'zod';
import { SUPPORTED_LOCALES } from '../i18n/locales.ts';
import {
+ attachmentFolderForDocument,
+ attachmentFolderPathVariableIssue,
ConfigSchema,
checkEmbeddingsBaseUrl,
isValidAttachmentFolderPath,
@@ -40,13 +42,35 @@ describe('checkEmbeddingsBaseUrl', () => {
});
describe('content.attachmentFolderPath', () => {
- test('defaults to "./" when absent', () => {
- expect(ConfigSchema.parse({}).content.attachmentFolderPath).toBe('./');
+ test('accepts brace values, so a bad variable never invalidates the rest of the config', () => {
+ for (const value of ['./{{filename', 'a}}b', './{{filename}}{{filename}}']) {
+ const parsed = ConfigSchema.safeParse({
+ content: { attachmentFolderPath: value },
+ validation: { links: 'error' },
+ });
+ expect(parsed.success).toBe(true);
+ }
+ });
+
+ test.each([
+ ['/uploads/{{filename}}/img', null],
+ ['/attachments', null],
+ ['attachments', null],
+ ['uploads/{{filename}}', null],
+ ['/{{filename}}/{{filename}}', null],
+ ['./{{ date }}', { kind: 'unknown-variable', variables: ['{{ date }}'] }],
+ ['./filename}}', { kind: 'unclosed-braces' }],
+ ])('attachmentFolderPathVariableIssue(%s)', (value, expected) => {
+ expect(attachmentFolderPathVariableIssue(value)).toEqual(expected);
});
- test('defaults to "./" when key is absent inside content', () => {
+ test('defaults to a folder per document when absent', () => {
+ expect(ConfigSchema.parse({}).content.attachmentFolderPath).toBe('./{{filename}}.assets');
+ });
+
+ test('defaults to a folder per document when key is absent inside content', () => {
expect(ConfigSchema.parse({ content: { dir: 'docs' } }).content.attachmentFolderPath).toBe(
- './',
+ './{{filename}}.assets',
);
});
@@ -83,13 +107,13 @@ describe('content.attachmentFolderPath', () => {
).toBe('assets/uploads');
});
- test('normalizes empty string to "./"', () => {
- expect(normalizeAttachmentFolderPath('')).toBe('./');
+ test('normalizes empty string to the default', () => {
+ expect(normalizeAttachmentFolderPath('')).toBe('./{{filename}}.assets');
expect(isValidAttachmentFolderPath('')).toBe(true);
});
- test('normalizes whitespace-only to "./"', () => {
- expect(normalizeAttachmentFolderPath(' ')).toBe('./');
+ test('normalizes whitespace-only to the default', () => {
+ expect(normalizeAttachmentFolderPath(' ')).toBe('./{{filename}}.assets');
expect(isValidAttachmentFolderPath(' ')).toBe(true);
});
@@ -113,22 +137,32 @@ describe('content.attachmentFolderPath', () => {
).toThrow();
});
+ test('rejects a drive letter', () => {
+ expect(isValidAttachmentFolderPath('C:/attachments')).toBe(false);
+ expect(isValidAttachmentFolderPath('/C:/attachments')).toBe(false);
+ expect(isValidAttachmentFolderPath('./C:/attachments')).toBe(false);
+ });
+
test('rejects backslash', () => {
expect(() =>
ConfigSchema.parse({ content: { attachmentFolderPath: 'attach\\ments' } }),
).toThrow();
});
- test('rejects absolute POSIX path "/etc/passwd"', () => {
- expect(() =>
- ConfigSchema.parse({ content: { attachmentFolderPath: '/etc/passwd' } }),
- ).toThrow();
+ test('reads a leading slash as the content root, so "/etc/passwd" stays inside the project', () => {
+ expect(
+ ConfigSchema.parse({ content: { attachmentFolderPath: '/etc/passwd' } }).content
+ .attachmentFolderPath,
+ ).toBe('/etc/passwd');
+ expect(attachmentFolderForDocument('/etc/passwd', 'docs/guide.md')).toBe('etc/passwd');
});
- test('rejects absolute POSIX path "/attachments"', () => {
- expect(() =>
- ConfigSchema.parse({ content: { attachmentFolderPath: '/attachments' } }),
- ).toThrow();
+ test('accepts "/attachments" as a folder at the content root', () => {
+ expect(
+ ConfigSchema.parse({ content: { attachmentFolderPath: '/attachments' } }).content
+ .attachmentFolderPath,
+ ).toBe('/attachments');
+ expect(attachmentFolderForDocument('/attachments', 'docs/guide.md')).toBe('attachments');
});
test('rejects Windows drive-letter path "C:/"', () => {
diff --git a/packages/core/src/config/schema.ts b/packages/core/src/config/schema.ts
index c8d2c44e9..1d89110a1 100644
--- a/packages/core/src/config/schema.ts
+++ b/packages/core/src/config/schema.ts
@@ -1,5 +1,9 @@
import { z } from 'zod';
-import { DEFAULT_ATTACHMENT_FOLDER_PATH } from '../constants/upload.ts';
+import { SUPPORTED_DOC_EXTENSIONS } from '../constants/doc-extensions.ts';
+import {
+ BESIDE_DOCUMENT_ATTACHMENT_FOLDER_PATH,
+ DEFAULT_ATTACHMENT_FOLDER_PATH,
+} from '../constants/upload.ts';
import { SUPPORTED_LOCALES } from '../i18n/locales.ts';
import {
DEFAULT_LINKS_VALIDATION,
@@ -108,18 +112,230 @@ export function normalizeAttachmentFolderPath(value: string): string {
return trimmed === '' ? DEFAULT_ATTACHMENT_FOLDER_PATH : trimmed;
}
+export function canonicalAttachmentFolderPath(value: string): string {
+ const normalized = normalizeAttachmentFolderPath(value);
+ if (normalized === '.') return '/';
+ if (normalized.startsWith('./') || normalized.startsWith('/')) return normalized;
+ return `/${normalized}`;
+}
+
+export const ATTACHMENT_FOLDER_PATH_VARIABLES = ['filename'] as const;
+
+type AttachmentFolderPathVariable = (typeof ATTACHMENT_FOLDER_PATH_VARIABLES)[number];
+
+export type AttachmentFolderPathPart =
+ | { kind: 'text'; text: string; start: number }
+ | { kind: 'variable'; text: string; start: number; name: AttachmentFolderPathVariable }
+ | { kind: 'unknown-variable'; text: string; start: number; name: string };
+
+export type AttachmentFolderPathVariableIssue =
+ | { kind: 'unknown-variable'; variables: string[] }
+ | { kind: 'unclosed-braces' }
+ | { kind: 'repeated-variable' };
+
+const ATTACHMENT_FOLDER_VARIABLE_PATTERN = /\{\{([^{}\n]+?)\}\}/g;
+
+function isAttachmentFolderPathVariable(name: string): name is AttachmentFolderPathVariable {
+ return (ATTACHMENT_FOLDER_PATH_VARIABLES as readonly string[]).includes(name);
+}
+
+export function parseAttachmentFolderPath(value: string): AttachmentFolderPathPart[] {
+ const parts: AttachmentFolderPathPart[] = [];
+ let cursor = 0;
+ for (const match of value.matchAll(ATTACHMENT_FOLDER_VARIABLE_PATTERN)) {
+ const start = match.index;
+ if (start > cursor)
+ parts.push({ kind: 'text', text: value.slice(cursor, start), start: cursor });
+ const name = (match[1] ?? '').trim();
+ parts.push(
+ isAttachmentFolderPathVariable(name)
+ ? { kind: 'variable', text: match[0], start, name }
+ : { kind: 'unknown-variable', text: match[0], start, name },
+ );
+ cursor = start + match[0].length;
+ }
+ if (cursor < value.length) parts.push({ kind: 'text', text: value.slice(cursor), start: cursor });
+ return parts;
+}
+
+function countVariables(parts: readonly AttachmentFolderPathPart[]): number {
+ return parts.filter((part) => part.kind === 'variable').length;
+}
+
+export function attachmentFolderPathVariableIssue(
+ value: string,
+): AttachmentFolderPathVariableIssue | null {
+ const parts = parseAttachmentFolderPath(value);
+ const unknown = parts.flatMap((part) => (part.kind === 'unknown-variable' ? [part.text] : []));
+ if (unknown.length > 0) return { kind: 'unknown-variable', variables: unknown };
+ if (
+ parts.some(
+ (part) => part.kind === 'text' && (part.text.includes('{{') || part.text.includes('}}')),
+ )
+ ) {
+ return { kind: 'unclosed-braces' };
+ }
+ if (value.split('/').some((segment) => countVariables(parseAttachmentFolderPath(segment)) > 1)) {
+ return { kind: 'repeated-variable' };
+ }
+ return null;
+}
+
+export function describeAttachmentFolderPathVariableIssue(
+ issue: AttachmentFolderPathVariableIssue,
+): string {
+ const supported = ATTACHMENT_FOLDER_PATH_VARIABLES.map((name) => `{{${name}}}`).join(', ');
+ switch (issue.kind) {
+ case 'unknown-variable':
+ return `content.attachmentFolderPath uses the unknown variable ${issue.variables.join(', ')}. Supported variables: ${supported}.`;
+ case 'unclosed-braces':
+ return 'content.attachmentFolderPath has a "{{" or "}}" without its pair.';
+ case 'repeated-variable':
+ return 'content.attachmentFolderPath uses a variable more than once in one folder name.';
+ }
+}
+
+function expandAttachmentFolderPath(
+ value: string,
+ variables: Record<AttachmentFolderPathVariable, string>,
+): string {
+ return parseAttachmentFolderPath(value)
+ .map((part) => (part.kind === 'variable' ? variables[part.name] : part.text))
+ .join('');
+}
+
+function documentFilenameVariable(docFile: string): string {
+ const lower = docFile.toLowerCase();
+ const docExt = SUPPORTED_DOC_EXTENSIONS.find((candidate) => lower.endsWith(candidate));
+ return docExt ? docFile.slice(0, -docExt.length) : '';
+}
+
+export function attachmentFolderForDocument(attachmentFolderPath: string, docPath: string): string {
+ const slash = docPath.lastIndexOf('/');
+ const docDir = slash === -1 ? '' : docPath.slice(0, slash);
+ const filename = documentFilenameVariable(docPath.slice(slash + 1));
+ const normalized = normalizeAttachmentFolderPath(attachmentFolderPath);
+ const template =
+ filename === '' && countVariables(parseAttachmentFolderPath(normalized)) > 0
+ ? BESIDE_DOCUMENT_ATTACHMENT_FOLDER_PATH
+ : normalized;
+ const expanded = expandAttachmentFolderPath(template, { filename });
+ const docRelative = expanded.startsWith('./');
+ const rest = docRelative ? expanded.slice(2) : expanded;
+ return [...(docRelative ? [docDir] : []), ...rest.split('/')]
+ .filter((segment) => segment !== '' && segment !== '.')
+ .join('/');
+}
+
+export function attachmentFolderSegmentMatcher(segment: string): (candidate: string) => boolean {
+ const parts = parseAttachmentFolderPath(segment);
+ if (countVariables(parts) !== 1) return (candidate) => candidate === segment;
+ const variableIndex = parts.findIndex((part) => part.kind === 'variable');
+ const textOf = (side: readonly AttachmentFolderPathPart[]) =>
+ side.map((part) => part.text).join('');
+ const prefix = textOf(parts.slice(0, variableIndex));
+ const suffix = textOf(parts.slice(variableIndex + 1));
+ return (candidate) =>
+ candidate.length > prefix.length + suffix.length &&
+ candidate.startsWith(prefix) &&
+ candidate.endsWith(suffix);
+}
+
+const ATTACHMENT_FOLDER_PATH_SAFETY_RULE =
+ "must not contain '..' segments, NUL bytes, backslashes, or drive letters";
+
export function isValidAttachmentFolderPath(value: string): boolean {
const normalized = normalizeAttachmentFolderPath(value);
if (normalized.includes('\0')) return false;
if (normalized.includes('\\')) return false;
- if (normalized === '/') return true;
- if (normalized.startsWith('/')) return false;
- if (/^[A-Za-z]:/.test(normalized)) return false;
const segments = normalized.split('/');
+ const firstFolder = segments.find((segment) => segment !== '' && segment !== '.');
+ if (firstFolder !== undefined && /^[A-Za-z]:/.test(firstFolder)) return false;
if (segments.some((seg) => seg === '..')) return false;
return true;
}
+const RESERVED_FOLDER_NAME_CHARACTERS = /[<>:"\\|?*]/;
+
+export type AttachmentFolderPathInputIssue =
+ | { kind: 'empty' }
+ | { kind: 'outside-project' }
+ | { kind: 'reserved-character' }
+ | { kind: 'surrounding-space' }
+ | { kind: 'missing-prefix' }
+ | { kind: 'empty-folder-name' }
+ | { kind: 'trailing-slash' }
+ | { kind: 'single-brace' }
+ | AttachmentFolderPathVariableIssue;
+
+function inputIssue(issue: AttachmentFolderPathInputIssue) {
+ return { params: issue };
+}
+
+function hasSingleBrace(path: string): boolean {
+ return parseAttachmentFolderPath(path).some(
+ (part) => part.kind === 'text' && /[{}]/.test(part.text),
+ );
+}
+
+const AttachmentFolderPathInputSchema = z
+ .string()
+ .refine((path) => path.trim() !== '', inputIssue({ kind: 'empty' }))
+ .refine(
+ (path) => !RESERVED_FOLDER_NAME_CHARACTERS.test(path),
+ inputIssue({ kind: 'reserved-character' }),
+ )
+ .refine(isValidAttachmentFolderPath, inputIssue({ kind: 'outside-project' }))
+ .refine((path) => path === path.trim(), inputIssue({ kind: 'surrounding-space' }))
+ .refine(
+ (path) => path.startsWith('./') || path.startsWith('/'),
+ inputIssue({ kind: 'missing-prefix' }),
+ )
+ .refine((path) => !path.includes('//'), inputIssue({ kind: 'empty-folder-name' }))
+ .refine(
+ (path) => path === './' || path === '/' || !path.endsWith('/'),
+ inputIssue({ kind: 'trailing-slash' }),
+ )
+ .superRefine((path, ctx) => {
+ const issue = attachmentFolderPathVariableIssue(path);
+ if (issue) ctx.addIssue({ code: 'custom', params: issue });
+ })
+ .refine((path) => !hasSingleBrace(path), inputIssue({ kind: 'single-brace' }));
+
+const INPUT_ISSUE_KINDS = {
+ empty: true,
+ 'outside-project': true,
+ 'reserved-character': true,
+ 'surrounding-space': true,
+ 'missing-prefix': true,
+ 'empty-folder-name': true,
+ 'trailing-slash': true,
+ 'single-brace': true,
+ 'unknown-variable': true,
+ 'unclosed-braces': true,
+ 'repeated-variable': true,
+} satisfies Record<AttachmentFolderPathInputIssue['kind'], true>;
+
+function isAttachmentFolderPathInputIssue(value: unknown): value is AttachmentFolderPathInputIssue {
+ if (typeof value !== 'object' || value === null || !('kind' in value)) return false;
+ const { kind } = value;
+ if (typeof kind !== 'string' || !Object.hasOwn(INPUT_ISSUE_KINDS, kind)) return false;
+ return kind !== 'unknown-variable' || ('variables' in value && Array.isArray(value.variables));
+}
+
+export function attachmentFolderPathInputIssue(
+ path: string,
+): AttachmentFolderPathInputIssue | null {
+ const result = AttachmentFolderPathInputSchema.safeParse(path);
+ if (result.success) return null;
+ const [first] = result.error.issues;
+ const params = first?.code === 'custom' ? first.params : undefined;
+ if (isAttachmentFolderPathInputIssue(params)) return params;
+ throw new Error(
+ `Attachment folder path check failed without a known problem kind: ${first?.message}`,
+ );
+}
+
export const ConfigSchema = z.looseObject({
content: z
.looseObject({
@@ -142,11 +358,10 @@ export const ConfigSchema = z.looseObject({
reload: 'live',
defaultScope: 'project',
description:
- "Where pasted and dropped assets, and MCP write assets given a bare file name, are stored, relative to the content root. './' colocates beside the current document (default); '/' targets the content root; './subdir' targets a subfolder under the current document folder; 'folder' targets a fixed folder under the content root. Whitespace-only values are treated as './'.",
+ "Where pasted and dropped assets, and MCP write assets given a bare file name, are stored. The path must start with './' (relative to the current document) or '/' (relative to the content root): './' colocates beside the current document; './subdir' targets a subfolder next to it; '/' targets the content root; '/folder' targets a fixed folder under the content root. '{{filename}}' expands to the current document's name without its extension, so the default './{{filename}}.assets' keeps each document's files in its own folder. An upload whose parent is not a Markdown document, such as an MCP write asset given a bare file name, ignores {{filename}} and is placed as with './', which for a bare file name is the content root. A bare name such as 'attachments', saved by older versions, is read as '/attachments'. A path with an unknown variable refuses uploads until it is fixed. Whitespace-only values are treated as the default.",
})
.refine(isValidAttachmentFolderPath, {
- message:
- "Invalid attachment folder path: must not contain '..' segments, NUL bytes, backslashes, or OS absolute paths (use '/' for the content root).",
+ message: `Invalid attachment folder path: ${ATTACHMENT_FOLDER_PATH_SAFETY_RULE}.`,
})
.default(DEFAULT_ATTACHMENT_FOLDER_PATH),
})
diff --git a/packages/core/src/constants/upload.ts b/packages/core/src/constants/upload.ts
index a39c11f94..f652c16f1 100644
--- a/packages/core/src/constants/upload.ts
+++ b/packages/core/src/constants/upload.ts
@@ -253,7 +253,9 @@ export type EmitFormat = 'wikiembed' | 'markdown-image';
export type DedupMode = 'off' | 'same-dir';
export type DedupUIMode = 'silent' | 'toast' | 'confirm';
-export const DEFAULT_ATTACHMENT_FOLDER_PATH = './';
+export const DEFAULT_ATTACHMENT_FOLDER_PATH = './{{filename}}.assets';
+
+export const BESIDE_DOCUMENT_ATTACHMENT_FOLDER_PATH = './';
export const DEFAULT_EMIT_FORMAT: EmitFormat = 'wikiembed';
diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts
index c619da2be..19a35c00e 100644
--- a/packages/core/src/index.ts
+++ b/packages/core/src/index.ts
@@ -316,6 +316,14 @@ export {
} from './config/resolve-server-config.ts';
export type { Err, Ok, Result } from './config/result.ts';
export {
+ ATTACHMENT_FOLDER_PATH_VARIABLES,
+ type AttachmentFolderPathInputIssue,
+ type AttachmentFolderPathPart,
+ type AttachmentFolderPathVariableIssue,
+ attachmentFolderForDocument,
+ attachmentFolderPathInputIssue,
+ attachmentFolderPathVariableIssue,
+ attachmentFolderSegmentMatcher,
type Config,
type ConfigPatch,
ConfigSchema,
@@ -330,6 +338,7 @@ export {
DEFAULT_SPANS_MAX_BYTES,
DEFAULT_TELEMETRY_ATTRIBUTE_DENYLIST,
DEFAULT_TUNNEL_PORT,
+ describeAttachmentFolderPathVariableIssue,
IDLE_SHUTDOWN_DURATION_RE,
isLoopbackEmbeddingsUrl,
isValidAttachmentFolderPath,
@@ -340,6 +349,7 @@ export {
MIN_EMBEDDINGS_MAX_BATCH_CHARS,
MIN_EMBEDDINGS_MAX_BATCH_SIZE,
normalizeAttachmentFolderPath,
+ parseAttachmentFolderPath,
} from './config/schema.ts';
export { getLeafFieldMeta, resolveLeafSchema } from './config/schema-leaf.ts';
export { CONFIG_SCHEMA_MAJOR, CONFIG_SCHEMA_MAJOR_PATH } from './config/schema-version.ts';
@@ -634,6 +644,7 @@ export {
ALLOWED_VIDEO_MIME_TYPES,
ASSET_EXTENSIONS,
AUDIO_EXTENSIONS,
+ BESIDE_DOCUMENT_ATTACHMENT_FOLDER_PATH,
CODE_FILE_EXTENSIONS,
DEFAULT_ATTACHMENT_FOLDER_PATH,
DEFAULT_DEDUP_MODE,
@@ -1264,6 +1275,8 @@ export {
type Anchor,
type ApiConfigSuccess,
ApiConfigSuccessSchema,
+ type AttachmentFolderUploadIssue,
+ AttachmentFolderUploadIssueSchema,
agentWriteOutcomeWireFields,
assertNeverProblemType,
assertNeverSemanticProviderErrorReason,
diff --git a/packages/core/src/markdown/comment-promoter.ts b/packages/core/src/markdown/comment-promoter.ts
index fc267cbea..fb0ba5a7c 100644
--- a/packages/core/src/markdown/comment-promoter.ts
+++ b/packages/core/src/markdown/comment-promoter.ts
@@ -1,3 +1,4 @@
+
import type { Nodes, Paragraph, PhrasingContent, Root, RootContent, Text } from 'mdast';
import { SKIP, visit } from 'unist-util-visit';
import type { VFile } from 'vfile';
diff --git a/packages/core/src/markdown/merged-walker.ts b/packages/core/src/markdown/merged-walker.ts
index 861003fb4..ae8cb390b 100644
--- a/packages/core/src/markdown/merged-walker.ts
+++ b/packages/core/src/markdown/merged-walker.ts
@@ -1,3 +1,4 @@
+
import type { Nodes, Parent, Root } from 'mdast';
import { SKIP, visit } from 'unist-util-visit';
import type { VFile } from 'vfile';
diff --git a/packages/core/src/markdown/safe-url.ts b/packages/core/src/markdown/safe-url.ts
index 4d3250d3a..8be632ba4 100644
--- a/packages/core/src/markdown/safe-url.ts
+++ b/packages/core/src/markdown/safe-url.ts
@@ -1,3 +1,4 @@
+
export const SAFE_URL_SCHEMES = ['https', 'http', 'mailto', 'tel', 'ftp', 'sms'] as const;
const SCHEME_ALT = SAFE_URL_SCHEMES.map((s) => `${s}:`).join('|');
diff --git a/packages/core/src/schemas/api/_envelope.ts b/packages/core/src/schemas/api/_envelope.ts
index aed3c59df..71f2a9c06 100644
--- a/packages/core/src/schemas/api/_envelope.ts
+++ b/packages/core/src/schemas/api/_envelope.ts
@@ -181,6 +181,14 @@ export const UploadAssetSuccessSchema = z
.loose() satisfies StandardSchemaV1;
export type UploadAssetSuccess = z.infer<typeof UploadAssetSuccessSchema>;
+export const AttachmentFolderUploadIssueSchema = z.discriminatedUnion('kind', [
+ z.object({ kind: z.literal('unknown-variable'), variables: z.array(z.string()) }),
+ z.object({ kind: z.literal('unclosed-braces') }),
+ z.object({ kind: z.literal('repeated-variable') }),
+ z.object({ kind: z.literal('invalid-config') }),
+]);
+export type AttachmentFolderUploadIssue = z.infer<typeof AttachmentFolderUploadIssueSchema>;
+
export const LocalOpCloneRequestSchema = z
.object({
url: z.string().min(1),
diff --git a/packages/server/assets/skills/project/references/media-and-assets.md b/packages/server/assets/skills/project/references/media-and-assets.md
index 27d1d9633..0bc8c9a1f 100644
--- a/packages/server/assets/skills/project/references/media-and-assets.md
+++ b/packages/server/assets/skills/project/references/media-and-assets.md
@@ -3,7 +3,7 @@
- **Markdown syntax only:** `![alt text](./path/to/image.png)`. Do NOT emit HTML `<img>` tags — they don't participate in OK's content graph and don't render consistently across Fumadocs / preview surfaces. Paths resolve relative to the doc.
- **Always a doc-relative path — never a server URL.** Reference an asset by its path relative to the doc (`./image.png`, `../assets/foo.png`), never an absolute `http://localhost:<port>/…`, `127.0.0.1`, or other server URL. `preview_url`'s `url` navigates the *preview* — it is NOT an asset path; never paste it (or any `localhost` base) into an `![]()`. An asset already in the tree is the same rule: find its path with `exec("ls -A <dir>")` and write the relative link. (Upload via `write({ asset })` hands you the exact relative `![alt](ref)` to copy.)
- **Save locally, don't hot-link.** Hot-linked external image URLs rot when the source disappears. Fetch it through the ingest procedure in `references/ingest-and-sources.md` (SSRF-safe fetch flags, size + executable-extension gates, wrapper frontmatter) — never an ad-hoc `WebFetch` / `curl` into the tree — then reference the local file via a relative markdown link and cite the ingested wrapper below.
-- **Placement model.** Free-form image embeds → co-located alongside the referencing doc (sha256 same-directory dedup): give `write({ asset })` a `path` in that doc's folder, because a bare file name goes to the attachment folder (`content.attachmentFolderPath`, by default the content root). Raw sources via `ingest` → `external-sources/<slug>.<ext>` + `external-sources/<slug>.md` (the wrapper-binary pair). Check via `exec("ls -A")` if the project uses a different convention.
+- **Placement model.** Free-form image embeds → co-located alongside the referencing doc (sha256 same-directory dedup): give `write({ asset })` a `path` in that doc's folder, because a bare file name goes to the attachment folder (`content.attachmentFolderPath`, by default the content root; it has no parent document, so a setting that uses `{{filename}}` puts it in the content root). Raw sources via `ingest` → `external-sources/<slug>.<ext>` + `external-sources/<slug>.md` (the wrapper-binary pair). Check via `exec("ls -A")` if the project uses a different convention.
- **Cannot fetch** (no network, paywall) → don't invent a local path. Omit, or mark inline `(TODO: image needs sourcing from <URL>)`.
- **Meaningful alt text required** — describes WHAT the image shows, not what it is. `![]()` / `![image]()` / `![filename.png]()` all fail. OK indexes alt text — it's both accessibility AND searchability.
- **Cite web image sources** below the image (Grounding rule):
diff --git a/packages/server/src/api-extension.test.ts b/packages/server/src/api-extension.test.ts
index ed048ddae..c08ac6695 100644
--- a/packages/server/src/api-extension.test.ts
+++ b/packages/server/src/api-extension.test.ts
@@ -250,7 +250,7 @@ describe('handleUploadAsset', () => {
});
test('configured content-root folder stores upload under fixed attachments directory', async () => {
- attachmentFolderPath = 'attachments';
+ attachmentFolderPath = '/attachments';
const res = await uploadImage(createPngBuffer(), 'diagram.png', 'docs/guide.md');
const body = (await res.json()) as { src: string; path: string; deduped: boolean };
expect(res.status).toBe(200);
@@ -304,7 +304,7 @@ describe('handleUploadAsset', () => {
});
test('a configured attachmentFolderPath naming .ok is refused at the resolved destination', async () => {
- attachmentFolderPath = '.ok/skills';
+ attachmentFolderPath = '/.ok/skills';
const res = await uploadImage(createPngBuffer(), 'planted.png', 'docs/guide.md');
const body = (await res.json()) as { type: string; status: number };
expect(res.status).toBe(400);
@@ -313,7 +313,7 @@ describe('handleUploadAsset', () => {
});
test('parent-dir placement keeps explicit sidebar folder drops in the target folder', async () => {
- attachmentFolderPath = 'attachments';
+ attachmentFolderPath = '/attachments';
const res = await uploadImage(createPngBuffer(), 'clip.png', 'docs/guide.md', 'parent-dir');
const body = (await res.json()) as { src: string; path: string };
expect(res.status).toBe(200);
@@ -514,6 +514,7 @@ describe('handleUploadAsset — same-dir sha256 dedup (FR-2)', () => {
sessionManager,
contentDir,
getFileIndex: () => new Map(),
+ getAttachmentFolderPath: () => './',
});
const { createServer } = await import('node:http');
diff --git a/packages/server/src/content-filter.test.ts b/packages/server/src/content-filter.test.ts
index 5a9404909..fc38ab6d8 100644
--- a/packages/server/src/content-filter.test.ts
+++ b/packages/server/src/content-filter.test.ts
@@ -1600,6 +1600,74 @@ describe('ContentFilter', () => {
}
});
+ test('a {{filename}} attachment folder admits per-document folders beneath note directories in both factories', async () => {
+ mkdirSync(join(projectDir, 'notes'), { recursive: true });
+ writeFileSync(join(projectDir, 'root.md'), '# Root');
+ writeFileSync(join(projectDir, 'notes', 'meeting.md'), '# Meeting');
+ const filters = [
+ createContentFilter({
+ projectDir,
+ contentDir: projectDir,
+ attachmentFolderPath: './{{filename}}.assets',
+ }),
+ await createContentFilterAsync({
+ projectDir,
+ contentDir: projectDir,
+ attachmentFolderPath: './{{filename}}.assets',
+ }),
+ createContentFilter({
+ projectDir,
+ contentDir: projectDir,
+ attachmentFolderPath: '/uploads/{{filename}}',
+ }),
+ ];
+
+ for (const filter of filters.slice(0, 2)) {
+ expect(filter.isExcluded('root.assets/cover.png')).toBe(false);
+ expect(filter.isExcluded('notes/meeting.assets/photo.png')).toBe(false);
+ expect(filter.isExcluded('notes/meeting.files/photo.png')).toBe(true);
+ expect(filter.isExcluded('orphan/meeting.assets/photo.png')).toBe(true);
+ }
+ expect(filters[2].isExcluded('uploads/meeting/photo.png')).toBe(false);
+ expect(filters[2].isExcluded('uploads/photo.png')).toBe(true);
+ expect(filters[2].isExcluded('other/meeting/photo.png')).toBe(true);
+ });
+
+ test('a filter built without an attachment folder admits the default per-document folders in both factories', async () => {
+ mkdirSync(join(projectDir, 'notes'), { recursive: true });
+ writeFileSync(join(projectDir, 'notes', 'meeting.md'), '# Meeting');
+ const filters = [
+ createContentFilter({ projectDir, contentDir: projectDir }),
+ await createContentFilterAsync({ projectDir, contentDir: projectDir }),
+ ];
+
+ for (const filter of filters) {
+ expect(filter.isExcluded('notes/meeting.assets/photo.png')).toBe(false);
+ }
+ });
+
+ test('a folder name that repeats a variable is matched literally, not as a pattern', async () => {
+ mkdirSync(join(projectDir, 'notes'), { recursive: true });
+ writeFileSync(join(projectDir, 'notes', 'meeting.md'), '# Meeting');
+ const filters = [
+ createContentFilter({
+ projectDir,
+ contentDir: projectDir,
+ attachmentFolderPath: './{{filename}}{{filename}}.assets',
+ }),
+ await createContentFilterAsync({
+ projectDir,
+ contentDir: projectDir,
+ attachmentFolderPath: './{{filename}}{{filename}}.assets',
+ }),
+ ];
+
+ for (const filter of filters) {
+ expect(filter.isExcluded('notes/meetingmeeting.assets/photo.png')).toBe(true);
+ expect(filter.isExcluded('notes/{{filename}}{{filename}}.assets/photo.png')).toBe(false);
+ }
+ });
+
test('content-root attachment folder admits only root-level assets in both factories', async () => {
const filters = [
createContentFilter({
@@ -1677,7 +1745,7 @@ describe('ContentFilter', () => {
}
});
- test('explicit default keeps the historical sibling-only rule', () => {
+ test("an explicit './' admits only assets beside a document", () => {
mkdirSync(join(projectDir, 'assets'), { recursive: true });
writeFileSync(join(projectDir, 'root.md'), '# Root');
const filter = createContentFilter({
diff --git a/packages/server/src/content-filter.ts b/packages/server/src/content-filter.ts
index 59469c0d9..c61ae7ca8 100644
--- a/packages/server/src/content-filter.ts
+++ b/packages/server/src/content-filter.ts
@@ -5,6 +5,8 @@ import { homedir } from 'node:os';
import { dirname, extname, join, relative, resolve } from 'node:path';
import { promisify } from 'node:util';
import {
+ attachmentFolderSegmentMatcher,
+ BESIDE_DOCUMENT_ATTACHMENT_FOLDER_PATH,
DEFAULT_ATTACHMENT_FOLDER_PATH,
isValidAttachmentFolderPath,
LEGACY_SKILL_STORE_ROOT,
@@ -72,27 +74,37 @@ function isBuiltinSkipDirName(name: string): boolean {
return BUILTIN_SKIP_DIRS.has(name) || ALWAYS_SKIP_DIRS.has(name.toLowerCase());
}
+type AttachmentFolderSegment = (candidate: string) => boolean;
+
type AttachmentFolderShape =
| { kind: 'sibling' }
| { kind: 'content-root' }
- | { kind: 'fixed'; path: string }
- | { kind: 'doc-relative'; path: string };
+ | { kind: 'fixed'; segments: readonly AttachmentFolderSegment[] }
+ | { kind: 'doc-relative'; segments: readonly AttachmentFolderSegment[] };
function attachmentFolderShape(value: string): AttachmentFolderShape {
const normalized = normalizeAttachmentFolderPath(value);
if (!isValidAttachmentFolderPath(normalized)) {
throw new Error('Invalid attachment folder path');
}
- if (normalized === './') return { kind: 'sibling' };
+ if (normalized === BESIDE_DOCUMENT_ATTACHMENT_FOLDER_PATH) return { kind: 'sibling' };
if (normalized === '/' || normalized === '.') return { kind: 'content-root' };
const docRelative = normalized.startsWith('./');
- const path = (docRelative ? normalized.slice(2) : normalized)
+ const segments = (docRelative ? normalized.slice(2) : normalized)
.split('/')
.filter((segment) => segment !== '' && segment !== '.')
- .join('/');
- if (path === '') return docRelative ? { kind: 'sibling' } : { kind: 'content-root' };
- return { kind: docRelative ? 'doc-relative' : 'fixed', path };
+ .map(attachmentFolderSegmentMatcher);
+ if (segments.length === 0) return docRelative ? { kind: 'sibling' } : { kind: 'content-root' };
+ return { kind: docRelative ? 'doc-relative' : 'fixed', segments };
+}
+
+function segmentsMatchAt(
+ dirSegments: readonly string[],
+ start: number,
+ segments: readonly AttachmentFolderSegment[],
+): boolean {
+ return segments.every((matches, offset) => matches(dirSegments[start + offset] ?? ''));
}
function assertNeverAttachmentShape(shape: never): never {
@@ -110,16 +122,15 @@ function isConfiguredAttachmentAsset(
const lastSlash = relativePath.lastIndexOf('/');
const fileDir = lastSlash === -1 ? '' : relativePath.slice(0, lastSlash);
if (shape.kind === 'content-root') return fileDir === '';
+ const dirSegments = fileDir === '' ? [] : fileDir.split('/');
if (shape.kind === 'fixed') {
- return fileDir === shape.path || fileDir.startsWith(`${shape.path}/`);
+ return (
+ dirSegments.length >= shape.segments.length && segmentsMatchAt(dirSegments, 0, shape.segments)
+ );
}
if (shape.kind === 'doc-relative') {
- const dirSegments = fileDir === '' ? [] : fileDir.split('/');
- const shapeSegments = shape.path.split('/');
- for (let start = 0; start <= dirSegments.length - shapeSegments.length; start++) {
- if (!shapeSegments.every((segment, offset) => dirSegments[start + offset] === segment)) {
- continue;
- }
+ for (let start = 0; start <= dirSegments.length - shape.segments.length; start++) {
+ if (!segmentsMatchAt(dirSegments, start, shape.segments)) continue;
const parentDir = dirSegments.slice(0, start).join('/');
if (hasDocumentInDir(parentDir)) return true;
}
diff --git a/packages/server/src/http/file-ops-routes.ts b/packages/server/src/http/file-ops-routes.ts
index 0b69dec81..67bf71cea 100644
--- a/packages/server/src/http/file-ops-routes.ts
+++ b/packages/server/src/http/file-ops-routes.ts
@@ -10,6 +10,7 @@ import type { IncomingMessage, ServerResponse } from 'node:http';
import { dirname, extname, resolve, sep } from 'node:path';
import { pipeline } from 'node:stream/promises';
import {
+ type AttachmentFolderUploadIssue,
CreateFolderRequestSchema,
CreateFolderSuccessSchema,
CreatePageRequestSchema,
@@ -18,6 +19,7 @@ import {
DeletePathSuccessSchema,
DuplicatePathRequestSchema,
DuplicatePathSuccessSchema,
+ describeAttachmentFolderPathVariableIssue,
findTemplateByName,
instantiateDoc,
isManagedArtifactDocName,
@@ -62,7 +64,7 @@ import {
import { classifyFsPath, normalizeFsPath } from '../fs-traced.ts';
import type { PinoLogger } from '../logger.ts';
import { createMultipartParser, type MultipartParser } from '../multipart.ts';
-import type { AssetService } from '../services/assets.ts';
+import { type AssetService, AttachmentFolderPathConfigError } from '../services/assets.ts';
import { DuplicateNameExhaustedError, type FileOpsService } from '../services/file-ops.ts';
import { type getMeter, withSpan } from '../telemetry.ts';
import {
@@ -1541,12 +1543,32 @@ export function createFileOpsRoutes(deps: FileOpsRouteDeps): ApiRouteGroup {
500,
'urn:ok:error:internal-server-error',
'Server configuration error: invalid attachment folder path.',
- { handler: 'upload-asset', cause: outcome.cause },
+ {
+ handler: 'upload-asset',
+ cause: outcome.cause,
+ detail:
+ outcome.cause instanceof AttachmentFolderPathConfigError
+ ? `content.attachmentFolderPath in .ok/config.yml: ${outcome.cause.reasons.join('; ')}`
+ : 'content.attachmentFolderPath in .ok/config.yml could not be read.',
+ extensions: {
+ attachmentFolderIssue: {
+ kind: 'invalid-config',
+ } satisfies AttachmentFolderUploadIssue,
+ },
+ },
);
return;
case 'invalid-attachment-folder':
errorResponse(res, 400, 'urn:ok:error:invalid-request', 'Invalid attachment folder path.', {
handler: 'upload-asset',
+ ...(outcome.issue
+ ? {
+ detail: describeAttachmentFolderPathVariableIssue(outcome.issue),
+ extensions: {
+ attachmentFolderIssue: outcome.issue satisfies AttachmentFolderUploadIssue,
+ },
+ }
+ : {}),
});
return;
case 'path-escape':
diff --git a/packages/server/src/mcp-write-asset-placement.test.ts b/packages/server/src/mcp-write-asset-placement.test.ts
index 8dad9df5b..b19b4c5cb 100644
--- a/packages/server/src/mcp-write-asset-placement.test.ts
+++ b/packages/server/src/mcp-write-asset-placement.test.ts
@@ -9,6 +9,7 @@ import {
} from './mcp-dual-transport-rig.test-helper.ts';
const ATTACHMENT_FOLDER = 'attachments';
+const ATTACHMENT_FOLDER_SETTING = `/${ATTACHMENT_FOLDER}`;
const PNG_1X1 = Buffer.from(
'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==',
@@ -36,6 +37,22 @@ interface AssetWrite {
let rig: DualTransportMcpRig;
+function writeAttachmentFolderConfig(contentDir: string, attachmentFolderPath: string): void {
+ writeFileSync(
+ resolve(contentDir, OK_DIR, 'config.yml'),
+ `content:\n attachmentFolderPath: '${attachmentFolderPath}'\n`,
+ );
+}
+
+function withAttachmentFolderConfig(attachmentFolderPath: string): void {
+ beforeAll(() => writeAttachmentFolderConfig(rig.contentDir, attachmentFolderPath));
+ afterAll(() => writeAttachmentFolderConfig(rig.contentDir, ATTACHMENT_FOLDER_SETTING));
+}
+
+function replyText(result: ToolResult): string {
+ return result.content?.map((c) => c.text ?? '').join('\n') ?? '';
+}
+
beforeAll(async () => {
rig = await startDualTransportMcpRig({
tmpPrefix: 'ok-mcp-asset-placement-',
@@ -43,11 +60,7 @@ beforeAll(async () => {
seed: (contentDir) => {
const okDir = resolve(contentDir, OK_DIR);
mkdirSync(okDir, { recursive: true });
- writeFileSync(
- resolve(okDir, 'config.yml'),
- `content:\n attachmentFolderPath: ${ATTACHMENT_FOLDER}\n`,
- 'utf-8',
- );
+ writeAttachmentFolderConfig(contentDir, ATTACHMENT_FOLDER_SETTING);
writeFileSync(resolve(okDir, '.gitignore'), '', 'utf-8');
mkdirSync(resolve(contentDir, 'docs'), { recursive: true });
writeFileSync(resolve(contentDir, 'docs', 'readme.md'), '# Docs\n', 'utf-8');
@@ -81,7 +94,7 @@ async function writeAsset(transport: Transport, path: string, tag: string): Prom
asset: { path, content: Buffer.concat([PNG_1X1, Buffer.from(tag)]).toString('base64') },
},
})) as ToolResult;
- const reply = result.content?.map((c) => c.text ?? '').join('\n') ?? '';
+ const reply = replyText(result);
expect(result.isError ?? false, reply).toBe(false);
return {
reply,
@@ -93,7 +106,7 @@ async function writeAsset(transport: Transport, path: string, tag: string): Prom
const pathToken = (path: string): RegExp =>
new RegExp(`(?:^|[\\s\`'"])/?${path.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}(?![\\w/-])`, 'm');
-describe(`MCP write({ asset }) with content.attachmentFolderPath: ${ATTACHMENT_FOLDER}`, () => {
+describe(`MCP write({ asset }) with content.attachmentFolderPath: ${ATTACHMENT_FOLDER_SETTING}`, () => {
describe('an explicit folder in asset.path decides where the bytes land', () => {
test.each(TRANSPORTS)('$arm: docs/<name> lands in docs/', async ({ transport }) => {
const requested = `docs/${transport}-placed.png`;
@@ -147,3 +160,77 @@ describe(`MCP write({ asset }) with content.attachmentFolderPath: ${ATTACHMENT_F
);
});
});
+
+describe('MCP write({ asset }) with content.attachmentFolderPath: ./{{filename}}.assets', () => {
+ withAttachmentFolderConfig('./{{filename}}.assets');
+
+ test.each(TRANSPORTS)(
+ '$arm: a bare name has no document, so it skips the {{filename}} folder',
+ async ({ transport }) => {
+ const { written } = await writeAsset(
+ transport,
+ `${transport}-nodoc.png`,
+ `${transport}-nodoc`,
+ );
+ expect(written).toEqual([`${transport}-nodoc.png`]);
+ },
+ );
+
+ test.each(TRANSPORTS)('$arm: an explicit folder still wins', async ({ transport }) => {
+ const requested = `docs/${transport}-explicit.png`;
+ const { written } = await writeAsset(transport, requested, `${transport}-explicit`);
+ expect(written).toEqual([requested]);
+ });
+});
+
+describe('MCP write({ asset }) with content.attachmentFolderPath: /uploads/{{filename}}', () => {
+ withAttachmentFolderConfig('/uploads/{{filename}}');
+
+ test.each(TRANSPORTS)(
+ '$arm: a bare name has no document, so it is placed as with ./',
+ async ({ transport }) => {
+ const { written } = await writeAsset(
+ transport,
+ `${transport}-uploads-nodoc.png`,
+ `${transport}-uploads-nodoc`,
+ );
+ expect(written).toEqual([`${transport}-uploads-nodoc.png`]);
+ },
+ );
+});
+
+describe('MCP write({ asset }) with content.attachmentFolderPath: ./{{FILENAME}}.assets', () => {
+ withAttachmentFolderConfig('./{{FILENAME}}.assets');
+
+ test.each(TRANSPORTS)(
+ '$arm: the refusal reply names the setting and the unknown variable',
+ async ({ transport }) => {
+ const result = (await clientFor(transport).callTool({
+ name: 'write',
+ arguments: {
+ asset: { path: `${transport}-refused.png`, content: PNG_1X1.toString('base64') },
+ },
+ })) as ToolResult;
+ const reply = replyText(result);
+ expect(result.isError).toBe(true);
+ expect(reply).toContain('content.attachmentFolderPath');
+ expect(reply).toContain('{{FILENAME}}');
+ },
+ );
+});
+
+describe('MCP write({ asset }) with a bare content.attachmentFolderPath saved by older versions', () => {
+ withAttachmentFolderConfig(ATTACHMENT_FOLDER);
+
+ test.each(TRANSPORTS)(
+ '$arm: a legacy bare value still loads and places a bare-name asset in attachments/',
+ async ({ transport }) => {
+ const { written } = await writeAsset(
+ transport,
+ `${transport}-legacy-bare.png`,
+ `${transport}-legacy-bare`,
+ );
+ expect(written).toEqual([`${ATTACHMENT_FOLDER}/${transport}-legacy-bare.png`]);
+ },
+ );
+});
diff --git a/packages/server/src/mcp/tools/write.ts b/packages/server/src/mcp/tools/write.ts
index 5ae611ce2..4e4ea8bd7 100644
--- a/packages/server/src/mcp/tools/write.ts
+++ b/packages/server/src/mcp/tools/write.ts
@@ -631,9 +631,12 @@ async function handleAsset(
: {
ok: false,
status,
- error:
- (data && (typeof data.title === 'string' ? data.title : (data.error as string))) ||
- `Upload failed (HTTP ${status}).`,
+ error: requestFailureText({
+ error:
+ (data && (typeof data.title === 'string' ? data.title : (data.error as string))) ||
+ `Upload failed (HTTP ${status}).`,
+ detail: data?.detail,
+ }),
};
if (!resBody.ok) return textResult(`Error: ${resBody.error}`, true);
@@ -1112,7 +1115,7 @@ export function register(server: ServerInstance, deps: WriteDeps): void {
path: z
.string()
.describe(
- 'Asset path incl. extension — the slashes are the folder. Example: "images/diagram.png". A bare file name (no folder) goes to the attachment folder (`content.attachmentFolderPath`; by default the content root).',
+ 'Asset path incl. extension — the slashes are the folder. Example: "images/diagram.png". A bare file name (no folder) goes to the attachment folder (`content.attachmentFolderPath`; by default the content root). It has no parent document, so a setting that uses `{{filename}}` puts it in the content root.',
),
content: z.string().optional().describe('Base64 of the binary. Use for small files.'),
source: z
diff --git a/packages/server/src/resolve-upload-dest-dir.test.ts b/packages/server/src/resolve-upload-dest-dir.test.ts
index 737c89928..72ef2ded6 100644
--- a/packages/server/src/resolve-upload-dest-dir.test.ts
+++ b/packages/server/src/resolve-upload-dest-dir.test.ts
@@ -4,16 +4,16 @@ import { resolveUploadDestDir } from './api-extension.ts';
describe('resolveUploadDestDir (SPEC §6 FR-5 + docs matrix)', () => {
const root = '/vault';
- test('"./" → co-located with doc (default)', () => {
+ test('"./" → co-located with doc', () => {
expect(resolveUploadDestDir('docs/meeting.md', './', root)).toBe('/vault/docs');
});
- test('"" (empty) → co-located with doc (fallback)', () => {
- expect(resolveUploadDestDir('docs/meeting.md', '', root)).toBe('/vault/docs');
+ test('"" (empty) → the default folder named after the doc', () => {
+ expect(resolveUploadDestDir('docs/meeting.md', '', root)).toBe('/vault/docs/meeting.assets');
});
- test('whitespace-only → co-located with doc (fallback)', () => {
- expect(resolveUploadDestDir('docs/meeting.md', ' ', root)).toBe('/vault/docs');
+ test('whitespace-only → the default folder named after the doc', () => {
+ expect(resolveUploadDestDir('docs/meeting.md', ' ', root)).toBe('/vault/docs/meeting.assets');
});
test('"/" → content-directory root', () => {
@@ -52,6 +52,22 @@ describe('resolveUploadDestDir (SPEC §6 FR-5 + docs matrix)', () => {
);
});
+ test.each([
+ ['./{{filename}}.assets', 'docs/meeting.mdx', '/vault/docs/meeting.assets'],
+ ['./{{filename}}.assets', 'docs/Meeting.MD', '/vault/docs/Meeting.assets'],
+ ['./{{filename}}.assets', 'docs/v1.2.md', '/vault/docs/v1.2.assets'],
+ ['./{{filename}}.assets', 'docs/meeting', '/vault/docs'],
+ ['./{{filename}}.assets', 'model.stl', '/vault'],
+ ['./{{filename}}.assets', 'LICENSE', '/vault'],
+ ['/uploads/{{filename}}', 'docs/meeting.md', '/vault/uploads/meeting'],
+ ['/attachments', 'docs/meeting.md', '/vault/attachments'],
+ ['./{{filename}}.assets', 'diagram.png', '/vault'],
+ ['/uploads/{{filename}}', 'diagram.png', '/vault'],
+ ['/uploads/{{filename}}', 'docs/diagram.png', '/vault/docs'],
+ ])('%s for %s resolves to %s', (attachmentFolderPath, parentDocName, expected) => {
+ expect(resolveUploadDestDir(parentDocName, attachmentFolderPath, root)).toBe(expected);
+ });
+
test('doc in nested directory + bare name ignores the doc dir entirely', () => {
expect(resolveUploadDestDir('archive/2026/note.md', 'attachments', root)).toBe(
'/vault/attachments',
diff --git a/packages/server/src/server-factory.ts b/packages/server/src/server-factory.ts
index bd9843b25..953f1f08b 100644
--- a/packages/server/src/server-factory.ts
+++ b/packages/server/src/server-factory.ts
@@ -337,6 +337,7 @@ import {
registerLoadedDocsProvider,
registerPersistenceQueueDepthProvider,
} from './server-workload-telemetry.ts';
+import { AttachmentFolderPathConfigError } from './services/assets.ts';
import { shadowOpGateFor } from './shadow-op-gate.ts';
import {
buildWipTree,
@@ -896,8 +897,7 @@ export function createServer(options: ServerOptions): ServerInstance {
)
: [];
if (attachmentIssues.length > 0) {
- const details = attachmentIssues.map((issue) => issue.message).join('; ');
- throw new Error(`Invalid content.attachmentFolderPath in project config: ${details}`);
+ throw new AttachmentFolderPathConfigError(attachmentIssues.map((issue) => issue.message));
}
if (options?.requireValid) {
throw new Error('Project config is invalid', { cause: project.error });
@@ -2141,7 +2141,7 @@ export function createServer(options: ServerOptions): ServerInstance {
} catch (err) {
log.warn(
{ err },
- '[content-filter] invalid attachment folder at boot — using sibling admission',
+ '[content-filter] invalid attachment folder at boot — using default attachment placement',
);
}
lastAppliedAttachmentFolderPath = initialAttachmentFolderPath;
diff --git a/packages/server/src/services/assets.ts b/packages/server/src/services/assets.ts
index e3b164f33..0cac735b1 100644
--- a/packages/server/src/services/assets.ts
+++ b/packages/server/src/services/assets.ts
@@ -10,10 +10,14 @@ import {
unlinkSync,
} from 'node:fs';
import { readdir, stat } from 'node:fs/promises';
-import { dirname, extname, relative, resolve } from 'node:path';
+import { extname, relative, resolve } from 'node:path';
import { pipeline } from 'node:stream/promises';
import {
ASSET_EXTENSIONS,
+ type AttachmentFolderPathVariableIssue,
+ attachmentFolderForDocument,
+ attachmentFolderPathVariableIssue,
+ BESIDE_DOCUMENT_ATTACHMENT_FOLDER_PATH,
DEFAULT_ATTACHMENT_FOLDER_PATH,
DEFAULT_DEDUP_MODE,
INLINE_RENDERABLE_EXTENSIONS,
@@ -71,10 +75,19 @@ interface StoreUploadInput {
placement: 'configured-attachments' | 'parent-dir' | undefined;
}
+export class AttachmentFolderPathConfigError extends Error {
+ readonly reasons: readonly string[];
+ constructor(reasons: readonly string[]) {
+ super(`Invalid content.attachmentFolderPath in project config: ${reasons.join('; ')}`);
+ this.reasons = reasons;
+ this.name = 'AttachmentFolderPathConfigError';
+ }
+}
+
type StoreUploadOutcome =
| { ok: true; src: string; path: string; deduped: boolean; mime: string | null }
| { ok: false; kind: 'config-error'; cause: unknown }
- | { ok: false; kind: 'invalid-attachment-folder' }
+ | { ok: false; kind: 'invalid-attachment-folder'; issue?: AttachmentFolderPathVariableIssue }
| { ok: false; kind: 'path-escape'; cause?: unknown }
| { ok: false; kind: 'dest-validation-error'; cause: unknown; destDir: string }
| { ok: false; kind: 'reserved-destination'; destDir: string }
@@ -119,17 +132,10 @@ export function resolveUploadDestDir(
attachmentFolderPath: string,
resolvedContentDir: string,
): string {
- const trimmed = attachmentFolderPath.trim();
- if (trimmed === '' || trimmed === './') {
- return resolve(resolvedContentDir, dirname(parentDocName));
- }
- if (trimmed === '/') {
- return resolvedContentDir;
- }
- if (trimmed.startsWith('./')) {
- return resolve(resolvedContentDir, dirname(parentDocName), trimmed.slice(2));
- }
- return resolve(resolvedContentDir, trimmed);
+ return resolve(
+ resolvedContentDir,
+ attachmentFolderForDocument(attachmentFolderPath, parentDocName),
+ );
}
function readTempFileHead(path: string, n: number): Buffer {
@@ -265,7 +271,7 @@ export function createAssetService(deps: AssetServiceDeps): AssetService {
try {
rawAttachmentFolderPath =
placement === 'parent-dir'
- ? DEFAULT_ATTACHMENT_FOLDER_PATH
+ ? BESIDE_DOCUMENT_ATTACHMENT_FOLDER_PATH
: (deps.getAttachmentFolderPath?.() ?? DEFAULT_ATTACHMENT_FOLDER_PATH);
} catch (err) {
cleanupTempfile();
@@ -275,6 +281,11 @@ export function createAssetService(deps: AssetServiceDeps): AssetService {
cleanupTempfile();
return { ok: false, kind: 'invalid-attachment-folder' };
}
+ const variableIssue = attachmentFolderPathVariableIssue(rawAttachmentFolderPath);
+ if (variableIssue) {
+ cleanupTempfile();
+ return { ok: false, kind: 'invalid-attachment-folder', issue: variableIssue };
+ }
const attachmentFolderPath = normalizeAttachmentFolderPath(rawAttachmentFolderPath);
const destDir = resolveUploadDestDir(parentDocName, attachmentFolderPath, resolvedContentDir);
if (!isWithinContentDir(destDir, resolvedContentDir)) {
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index a5f3d3a88..51b3171d9 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1258,6 +1258,68 @@ importers:
specifier: 1.2.0-beta.15
version: 1.2.0-beta.15
+ packages/md-conformance:
+ dependencies:
+ '@inkeep/open-knowledge-core':
+ specifier: workspace:*
+ version: link:../core
+ '@tiptap/core':
+ specifier: 3.22.3
+ version: 3.22.3(@tiptap/[email protected])
+ '@tiptap/pm':
+ specifier: 3.22.4
+ version: 3.22.4
+ fast-check:
+ specifier: ^4.6.0
+ version: 4.9.0
+ ts-morph:
+ specifier: ^28.0.0
+ version: 28.0.0
+ yjs:
+ specifier: ^13.6.30
+ version: 13.6.31
+ zod:
+ specifier: ^4.3.6
+ version: 4.4.3
+ devDependencies:
+ '@types/mdast':
+ specifier: ^4.0.4
+ version: 4.0.4
+ '@types/node':
+ specifier: ^24.7.0
+ version: 24.13.3
+ commonmark.json:
+ specifier: 0.31.0
+ version: 0.31.0
+ typescript:
+ specifier: ~7.0.2
+ version: 7.0.2
+
+ packages/md-conformance/md-audit:
+ dependencies:
+ '@types/mdast':
+ specifier: ^4.0.4
+ version: 4.0.4
+ mdast-util-to-markdown:
+ specifier: ^2.1.2
+ version: 2.1.2
+ ts-morph:
+ specifier: ^28.0.0
+ version: 28.0.0
+ devDependencies:
+ '@types/node':
+ specifier: ^24.7.0
+ version: 24.13.3
+ tsx:
+ specifier: ^4.20.0
+ version: 4.23.0
+ typescript:
+ specifier: ~7.0.2
+ version: 7.0.2
+ vitest:
+ specifier: ^5.0.3
+
packages/native-config:
devDependencies:
'@napi-rs/cli':