From c84383a44bfd1de6ea30e29b8343e653bbb6d247 Mon Sep 17 00:00:00 2001 From: vorotamoroz Date: Fri, 4 Sep 2026 16:21:05 +0000 Subject: [PATCH] Keep active-file path warnings readable --- src/common/messages/combinedMessages.prod.ts | 2 +- src/common/messagesJson/en.json | 2 +- src/common/messagesYAML/en.yaml | 4 ++-- src/common/translation.unit.spec.ts | 17 +++++++++++++++++ src/modules/features/ModuleLog.ts | 4 ---- updates.md | 2 +- 6 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/common/messages/combinedMessages.prod.ts b/src/common/messages/combinedMessages.prod.ts index 77987015..0bcbaaf2 100644 --- a/src/common/messages/combinedMessages.prod.ts +++ b/src/common/messages/combinedMessages.prod.ts @@ -4213,7 +4213,7 @@ export const allMessages: Readonly- - A file or folder name exceeds ${maxBytes} UTF-8 bytes and may not work on - some Android and Linux file systems: ${components} + This path contains a file or folder name longer than ${maxBytes} UTF-8 + bytes. It may not work on some Android and Linux file systems. showLog: Show Log moduleMigration: fix0256: diff --git a/src/common/translation.unit.spec.ts b/src/common/translation.unit.spec.ts index 00ce480f..c4007822 100644 --- a/src/common/translation.unit.spec.ts +++ b/src/common/translation.unit.spec.ts @@ -21,6 +21,23 @@ describe("LiveSync-owned translation catalogue", () => { expect($msg("moduleCheckRemoteSize.optionIncreaseLimit", { newMax: "800" }, "def")).toBe("increase to 800MB"); }); + it("keeps the active-file path compatibility warning concise", () => { + const oversizedComponent = `${"界".repeat(86)} (258 bytes)`; + + expect( + $msg( + "moduleLog.pathComponentTooLong", + { + maxBytes: "255", + components: oversizedComponent, + }, + "def" + ) + ).toBe( + "This path contains a file or folder name longer than 255 UTF-8 bytes. It may not work on some Android and Linux file systems." + ); + }); + it("uses Commonlib's canonical English when the application catalogue has no translation", () => { setLang("es"); diff --git a/src/modules/features/ModuleLog.ts b/src/modules/features/ModuleLog.ts index 4b7e4fec..14bfd36c 100644 --- a/src/modules/features/ModuleLog.ts +++ b/src/modules/features/ModuleLog.ts @@ -299,13 +299,9 @@ export class ModuleLog extends AbstractObsidianModule { } const oversizedPathComponents = findPathComponentsExceedingUtf8Limit(thisFile.path); if (oversizedPathComponents.length > 0) { - const components = oversizedPathComponents - .map(({ component, utf8Bytes }) => `${component} (${utf8Bytes} bytes)`) - .join(", "); reasonWarn.push( $msg("moduleLog.pathComponentTooLong", { maxBytes: `${ANDROID_LINUX_PATH_COMPONENT_UTF8_WARNING_BOUNDARY}`, - components, }) ); } diff --git a/updates.md b/updates.md index fd0810cf..4ca32553 100644 --- a/updates.md +++ b/updates.md @@ -23,7 +23,7 @@ Earlier releases remain available in the 1.0 release history, the 1.0 preview hi #### Improved - Start-up now keeps unconfigured Vaults on the onboarding path without running configured-only checks or accepting Config Doctor and incomplete-document repair requests. Returning a configured Vault to an unconfigured state also retires those requests for the current plug-in process, so completing setup admits them only after the requested restart. -- The active-file warning now identifies file or folder names longer than 255 UTF-8 bytes as an Android and Linux compatibility risk, without rejecting or changing the path. +- The active-file warning now concisely identifies file or folder names longer than 255 UTF-8 bytes as an Android and Linux compatibility risk, without rejecting or changing the path. ### Testing