Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

fix(open-knowledge): keep a project autofix sweep alive past its panel (PRD-7741) (#3218)

serafin-garcia774c87649b6f
diff --git a/.changeset/background-project-autofix-sweep.md b/.changeset/background-project-autofix-sweep.md
new file mode 100644
index 000000000..7ca755691
--- /dev/null
+++ b/.changeset/background-project-autofix-sweep.md
@@ -0,0 +1,5 @@
+---
+"@inkeep/open-knowledge": patch
+---
+
+A project-wide **Fix all** now keeps running when you switch away from the Problems tab. Previously the sweep lived inside the Problems panel and ended the moment that panel stopped being rendered, so clicking over to Timeline or Comments mid-sweep left the project partially fixed with nothing to say that anything had stopped, or why. The sweep now belongs to the operation rather than to the panel: it runs to completion in the background, any panel you open mid-sweep picks up its progress, and it reports how it ended — finished, stopped, or failed — wherever you happen to be looking. Completion is now announced too, so a long sweep you walked away from tells you when it is done.
diff --git a/packages/app/src/components/ProblemsPanel.dom.test.tsx b/packages/app/src/components/ProblemsPanel.dom.test.tsx
index 43ace11a9..86a223f6a 100644
--- a/packages/app/src/components/ProblemsPanel.dom.test.tsx
+++ b/packages/app/src/components/ProblemsPanel.dom.test.tsx
@@ -25,6 +25,8 @@ import type { LintNavDetail } from './ProblemsPanel';
const linguiMacroMock = {
t: renderLinguiTemplate,
msg: renderLinguiTemplate,
+ plural: (value: number, { one, other }: { one: string; other: string }) =>
+ (value === 1 ? one : other).replace('#', String(value)),
Trans: ({ children }: { children: ReactNode }) => children,
Plural: ({ value, one, other }: { value: number; one: string; other: string }) => (
<>{(value === 1 ? one : other).replace('#', String(value))}</>
@@ -121,6 +123,10 @@ function lintConfigWith(plugins: { markdownlint: boolean; frontmatter: boolean }
}
const { ProblemsPanel, LINT_NAV_EVENT } = await import('./ProblemsPanel');
+// Dynamic like the panel above, not a static import: the store binds the mocked
+// `sonner` only if it loads after the registrations, and a hoisted static import
+// would bind the real one.
+const { __resetProjectFixSweepForTests } = await import('@/lib/project-fix-sweep-store');
// The real registry, deliberately unmocked: the tests assert the banked intent
// through its public consume API — the same call the source editor replays.
const { consumePendingSourceNavigation, clearPendingSourceNavigationsForTest } = await import(
@@ -178,11 +184,16 @@ beforeEach(() => {
toastSuccess.mockClear();
toastInfo.mockClear();
lintConfigListeners.clear();
+ // The sweep is a session singleton now, and this config isolates per FILE,
+ // not per test — without this a sweep left running by one test would refuse
+ // the next test's start.
+ __resetProjectFixSweepForTests();
});
afterEach(() => {
cleanup();
clearPendingSourceNavigationsForTest();
+ __resetProjectFixSweepForTests();
window.location.hash = '';
});
@@ -1101,7 +1112,7 @@ describe('ProblemsPanel — project scope', () => {
}
});
- test('project Auto-fix sweeps only fixable files, re-audits, and stays quiet on success', async () => {
+ test('project Auto-fix sweeps only fixable files, re-audits, and reports completion', async () => {
const fixableEdit = {
range: { start: { line: 2, character: 0 }, end: { line: 2, character: 1 } },
newText: ' ',
@@ -1126,6 +1137,10 @@ describe('ProblemsPanel — project scope', () => {
await waitFor(() => expect(fixLintDocCalls).toEqual(['a', 'nested/c']));
// The sweep ends in a fresh audit fetch (initial activation + re-audit).
await waitFor(() => expect(auditCalls).toBe(2));
+ // A sweep can finish with nobody watching the counter, so completion is
+ // announced rather than inferred from the count landing on N/N.
+ expect(toastSuccess).toHaveBeenCalledTimes(1);
+ expect(String(toastSuccess.mock.calls[0]?.[0])).toContain('2 files');
expect(toastError).not.toHaveBeenCalled();
});
@@ -1176,6 +1191,52 @@ describe('ProblemsPanel — project scope', () => {
await waitFor(() => expect(auditCalls).toBe(2));
});
+ test('a running sweep survives the panel unmounting and still reports how it ended', async () => {
+ // The Problems tab is rendered conditionally, so switching to Timeline
+ // unmounts this panel mid-sweep. That used to end the run silently, leaving
+ // the project half-fixed with nothing to explain it on return.
+ const fixableEdit = {
+ range: { start: { line: 2, character: 0 }, end: { line: 2, character: 1 } },
+ newText: ' ',
+ };
+ runLintAuditImpl = async () =>
+ auditResult({
+ files: [
+ { file: 'a.md', diagnostics: [diag({ fixes: [fixableEdit] })] },
+ { file: 'b.md', diagnostics: [diag({ fixes: [fixableEdit] })] },
+ { file: 'c.md', diagnostics: [diag({ fixes: [fixableEdit] })] },
+ ],
+ });
+ // Park the opening fix so the unmount lands while the sweep is genuinely
+ // mid-flight, rather than after it has already finished.
+ let releaseFirst: (() => void) | undefined;
+ const firstInFlight = new Promise<void>((resolve) => {
+ releaseFirst = resolve;
+ });
+ fixLintDocImpl = async (docName: string) => {
+ if (docName === 'a') await firstInFlight;
+ return { ok: true as const, status: 200, problemType: null, errorDetail: null };
+ };
+
+ const view = render(<ProblemsPanel docName="notes" diagnostics={[]} />);
+ fireEvent.click(screen.getByTestId('panel-scope-project'));
+ await waitFor(() => expect(screen.getByText('a.md')).toBeTruthy());
+
+ fireEvent.click(screen.getByTestId('problems-auto-fix'));
+ await screen.findByTestId('problems-cancel-fix');
+ view.unmount();
+ releaseFirst?.();
+
+ // Every file still gets fixed, and the completion toast reaches the user
+ // through the app-root Toaster even though no panel is mounted.
+ await waitFor(() => expect(fixLintDocCalls).toEqual(['a', 'b', 'c']));
+ await waitFor(() => expect(toastSuccess).toHaveBeenCalledTimes(1));
+ expect(toastError).not.toHaveBeenCalled();
+ // Nothing left to re-audit for: the panel that owned the plane is gone, so
+ // the only walk was its initial activation.
+ expect(auditCalls).toBe(1);
+ });
+
test('a stopped sweep does not poison the next one', async () => {
const fixableEdit = {
range: { start: { line: 2, character: 0 }, end: { line: 2, character: 1 } },
diff --git a/packages/app/src/components/ProblemsPanel.tsx b/packages/app/src/components/ProblemsPanel.tsx
index 03d2fcee8..e1b38ac8a 100644
--- a/packages/app/src/components/ProblemsPanel.tsx
+++ b/packages/app/src/components/ProblemsPanel.tsx
@@ -17,7 +17,6 @@ import { type ReactElement, type ReactNode, useEffect, useRef, useState } from '
import { toast } from 'sonner';
import { useOptionalPageList } from '@/components/PageListContext';
import { type PanelScope, PanelScopeHeader } from '@/components/PanelScopeHeader';
-import { runProjectFixSweep, sweepSleep } from '@/components/problems-sweep';
import { LINT_PLUGIN_META, type LintPluginMeta } from '@/components/settings/lint-plugin-meta';
import { Badge } from '@/components/ui/badge';
import { Button } from '@/components/ui/button';
@@ -42,6 +41,12 @@ import { rememberPendingSourceNavigation } from '@/editor/source-editor-navigati
import { AUDIT_SUPERSEDED, runValidationAudit } from '@/editor/validation-audit-client';
import { createPageFromSeedAndUpdate } from '@/lib/create-page';
import { filePathToDocName, hashFromDocName } from '@/lib/doc-hash';
+import {
+ cancelProjectFixSweep,
+ startProjectFixSweep,
+ subscribeToProjectFixSweepSettled,
+ useProjectFixSweep,
+} from '@/lib/project-fix-sweep-store';
import { openProjectPluginsSettings } from '@/lib/use-settings-route';
import { cn } from '@/lib/utils';
import { replaceValidationFromAudit } from '@/lib/validation-store';
@@ -541,19 +546,20 @@ export function ProblemsPanel({
: [];
const noPluginsEnabled = activePlugins !== null && activePlugins.length === 0;
const [audit, setAudit] = useState<ProjectAuditState>({ status: 'idle' });
- const [projectFixing, setProjectFixing] = useState<{ done: number; total: number } | null>(null);
+ // The sweep itself lives in a module store, not here, so it outlives this
+ // panel — a tab switch unmounts the Problems tab, and the run must not end
+ // with it. The panel only reads progress and drives start/stop.
+ const projectFixing = useProjectFixSweep();
// The dead-link "Create page" one-shot (target being created, else null).
// Optional context: the panel is always under PageListProvider in the app;
// the null branch only serves bare unit harnesses (create renders disabled).
const pageList = useOptionalPageList();
const [creatingTarget, setCreatingTarget] = useState<string | null>(null);
- // Tracks whether the panel is still mounted so the async project sweep can
- // stop early instead of posting fixes and setState-ing into an unmounted tree.
+ // Tracks whether the panel is still mounted so async work owned BY the panel
+ // (the audit walk, the dead-link page create) can stop early instead of
+ // setState-ing into an unmounted tree. Deliberately not consulted by the
+ // sweep, which the store owns and which must survive this panel.
const mountedRef = useRef(true);
- // Set by the Stop control to end a running sweep at the next file boundary. A
- // ref, not state: the sweep loop reads it between files and a re-render would
- // neither reach the in-flight loop nor be wanted mid-sweep.
- const cancelSweepRef = useRef(false);
useEffect(() => {
mountedRef.current = true;
return () => {
@@ -564,6 +570,8 @@ export function ProblemsPanel({
// installed once and must not be torn down and re-added on every render, so it
// calls through this instead of closing over a particular render's state.
const onLintConfigChangedRef = useRef<() => void>(() => {});
+ // Latest-ref for the sweep-settled subscription, same reason as above.
+ const onSweepSettledRef = useRef<() => void>(() => {});
// The last SETTLED audit plane, i.e. what an abandoned walk falls back to.
// A latest-ref rather than the `audit` closure because `loadAudit` runs from
// callbacks that outlive their render (a project sweep, a page create), and
@@ -580,36 +588,9 @@ export function ProblemsPanel({
const sorted = [...diagnostics].sort(compareDiagnostics);
const docFixableCount = countFixable(sorted);
- /**
- * One-shot fix for a dead link: create the missing target page (the same
- * action as the Links panel's amber "missing page" affordance). Deliberately
- * NOT part of Fix all — a broken link may be a typo, and bulk-creating
- * targets would silently mint duplicate files.
- */
- async function createLinkTarget(diagnostic: DiagnosticLike) {
- const target = diagnostic.linkTarget;
- if (target === undefined || creatingTarget !== null || pageList === null) return;
- setCreatingTarget(target);
- // No try/finally: the React Compiler cannot lower a finalizer clause, so
- // both exits clear the creating flag explicitly.
- try {
- await createPageFromSeedAndUpdate(
- { initialDir: '', suggestedName: target },
- { addPage: pageList.addPage },
- );
- } catch (err) {
- toast.error(err instanceof Error ? err.message : t`Failed to create page`);
- if (mountedRef.current) setCreatingTarget(null);
- return;
- }
- toast.success(t`Created ${target}`);
- if (mountedRef.current) setCreatingTarget(null);
- // The doc scope heals itself (the create emits the backlinks relay the
- // link-findings hook listens to); a loaded project snapshot is stale
- // truth, so refresh it in place.
- if (mountedRef.current && audit.status === 'loaded') await loadAudit();
- }
-
+ // Declared ahead of its callers: the React Compiler cannot lower a reference
+ // to a function hoisted from below ("[PruneHoistedContexts] Rewrite hoisted
+ // function references"), and several of them sit below this declaration.
async function loadAudit() {
loadGenRef.current += 1;
const generation = loadGenRef.current;
@@ -637,13 +618,42 @@ export function ProblemsPanel({
// update in the same pass. Deliberately BEFORE the mounted guard: the
// store outlives this panel, and the fetch already completed.
if (result !== null) replaceValidationFromAudit(result.files);
- // Match the sweep's mounted guard: don't setState into an unmounted tree
- // (loadAudit is awaited from the sweep, the refresh button, and scope
- // activation).
+ // Don't setState into an unmounted tree: loadAudit is awaited from a
+ // settled sweep, the refresh button, and scope activation.
if (!mountedRef.current) return;
setAudit(result === null ? { status: 'failed' } : { status: 'loaded', result });
}
+ /**
+ * One-shot fix for a dead link: create the missing target page (the same
+ * action as the Links panel's amber "missing page" affordance). Deliberately
+ * NOT part of Fix all — a broken link may be a typo, and bulk-creating
+ * targets would silently mint duplicate files.
+ */
+ async function createLinkTarget(diagnostic: DiagnosticLike) {
+ const target = diagnostic.linkTarget;
+ if (target === undefined || creatingTarget !== null || pageList === null) return;
+ setCreatingTarget(target);
+ // No try/finally: the React Compiler cannot lower a finalizer clause, so
+ // both exits clear the creating flag explicitly.
+ try {
+ await createPageFromSeedAndUpdate(
+ { initialDir: '', suggestedName: target },
+ { addPage: pageList.addPage },
+ );
+ } catch (err) {
+ toast.error(err instanceof Error ? err.message : t`Failed to create page`);
+ if (mountedRef.current) setCreatingTarget(null);
+ return;
+ }
+ toast.success(t`Created ${target}`);
+ if (mountedRef.current) setCreatingTarget(null);
+ // The doc scope heals itself (the create emits the backlinks relay the
+ // link-findings hook listens to); a loaded project snapshot is stale
+ // truth, so refresh it in place.
+ if (mountedRef.current && audit.status === 'loaded') await loadAudit();
+ }
+
const projectFixableFiles =
audit.status === 'loaded'
? audit.result.files.filter((file) =>
@@ -651,76 +661,17 @@ export function ProblemsPanel({
)
: [];
- function cancelProjectFix() {
- cancelSweepRef.current = true;
- }
-
- async function fixAllProjectFiles() {
- if (projectFixing !== null || projectFixableFiles.length === 0) return;
- const total = projectFixableFiles.length;
- // Clear any stop left over from a previous sweep, or this one ends instantly.
- cancelSweepRef.current = false;
- setProjectFixing({ done: 0, total });
- // Sequential with a small inter-file pace and capacity-aware retry: each fix
- // lands through the agent-write spine (disk + git flush) and holds a server
- // session, so an unpaced sweep saturates the shared session pool and starves
- // concurrent agent writes. Pacing leaves headroom; a capacity refusal is
- // retried rather than counted as a failure. Non-capacity failures don't stop
- // the sweep; the re-audit below shows what remains.
- const { failures, cancelled } = await runProjectFixSweep({
+ function fixAllProjectFiles() {
+ // The store owns the sweep loop, the progress it publishes, and the toast
+ // that reports how it ended. It fixes the files sequentially with a small
+ // inter-file pace and capacity-aware retry because each fix lands through the
+ // agent-write spine (disk + git flush) and holds a server session, so an
+ // unpaced sweep saturates the shared session pool and starves concurrent
+ // agent writes.
+ void startProjectFixSweep({
items: projectFixableFiles,
fixItem: (file) => fixLintDoc(filePathToDocName(file.file)),
- sleep: sweepSleep,
- // Commit progress in chunks, not per file, so a large sweep doesn't
- // re-render (and re-announce to a screen reader) the panel thousands of
- // times; the final file always commits, so the count lands on the total.
- onProgress: (done) => setProjectFixing((prev) => (prev === null ? prev : { ...prev, done })),
- // Two ways a sweep ends early. The panel unmounted mid-sweep (tab switch,
- // agent-mode flip) — the user walked away, so stop posting fixes and skip
- // the state updates React would no-op anyway (mirrors the `cancelled`
- // guard in useDocLintConfig). Or the user pressed Stop, which is the same
- // between-files bail but leaves the panel mounted and owing them an answer.
- shouldContinue: () => mountedRef.current && !cancelSweepRef.current,
});
- // Unmounted: nobody is left to tell, and every setState below would no-op.
- if (cancelled && !mountedRef.current) return;
- setProjectFixing(null);
- if (failures.length > 0) {
- // The toast names only the first casualty; log the whole set once so a
- // bulk failure (one root cause across many files, or a mid-sweep server
- // restart) leaves a diagnostic trail for every file, not just the first.
- console.warn(
- `[lint] fix-all: ${failures.length} of ${projectFixableFiles.length} files failed`,
- failures.map((failure) => ({ file: failure.item.file, detail: failure.detail })),
- );
- // Name the first casualty so the toast is actionable — "1 of 10 failed"
- // alone gives the user nothing to act on. The detail is the server's
- // problem+json title (untranslated, like the rule-write error toasts).
- // Suppressed on a user stop: they know why it ended, and a failure toast
- // there reads as "your stop broke something".
- if (!cancelled) {
- const first = failures[0];
- toast.error(t`Could not fix ${failures.length} of ${projectFixableFiles.length} files.`, {
- description:
- first === undefined
- ? undefined
- : `${first.item.file}${first.detail === null ? '' : ` — ${first.detail}`}`,
- });
- }
- }
- if (cancelled) {
- // A stop leaves the project genuinely half-fixed, which is fine — every
- // file already swept stays fixed. Say so, and let the re-audit below
- // replace the count with what actually remains.
- toast.info(t`Stopped fixing. Files already fixed stay fixed.`);
- }
- // Guard the re-audit so a failure surfaces the "Try again" state instead of
- // an unhandled rejection off the fire-and-forget `void fixAllProjectFiles()`.
- try {
- await loadAudit();
- } catch {
- if (mountedRef.current) setAudit({ status: 'failed' });
- }
}
function handleScopeChange(next: PanelScope) {
@@ -752,6 +703,28 @@ export function ProblemsPanel({
});
useEffect(() => subscribeToLintConfigChanged(() => onLintConfigChangedRef.current()), []);
+ // A settled sweep leaves the loaded plane describing problems it just fixed.
+ // Refresh it in place — but only for a panel that is actually mounted and
+ // showing one; a sweep that outlives this panel has nothing to refresh, and
+ // the remount reloads the plane from scratch anyway. Latest-ref for the same
+ // reason as the config subscription above: installed once, never re-added.
+ useEffect(() => {
+ onSweepSettledRef.current = () => {
+ if (audit.status === 'idle' || audit.status === 'failed') return;
+ // Guard the re-audit against an unexpected throw past the fetch: a failed
+ // audit already resolves to a null plane (logged `[audit]` and handled
+ // above), so only a genuine bug lands here. Surface the "Try again" state
+ // instead of an unhandled rejection off this fire-and-forget subscriber,
+ // and log it like the sibling `[lint]` failure sites so a swallowed bug
+ // still leaves a trail.
+ void loadAudit().catch((err) => {
+ console.warn('[lint] post-sweep re-audit failed', err);
+ if (mountedRef.current) setAudit({ status: 'failed' });
+ });
+ };
+ });
+ useEffect(() => subscribeToProjectFixSweepSettled(() => onSweepSettledRef.current()), []);
+
function handleNav(diagnostic: DiagnosticLike) {
const detail = lintNavDetailOf(docName, diagnostic);
// Banked unconditionally: the visible editor (source line-jump, or the
@@ -933,8 +906,8 @@ export function ProblemsPanel({
: 0
}
fixing={projectFixing}
- onAutoFix={() => void fixAllProjectFiles()}
- onCancelFix={cancelProjectFix}
+ onAutoFix={fixAllProjectFiles}
+ onCancelFix={cancelProjectFixSweep}
onFixWithAi={
onFixWithAi === undefined || audit.status !== 'loaded'
? undefined
diff --git a/packages/app/src/components/problems-sweep.ts b/packages/app/src/components/problems-sweep.ts
index 3db79bf94..3edc18b18 100644
--- a/packages/app/src/components/problems-sweep.ts
+++ b/packages/app/src/components/problems-sweep.ts
@@ -115,7 +115,7 @@ export interface ProjectFixSweepDeps<T> {
readonly sleep: (ms: number) => Promise<void>;
/** Publishes chunked progress; called at chunk boundaries and on the last file. */
readonly onProgress: (done: number, total: number) => void;
- /** False once the caller has torn down (panel unmounted); ends the sweep. */
+ /** False once the caller wants the sweep to stop; ends it at a file boundary. */
readonly shouldContinue: () => boolean;
}
@@ -128,8 +128,8 @@ export interface ProjectFixSweepResult<T> {
/**
* One file's fix, retried on capacity refusal with the bounded backoff schedule.
* A non-capacity failure returns on the first attempt (no retry); success short-
- * circuits. Re-checks liveness around each backoff so a teardown mid-wait stops
- * the retries.
+ * circuits. Re-checks liveness around each backoff so a stop landing mid-wait
+ * ends the retries.
*/
async function fixItemWithCapacityRetry<T>(
item: T,
@@ -154,10 +154,10 @@ async function fixItemWithCapacityRetry<T>(
* Drive the project-scope "Fix all" sweep: fix each file in series, pacing
* between files and retrying capacity refusals so the sweep neither saturates
* the shared session pool nor drops files the server merely deferred. Progress
- * is published in chunks; a torn-down caller ends the sweep early. Terminal
- * (non-capacity) failures don't stop the sweep — they're collected and returned
- * for the caller to surface. Pure over its injected effects, so pacing, retry,
- * and cancellation are testable without a real clock.
+ * is published in chunks; a caller that withdraws consent ends the sweep early.
+ * Terminal (non-capacity) failures don't stop the sweep — they're collected and
+ * returned for the caller to surface. Pure over its injected effects, so pacing,
+ * retry, and cancellation are testable without a real clock.
*/
export async function runProjectFixSweep<T>(
deps: ProjectFixSweepDeps<T>,
diff --git a/packages/app/src/lib/project-fix-sweep-store.test.ts b/packages/app/src/lib/project-fix-sweep-store.test.ts
new file mode 100644
index 000000000..8ba4e4738
--- /dev/null
+++ b/packages/app/src/lib/project-fix-sweep-store.test.ts
@@ -0,0 +1,379 @@
+import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';
+import {
+ CAPACITY_PROBLEM_TYPE,
+ SWEEP_PACE_DELAY_MS,
+ type SweepFixOutcome,
+ sweepProgressInterval,
+} from '@/components/problems-sweep';
+import {
+ __resetProjectFixSweepForTests,
+ cancelProjectFixSweep,
+ getProjectFixSweepProgress,
+ type ProjectFixSweepItem,
+ startProjectFixSweep,
+ subscribeToProjectFixSweepSettled,
+} from './project-fix-sweep-store';
+
+const toasts = vi.hoisted(() => ({ error: vi.fn(), success: vi.fn(), info: vi.fn() }));
+vi.mock('sonner', () => ({ toast: toasts }));
+
+/** Records the delays the sweep asks for and resolves immediately — no clock. */
+function recordingSleep(): { sleep: (ms: number) => Promise<void>; waited: number[] } {
+ const waited: number[] = [];
+ return {
+ sleep: async (ms: number) => {
+ waited.push(ms);
+ },
+ waited,
+ };
+}
+
+function files(count: number): ProjectFixSweepItem[] {
+ return Array.from({ length: count }, (_, index) => ({ file: `doc-${index}.md` }));
+}
+
+let warn: ReturnType<typeof vi.spyOn>;
+
+beforeEach(() => {
+ __resetProjectFixSweepForTests();
+ toasts.error.mockClear();
+ toasts.success.mockClear();
+ toasts.info.mockClear();
+ warn = vi.spyOn(console, 'warn').mockImplementation(() => {});
+});
+
+afterEach(() => {
+ __resetProjectFixSweepForTests();
+ warn.mockRestore();
+});
+
+describe('startProjectFixSweep — progress', () => {
+ test('publishes the total up front so the counter reads N/M before the first fix', async () => {
+ const seen: (number | null)[] = [];
+ await startProjectFixSweep({
+ items: files(3),
+ sleep: async () => {},
+ fixItem: async () => {
+ seen.push(getProjectFixSweepProgress()?.total ?? null);
+ return { ok: true };
+ },
+ });
+ expect(seen).toEqual([3, 3, 3]);
+ });
+
+ test('advances the published count in chunks as the sweep runs', async () => {
+ // Big enough that the chunk interval exceeds one file, so a per-file
+ // publish would be visibly different from the chunked one.
+ const total = 30;
+ const interval = sweepProgressInterval(total);
+ expect(interval).toBeGreaterThan(1);
+ const seen: number[] = [];
+ await startProjectFixSweep({
+ items: files(total),
+ sleep: async () => {},
+ fixItem: async () => {
+ seen.push(getProjectFixSweepProgress()?.done ?? -1);
+ return { ok: true };
+ },
+ });
+ // Read at the top of each file, so file k sees the last chunk boundary at
+ // or below k-1: starts at 0, never goes backwards, and steps by the chunk.
+ expect(seen[0]).toBe(0);
+ expect([...seen].sort((a, b) => a - b)).toEqual(seen);
+ expect(new Set(seen).size).toBeLessThan(total);
+ expect(seen.at(-1)).toBe(Math.floor((total - 1) / interval) * interval);
+ });
+
+ test('clears progress when the sweep settles, so the Fix all button re-enables', async () => {
+ await startProjectFixSweep({
+ items: files(2),
+ sleep: async () => {},
+ fixItem: async () => ({ ok: true }),
+ });
+ expect(getProjectFixSweepProgress()).toBeNull();
+ });
+
+ test('paces between files using the injected sleep', async () => {
+ const { sleep, waited } = recordingSleep();
+ await startProjectFixSweep({
+ items: files(3),
+ sleep,
+ fixItem: async () => ({ ok: true }),
+ });
+ expect(waited).toEqual([SWEEP_PACE_DELAY_MS, SWEEP_PACE_DELAY_MS]);
+ });
+
+ test('an empty file list starts nothing', async () => {
+ // The early return skips BOTH the progress publish and the settled
+ // dispatch. Pinned because moving that return below either one would fire
+ // settled on an empty sweep and provoke a needless re-audit.
+ const settled = vi.fn();
+ subscribeToProjectFixSweepSettled(settled);
+ const fixItem = vi.fn(async (): Promise<SweepFixOutcome> => ({ ok: true }));
+ await startProjectFixSweep({ items: [], fixItem, sleep: async () => {} });
+ expect(fixItem).not.toHaveBeenCalled();
+ expect(toasts.success).not.toHaveBeenCalled();
+ expect(getProjectFixSweepProgress()).toBeNull();
+ expect(settled).not.toHaveBeenCalled();
+ });
+});
+
+describe('startProjectFixSweep — one sweep at a time', () => {
+ test('refuses a second start while one is running, however many panels ask', async () => {
+ const attempts: string[] = [];
+ let releaseFirst: (() => void) | undefined;
+ const firstFixLanded = new Promise<void>((resolve) => {
+ releaseFirst = resolve;
+ });
+ // Only the opening file parks, so the run resumes to completion once
+ // released rather than blocking again on the next one.
+ let held: (() => void) | undefined;
+ const parked = new Promise<void>((resolve) => {
+ held = resolve;
+ });
+ const first = startProjectFixSweep({
+ items: files(2),
+ sleep: async () => {},
+ fixItem: async (item) => {
+ attempts.push(item.file);
+ if (item.file === 'doc-0.md') {
+ releaseFirst?.();
+ await parked;
+ }
+ return { ok: true };
+ },
+ });
+ await firstFixLanded;
+
+ const second = vi.fn(async (): Promise<SweepFixOutcome> => ({ ok: true }));
+ await startProjectFixSweep({ items: files(5), fixItem: second, sleep: async () => {} });
+ expect(second).not.toHaveBeenCalled();
+ // The refused start must not disturb the running sweep's own progress.
+ expect(getProjectFixSweepProgress()?.total).toBe(2);
+
+ held?.();
+ await first;
+ expect(attempts).toHaveLength(2);
+ });
+
+ test('a stopped sweep does not poison the next one', async () => {
+ await startProjectFixSweep({
+ items: files(2),
+ sleep: async () => {},
+ fixItem: async () => {
+ cancelProjectFixSweep();
+ return { ok: true };
+ },
+ });
+ const attempts: string[] = [];
+ await startProjectFixSweep({
+ items: files(2),
+ sleep: async () => {},
+ fixItem: async (item) => {
+ attempts.push(item.file);
+ return { ok: true };
+ },
+ });
+ expect(attempts).toEqual(['doc-0.md', 'doc-1.md']);
+ });
+});
+
+describe('startProjectFixSweep — how a sweep ends', () => {
+ test('reports a clean run, pluralising the count', async () => {
+ await startProjectFixSweep({
+ items: files(2),
+ sleep: async () => {},
+ fixItem: async () => ({ ok: true }),
+ });
+ expect(toasts.success).toHaveBeenCalledTimes(1);
+ expect(String(toasts.success.mock.calls[0]?.[0])).toContain('2 files');
+ expect(toasts.error).not.toHaveBeenCalled();
+ expect(toasts.info).not.toHaveBeenCalled();
+ });
+
+ test('a single-file sweep does not report "1 files"', async () => {
+ await startProjectFixSweep({
+ items: files(1),
+ sleep: async () => {},
+ fixItem: async () => ({ ok: true }),
+ });
+ expect(String(toasts.success.mock.calls[0]?.[0])).toContain('1 file');
+ expect(String(toasts.success.mock.calls[0]?.[0])).not.toContain('1 files');
+ });
+
+ test('a user stop leaves earlier fixes in place and says so', async () => {
+ const attempts: string[] = [];
+ await startProjectFixSweep({
+ items: files(4),
+ sleep: async () => {},
+ fixItem: async (item) => {
+ attempts.push(item.file);
+ cancelProjectFixSweep();
+ return { ok: true };
+ },
+ });
+ expect(attempts).toEqual(['doc-0.md']);
+ expect(toasts.info).toHaveBeenCalledTimes(1);
+ expect(String(toasts.info.mock.calls[0]?.[0])).toContain('already fixed stay fixed');
+ // A stop is not a success, and it is not a failure either.
+ expect(toasts.success).not.toHaveBeenCalled();
+ expect(toasts.error).not.toHaveBeenCalled();
+ });
+
+ test('names the first casualty and logs the whole set when files fail', async () => {
+ await startProjectFixSweep({
+ items: files(3),
+ sleep: async () => {},
+ fixItem: async (item) =>
+ item.file === 'doc-0.md'
+ ? { ok: false, errorDetail: 'conflict', status: 409, problemType: null }
+ : { ok: true },
+ });
+ expect(toasts.error).toHaveBeenCalledTimes(1);
+ expect(String(toasts.error.mock.calls[0]?.[0])).toContain('1 of 3');
+ expect(toasts.error.mock.calls[0]?.[1]).toEqual({ description: 'doc-0.md — conflict' });
+ // The toast names one file; the log carries every casualty, so a bulk
+ // failure leaves a trail wider than the toast.
+ expect(warn).toHaveBeenCalledWith(expect.stringContaining('1 of 3 files failed'), [
+ { file: 'doc-0.md', detail: 'conflict' },
+ ]);
+ // Terminal failures don't end the sweep, so no success toast either.
+ expect(toasts.success).not.toHaveBeenCalled();
+ });
+
+ test('a stop landing on a failed fix logs it without blaming the user for it', async () => {
+ await startProjectFixSweep({
+ items: files(3),
+ sleep: async () => {},
+ fixItem: async () => {
+ cancelProjectFixSweep();
+ return { ok: false, errorDetail: null, status: 500, problemType: null };
+ },
+ });
+ expect(warn).toHaveBeenCalledWith(expect.stringContaining('1 of 3 files failed'), [
+ { file: 'doc-0.md', detail: null },
+ ]);
+ expect(toasts.error).not.toHaveBeenCalled();
+ expect(toasts.info).toHaveBeenCalledTimes(1);
+ });
+
+ test('retries a capacity refusal rather than reporting it as a failure', async () => {
+ const attempts: string[] = [];
+ let refusals = 1;
+ const { sleep } = recordingSleep();
+ await startProjectFixSweep({
+ items: files(1),
+ sleep,
+ fixItem: async (item) => {
+ attempts.push(item.file);
+ if (refusals-- > 0) {
+ return {
+ ok: false,
+ errorDetail: null,
+ status: 503,
+ problemType: CAPACITY_PROBLEM_TYPE,
+ };
+ }
+ return { ok: true };
+ },
+ });
+ expect(attempts).toEqual(['doc-0.md', 'doc-0.md']);
+ expect(toasts.error).not.toHaveBeenCalled();
+ expect(toasts.success).toHaveBeenCalledTimes(1);
+ });
+
+ test('a fixItem that rejects clears the counter instead of wedging it', async () => {
+ // Against contract, but the counter is module state with no unmount to
+ // clear it, so a wedged sweep would disable Fix all until a page reload.
+ // The settled signal must still fire on this path so a mounted panel
+ // re-audits the plane the aborted sweep left partly fixed.
+ const settled = vi.fn();
+ subscribeToProjectFixSweepSettled(settled);
+ await startProjectFixSweep({
+ items: files(2),
+ sleep: async () => {},
+ fixItem: async () => {
+ throw new Error('boom');
+ },
+ });
+ expect(getProjectFixSweepProgress()).toBeNull();
+ expect(toasts.error).toHaveBeenCalledTimes(1);
+ expect(settled).toHaveBeenCalledTimes(1);
+ });
+
+ test('settled listeners fire even when reporting the outcome throws', async () => {
+ // Reporting runs third-party toast calls and locale lookups. If one throws
+ // and takes the settled dispatch with it, every mounted panel keeps a plane
+ // describing problems the sweep just fixed, for the rest of the session.
+ const settled = vi.fn();
+ subscribeToProjectFixSweepSettled(settled);
+ toasts.success.mockImplementationOnce(() => {
+ throw new Error('toast blew up');
+ });
+ await expect(
+ startProjectFixSweep({
+ items: files(1),
+ sleep: async () => {},
+ fixItem: async () => ({ ok: true }),
+ }),
+ ).rejects.toThrow('toast blew up');
+ expect(settled).toHaveBeenCalledTimes(1);
+ // The throw is surfaced, not swallowed — but it does not wedge the counter.
+ expect(getProjectFixSweepProgress()).toBeNull();
+ });
+});
+
+describe('subscribeToProjectFixSweepSettled', () => {
+ test('fires on a clean finish, on a stop, and on failures', async () => {
+ const settled = vi.fn();
+ subscribeToProjectFixSweepSettled(settled);
+
+ await startProjectFixSweep({
+ items: files(1),
+ sleep: async () => {},
+ fixItem: async () => ({ ok: true }),
+ });
+ expect(settled).toHaveBeenCalledTimes(1);
+
+ await startProjectFixSweep({
+ items: files(2),
+ sleep: async () => {},
+ fixItem: async () => {
+ cancelProjectFixSweep();
+ return { ok: true };
+ },
+ });
+ expect(settled).toHaveBeenCalledTimes(2);
+
+ await startProjectFixSweep({
+ items: files(1),
+ sleep: async () => {},
+ fixItem: async () => ({ ok: false, errorDetail: null, status: 500, problemType: null }),
+ });
+ expect(settled).toHaveBeenCalledTimes(3);
+ });
+
+ test('fires only after the progress counter has cleared', async () => {
+ let progressAtSettle: unknown = 'unset';
+ subscribeToProjectFixSweepSettled(() => {
+ progressAtSettle = getProjectFixSweepProgress();
+ });
+ await startProjectFixSweep({
+ items: files(1),
+ sleep: async () => {},
+ fixItem: async () => ({ ok: true }),
+ });
+ expect(progressAtSettle).toBeNull();
+ });
+
+ test('unsubscribes', async () => {
+ const settled = vi.fn();
+ subscribeToProjectFixSweepSettled(settled)();
+ await startProjectFixSweep({
+ items: files(1),
+ sleep: async () => {},
+ fixItem: async () => ({ ok: true }),
+ });
+ expect(settled).not.toHaveBeenCalled();
+ });
+});
diff --git a/packages/app/src/lib/project-fix-sweep-store.ts b/packages/app/src/lib/project-fix-sweep-store.ts
new file mode 100644
index 000000000..356b7acf8
--- /dev/null
+++ b/packages/app/src/lib/project-fix-sweep-store.ts
@@ -0,0 +1,225 @@
+/**
+ * project-fix-sweep-store — session-wide owner of the project-scope "Fix all"
+ * sweep.
+ *
+ * The sweep is a module store, not panel state, so its lifetime is the
+ * operation's rather than any one panel's mount. That matters because the
+ * Problems tab is rendered conditionally: were the run owned by the panel,
+ * switching to Timeline would unmount it and end the run mid-project —
+ * silently, because a correct teardown declines to toast into a tree nobody is
+ * watching. As a store the run belongs to the operation and the panel is only a
+ * subscriber, so every unmount path is covered.
+ *
+ * Toasts are raised from here rather than the panel for the same reason — the
+ * app-root `<Toaster>` outlives every panel, so the user is told how a sweep
+ * ended whatever they are looking at.
+ *
+ * A running sweep is still client-side, so a page reload ends it. Surviving
+ * that would mean moving the loop server-side.
+ */
+import { plural, t } from '@lingui/core/macro';
+import { useSyncExternalStore } from 'react';
+import { toast } from 'sonner';
+import { runProjectFixSweep, type SweepFixOutcome, sweepSleep } from '@/components/problems-sweep';
+
+/** Files swept so far out of the total, published in chunks by the driver. */
+export interface ProjectFixSweepProgress {
+ readonly done: number;
+ readonly total: number;
+}
+
+/**
+ * A file the sweep fixes. Only the path is needed — to address the fix and to
+ * name the first casualty in a failure toast — so the store stays indifferent
+ * to the shape of the audit row the caller pulled it from.
+ */
+export interface ProjectFixSweepItem {
+ readonly file: string;
+}
+
+/**
+ * Both `items` and `fixItem` are captured at call time, not re-read as the
+ * sweep runs: a caller whose audit moves underneath it keeps sweeping the list
+ * it started with. A second call while one is running is declined outright, not
+ * queued — so a panel that re-renders (or a second panel that mounts) mid-sweep
+ * cannot swap the list out from under the run.
+ */
+export interface StartProjectFixSweepOptions {
+ readonly items: readonly ProjectFixSweepItem[];
+ /**
+ * Runs one file's fix. Must resolve rather than reject, per
+ * {@link runProjectFixSweep}'s contract.
+ */
+ readonly fixItem: (item: ProjectFixSweepItem) => Promise<SweepFixOutcome>;
+ /** Awaitable delay; injected so tests drive pacing and backoff without a clock. */
+ readonly sleep?: (ms: number) => Promise<void>;
+}
+
+/** Non-null exactly while a sweep is running; doubles as the re-entry guard. */
+let progress: ProjectFixSweepProgress | null = null;
+let cancelRequested = false;
+const listeners = new Set<() => void>();
+const settledListeners = new Set<() => void>();
+
+function setProgress(next: ProjectFixSweepProgress | null): void {
+ progress = next;
+ for (const listener of listeners) listener();
+}
+
+function subscribe(listener: () => void): () => void {
+ listeners.add(listener);
+ return () => {
+ listeners.delete(listener);
+ };
+}
+
+/** Progress of the running sweep, or null when none is running. */
+export function getProjectFixSweepProgress(): ProjectFixSweepProgress | null {
+ return progress;
+}
+
+/**
+ * Subscribe to the running sweep's progress. Every mounted panel sees the same
+ * run, so a panel that mounts mid-sweep picks it up rather than showing an idle
+ * Fix-all button for a project that is actively being rewritten.
+ */
+export function useProjectFixSweep(): ProjectFixSweepProgress | null {
+ return useSyncExternalStore(subscribe, getProjectFixSweepProgress, getProjectFixSweepProgress);
+}
+
+/**
+ * Fires once each time a sweep ends, however it ended. The panel re-audits on
+ * this; a panel that was unmounted at the time simply never hears it, and its
+ * remount reloads the plane anyway.
+ */
+export function subscribeToProjectFixSweepSettled(listener: () => void): () => void {
+ settledListeners.add(listener);
+ return () => {
+ settledListeners.delete(listener);
+ };
+}
+
+/** End the running sweep at the next file boundary. Files already fixed stay fixed. */
+export function cancelProjectFixSweep(): void {
+ cancelRequested = true;
+}
+
+/**
+ * Report how a sweep ended. Terminal failures are logged in full — a bulk
+ * failure (one root cause across many files, or a mid-sweep server restart)
+ * otherwise leaves a trail for only the file the toast names.
+ */
+function reportSweepOutcome(
+ failures: readonly { item: ProjectFixSweepItem; detail: string | null }[],
+ cancelled: boolean,
+ total: number,
+): void {
+ if (failures.length > 0) {
+ console.warn(
+ `[lint] fix-all: ${failures.length} of ${total} files failed`,
+ failures.map((failure) => ({ file: failure.item.file, detail: failure.detail })),
+ );
+ // Suppressed on a user stop: they know why it ended, and a failure toast
+ // there reads as "your stop broke something".
+ if (!cancelled) {
+ // Name the first casualty so the toast is actionable — "1 of 10 failed"
+ // alone gives the user nothing to act on. The detail is the server's
+ // problem+json title (untranslated, like the rule-write error toasts).
+ const first = failures[0];
+ toast.error(t`Could not fix ${failures.length} of ${total} files.`, {
+ description:
+ first === undefined
+ ? undefined
+ : `${first.item.file}${first.detail === null ? '' : ` — ${first.detail}`}`,
+ });
+ }
+ }
+ if (cancelled) {
+ // A stop leaves the project genuinely half-fixed, which is fine — every
+ // file already swept stays fixed. Say so; the settled listener in any
+ // mounted panel then re-audits, replacing the count with what actually
+ // remains.
+ toast.info(t`Stopped fixing. Files already fixed stay fixed.`);
+ return;
+ }
+ // A sweep can now finish with nobody watching the progress counter, so
+ // completion needs a signal of its own rather than relying on the count
+ // landing on N/N in a panel that may not be mounted.
+ //
+ // The count is files ATTEMPTED, not files whose content actually changed: the
+ // driver reports only failures, and `fixLintDoc`'s per-file `fixedCount` is
+ // dropped by `SweepFixOutcome`'s success arm. A file the audit called fixable
+ // that something else cleaned up before its turn still counts here. Deliberate
+ // — it matches the number the user clicked ("Fix all (N)"), and narrowing it
+ // would mean reopening the driver's result contract to thread `fixedCount`
+ // back out.
+ if (failures.length === 0) {
+ toast.success(t`Fixed ${plural(total, { one: '# file', other: '# files' })}.`);
+ }
+}
+
+/**
+ * Start the project-scope sweep: fix each file in series, publishing chunked
+ * progress, and report how it ended. Declines while a sweep is already running
+ * — one project-wide rewrite at a time, however many panels are mounted.
+ *
+ * Resolves when the sweep settles. Callers fire-and-forget; the outcome reaches
+ * the user through toasts and subscribers, not the returned promise.
+ */
+export async function startProjectFixSweep({
+ items,
+ fixItem,
+ sleep = sweepSleep,
+}: StartProjectFixSweepOptions): Promise<void> {
+ if (progress !== null || items.length === 0) return;
+ const total = items.length;
+ // Clear any stop left over from a previous sweep, or this one ends instantly.
+ cancelRequested = false;
+ setProgress({ done: 0, total });
+ let failures: { item: ProjectFixSweepItem; detail: string | null }[] = [];
+ let cancelled = false;
+ let threw = false;
+ try {
+ const result = await runProjectFixSweep<ProjectFixSweepItem>({
+ items,
+ fixItem,
+ sleep,
+ onProgress: (done) => setProgress({ done, total }),
+ shouldContinue: () => !cancelRequested,
+ });
+ failures = result.failures;
+ cancelled = result.cancelled;
+ } catch (err) {
+ // `fixItem` is contracted to resolve rather than reject, so this is a
+ // caller bug — but the progress counter is module state with no unmount to
+ // clear it, and a wedged "Fixing 3/10" would leave the button disabled
+ // with a page reload as the only way out. Clear it and say so instead.
+ console.warn('[lint] fix-all: sweep threw', err);
+ threw = true;
+ } finally {
+ setProgress(null);
+ }
+ // `finally`, not `catch`: reporting the outcome runs third-party toast calls
+ // and locale lookups, and if any of them throws, the settled listeners must
+ // still fire — a panel that never hears the sweep ended shows a stale plane
+ // for the rest of the session. Nothing is swallowed; the throw still
+ // propagates once the listeners have run.
+ try {
+ if (threw) toast.error(t`Fixing files stopped unexpectedly.`);
+ else reportSweepOutcome(failures, cancelled, total);
+ } finally {
+ for (const listener of settledListeners) listener();
+ }
+}
+
+/** Test-only: drop the in-flight sweep state and every subscriber. Production
+ * never calls this — the store is a session singleton. */
+export function __resetProjectFixSweepForTests(): void {
+ progress = null;
+ // True, not false: a sweep a previous test left running only stops when it
+ // sees a cancel, and until then it writes into the store this just reset.
+ // Safe because every start clears the flag before its first file.
+ cancelRequested = true;
+ listeners.clear();
+ settledListeners.clear();
+}
diff --git a/packages/app/src/locales/en/messages.json b/packages/app/src/locales/en/messages.json
index f548b8b96..eabc90c0f 100644
--- a/packages/app/src/locales/en/messages.json
+++ b/packages/app/src/locales/en/messages.json
@@ -1763,6 +1763,11 @@
"STTOnz": [["keyName"], " type: complex value (nested; read-only)"],
"SUOoXn": ["Failed to open project."],
"SVLPt5": [["formatted"], " GitHub stars"],
+ "SWX1O7": [
+ "Fixed ",
+ ["total", "plural", { "one": ["#", " file"], "other": ["#", " files"] }],
+ "."
+ ],
"SXCSQd": ["Copied path"],
"SXEdCq": ["Move to ", ["0"], "?"],
"SYfHmN": ["Unpin tab"],
@@ -2595,7 +2600,6 @@
"fnlBN4": ["Auto-approve settings not yet loaded — try again in a moment"],
"fo6CCk": ["pane ", ["0"]],
"fqSfXY": ["Replace"],
- "fru3T7": ["Could not fix ", ["0"], " of ", ["1"], " files."],
"ft-BOm": ["Report a bug…"],
"fuJZKk": ["Search branches"],
"fvrHin": ["Available in every project on this machine. Not shared through git."],
@@ -3452,6 +3456,7 @@
"saIASg": ["Second item"],
"saYiIO": ["Path cannot contain null bytes"],
"scu3wk": ["Model"],
+ "se-tU0": ["Could not fix ", ["0"], " of ", ["total"], " files."],
"seeS6l": ["Setup OpenKnowledge in this folder?"],
"sgmRY8": ["Skipped downloading ", ["0"], "."],
"shNd9t": ["Slash command menu"],
@@ -3655,6 +3660,7 @@
"vppAju": ["Where newly added attachments are placed."],
"vv7kpg": ["Cancelled"],
"vvWZnu": ["Diff unavailable"],
+ "vwV-kH": ["Fixing files stopped unexpectedly."],
"vy_VIN": ["Tracked in git — updates flow through your repo (pull or CI), not auto-update"],
"w3tVpc": ["No links yet. Add wiki links or markdown links to build a graph."],
"w3vFfL": ["Hide Files"],
diff --git a/packages/app/src/locales/en/messages.po b/packages/app/src/locales/en/messages.po
index a129347bf..7914c5f32 100644
--- a/packages/app/src/locales/en/messages.po
+++ b/packages/app/src/locales/en/messages.po
@@ -2850,10 +2850,9 @@ msgid "Could not finalize project setup. Try again."
msgstr "Could not finalize project setup. Try again."
#. placeholder {0}: failures.length
-#. placeholder {1}: projectFixableFiles.length
-#: src/components/ProblemsPanel.tsx
-msgid "Could not fix {0} of {1} files."
-msgstr "Could not fix {0} of {1} files."
+#: src/lib/project-fix-sweep-store.ts
+msgid "Could not fix {0} of {total} files."
+msgstr "Could not fix {0} of {total} files."
#. placeholder {0}: seed.candidatePath
#: src/components/ShareReceiveDialog.tsx
@@ -4963,6 +4962,10 @@ msgstr "Fix {flatId}"
msgid "Fix all with AI ({count})"
msgstr "Fix all with AI ({count})"
+#: src/lib/project-fix-sweep-store.ts
+msgid "Fixed {total, plural, one {# file} other {# files}}."
+msgstr "Fixed {total, plural, one {# file} other {# files}}."
+
#: src/components/settings/AttachmentsSection.tsx
msgid "Fixed folder in content root"
msgstr "Fixed folder in content root"
@@ -4979,6 +4982,10 @@ msgstr "Fixing {0} of {1} files"
msgid "Fixing {0}/{1}"
msgstr "Fixing {0}/{1}"
+#: src/lib/project-fix-sweep-store.ts
+msgid "Fixing files stopped unexpectedly."
+msgstr "Fixing files stopped unexpectedly."
+
#: src/components/settings/LintingSection.tsx
msgid "Flag common markdown issues in the editor. Powered by <0>markdownlint<1/></0>."
msgstr "Flag common markdown issues in the editor. Powered by <0>markdownlint<1/></0>."
@@ -10273,7 +10280,7 @@ msgstr "Stop fixing files"
msgid "Stop fixing. Files already fixed stay fixed."
msgstr "Stop fixing. Files already fixed stay fixed."
-#: src/components/ProblemsPanel.tsx
+#: src/lib/project-fix-sweep-store.ts
msgid "Stopped fixing. Files already fixed stay fixed."
msgstr "Stopped fixing. Files already fixed stay fixed."
diff --git a/packages/app/src/locales/pseudo/messages.json b/packages/app/src/locales/pseudo/messages.json
index 88e3f5369..ee7d614ef 100644
--- a/packages/app/src/locales/pseudo/messages.json
+++ b/packages/app/src/locales/pseudo/messages.json
@@ -1763,6 +1763,11 @@
"STTOnz": [["keyName"], " ţŷƥē: ćōḿƥĺēx vàĺũē (ńēśţēď; ŕēàď-ōńĺŷ)"],
"SUOoXn": ["Ƒàĩĺēď ţō ōƥēń ƥŕōĴēćţ."],
"SVLPt5": [["formatted"], " ĜĩţĤũƀ śţàŕś"],
+ "SWX1O7": [
+ "Ƒĩxēď ",
+ ["total", "plural", { "one": ["#", " ƒĩĺē"], "other": ["#", " ƒĩĺēś"] }],
+ "."
+ ],
"SXCSQd": ["Ćōƥĩēď ƥàţĥ"],
"SXEdCq": ["Ḿōvē ţō ", ["0"], "?"],
"SYfHmN": ["Ũńƥĩń ţàƀ"],
@@ -2595,7 +2600,6 @@
"fnlBN4": ["Àũţō-àƥƥŕōvē śēţţĩńĝś ńōţ ŷēţ ĺōàďēď — ţŕŷ àĝàĩń ĩń à ḿōḿēńţ"],
"fo6CCk": ["ƥàńē ", ["0"]],
"fqSfXY": ["Ŕēƥĺàćē"],
- "fru3T7": ["Ćōũĺď ńōţ ƒĩx ", ["0"], " ōƒ ", ["1"], " ƒĩĺēś."],
"ft-BOm": ["Ŕēƥōŕţ à ƀũĝ…"],
"fuJZKk": ["Śēàŕćĥ ƀŕàńćĥēś"],
"fvrHin": ["Àvàĩĺàƀĺē ĩń ēvēŕŷ ƥŕōĴēćţ ōń ţĥĩś ḿàćĥĩńē. Ńōţ śĥàŕēď ţĥŕōũĝĥ ĝĩţ."],
@@ -3452,6 +3456,7 @@
"saIASg": ["Śēćōńď ĩţēḿ"],
"saYiIO": ["Ƥàţĥ ćàńńōţ ćōńţàĩń ńũĺĺ ƀŷţēś"],
"scu3wk": ["Ḿōďēĺ"],
+ "se-tU0": ["Ćōũĺď ńōţ ƒĩx ", ["0"], " ōƒ ", ["total"], " ƒĩĺēś."],
"seeS6l": ["Śēţũƥ ŌƥēńĶńōŵĺēďĝē ĩń ţĥĩś ƒōĺďēŕ?"],
"sgmRY8": ["Śķĩƥƥēď ďōŵńĺōàďĩńĝ ", ["0"], "."],
"shNd9t": ["Śĺàśĥ ćōḿḿàńď ḿēńũ"],
@@ -3655,6 +3660,7 @@
"vppAju": ["Ŵĥēŕē ńēŵĺŷ àďďēď àţţàćĥḿēńţś àŕē ƥĺàćēď."],
"vv7kpg": ["Ćàńćēĺĺēď"],
"vvWZnu": ["Ďĩƒƒ ũńàvàĩĺàƀĺē"],
+ "vwV-kH": ["Ƒĩxĩńĝ ƒĩĺēś śţōƥƥēď ũńēxƥēćţēďĺŷ."],
"vy_VIN": ["Ţŕàćķēď ĩń ĝĩţ — ũƥďàţēś ƒĺōŵ ţĥŕōũĝĥ ŷōũŕ ŕēƥō (ƥũĺĺ ōŕ ĆĨ), ńōţ àũţō-ũƥďàţē"],
"w3tVpc": ["Ńō ĺĩńķś ŷēţ. Àďď ŵĩķĩ ĺĩńķś ōŕ ḿàŕķďōŵń ĺĩńķś ţō ƀũĩĺď à ĝŕàƥĥ."],
"w3vFfL": ["Ĥĩďē Ƒĩĺēś"],
diff --git a/packages/app/src/locales/pseudo/messages.po b/packages/app/src/locales/pseudo/messages.po
index 946535060..e30a71bb8 100644
--- a/packages/app/src/locales/pseudo/messages.po
+++ b/packages/app/src/locales/pseudo/messages.po
@@ -2846,9 +2846,8 @@ msgid "Could not finalize project setup. Try again."
msgstr ""
#. placeholder {0}: failures.length
-#. placeholder {1}: projectFixableFiles.length
-#: src/components/ProblemsPanel.tsx
-msgid "Could not fix {0} of {1} files."
+#: src/lib/project-fix-sweep-store.ts
+msgid "Could not fix {0} of {total} files."
msgstr ""
#. placeholder {0}: seed.candidatePath
@@ -4959,6 +4958,10 @@ msgstr ""
msgid "Fix all with AI ({count})"
msgstr ""
+#: src/lib/project-fix-sweep-store.ts
+msgid "Fixed {total, plural, one {# file} other {# files}}."
+msgstr ""
+
#: src/components/settings/AttachmentsSection.tsx
msgid "Fixed folder in content root"
msgstr ""
@@ -4975,6 +4978,10 @@ msgstr ""
msgid "Fixing {0}/{1}"
msgstr ""
+#: src/lib/project-fix-sweep-store.ts
+msgid "Fixing files stopped unexpectedly."
+msgstr ""
+
#: src/components/settings/LintingSection.tsx
msgid "Flag common markdown issues in the editor. Powered by <0>markdownlint<1/></0>."
msgstr ""
@@ -10269,7 +10276,7 @@ msgstr ""
msgid "Stop fixing. Files already fixed stay fixed."
msgstr ""
-#: src/components/ProblemsPanel.tsx
+#: src/lib/project-fix-sweep-store.ts
msgid "Stopped fixing. Files already fixed stay fixed."
msgstr ""