From 339e09365c753728fe44a3f43a500d60e4a3091a Mon Sep 17 00:00:00 2001 From: fuxiao Date: Tue, 28 Apr 2026 13:29:12 +0800 Subject: [PATCH 1/2] fix(extension): Stabilize update marker Use the upstream README timestamp for the generated settings marker instead of formatting the local update time. This keeps the marker deterministic across operating systems and avoids locale-specific settings churn. Co-authored-by: Codex --- extension/src/fetch.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/extension/src/fetch.ts b/extension/src/fetch.ts index 6406afa2..da9736d3 100644 --- a/extension/src/fetch.ts +++ b/extension/src/fetch.ts @@ -4,12 +4,15 @@ import { window, workspace } from 'vscode' import { getConfig } from './config' import { FILE, MSG_PREFIX, URL_PREFIX } from './constants' +const UPDATE_MARKER_FALLBACK = 'Last update from upstream' + export async function fetchLatest() { const repo = getConfig('fileNestingUpdater.upstreamRepo') const branch = getConfig('fileNestingUpdater.upstreamBranch') const url = `${URL_PREFIX}/${repo}@${branch}/${FILE}` const md = await fetch(url).then(r => r.text()) const content = (md.match(/```jsonc([\s\S]*?)```/) || [])[1] || '' + const updated = content.match(/^\s*\/\/ updated (.+)$/m)?.[1]?.trim() const json = `{${ content @@ -21,12 +24,15 @@ export async function fetchLatest() { }}` const config = JSON.parse(json) || {} - return config['explorer.fileNesting.patterns'] + return { + patterns: config['explorer.fileNesting.patterns'], + updated, + } } export async function fetchAndUpdate(ctx: ExtensionContext, prompt = true) { const config = workspace.getConfiguration() - const patterns = await fetchLatest() + const { patterns, updated } = await fetchLatest() let shouldUpdate = true const oringalPatterns = { ...(config.get('explorer.fileNesting.patterns') || {}) } @@ -54,7 +60,9 @@ export async function fetchAndUpdate(ctx: ExtensionContext, prompt = true) { config.update('explorer.fileNesting.expand', false, true) config.update('explorer.fileNesting.patterns', { - '//': `Last update at ${new Date().toLocaleString()}`, + '//': updated + ? `Last update from upstream at ${updated} UTC` + : UPDATE_MARKER_FALLBACK, ...patterns, }, true) From e0891fea52f6f327e4c0c7060928fa1485abd187 Mon Sep 17 00:00:00 2001 From: fuxiao Date: Tue, 28 Apr 2026 13:33:24 +0800 Subject: [PATCH 2/2] fix(extension): Preserve marker wording Keep the generated marker compatible with the previous text shape while making the timestamp deterministic. This limits the change to the timestamp source and reduces risk for ad-hoc readers. Co-authored-by: Codex --- extension/src/fetch.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extension/src/fetch.ts b/extension/src/fetch.ts index da9736d3..518ad839 100644 --- a/extension/src/fetch.ts +++ b/extension/src/fetch.ts @@ -61,7 +61,7 @@ export async function fetchAndUpdate(ctx: ExtensionContext, prompt = true) { config.update('explorer.fileNesting.patterns', { '//': updated - ? `Last update from upstream at ${updated} UTC` + ? `Last update at ${updated} UTC` : UPDATE_MARKER_FALLBACK, ...patterns, }, true)