Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
feat(ok): pull latest changes from the share-receive miss surface (#2930)
miles-kt-inkeepe42bcd43b658
diff --git a/.changeset/share-receive-pull-cta.md b/.changeset/share-receive-pull-cta.mdnew file mode 100644index 000000000..e678d2c49--- /dev/null+++ b/.changeset/share-receive-pull-cta.md@@ -0,0 +1,11 @@+---+"@inkeep/open-knowledge": patch+---++Pull the latest changes without leaving OpenKnowledge when a share link arrives ahead of your copy.++When someone sends a link to a doc that is already on GitHub but has not reached your local copy yet, the receive dialog used to say "pull the latest changes, then open the link again" and leave you to go do it in a terminal. It now offers "Pull latest changes" on the spot: OpenKnowledge fetches and fast-forwards your copy in place, then opens the shared doc once the update lands. It only ever pulls — nothing is committed or pushed on your behalf, and your uncommitted edits ride on top of what comes in. If the pull can't run, because another sync operation is already in flight or GitHub is unreachable, the reason appears under the message and the button stays available to retry.++When that pull lands on a project whose sync is off, OpenKnowledge then asks whether to keep the copy updated, so later links arrive on a copy that is already current. It is the usual Follow confirmation, asked once the pull has proved its worth rather than offered as a second button beside it: confirm and Follow turns on before the shared doc opens, decline and the doc opens anyway. You are asked at most once per session, and never after a pull that failed or brought a conflict with it.++The button and the question both appear in the dialog you get before a tab opens and in the in-tab panel behind it, and both stand down in favor of the previous guidance when the project has no GitHub remote or its sync is mid-conflict.diff --git a/docs/content/features/share.mdx b/docs/content/features/share.mdxindex a172ad524..404f0b5c8 100644--- a/docs/content/features/share.mdx+++ b/docs/content/features/share.mdx@@ -58,11 +58,13 @@ If you have the repo open locally but on a different branch, the app opens a braIf uncommitted changes conflict with the switch, switching is disabled until you commit or stash them; if the share's branch is already checked out in another worktree, the dialog offers to open that worktree instead.-If OpenKnowledge can't reach GitHub to make this call, the dialog falls back to the plain switch; the "pull the latest changes, then open the link again" guidance appears only if the target is still missing after the switch.+If OpenKnowledge can't reach GitHub to make this call, the dialog falls back to the plain switch.-### When the shared target has moved or been removed+### When the shared target is not on your local copy-Even on the right branch, a doc or folder can be renamed or deleted after a link is minted. Rather than opening an empty editor at the old path — where you could unknowingly start a divergent copy — OpenKnowledge shows a dialog before navigating (or an in-tab panel, if the miss is only discovered after a tab opens) with the same verdict-driven copy as the branch-switch dialog: an offer to open a renamed target at its new path, a plain "removed from this branch" message with a link back to the parent folder, or "not pushed yet" when the path never existed. A target you moved, renamed, or deleted in your own local copy gets a fourth verdict: commit your changes or enable auto-sync. If the check can't reach GitHub, it falls back to the usual pull-and-retry guidance.+Even on the right branch, a shared target (file or folder) can be renamed or deleted after a link is minted. In this case, OpenKnowledge offers to open the renamed target at its new path, a plain "removed from this branch" message with a link back to the parent folder, or "not pushed yet" when the path never existed.+If the target was moved, renamed, or deleted in your own local copy, OpenKnowledge tells you to commit your changes manually or enable auto-sync.+If the target is on GitHub but hasn't reached your local copy yet, OpenKnowledge alerts you that your local copy is behind. The **Pull latest changes** button on this message fetches from GitHub and fast-forwards your copy in place. It only ever pulls: nothing is committed or pushed on your behalf, and your uncommitted edits ride on top of what comes in. If the pull can't run — another sync operation is already in flight, or GitHub is unreachable — the reason appears under the message and the button stays available to retry.### Receiving without push permissiondiff --git a/packages/app/src/components/ShareReceiveMissDialog.dom.test.tsx b/packages/app/src/components/ShareReceiveMissDialog.dom.test.tsxindex df3010ded..0e861e9e4 100644--- a/packages/app/src/components/ShareReceiveMissDialog.dom.test.tsx+++ b/packages/app/src/components/ShareReceiveMissDialog.dom.test.tsx@@ -16,16 +16,23 @@ import type { GitSyncStatus } from '@/hooks/use-git-sync-status';import { missDialogStore } from '@/lib/share/miss-dialog-store';import { pendingReceiveNavStore } from '@/lib/share/pending-receive-nav-store';-// The changed-locally cell's Enable auto-sync CTA reaches useSyncEnabledWriter →-// useConfigContext; mock the binding so the guarded flow runs without a live-// config context, and capture writes. Mocked before the dynamic import below.-let autoSyncWrites: boolean[] = [];+// The recovery flows write sync config through the project-local binding: Enable+// auto-sync via useSyncEnabledWriter (legacy boolean + mode), the post-pull+// follow offer via useSyncModeWriter (mode + a cleared legacy flag). Mock the+// binding so both guarded flows run without a live config context, and capture+// the whole `autoSync` patch so either shape is assertable. Mocked before the+// dynamic import below.+type AutoSyncPatch = { mode?: string; enabled?: boolean | null };+let autoSyncWrites: AutoSyncPatch[] = [];+let configPatchResult: { ok: true } | { ok: false; error: { code: string; message: string } } = {+ ok: true,+};vi.doMock('@/lib/config-provider', () => ({useConfigContext: () => ({projectLocalBinding: {- patch: (value: { autoSync?: { enabled?: boolean } }) => {- if (value.autoSync?.enabled !== undefined) autoSyncWrites.push(value.autoSync.enabled);- return { ok: true };+ patch: (value: { autoSync?: AutoSyncPatch }) => {+ if (value.autoSync !== undefined) autoSyncWrites.push(value.autoSync);+ return configPatchResult;},},}),@@ -75,7 +82,33 @@ function makeSyncStatus(partial: Partial<GitSyncStatus>): GitSyncStatus {};}+/**+ * Status of a sync-off receiver whose engine carries the pull-outcome contract —+ * the shape that makes the behind cells' pull CTA actionable. `makeSyncStatus`+ * deliberately omits `lastPullUtc` so the default is the version-skew case.+ */+function pullableSyncStatus(partial: Partial<GitSyncStatus> = {}): GitSyncStatus {+ return makeSyncStatus({+ syncEnabled: false,+ state: 'disabled',+ lastPullUtc: 'p0',+ lastPullOutcome: null,+ ...partial,+ });+}++/**+ * A receiver who is already syncing on a pull-capable engine — the shape where a+ * landed pull resolves the miss directly, with no follow offer to answer first.+ */+function syncingPullableStatus(partial: Partial<GitSyncStatus> = {}): GitSyncStatus {+ return pullableSyncStatus({ syncEnabled: true, state: 'idle', ...partial });+}+const { ShareReceiveMissDialog } = await import('./ShareReceiveMissDialog');+// Same module instance the dialog renders, so the once-per-session follow-offer+// latch resets between tests instead of the first offer suppressing the rest.+const { __resetFollowOfferLatchForTests } = await import('./share-receive-miss-content');type FetchTargetStatus = (req: {projectPath: string;@@ -97,6 +130,18 @@ function stubVerdict(response: ShareTargetStatusResponse | null): FetchTargetStaconst DOC_NAV = { kind: 'doc' as const, path: 'notes/plan.md', branch: 'feature' };+/**+ * The consent dialog a recovery CTA opens over the miss dialog — the other+ * `role=dialog`, since the miss dialog is the one carrying the testid.+ */+function openConsentDialog(): HTMLElement {+ const consent = screen+ .getAllByRole('dialog')+ .find((d) => d.getAttribute('data-testid') !== 'share-receive-miss-dialog');+ if (!consent) throw new Error('consent dialog not found');+ return consent;+}+async function renderArmed(nav = DOC_NAV): Promise<HTMLElement> {render(<ShareReceiveMissDialog />);missDialogStore.arm(nav);@@ -110,6 +155,7 @@ beforeEach(() => {window.location.hash = '';missDialogStore.dismiss();pendingReceiveNavStore.clear();+ __resetFollowOfferLatchForTests();});afterEach(() => {cleanup();@@ -117,6 +163,7 @@ afterEach(() => {pendingReceiveNavStore.clear();Reflect.deleteProperty(window, 'okDesktop');autoSyncWrites = [];+ configPatchResult = { ok: true };syncTriggers = [];triggerSyncImpl = () => Promise.resolve();syncStatus = null;@@ -162,17 +209,13 @@ describe('ShareReceiveMissDialog', () => {// Sync is OFF — the enable CTA renders, never the Sync-now one.expect(screen.queryByTestId('share-receive-miss-sync-now')).toBeNull();- // Open the guarded confirm, then confirm inside it (the confirm dialog is the- // OTHER role=dialog — the miss dialog carries the testid). Confirming enables- // in place AND dismisses the miss dialog (the reported gap: it used to stay).+ // Open the guarded confirm, then confirm inside it. Confirming enables in+ // place AND dismisses the miss dialog (regression guard: the dialog must+ // dismiss on confirm).fireEvent.click(screen.getByTestId('share-receive-miss-enable-sync'));- const confirm = screen- .getAllByRole('dialog')- .find((d) => d.getAttribute('data-testid') !== 'share-receive-miss-dialog');- if (!confirm) throw new Error('confirm dialog not found');- fireEvent.click(within(confirm).getByRole('button', { name: 'Enable auto-sync' }));+ fireEvent.click(within(openConsentDialog()).getByRole('button', { name: 'Enable auto-sync' }));- expect(autoSyncWrites).toEqual([true]);+ expect(autoSyncWrites).toEqual([{ mode: 'full', enabled: true }]);await waitFor(() => {expect(missDialogStore.getSnapshot()).toBeNull();});@@ -195,12 +238,19 @@ describe('ShareReceiveMissDialog', () => {// Sync is already ON — offering to enable it would be nonsense.expect(screen.queryByTestId('share-receive-miss-enable-sync')).toBeNull();+ // The in-flight announcement region exists (empty) before the click.+ expect(screen.getByTestId('share-receive-miss-sync-status').textContent).toBe('');+fireEvent.click(screen.getByTestId('share-receive-miss-sync-now'));expect(syncTriggers).toEqual(['sync']);// In-flight until the push lands.expect((screen.getByTestId('share-receive-miss-sync-now') as HTMLButtonElement).disabled).toBe(true,);+ // ...and announced, not just a silent label swap on a disabled button.+ const syncStatusRegion = screen.getByTestId('share-receive-miss-sync-status');+ expect(syncStatusRegion.getAttribute('role')).toBe('status');+ expect(syncStatusRegion.textContent).toBe('Syncing your changes');// The push lands (lastSyncUtc advances over the status channel) → the// verdict is re-probed → the dialog pivots to the renamed cell.@@ -318,3 +368,463 @@ describe('ShareReceiveMissDialog', () => {expect(dialog.textContent).toContain('This folder was removed');});});++describe('ShareReceiveMissDialog pull recovery', () => {+ test('a behind receiver on a pull-capable engine is offered Pull latest changes', async () => {+ installBridge(stubVerdict({ verdict: 'on-origin' }));+ setSyncStatus(pullableSyncStatus());+ const dialog = await renderArmed();++ expect(dialog.getAttribute('data-verdict')).toBe('on-origin');+ expect(screen.getByTestId('share-receive-miss-pull-now')).toBeTruthy();+ // The button replaces the manual instruction it used to give.+ expect(dialog.textContent).toContain('is behind');+ expect(dialog.textContent).not.toContain('then open the link again');+ // The escape hatch stays available alongside it.+ expect(screen.getByTestId('share-receive-miss-browse')).toBeTruthy();+ });++ test('the fail-open unknown verdict offers the same pull recovery', async () => {+ installBridge(stubVerdict(null));+ setSyncStatus(pullableSyncStatus());+ const dialog = await renderArmed();++ expect(dialog.getAttribute('data-verdict')).toBe('unknown');+ expect(screen.getByTestId('share-receive-miss-pull-now')).toBeTruthy();+ });++ test('no pull CTA before the first sync-status response', async () => {+ installBridge(stubVerdict({ verdict: 'on-origin' }));+ // syncStatus stays null (no response yet / server unreachable).+ const dialog = await renderArmed();++ expect(screen.queryByTestId('share-receive-miss-pull-now')).toBeNull();+ // Falls back to exactly the guidance the cell gave before the CTA existed.+ expect(dialog.textContent).toContain('Pull the latest changes, then open the link again');+ expect(screen.getByTestId('share-receive-miss-browse')).toBeTruthy();+ });++ test('no pull CTA without a remote to pull from', async () => {+ installBridge(stubVerdict({ verdict: 'on-origin' }));+ setSyncStatus(pullableSyncStatus({ hasRemote: false }));+ const dialog = await renderArmed();++ expect(screen.queryByTestId('share-receive-miss-pull-now')).toBeNull();+ expect(dialog.textContent).toContain('Pull the latest changes, then open the link again');+ });++ test('no pull CTA while the engine is conflicted', async () => {+ installBridge(stubVerdict({ verdict: 'on-origin' }));+ setSyncStatus(pullableSyncStatus({ state: 'conflict', conflictCount: 2 }));+ const dialog = await renderArmed();++ expect(screen.queryByTestId('share-receive-miss-pull-now')).toBeNull();+ expect(dialog.textContent).toContain('Pull the latest changes, then open the link again');+ });++ test('no pull CTA when the engine predates the pull-outcome contract', async () => {+ installBridge(stubVerdict({ verdict: 'on-origin' }));+ // A status payload with no `lastPullUtc` key at all: an older engine that+ // would never report a pull back, so the CTA would spin forever.+ setSyncStatus(makeSyncStatus({ syncEnabled: false, state: 'disabled' }));+ const dialog = await renderArmed();++ expect(screen.queryByTestId('share-receive-miss-pull-now')).toBeNull();+ expect(dialog.textContent).toContain('Pull the latest changes, then open the link again');+ });++ test('clicking Pull triggers a one-shot pull and holds an in-flight state', async () => {+ installBridge(stubVerdict({ verdict: 'on-origin' }));+ setSyncStatus(pullableSyncStatus());+ await renderArmed();++ fireEvent.click(screen.getByTestId('share-receive-miss-pull-now'));++ expect(syncTriggers).toEqual(['pull']);+ const button = screen.getByTestId('share-receive-miss-pull-now') as HTMLButtonElement;+ expect(button.disabled).toBe(true);+ expect(button.textContent).toContain('Pulling');+ // Still open — nothing has landed yet.+ expect(missDialogStore.getSnapshot()).not.toBeNull();+ });++ test('a succeeded pull arms the backstop, opens the target, and dismisses', async () => {+ installBridge(stubVerdict({ verdict: 'on-origin' }));+ setSyncStatus(syncingPullableStatus());+ await renderArmed();++ fireEvent.click(screen.getByTestId('share-receive-miss-pull-now'));+ setSyncStatus(syncingPullableStatus({ lastPullUtc: 'p1', lastPullOutcome: 'succeeded' }));++ await waitFor(() => {+ expect(missDialogStore.getSnapshot()).toBeNull();+ });+ expect(window.location.hash).toBe('#/notes/plan.md');+ // Backstop armed: if the target is somehow still absent, the panel renders+ // the honest verdict rather than a create-mode fork.+ expect(pendingReceiveNavStore.getSnapshot()).toEqual({+ kind: 'doc',+ path: 'notes/plan.md',+ branch: 'feature',+ });+ });++ test('an up-to-date pull resolves the flow the same way for a folder share', async () => {+ installBridge(stubVerdict({ verdict: 'on-origin' }));+ setSyncStatus(syncingPullableStatus());+ await renderArmed({ kind: 'folder', path: 'docs/guides', branch: 'feature' });++ fireEvent.click(screen.getByTestId('share-receive-miss-pull-now'));+ setSyncStatus(syncingPullableStatus({ lastPullUtc: 'p1', lastPullOutcome: 'up-to-date' }));++ await waitFor(() => {+ expect(missDialogStore.getSnapshot()).toBeNull();+ });+ expect(window.location.hash).toBe('#/docs/guides/');+ expect(pendingReceiveNavStore.getSnapshot()).toEqual({+ kind: 'folder',+ path: 'docs/guides',+ branch: 'feature',+ });+ });++ test('a conflict outcome opens the target without claiming the pull failed', async () => {+ installBridge(stubVerdict({ verdict: 'on-origin' }));+ setSyncStatus(pullableSyncStatus());+ await renderArmed();++ fireEvent.click(screen.getByTestId('share-receive-miss-pull-now'));+ // The fast-forward landed before the per-doc conflict was recorded, so the+ // target exists locally and the locked-editor resolver owns the signal.+ setSyncStatus(pullableSyncStatus({ lastPullUtc: 'p1', lastPullOutcome: 'conflict' }));++ await waitFor(() => {+ expect(missDialogStore.getSnapshot()).toBeNull();+ });+ expect(window.location.hash).toBe('#/notes/plan.md');+ // The dialog dismissed on navigation — no failure line was ever shown, and+ // nothing remains mounted to claim one.+ expect(screen.queryByTestId('share-receive-miss-pull-error')).toBeNull();+ });++ test('a refused pull explains the engine is busy and stays retriable', async () => {+ installBridge(stubVerdict({ verdict: 'on-origin' }));+ setSyncStatus(pullableSyncStatus());+ await renderArmed();++ fireEvent.click(screen.getByTestId('share-receive-miss-pull-now'));+ setSyncStatus(pullableSyncStatus({ lastPullUtc: 'p1', lastPullOutcome: 'refused' }));++ // The alert region is pre-mounted; the failure POPULATES it (inserting an+ // already-full alert is skipped by some screen readers).+ await waitFor(() => {+ expect(screen.getByTestId('share-receive-miss-pull-error').textContent).toContain(+ 'Another sync operation is in progress',+ );+ });+ // The dialog holds, and the button is live again for a retry.+ expect(missDialogStore.getSnapshot()).not.toBeNull();+ const button = screen.getByTestId('share-receive-miss-pull-now') as HTMLButtonElement;+ expect(button.disabled).toBe(false);++ // Retrying fires a second pull and clears the stale failure text.+ fireEvent.click(button);+ expect(syncTriggers).toEqual(['pull', 'pull']);+ expect(screen.getByTestId('share-receive-miss-pull-error').textContent).toBe('');+ });++ test('an errored pull points at connectivity and stays retriable', async () => {+ installBridge(stubVerdict({ verdict: 'on-origin' }));+ setSyncStatus(pullableSyncStatus());+ await renderArmed();++ fireEvent.click(screen.getByTestId('share-receive-miss-pull-now'));+ setSyncStatus(pullableSyncStatus({ lastPullUtc: 'p1', lastPullOutcome: 'error' }));++ await waitFor(() => {+ expect(screen.getByTestId('share-receive-miss-pull-error').textContent).toContain(+ 'Check your connection',+ );+ });+ expect(missDialogStore.getSnapshot()).not.toBeNull();+ expect((screen.getByTestId('share-receive-miss-pull-now') as HTMLButtonElement).disabled).toBe(+ false,+ );+ });++ test('a pull trigger that never lands clears the in-flight state', async () => {+ installBridge(stubVerdict({ verdict: 'on-origin' }));+ setSyncStatus(pullableSyncStatus());+ triggerSyncImpl = () => Promise.reject(new Error('server down'));+ await renderArmed();++ fireEvent.click(screen.getByTestId('share-receive-miss-pull-now'));++ // No status update will ever follow, so the surface must report it itself+ // rather than spin.+ await waitFor(() => {+ expect(screen.getByTestId('share-receive-miss-pull-error').textContent).toContain(+ 'Check your connection',+ );+ });+ expect((screen.getByTestId('share-receive-miss-pull-now') as HTMLButtonElement).disabled).toBe(+ false,+ );++ // A background pull completing AFTER the click already failed must not be+ // read as the click's result: no navigation, no follow offer, and the+ // failure explanation stays put. (The watcher only listens while pending.)+ setSyncStatus(pullableSyncStatus({ lastPullUtc: 'bg1', lastPullOutcome: 'succeeded' }));+ expect(missDialogStore.getSnapshot()).not.toBeNull();+ expect(window.location.hash).toBe('');+ expect(screen.getAllByRole('dialog')).toHaveLength(1);+ expect(screen.getByTestId('share-receive-miss-pull-error').textContent).toContain(+ 'Check your connection',+ );+ });++ test('completion is read off lastPullUtc, not lastSyncUtc', async () => {+ installBridge(stubVerdict({ verdict: 'on-origin' }));+ setSyncStatus(syncingPullableStatus({ lastSyncUtc: 's0' }));+ await renderArmed();++ fireEvent.click(screen.getByTestId('share-receive-miss-pull-now'));++ // A commit/push advancing lastSyncUtc is not this pull completing.+ setSyncStatus(syncingPullableStatus({ lastSyncUtc: 's1' }));+ await waitFor(() => {+ expect(+ (screen.getByTestId('share-receive-miss-pull-now') as HTMLButtonElement).textContent,+ ).toContain('Pulling');+ });+ expect(missDialogStore.getSnapshot()).not.toBeNull();++ // An up-to-date pull leaves lastSyncUtc alone; only lastPullUtc moves.+ setSyncStatus(+ syncingPullableStatus({+ lastSyncUtc: 's1',+ lastPullUtc: 'p1',+ lastPullOutcome: 'up-to-date',+ }),+ );+ await waitFor(() => {+ expect(missDialogStore.getSnapshot()).toBeNull();+ });+ });+});++describe('ShareReceiveMissDialog follow-mode offer', () => {+ test('a landed pull offers to keep the copy updated before opening the target', async () => {+ installBridge(stubVerdict({ verdict: 'on-origin' }));+ setSyncStatus(pullableSyncStatus());+ await renderArmed();++ fireEvent.click(screen.getByTestId('share-receive-miss-pull-now'));+ setSyncStatus(pullableSyncStatus({ lastPullUtc: 'p1', lastPullOutcome: 'succeeded' }));++ // The offer arrives at the moment the pull proved its worth, and it holds+ // the navigation — the receiver answers before the doc opens.+ const consent = await waitFor(() => openConsentDialog());+ expect(window.location.hash).toBe('');+ expect(autoSyncWrites).toEqual([]);++ fireEvent.click(within(consent).getByRole('button', { name: 'Enable Follow' }));++ // Follow mode lands, and the legacy boolean is cleared so an older app can't+ // read the project as full-sync and start pushing this receiver's copy.+ expect(autoSyncWrites).toEqual([{ mode: 'follow', enabled: null }]);+ // Nothing left to fetch — the content arrived with the pull just answered.+ expect(syncTriggers).toEqual(['pull']);+ await waitFor(() => {+ expect(missDialogStore.getSnapshot()).toBeNull();+ });+ expect(window.location.hash).toBe('#/notes/plan.md');+ });++ test('an up-to-date pull on a sync-off receiver still offers to keep the copy updated', async () => {+ installBridge(stubVerdict({ verdict: 'on-origin' }));+ setSyncStatus(pullableSyncStatus());+ await renderArmed();++ fireEvent.click(screen.getByTestId('share-receive-miss-pull-now'));+ // up-to-date is the common outcome when the remote was already current — the+ // offer must still stand for a sync-off receiver, not just after `succeeded`.+ setSyncStatus(pullableSyncStatus({ lastPullUtc: 'p1', lastPullOutcome: 'up-to-date' }));++ const consent = await waitFor(() => openConsentDialog());+ expect(window.location.hash).toBe('');++ // Declining resolves the flow: no write, and the target still opens.+ fireEvent.click(within(consent).getByRole('button', { name: 'Cancel' }));+ expect(autoSyncWrites).toEqual([]);+ await waitFor(() => {+ expect(missDialogStore.getSnapshot()).toBeNull();+ });+ expect(window.location.hash).toBe('#/notes/plan.md');+ });++ test('nothing competes with the pull action before a pull has run', async () => {+ installBridge(stubVerdict({ verdict: 'on-origin' }));+ setSyncStatus(pullableSyncStatus());+ await renderArmed();++ // One primary action and the escape hatch — the offer is not a button here.+ expect(screen.getByTestId('share-receive-miss-pull-now')).toBeTruthy();+ expect(screen.getByTestId('share-receive-miss-browse')).toBeTruthy();+ expect(screen.queryByTestId('share-receive-miss-keep-updated')).toBeNull();+ expect(screen.getAllByRole('dialog')).toHaveLength(1);+ });++ test('declining the offer writes nothing and still opens the target', async () => {+ installBridge(stubVerdict({ verdict: 'on-origin' }));+ setSyncStatus(pullableSyncStatus());+ await renderArmed();++ fireEvent.click(screen.getByTestId('share-receive-miss-pull-now'));+ setSyncStatus(pullableSyncStatus({ lastPullUtc: 'p1', lastPullOutcome: 'succeeded' }));++ const consent = await waitFor(() => openConsentDialog());+ fireEvent.click(within(consent).getByRole('button', { name: 'Cancel' }));++ // Saying no costs nothing: no write, and the doc still opens.+ expect(autoSyncWrites).toEqual([]);+ await waitFor(() => {+ expect(missDialogStore.getSnapshot()).toBeNull();+ });+ expect(window.location.hash).toBe('#/notes/plan.md');+ });++ test('a rejected mode write still opens the target', async () => {+ installBridge(stubVerdict({ verdict: 'on-origin' }));+ setSyncStatus(pullableSyncStatus());+ configPatchResult = { ok: false, error: { code: 'WRITE_FAILED', message: 'binding offline' } };+ await renderArmed();++ fireEvent.click(screen.getByTestId('share-receive-miss-pull-now'));+ setSyncStatus(pullableSyncStatus({ lastPullUtc: 'p1', lastPullOutcome: 'succeeded' }));++ const consent = await waitFor(() => openConsentDialog());+ fireEvent.click(within(consent).getByRole('button', { name: 'Enable Follow' }));++ // The failed write raises its own toast; it must not cost the receiver the+ // document the pull already fetched for them.+ await waitFor(() => {+ expect(missDialogStore.getSnapshot()).toBeNull();+ });+ expect(window.location.hash).toBe('#/notes/plan.md');+ });++ test('a conflicted pull heads for the resolver instead of the offer', async () => {+ installBridge(stubVerdict({ verdict: 'on-origin' }));+ setSyncStatus(pullableSyncStatus());+ await renderArmed();++ fireEvent.click(screen.getByTestId('share-receive-miss-pull-now'));+ setSyncStatus(pullableSyncStatus({ lastPullUtc: 'p1', lastPullOutcome: 'conflict' }));++ // Dismissing without an answer is the proof: nothing was asked.+ await waitFor(() => {+ expect(missDialogStore.getSnapshot()).toBeNull();+ });+ expect(window.location.hash).toBe('#/notes/plan.md');+ expect(autoSyncWrites).toEqual([]);+ });++ test('a failed pull reports the failure instead of offering follow', async () => {+ installBridge(stubVerdict({ verdict: 'on-origin' }));+ setSyncStatus(pullableSyncStatus());+ await renderArmed();++ fireEvent.click(screen.getByTestId('share-receive-miss-pull-now'));+ setSyncStatus(pullableSyncStatus({ lastPullUtc: 'p1', lastPullOutcome: 'refused' }));++ await waitFor(() => {+ expect(screen.getByTestId('share-receive-miss-pull-error').textContent).not.toBe('');+ });+ // The failure line owns the surface — no consent gate over the top of it.+ expect(screen.getAllByRole('dialog')).toHaveLength(1);+ expect(autoSyncWrites).toEqual([]);+ });++ test('a receiver who already syncs is never asked to enable what they have', async () => {+ installBridge(stubVerdict({ verdict: 'on-origin' }));+ setSyncStatus(syncingPullableStatus());+ await renderArmed();++ fireEvent.click(screen.getByTestId('share-receive-miss-pull-now'));+ setSyncStatus(syncingPullableStatus({ lastPullUtc: 'p1', lastPullOutcome: 'succeeded' }));++ await waitFor(() => {+ expect(missDialogStore.getSnapshot()).toBeNull();+ });+ expect(autoSyncWrites).toEqual([]);+ });++ test('the offer is made at most once per session', async () => {+ installBridge(stubVerdict({ verdict: 'on-origin' }));+ setSyncStatus(pullableSyncStatus());+ await renderArmed();++ fireEvent.click(screen.getByTestId('share-receive-miss-pull-now'));+ setSyncStatus(pullableSyncStatus({ lastPullUtc: 'p1', lastPullOutcome: 'succeeded' }));+ const consent = await waitFor(() => openConsentDialog());+ fireEvent.click(within(consent).getByRole('button', { name: 'Cancel' }));+ await waitFor(() => {+ expect(missDialogStore.getSnapshot()).toBeNull();+ });++ // A second miss in the same session: they already said no once, so this pull+ // resolves without asking again.+ missDialogStore.arm(DOC_NAV);+ await screen.findByTestId('share-receive-miss-dialog');+ await screen.findByText((_, el) => el?.getAttribute('data-phase') === 'resolved');+ fireEvent.click(screen.getByTestId('share-receive-miss-pull-now'));+ setSyncStatus(pullableSyncStatus({ lastPullUtc: 'p2', lastPullOutcome: 'succeeded' }));++ await waitFor(() => {+ expect(missDialogStore.getSnapshot()).toBeNull();+ });+ expect(autoSyncWrites).toEqual([]);+ expect(syncTriggers).toEqual(['pull', 'pull']);+ });++ test('the offer discloses commits follow mode would strand', async () => {+ installBridge(stubVerdict({ verdict: 'on-origin' }));+ setSyncStatus(pullableSyncStatus({ ahead: 3 }));+ await renderArmed();++ fireEvent.click(screen.getByTestId('share-receive-miss-pull-now'));+ setSyncStatus(+ pullableSyncStatus({ ahead: 3, lastPullUtc: 'p1', lastPullOutcome: 'succeeded' }),+ );++ // Every other follow-enable surface warns about unpushed commits; a+ // receiver consenting from this one deserves the same honesty.+ const consent = await waitFor(() => openConsentDialog());+ expect(within(consent).getByText(/3 changes you haven't shared/)).toBeTruthy();+ });+});++describe('ShareReceiveMissDialog pull progress announcement', () => {+ test('starting a pull is announced to assistive tech', async () => {+ installBridge(stubVerdict({ verdict: 'on-origin' }));+ setSyncStatus(pullableSyncStatus());+ await renderArmed();++ // The region exists before the click and is empty — populating an+ // already-mounted live region is what screen readers reliably announce.+ const status = screen.getByTestId('share-receive-miss-pull-status');+ expect(status.getAttribute('role')).toBe('status');+ expect(status.textContent).toBe('');++ fireEvent.click(screen.getByTestId('share-receive-miss-pull-now'));+ await waitFor(() => {+ expect(screen.getByTestId('share-receive-miss-pull-status').textContent).toBe(+ 'Pulling the latest changes',+ );+ });+ expect(screen.getByTestId('share-receive-miss-pull-now').getAttribute('aria-busy')).toBe(+ 'true',+ );+ });+});diff --git a/packages/app/src/components/ShareReceiveMissDialog.tsx b/packages/app/src/components/ShareReceiveMissDialog.tsxindex 61575686e..1d1b109f4 100644--- a/packages/app/src/components/ShareReceiveMissDialog.tsx+++ b/packages/app/src/components/ShareReceiveMissDialog.tsx@@ -61,13 +61,15 @@ function ShareReceiveMissDialogInner({ nav }: { nav: PendingReceiveNav }) {dismiss();}- function openRenamed(renamedTo: string): void {- // Arm the in-tab backstop before navigating: if the rename destination is- // also missing locally (the receiver's ref is behind), the miss surface- // renders for it too instead of the create-mode editor.- pendingReceiveNavStore.arm({ kind: nav.kind, path: renamedTo, branch: nav.branch });- window.location.hash =- nav.kind === 'folder' ? hashFromFolderPath(renamedTo) : hashFromDocName(renamedTo);+ /**+ * Arm the in-tab backstop before navigating: if the target is still missing+ * locally (a rename destination the receiver's behind ref doesn't carry, or a+ * pull that came back up-to-date), the miss surface renders for it again+ * instead of the create-mode editor.+ */+ function navigateWithBackstop(path: string): void {+ pendingReceiveNavStore.arm({ kind: nav.kind, path, branch: nav.branch });+ window.location.hash = nav.kind === 'folder' ? hashFromFolderPath(path) : hashFromDocName(path);dismiss();}@@ -98,13 +100,17 @@ function ShareReceiveMissDialogInner({ nav }: { nav: PendingReceiveNav }) {nav={nav}state={state}onBrowseFolder={browseFolder}- onOpenRenamed={openRenamed}+ onOpenRenamed={navigateWithBackstop}onEnableAutoSync={dismiss}// A landed Sync now push changes the verdict (the local// delete/rename is now on the branch) — re-probe instead of// dismissing, so the dialog pivots to the honest cell (including// the rename redirect offer).onSyncCompleted={refetch}+ // A resolved pull opens what the receiver clicked the link for.+ // Re-probing instead would risk an on-origin → pull → on-origin+ // loop, since an up-to-date pull leaves the verdict unchanged.+ onPullApplied={() => navigateWithBackstop(nav.path)}/></DialogBody></DialogContent>diff --git a/packages/app/src/components/ShareReceiveMissPanel.dom.test.tsx b/packages/app/src/components/ShareReceiveMissPanel.dom.test.tsxindex 8b4778988..e7dec9418 100644--- a/packages/app/src/components/ShareReceiveMissPanel.dom.test.tsx+++ b/packages/app/src/components/ShareReceiveMissPanel.dom.test.tsx@@ -1,5 +1,6 @@import type { ShareTargetStatusResponse } from '@inkeep/open-knowledge-core';-import { cleanup, fireEvent, render, screen, within } from '@testing-library/react';+import { cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react';+import { useSyncExternalStore } from 'react';import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';import type { GitSyncStatus } from '@/hooks/use-git-sync-status';import { pendingReceiveNavStore } from '@/lib/share/pending-receive-nav-store';@@ -20,14 +21,36 @@ vi.doMock('@/lib/config-provider', () => ({}),}));-// The changed-locally cell picks its CTA off the live sync status: Enable-// auto-sync when the toggle is off, Sync now when it is already on.+// The changed-locally cell picks its CTA off the live sync status (Enable+// auto-sync when the toggle is off, Sync now when it is already on), and the+// behind cell reads it for the pull CTA. Reactive so a test can land a pull+// (lastPullUtc advance) and observe the re-probe.let syncStatus: GitSyncStatus | null = null;+const syncStatusListeners = new Set<() => void>();+function setSyncStatus(next: GitSyncStatus | null): void {+ syncStatus = next;+ for (const listener of syncStatusListeners) listener();+}vi.doMock('@/hooks/use-git-sync-status', () => ({- useGitSyncStatus: () => syncStatus,+ useGitSyncStatus: () =>+ useSyncExternalStore(+ (onStoreChange: () => void) => {+ syncStatusListeners.add(onStoreChange);+ return () => syncStatusListeners.delete(onStoreChange);+ },+ () => syncStatus,+ ),useGitSyncStatusDetailed: () => ({ status: syncStatus, fetchError: null }),}));+let syncTriggers: string[] = [];+vi.doMock('@/lib/trigger-sync', () => ({+ triggerSync: (op: string) => {+ syncTriggers.push(op);+ return Promise.resolve();+ },+}));+function makeSyncStatus(partial: Partial<GitSyncStatus>): GitSyncStatus {return {state: 'idle',@@ -42,7 +65,25 @@ function makeSyncStatus(partial: Partial<GitSyncStatus>): GitSyncStatus {};}+/**+ * Status of a sync-off receiver whose engine carries the pull-outcome contract —+ * the shape that makes the behind cell's pull CTA actionable. `makeSyncStatus`+ * deliberately omits `lastPullUtc` so the default is the version-skew case.+ */+function pullableSyncStatus(partial: Partial<GitSyncStatus> = {}): GitSyncStatus {+ return makeSyncStatus({+ syncEnabled: false,+ state: 'disabled',+ lastPullUtc: 'p0',+ lastPullOutcome: null,+ ...partial,+ });+}+const { ShareReceiveMissPanel } = await import('./ShareReceiveMissPanel');+// Same module instance the panel renders, so the once-per-session follow-offer+// latch resets between tests instead of the first offer suppressing the rest.+const { __resetFollowOfferLatchForTests } = await import('./share-receive-miss-content');type FetchTargetStatus = (req: {projectPath: string;@@ -76,6 +117,7 @@ beforeEach(() => {cleanup();window.location.hash = '';pendingReceiveNavStore.clear();+ __resetFollowOfferLatchForTests();});afterEach(() => {cleanup();@@ -83,7 +125,9 @@ afterEach(() => {window.location.hash = '';pendingReceiveNavStore.clear();autoSyncWrites = [];+ syncTriggers = [];syncStatus = null;+ syncStatusListeners.clear();});describe('ShareReceiveMissPanel verdict surfaces', () => {@@ -163,7 +207,7 @@ describe('ShareReceiveMissPanel verdict surfaces', () => {// Enable auto-sync recovery CTA (the guarded off → on flow).test('changed-locally verdict shows the local-change message and enables auto-sync in place', async () => {installBridge(stubVerdict({ verdict: 'changed-locally' }));- syncStatus = makeSyncStatus({ syncEnabled: false, state: 'disabled' });+ setSyncStatus(makeSyncStatus({ syncEnabled: false, state: 'disabled' }));const panel = await renderResolved();expect(panel.getAttribute('data-verdict')).toBe('changed-locally');@@ -189,7 +233,7 @@ describe('ShareReceiveMissPanel verdict surfaces', () => {// dialog's dom tests; both shells share the content component).test('changed-locally with auto-sync ON offers Sync now, not Enable auto-sync', async () => {installBridge(stubVerdict({ verdict: 'changed-locally' }));- syncStatus = makeSyncStatus({ syncEnabled: true });+ setSyncStatus(makeSyncStatus({ syncEnabled: true }));const panel = await renderResolved();expect(panel.getAttribute('data-verdict')).toBe('changed-locally');@@ -257,3 +301,83 @@ describe('ShareReceiveMissPanel verdict surfaces', () => {expect(document.activeElement).toBe(screen.getByTestId('share-receive-miss-open-renamed'));});});++describe('ShareReceiveMissPanel pull recovery', () => {+ test('the behind cell offers Pull latest changes on a pull-capable engine', async () => {+ installBridge(stubVerdict({ verdict: 'on-origin' }));+ setSyncStatus(pullableSyncStatus());+ const panel = await renderResolved();++ expect(panel.getAttribute('data-verdict')).toBe('on-origin');+ expect(screen.getByTestId('share-receive-miss-pull-now')).toBeTruthy();+ // The button replaces the manual instruction the cell used to give.+ expect(panel.textContent).toContain('is behind');+ expect(panel.textContent).not.toContain('then open the link again');+ expect(screen.getByTestId('share-receive-miss-browse')).toBeTruthy();+ // Keyboard users land on the recovery, which is now the first action.+ expect(document.activeElement).toBe(screen.getByTestId('share-receive-miss-pull-now'));+ });++ // Unlike the pre-nav dialog (which navigates on a landed pull), the in-tab+ // backstop resolves in place: when the pull materialized the target, EditorArea+ // swaps the panel out for the editor on its own, so all the panel owes is a+ // re-probe — the pre-pull cell must not stay on screen as the honest answer.+ test('a landed pull re-probes the target status once the follow offer is answered', async () => {+ // The second probe fetches again, so it can see an upstream change the first+ // one missed — here the target turned out to be gone for good.+ const verdicts: ShareTargetStatusResponse[] = [+ { verdict: 'on-origin' },+ { verdict: 'deleted' },+ ];+ let probeCount = 0;+ installBridge(() => Promise.resolve(verdicts[Math.min(probeCount++, verdicts.length - 1)]));+ setSyncStatus(pullableSyncStatus());+ const panel = await renderResolved();++ fireEvent.click(screen.getByTestId('share-receive-miss-pull-now'));+ expect(syncTriggers).toEqual(['pull']);++ setSyncStatus(pullableSyncStatus({ lastPullUtc: 'p1', lastPullOutcome: 'succeeded' }));++ // A sync-off receiver meets the follow offer here too; declining it hands+ // control straight back to the panel.+ const consent = await screen.findByRole('dialog');+ fireEvent.click(within(consent).getByRole('button', { name: 'Cancel' }));++ await waitFor(() => {+ expect(panel.getAttribute('data-verdict')).toBe('deleted');+ });+ expect(probeCount).toBe(2);+ });++ test('an already-syncing receiver re-probes directly, with no follow offer in between', async () => {+ // Pins the panel's own onPullApplied wiring on the path that skips the+ // consent gate — if the prop were dropped, this receiver would stay stuck+ // on "is behind" after a successful pull.+ const verdicts: ShareTargetStatusResponse[] = [+ { verdict: 'on-origin' },+ { verdict: 'deleted' },+ ];+ let probeCount = 0;+ installBridge(() => Promise.resolve(verdicts[Math.min(probeCount++, verdicts.length - 1)]));+ setSyncStatus(pullableSyncStatus({ syncEnabled: true, state: 'idle' }));+ const panel = await renderResolved();++ fireEvent.click(screen.getByTestId('share-receive-miss-pull-now'));+ setSyncStatus(+ pullableSyncStatus({+ syncEnabled: true,+ state: 'idle',+ lastPullUtc: 'p1',+ lastPullOutcome: 'succeeded',+ }),+ );++ await waitFor(() => {+ expect(panel.getAttribute('data-verdict')).toBe('deleted');+ });+ expect(probeCount).toBe(2);+ expect(screen.queryByRole('dialog')).toBeNull();+ expect(autoSyncWrites).toEqual([]);+ });+});diff --git a/packages/app/src/components/ShareReceiveMissPanel.tsx b/packages/app/src/components/ShareReceiveMissPanel.tsxindex b63da9f9a..e1479e901 100644--- a/packages/app/src/components/ShareReceiveMissPanel.tsx+++ b/packages/app/src/components/ShareReceiveMissPanel.tsx@@ -73,6 +73,10 @@ export function ShareReceiveMissPanel({ nav }: { nav: PendingReceiveNav }) {// A landed Sync now push changes the verdict — re-probe so the panel// pivots to the honest cell rather than keeping stale copy.onSyncCompleted={refetch}+ // A landed pull needs no navigation here: the target is already the+ // active one, so `EditorArea` swaps this panel for the editor as soon as+ // the doc materializes. Re-probe for the case where it did not.+ onPullApplied={refetch}/></div>);diff --git a/packages/app/src/components/share-receive-miss-content.tsx b/packages/app/src/components/share-receive-miss-content.tsxindex d27b52eb0..3054e688a 100644--- a/packages/app/src/components/share-receive-miss-content.tsx+++ b/packages/app/src/components/share-receive-miss-content.tsx@@ -13,7 +13,7 @@* Fail-open: no desktop bridge, no branch, or a failed fetch resolves to* `unknown` (the honest "your checkout is behind — pull" guidance).*/-import type { ShareTargetStatusResponse } from '@inkeep/open-knowledge-core';+import type { PullOutcome, ShareTargetStatusResponse } from '@inkeep/open-knowledge-core';import { Trans, useLingui } from '@lingui/react/macro';import {ArrowDownToLine,@@ -26,10 +26,13 @@ import {RefreshCw,} from 'lucide-react';import { type ReactNode, useEffect, useRef, useState } from 'react';+import { toast } from 'sonner';import { Button } from '@/components/ui/button';import {useEnableSyncWithConfirm,useSyncEnabledWriter,+ useSyncModeSelection,+ useSyncModeWriter,} from '@/hooks/use-enable-sync-with-confirm';import { type GitSyncStatus, useGitSyncStatus } from '@/hooks/use-git-sync-status';import type { PendingReceiveNav } from '@/lib/share/pending-receive-nav-store';@@ -156,6 +159,7 @@ function SyncNowButton({status: GitSyncStatus;onSyncCompleted?: () => void;}) {+ const { t } = useLingui();const [pending, setPending] = useState(false);// The `lastSyncUtc` at click time; a later value means a sync completed// since — the "push landed" signal.@@ -184,19 +188,271 @@ function SyncNowButton({triggerSync('sync').catch((err) => {console.warn('[receive] miss sync trigger failed', err instanceof Error ? err.message : err);setPending(false);+ // Silent re-enable reads as a broken button; say why, like the pull CTA's+ // inline failure line does for its trigger-failure arm.+ toast.error(t`Couldn't start the sync. Check your connection, then retry.`);});};- return pending ? (- <Button disabled data-testid="share-receive-miss-sync-now">- <RefreshCw className="size-4 animate-spin" aria-hidden="true" />- <Trans>Syncing</Trans>- </Button>- ) : (- <Button onClick={handleSyncNow} data-testid="share-receive-miss-sync-now">- <RefreshCw className="size-4" aria-hidden="true" />- <Trans>Sync now</Trans>- </Button>+ return (+ <>+ {pending ? (+ <Button disabled aria-busy="true" data-testid="share-receive-miss-sync-now">+ <RefreshCw className="size-4 animate-spin" aria-hidden="true" />+ <Trans>Syncing</Trans>+ </Button>+ ) : (+ <Button onClick={handleSyncNow} data-testid="share-receive-miss-sync-now">+ <RefreshCw className="size-4" aria-hidden="true" />+ <Trans>Sync now</Trans>+ </Button>+ )}+ {/* Same announcement contract as the pull button below: a disabled+ control's silent label swap is invisible to screen readers, so an+ always-mounted region populating on start is what carries the news. */}+ <span+ role="status"+ aria-live="polite"+ className="sr-only"+ data-testid="share-receive-miss-sync-status"+ >+ {pending ? <Trans>Syncing your changes</Trans> : null}+ </span>+ </>+ );+}++/** Pull outcomes the surface reports itself; the rest resolve the miss instead. */+type PullFailure = Extract<PullOutcome, 'refused' | 'error'>;++/**+ * Whether the follow offer has already been made in this app session. A receiver+ * who declined once should not be asked again on every later pull, and the+ * decline is deliberately not persisted — a fresh session is a fresh chance to+ * offer, which is cheap because the offer only ever follows a pull they asked+ * for.+ */+let followOfferMade = false;++/** Test-only: clear the once-per-session offer latch. Production never resets it. */+export function __resetFollowOfferLatchForTests(): void {+ followOfferMade = false;+}++/**+ * Whether a landed pull should be followed by the keep-this-copy-updated offer.+ * Someone already syncing has nothing to enable, and a status the surface never+ * received says nothing about their mode.+ */+function shouldOfferFollow(status: GitSyncStatus | null): boolean {+ return !followOfferMade && status !== null && status.syncEnabled !== true;+}++/**+ * Whether a one-shot pull can be offered for this project. An absent (as opposed+ * to null) `lastPullUtc` means the engine predates the pull-outcome contract, so+ * a triggered pull would never report back and the CTA would spin forever; the+ * engine refuses one-shot pulls while conflicted; and there is nothing to pull+ * without a remote.+ */+function pullActionable(status: GitSyncStatus | null): boolean {+ if (status === null) return false;+ return status.hasRemote && status.lastPullUtc !== undefined && status.state !== 'conflict';+}++/**+ * Drives a one-shot pull for the behind cells. The engine runs a one-shot pull+ * in ANY sync mode, including off, and it only ever fetches + fast-forwards+ * (never commits or pushes), so an explicit click is the whole consent needed.+ *+ * Completion is a CHANGE in `lastPullUtc`, which the engine bumps at every pull+ * completion — including `up-to-date` and `error`. Watching `lastSyncUtc` (as+ * the sibling push CTAs do) cannot work here: an up-to-date pull never advances+ * it, so the surface would hang on the most common outcome.+ *+ * A clean pull can hand off to the follow offer instead of resolving straight+ * away (`offering`); resolution then waits for the receiver's answer.+ */+function useOneShotPull(+ status: GitSyncStatus | null,+ onApplied?: () => void,+): {+ pending: boolean;+ failure: PullFailure | null;+ offering: boolean;+ start: () => void;+ resolveOffer: () => void;+} {+ const [pending, setPending] = useState(false);+ const [failure, setFailure] = useState<PullFailure | null>(null);+ const [offering, setOffering] = useState(false);+ const lastPullAtClick = useRef<string | null>(null);++ useEffect(() => {+ if (!pending) return;+ if ((status?.lastPullUtc ?? null) === lastPullAtClick.current) return;+ setPending(false);+ const outcome = status?.lastPullOutcome ?? null;+ // A completion with no recorded outcome resolves optimistically: the pull+ // bumped `lastPullUtc`, so it ran, and there is nothing to report on.+ if (outcome === null) {+ onApplied?.();+ return;+ }+ // Exhaustive over `PullOutcome` so a new variant can't silently fall through+ // to opening the target — the first consumer of the outcome contract, so it+ // sets the precedent that every future outcome makes a deliberate choice.+ switch (outcome) {+ case 'refused':+ case 'error':+ setFailure(outcome);+ return;+ case 'succeeded':+ case 'up-to-date':+ // Only a clean pull earns the follow offer; a receiver already syncing+ // has nothing to enable.+ if (shouldOfferFollow(status)) {+ followOfferMade = true;+ setOffering(true);+ return;+ }+ onApplied?.();+ return;+ case 'conflict':+ // Resolves the miss like a plain success: the fast-forward has already+ // landed (branch at the origin tip, target materialized), and the+ // locked-editor conflict resolver owns the conflict signal from here.+ onApplied?.();+ return;+ default: {+ // Optimistic resolution stays the default for an unknown outcome, but a+ // new `PullOutcome` fails the build here until it is handled on purpose.+ const _exhaustive: never = outcome;+ void _exhaustive;+ onApplied?.();+ return;+ }+ }+ }, [pending, status, onApplied]);++ return {+ pending,+ failure,+ offering,+ resolveOffer: () => {+ setOffering(false);+ onApplied?.();+ },+ start: () => {+ lastPullAtClick.current = status?.lastPullUtc ?? null;+ setFailure(null);+ setPending(true);+ // A trigger that never lands (offline / server down / non-2xx) gets no CC1+ // status update, so report it here rather than waiting forever.+ triggerSync('pull').catch((err) => {+ console.warn(+ '[receive] miss pull trigger failed',+ err instanceof Error ? err.message : err,+ );+ setPending(false);+ setFailure('error');+ });+ },+ };+}++/**+ * "Pull latest changes" recovery for the behind cells — an in-product+ * alternative to running `git pull` in a terminal. Presentational: the pull+ * state lives in `useOneShotPull` on the host so the failure line can read it+ * too.+ */+function PullNowButton({ pending, onPull }: { pending: boolean; onPull: () => void }) {+ return (+ <>+ {pending ? (+ <Button disabled aria-busy="true" data-testid="share-receive-miss-pull-now">+ <RefreshCw className="size-4 animate-spin" aria-hidden="true" />+ <Trans>Pulling</Trans>+ </Button>+ ) : (+ <Button onClick={onPull} data-testid="share-receive-miss-pull-now">+ <ArrowDownToLine className="size-4" aria-hidden="true" />+ <Trans>Pull latest changes</Trans>+ </Button>+ )}+ {/* A disabled control is skipped by the virtual cursor and its silent+ label swap fires no announcement, so this always-mounted region is+ what tells a screen-reader user the pull actually started. Populating+ an existing region (not inserting one) is what makes the announcement+ reliable across screen readers. */}+ <span+ role="status"+ aria-live="polite"+ className="sr-only"+ data-testid="share-receive-miss-pull-status"+ >+ {pending ? <Trans>Pulling the latest changes</Trans> : null}+ </span>+ </>+ );+}++/**+ * The keep-this-copy-updated offer: follow mode — the one-directional sync that+ * keeps pulling origin without ever pushing this receiver's copy — proposed+ * right after a pull the receiver asked for, when its worth has just been shown,+ * rather than as a second button competing with the pull itself.+ *+ * Mounted only while the offer stands, so the shared miss content reads config+ * context at the one moment it can act on it. Either answer resolves the miss:+ * declining must never cost the receiver the document they followed the link+ * for, and a failed write is the toast's problem, not a reason to strand them.+ */+function FollowOfferGate({+ onResolve,+ strandedCommitCount,+}: {+ onResolve: () => void;+ /** Unpushed local commits follow mode would strand — drives the same consent disclosure every sibling enable surface shows. */+ strandedCommitCount: number;+}) {+ const modeWriter = useSyncModeWriter();+ const resolved = useRef(false);+ function resolveOnce(): void {+ if (resolved.current) return;+ resolved.current = true;+ onResolve();+ }+ // Mounted only when sync is off, so `off` is the mode being moved away from.+ const { confirmOpen, setConfirmOpen, onModeSelect, onConfirm } = useSyncModeSelection(+ modeWriter,+ 'off',+ { onApplied: resolveOnce },+ );+ // Selecting follow is what opens the consent gate, and mounting is this+ // component's whole trigger — there is no click to hang it off. Latched so the+ // gate can't reopen itself as the answered dialog closes.+ const opened = useRef(false);+ useEffect(() => {+ if (opened.current) return;+ opened.current = true;+ onModeSelect('follow');+ }, [onModeSelect]);+ return (+ <EnableSyncConfirmDialog+ open={confirmOpen}+ onOpenChange={(open) => {+ setConfirmOpen(open);+ if (!open) resolveOnce();+ }}+ onConfirm={() => {+ onConfirm();+ resolveOnce();+ }}+ variant="follow"+ strandedCommitCount={strandedCommitCount}+ />);}@@ -216,6 +472,7 @@ export function ShareReceiveMissContent({onOpenRenamed,onEnableAutoSync,onSyncCompleted,+ onPullApplied,}: {nav: PendingReceiveNav;state: ShareTargetVerdictState;@@ -225,12 +482,15 @@ export function ShareReceiveMissContent({onEnableAutoSync?: () => void;/** Called after a "Sync now" push lands (changed-locally cell) — the shell re-probes the verdict, which the push has changed. */onSyncCompleted?: () => void;+ /** Called when a pull completed in a state that can resolve the miss (behind cells) — the shell navigates to the target or re-probes. */+ onPullApplied?: () => void;}) {const { t } = useLingui();- // Sync state feeds only the changed-locally cell (Enable auto-sync vs Sync- // now); for every other verdict it is read and unused. Null until the first- // status response — neither CTA renders on an unknown sync state.+ // Sync state feeds the changed-locally cell (Enable auto-sync vs Sync now) and+ // the behind cells' pull CTA; for the other verdicts it is read and unused.+ // Null until the first status response — no CTA renders on an unknown state.const syncStatus = useGitSyncStatus();+ const pull = useOneShotPull(syncStatus, onPullApplied);const branch = nav.branch;const targetNoun = nav.kind === 'folder' ? t`folder` : t`document`;@@ -254,6 +514,7 @@ export function ShareReceiveMissContent({let icon: ReactNode;let message: ReactNode;let actions: ReactNode;+ let failureLine: ReactNode = null;if (resolution.verdict === 'renamed') {icon = <MapPin className="size-9" aria-hidden="true" />;@@ -357,19 +618,67 @@ export function ShareReceiveMissContent({);} else {// on-origin (local ref behind) and unknown (fetch failed / no bridge) both- // land on the honest stale-local pull guidance.+ // land on the honest stale-local pull guidance. When the engine can run a+ // one-shot pull the surface offers it instead of telling the receiver to go+ // do it by hand, so the copy drops the manual instruction.icon = <ArrowDownToLine className="size-9" aria-hidden="true" />;- message =- branch === null ? (- <Trans>Your local copy is behind. Pull the latest changes, then open the link again.</Trans>- ) : (- <Trans>- Your local copy of branch{' '}- <code className="rounded-sm bg-muted px-1 py-0.5 text-foreground/80">{branch}</code> is- behind. Pull the latest changes, then open the link again.- </Trans>- );- actions = browseFolderButton;+ const canPull = pullActionable(syncStatus);+ if (canPull) {+ message =+ branch === null ? (+ <Trans>Your local copy is behind.</Trans>+ ) : (+ <Trans>+ Your local copy of branch{' '}+ <code className="rounded-sm bg-muted px-1 py-0.5 text-foreground/80">{branch}</code> is+ behind.+ </Trans>+ );+ } else {+ message =+ branch === null ? (+ <Trans>+ Your local copy is behind. Pull the latest changes, then open the link again.+ </Trans>+ ) : (+ <Trans>+ Your local copy of branch{' '}+ <code className="rounded-sm bg-muted px-1 py-0.5 text-foreground/80">{branch}</code> is+ behind. Pull the latest changes, then open the link again.+ </Trans>+ );+ }+ // Pre-mounted like the progress regions: populating an existing alert is+ // what screen readers reliably announce — one inserted already-full is+ // skipped by some (NVDA + Chrome). Kept sr-only while empty so the blank+ // region neither shows nor consumes a flex gap.+ failureLine = (+ <p+ role="alert"+ className={+ pull.failure !== null ? 'max-w-md text-balance text-1sm text-destructive' : 'sr-only'+ }+ data-testid="share-receive-miss-pull-error"+ >+ {pull.failure === 'refused' ? (+ <Trans>Another sync operation is in progress. Try again in a moment.</Trans>+ ) : pull.failure === 'error' ? (+ <Trans>Couldn't pull from GitHub. Check your connection and sign-in, then retry.</Trans>+ ) : null}+ </p>+ );+ actions = (+ <>+ {canPull ? <PullNowButton pending={pull.pending} onPull={pull.start} /> : null}+ {browseFolderButton}+ {pull.offering ? (+ <FollowOfferGate+ onResolve={pull.resolveOffer}+ strandedCommitCount={syncStatus?.ahead ?? 0}+ />+ ) : null}+ </>+ );}return (@@ -378,7 +687,12 @@ export function ShareReceiveMissContent({{icon}</div><p className="max-w-md text-balance text-base leading-6 text-foreground/90">{message}</p>- <div className="flex flex-col-reverse gap-2 sm:flex-row">{actions}</div>+ {failureLine}+ {/* Wraps so a pair of long action labels (translations run much longer+ than the English) stacks instead of overflowing the narrow dialog. */}+ <div className="flex flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:justify-center">+ {actions}+ </div></>);}diff --git a/packages/app/src/hooks/use-enable-sync-with-confirm.dom.test.tsx b/packages/app/src/hooks/use-enable-sync-with-confirm.dom.test.tsxindex 58308d58f..2364ab76e 100644--- a/packages/app/src/hooks/use-enable-sync-with-confirm.dom.test.tsx+++ b/packages/app/src/hooks/use-enable-sync-with-confirm.dom.test.tsx@@ -92,12 +92,18 @@ let latestModeSelection: ModeSelectionState | null = null;function ModeSelectionProbe({writer,currentMode,+ onApplied,}: {writer: ModeWriter;currentMode: SyncMode;+ onApplied?: (mode: SyncMode) => void;}) {if (!hooks) throw new Error('hooks not loaded');- latestModeSelection = hooks.useSyncModeSelection(writer, currentMode);+ latestModeSelection = hooks.useSyncModeSelection(+ writer,+ currentMode,+ onApplied ? { onApplied } : undefined,+ );return (<div data-testid="mode-selection">{String(latestModeSelection.confirmOpen)}:{String(latestModeSelection.pendingMode)}@@ -503,4 +509,89 @@ describe('useSyncModeSelection runtime behavior', () => {expect(screen.getByTestId('mode-selection').textContent).toBe('true:full');expect(toastErrors).toEqual(['Failed to update sync mode — branch is protected']);});++ test('fires opts.onApplied with the confirmed mode after a successful write', async () => {+ await loadHooks();+ const applied: SyncMode[] = [];+ const writer: ModeWriter = () => ({ ok: true });+ render(+ <ModeSelectionProbe+ writer={writer}+ currentMode="off"+ onApplied={(mode) => applied.push(mode)}+ />,+ );++ await act(async () => {+ latestModeSelection?.onModeSelect('follow');+ });+ expect(applied).toEqual([]); // not until the user confirms++ await act(async () => {+ latestModeSelection?.onConfirm();+ });+ expect(applied).toEqual(['follow']);+ });++ test('fires opts.onApplied for the unconfirmed off direction too', async () => {+ await loadHooks();+ const applied: SyncMode[] = [];+ const writer: ModeWriter = () => ({ ok: true });+ render(+ <ModeSelectionProbe+ writer={writer}+ currentMode="full"+ onApplied={(mode) => applied.push(mode)}+ />,+ );++ await act(async () => {+ latestModeSelection?.onModeSelect('off');+ });++ expect(applied).toEqual(['off']);+ });++ test('does not fire opts.onApplied when the mode write fails', async () => {+ await loadHooks();+ consoleErrorSpy = vi.spyOn(console, 'error').mockImplementation(() => {});+ const applied: SyncMode[] = [];+ const writer: ModeWriter = () => ({ ok: false, error: 'branch is protected' });+ render(+ <ModeSelectionProbe+ writer={writer}+ currentMode="off"+ onApplied={(mode) => applied.push(mode)}+ />,+ );++ await act(async () => {+ latestModeSelection?.onModeSelect('follow');+ });+ await act(async () => {+ latestModeSelection?.onConfirm();+ });++ expect(applied).toEqual([]);+ expect(toastErrors).toEqual(['Failed to update sync mode — branch is protected']);+ });++ test('does not fire opts.onApplied when no writer has mounted yet', async () => {+ await loadHooks();+ const applied: SyncMode[] = [];+ render(+ <ModeSelectionProbe+ writer={null}+ currentMode="full"+ onApplied={(mode) => applied.push(mode)}+ />,+ );++ await act(async () => {+ latestModeSelection?.onModeSelect('off');+ });++ expect(applied).toEqual([]);+ expect(toastErrors).toEqual(['Sync settings not yet loaded — try again in a moment']);+ });});diff --git a/packages/app/src/hooks/use-enable-sync-with-confirm.ts b/packages/app/src/hooks/use-enable-sync-with-confirm.tsindex 80afbc71f..1bfdafd7f 100644--- a/packages/app/src/hooks/use-enable-sync-with-confirm.ts+++ b/packages/app/src/hooks/use-enable-sync-with-confirm.ts@@ -211,10 +211,18 @@ interface UseSyncModeSelectionResult {* `currentMode` is the resolved per-machine mode; the caller renders* `<EnableSyncConfirmDialog variant={pendingMode ?? 'full'} ...>` with the* returned props.+ *+ * `opts.onApplied` (optional) fires once per SUCCESSFUL write, with the mode+ * that landed, so a host surface can chain a follow-up on the same click (e.g.+ * the share-receive miss surface's post-pull follow offer resolving its consent+ * gate — closing the offer and opening the target — once Follow is confirmed).+ * It never fires on a failed write. Mirrors `opts.onEnabled` on the boolean+ * sibling {@link useEnableSyncWithConfirm}.*/export function useSyncModeSelection(writer: SyncModeWriter | null,currentMode: SyncMode,+ opts?: { onApplied?: (mode: SyncMode) => void },): UseSyncModeSelectionResult {const { t } = useLingui();const [confirmOpen, setConfirmOpen] = useState(false);@@ -232,6 +240,9 @@ export function useSyncModeSelection(toast.error(t`Failed to update sync mode — ${detail}`);return false;}+ // Success-only notify, fired from the single write choke point so both+ // directions (immediate 'off', confirmed enable) report exactly once.+ opts?.onApplied?.(next);return true;}diff --git a/packages/app/src/locales/en/messages.json b/packages/app/src/locales/en/messages.jsonindex a7a3f25b7..47706eff4 100644--- a/packages/app/src/locales/en/messages.json+++ b/packages/app/src/locales/en/messages.json@@ -125,6 +125,7 @@"1njn7W": ["Light"],"1nke1r": ["Open ", ["0"], " on GitHub (opens in a new tab)"],"1t_NnN": ["Reject"],+ "1u-mAI": ["Couldn't start the sync. Check your connection, then retry."],"2-CeZn": ["Your report is saved on this Mac, so nothing was lost. You can email it to us instead."],@@ -1032,6 +1033,7 @@"No disconnected pages. Pages appear here only when they have no incoming and no outgoing graph edges."],"JE21eh": ["Symlink to ", ["targetPath"]],+ "JG_8KT": ["Couldn't pull from GitHub. Check your connection and sign-in, then retry."],"JHf6qZ": ["[email protected]"],"JJcBCm": [["0"], " total"],"JK-Ave": ["Hide thumbnails"],@@ -1746,6 +1748,7 @@"XmJfZT": ["name"],"XnlF3W": ["Add the next matching source selection."],"XopE_I": ["Failed to parse backlinks error response (HTTP ", ["status"], ")"],+ "Xp7Kq4": ["Another sync operation is in progress. Try again in a moment."],"XpIZmv": ["Fenced code block with monospace text."],"XqNHcm": ["Couldn't update skill targets: ", ["0"]],"XtRoxT": ["Page ", ["pageNumber"]],@@ -2091,6 +2094,7 @@"dURmlQ": ["\"frontmatter\" is a reserved property name"],"dVaXnv": ["Content rules not yet loaded — try again in a moment"],"dXCi3J": ["Something broke"],+ "dXOolp": ["Syncing your changes"],"dXWMFn": ["Removes this skill from your editors."],"dYCvMf": ["Couldn't resume this conversation: ", ["0"]],"darW93": [@@ -2191,6 +2195,7 @@"fbdLmk": ["Toggle bold formatting."],"fbsiBw": ["Something went wrong starting the terminal."],"fcgvCA": ["Claude"],+ "fevEu0": ["Pull latest changes"],"fiMNLl": ["Sync settings not yet loaded — try again in a moment"],"fj5YiP": ["Downloads a fresh copy from GitHub."],"fnlBN4": ["Auto-approve settings not yet loaded — try again in a moment"],@@ -2242,6 +2247,7 @@"gh27t1": ["Link previews"],"gijbne": ["Failed to rename path"],"gk_-qj": ["Couldn't rename template: ", ["0"]],+ "glG1TR": ["Pulling the latest changes"],"gljvbT": [["words", "plural", { "one": ["word"], "other": ["words"] }]],"glzsS_": ["Pan right"],"gmJ0An": ["Failed to open folder."],@@ -2252,6 +2258,7 @@"gvApb7": ["Turn the things you read into clear, trusted articles. Save a source, figure out what it means, then keep the final version so you can rely on it later."],+ "gwEcOD": ["Your local copy is behind."],"gwykHF": ["This doc hasn't synced to GitHub yet. The link will work after the next sync."],"h-AdvS": ["The folders and templates are already here, so there's nothing to add."],"h06R3C": ["No pages are missing outgoing graph links."],@@ -3070,6 +3077,7 @@"wndeIl": ["Project-level pages with neither incoming nor outgoing graph edges."],"ws5o1F": ["Checked by: ", ["0"]],"wtcxiD": ["Share this setup with your team?"],+ "wvK7Ay": ["Your local copy of branch <0>", ["branch"], "</0> is behind."],"wvbc1r": ["Couldn't open document"],"wzq9Rv": ["A branch with that name already exists. Open its worktree from the switcher instead."diff --git a/packages/app/src/locales/en/messages.po b/packages/app/src/locales/en/messages.poindex 273602bea..c79985742 100644--- a/packages/app/src/locales/en/messages.po+++ b/packages/app/src/locales/en/messages.po@@ -1117,6 +1117,10 @@ msgstr "and {remaining} more"msgid "and more"msgstr "and more"+#: src/components/share-receive-miss-content.tsx+msgid "Another sync operation is in progress. Try again in a moment."+msgstr "Another sync operation is in progress. Try again in a moment."+#: src/components/settings/frontmatter-schema-field-editor.tsxmsgid "any"msgstr "any"@@ -2554,6 +2558,10 @@ msgstr "Couldn't open the terminal — please try again."msgid "Couldn't open the worktree. Try again."msgstr "Couldn't open the worktree. Try again."+#: src/components/share-receive-miss-content.tsx+msgid "Couldn't pull from GitHub. Check your connection and sign-in, then retry."+msgstr "Couldn't pull from GitHub. Check your connection and sign-in, then retry."+#: src/components/ConnectingBanner.tsxmsgid "Couldn't reach collab server — {errorDetail}. Try <0>ok status</0> or check <1>.ok/local/last-spawn-error.log</1>."msgstr "Couldn't reach collab server — {errorDetail}. Try <0>ok status</0> or check <1>.ok/local/last-spawn-error.log</1>."@@ -2663,6 +2671,10 @@ msgstr "Couldn't share skills: internal error. Please restart the app."msgid "Couldn't start the agent thread — please try again."msgstr "Couldn't start the agent thread — please try again."+#: src/components/share-receive-miss-content.tsx+msgid "Couldn't start the sync. Check your connection, then retry."+msgstr "Couldn't start the sync. Check your connection, then retry."+#. placeholder {0}: result.error#: src/components/skill-actions.tsxmsgid "Couldn't uninstall skill: {0}"@@ -7117,10 +7129,19 @@ msgstr "Publishing..."msgid "Pull"msgstr "Pull"+#: src/components/share-receive-miss-content.tsx+msgid "Pull latest changes"+msgstr "Pull latest changes"++#: src/components/share-receive-miss-content.tsx#: src/components/SyncStatusBadge.tsxmsgid "Pulling"msgstr "Pulling"+#: src/components/share-receive-miss-content.tsx+msgid "Pulling the latest changes"+msgstr "Pulling the latest changes"+#: src/components/AutoSyncEnableWarning.tsxmsgid "Pulls may overwrite uncommitted edits in your local files."msgstr "Pulls may overwrite uncommitted edits in your local files."@@ -8877,6 +8898,10 @@ msgstr "Synced. The link is up to date."msgid "Syncing"msgstr "Syncing"+#: src/components/share-receive-miss-content.tsx+msgid "Syncing your changes"+msgstr "Syncing your changes"+#: src/components/TrashFailureModal.tsxmsgid "System error"msgstr "System error"@@ -10333,10 +10358,18 @@ msgstr "Your GitHub token is missing required scopes. Try signing in again."msgid "Your knowledge base is now on GitHub at <0>{ownerLogin}/{repoName}</0>."msgstr "Your knowledge base is now on GitHub at <0>{ownerLogin}/{repoName}</0>."+#: src/components/share-receive-miss-content.tsx+msgid "Your local copy is behind."+msgstr "Your local copy is behind."+#: src/components/share-receive-miss-content.tsxmsgid "Your local copy is behind. Pull the latest changes, then open the link again."msgstr "Your local copy is behind. Pull the latest changes, then open the link again."+#: src/components/share-receive-miss-content.tsx+msgid "Your local copy of branch <0>{branch}</0> is behind."+msgstr "Your local copy of branch <0>{branch}</0> is behind."+#: src/components/share-receive-miss-content.tsxmsgid "Your local copy of branch <0>{branch}</0> is behind. Pull the latest changes, then open the link again."msgstr "Your local copy of branch <0>{branch}</0> is behind. Pull the latest changes, then open the link again."diff --git a/packages/app/src/locales/pseudo/messages.json b/packages/app/src/locales/pseudo/messages.jsonindex bf2557465..bb2a0b4a9 100644--- a/packages/app/src/locales/pseudo/messages.json+++ b/packages/app/src/locales/pseudo/messages.json@@ -125,6 +125,7 @@"1njn7W": ["Ĺĩĝĥţ"],"1nke1r": ["Ōƥēń ", ["0"], " ōń ĜĩţĤũƀ (ōƥēńś ĩń à ńēŵ ţàƀ)"],"1t_NnN": ["ŔēĴēćţ"],+ "1u-mAI": ["Ćōũĺďń'ţ śţàŕţ ţĥē śŷńć. Ćĥēćķ ŷōũŕ ćōńńēćţĩōń, ţĥēń ŕēţŕŷ."],"2-CeZn": ["Ŷōũŕ ŕēƥōŕţ ĩś śàvēď ōń ţĥĩś Ḿàć, śō ńōţĥĩńĝ ŵàś ĺōśţ. Ŷōũ ćàń ēḿàĩĺ ĩţ ţō ũś ĩńśţēàď."],@@ -1032,6 +1033,7 @@"Ńō ďĩśćōńńēćţēď ƥàĝēś. Ƥàĝēś àƥƥēàŕ ĥēŕē ōńĺŷ ŵĥēń ţĥēŷ ĥàvē ńō ĩńćōḿĩńĝ àńď ńō ōũţĝōĩńĝ ĝŕàƥĥ ēďĝēś."],"JE21eh": ["Śŷḿĺĩńķ ţō ", ["targetPath"]],+ "JG_8KT": ["Ćōũĺďń'ţ ƥũĺĺ ƒŕōḿ ĜĩţĤũƀ. Ćĥēćķ ŷōũŕ ćōńńēćţĩōń àńď śĩĝń-ĩń, ţĥēń ŕēţŕŷ."],"JHf6qZ": ["ŷōũ@ćōḿƥàńŷ.ćōḿ"],"JJcBCm": [["0"], " ţōţàĺ"],"JK-Ave": ["Ĥĩďē ţĥũḿƀńàĩĺś"],@@ -1746,6 +1748,7 @@"XmJfZT": ["ńàḿē"],"XnlF3W": ["Àďď ţĥē ńēxţ ḿàţćĥĩńĝ śōũŕćē śēĺēćţĩōń."],"XopE_I": ["Ƒàĩĺēď ţō ƥàŕśē ƀàćķĺĩńķś ēŕŕōŕ ŕēśƥōńśē (ĤŢŢƤ ", ["status"], ")"],+ "Xp7Kq4": ["Àńōţĥēŕ śŷńć ōƥēŕàţĩōń ĩś ĩń ƥŕōĝŕēśś. Ţŕŷ àĝàĩń ĩń à ḿōḿēńţ."],"XpIZmv": ["Ƒēńćēď ćōďē ƀĺōćķ ŵĩţĥ ḿōńōśƥàćē ţēxţ."],"XqNHcm": ["Ćōũĺďń'ţ ũƥďàţē śķĩĺĺ ţàŕĝēţś: ", ["0"]],"XtRoxT": ["Ƥàĝē ", ["pageNumber"]],@@ -2091,6 +2094,7 @@"dURmlQ": ["\"ƒŕōńţḿàţţēŕ\" ĩś à ŕēśēŕvēď ƥŕōƥēŕţŷ ńàḿē"],"dVaXnv": ["Ćōńţēńţ ŕũĺēś ńōţ ŷēţ ĺōàďēď — ţŕŷ àĝàĩń ĩń à ḿōḿēńţ"],"dXCi3J": ["Śōḿēţĥĩńĝ ƀŕōķē"],+ "dXOolp": ["Śŷńćĩńĝ ŷōũŕ ćĥàńĝēś"],"dXWMFn": ["Ŕēḿōvēś ţĥĩś śķĩĺĺ ƒŕōḿ ŷōũŕ ēďĩţōŕś."],"dYCvMf": ["Ćōũĺďń'ţ ŕēśũḿē ţĥĩś ćōńvēŕśàţĩōń: ", ["0"]],"darW93": [@@ -2191,6 +2195,7 @@"fbdLmk": ["Ţōĝĝĺē ƀōĺď ƒōŕḿàţţĩńĝ."],"fbsiBw": ["Śōḿēţĥĩńĝ ŵēńţ ŵŕōńĝ śţàŕţĩńĝ ţĥē ţēŕḿĩńàĺ."],"fcgvCA": ["Ćĺàũďē"],+ "fevEu0": ["Ƥũĺĺ ĺàţēśţ ćĥàńĝēś"],"fiMNLl": ["Śŷńć śēţţĩńĝś ńōţ ŷēţ ĺōàďēď — ţŕŷ àĝàĩń ĩń à ḿōḿēńţ"],"fj5YiP": ["Ďōŵńĺōàďś à ƒŕēśĥ ćōƥŷ ƒŕōḿ ĜĩţĤũƀ."],"fnlBN4": ["Àũţō-àƥƥŕōvē śēţţĩńĝś ńōţ ŷēţ ĺōàďēď — ţŕŷ àĝàĩń ĩń à ḿōḿēńţ"],@@ -2242,6 +2247,7 @@"gh27t1": ["Ĺĩńķ ƥŕēvĩēŵś"],"gijbne": ["Ƒàĩĺēď ţō ŕēńàḿē ƥàţĥ"],"gk_-qj": ["Ćōũĺďń'ţ ŕēńàḿē ţēḿƥĺàţē: ", ["0"]],+ "glG1TR": ["Ƥũĺĺĩńĝ ţĥē ĺàţēśţ ćĥàńĝēś"],"gljvbT": [["words", "plural", { "one": ["ŵōŕď"], "other": ["ŵōŕďś"] }]],"glzsS_": ["Ƥàń ŕĩĝĥţ"],"gmJ0An": ["Ƒàĩĺēď ţō ōƥēń ƒōĺďēŕ."],@@ -2252,6 +2258,7 @@"gvApb7": ["Ţũŕń ţĥē ţĥĩńĝś ŷōũ ŕēàď ĩńţō ćĺēàŕ, ţŕũśţēď àŕţĩćĺēś. Śàvē à śōũŕćē, ƒĩĝũŕē ōũţ ŵĥàţ ĩţ ḿēàńś, ţĥēń ķēēƥ ţĥē ƒĩńàĺ vēŕśĩōń śō ŷōũ ćàń ŕēĺŷ ōń ĩţ ĺàţēŕ."],+ "gwEcOD": ["Ŷōũŕ ĺōćàĺ ćōƥŷ ĩś ƀēĥĩńď."],"gwykHF": ["Ţĥĩś ďōć ĥàśń'ţ śŷńćēď ţō ĜĩţĤũƀ ŷēţ. Ţĥē ĺĩńķ ŵĩĺĺ ŵōŕķ àƒţēŕ ţĥē ńēxţ śŷńć."],"h-AdvS": ["Ţĥē ƒōĺďēŕś àńď ţēḿƥĺàţēś àŕē àĺŕēàďŷ ĥēŕē, śō ţĥēŕē'ś ńōţĥĩńĝ ţō àďď."],"h06R3C": ["Ńō ƥàĝēś àŕē ḿĩśśĩńĝ ōũţĝōĩńĝ ĝŕàƥĥ ĺĩńķś."],@@ -3070,6 +3077,7 @@"wndeIl": ["ƤŕōĴēćţ-ĺēvēĺ ƥàĝēś ŵĩţĥ ńēĩţĥēŕ ĩńćōḿĩńĝ ńōŕ ōũţĝōĩńĝ ĝŕàƥĥ ēďĝēś."],"ws5o1F": ["Ćĥēćķēď ƀŷ: ", ["0"]],"wtcxiD": ["Śĥàŕē ţĥĩś śēţũƥ ŵĩţĥ ŷōũŕ ţēàḿ?"],+ "wvK7Ay": ["Ŷōũŕ ĺōćàĺ ćōƥŷ ōƒ ƀŕàńćĥ <0>", ["branch"], "</0> ĩś ƀēĥĩńď."],"wvbc1r": ["Ćōũĺďń'ţ ōƥēń ďōćũḿēńţ"],"wzq9Rv": ["À ƀŕàńćĥ ŵĩţĥ ţĥàţ ńàḿē àĺŕēàďŷ ēxĩśţś. Ōƥēń ĩţś ŵōŕķţŕēē ƒŕōḿ ţĥē śŵĩţćĥēŕ ĩńśţēàď."diff --git a/packages/app/src/locales/pseudo/messages.po b/packages/app/src/locales/pseudo/messages.poindex d7a1fe99a..1c94f7d2c 100644--- a/packages/app/src/locales/pseudo/messages.po+++ b/packages/app/src/locales/pseudo/messages.po@@ -1113,6 +1113,10 @@ msgstr ""msgid "and more"msgstr ""+#: src/components/share-receive-miss-content.tsx+msgid "Another sync operation is in progress. Try again in a moment."+msgstr ""+#: src/components/settings/frontmatter-schema-field-editor.tsxmsgid "any"msgstr ""@@ -2550,6 +2554,10 @@ msgstr ""msgid "Couldn't open the worktree. Try again."msgstr ""+#: src/components/share-receive-miss-content.tsx+msgid "Couldn't pull from GitHub. Check your connection and sign-in, then retry."+msgstr ""+#: src/components/ConnectingBanner.tsxmsgid "Couldn't reach collab server — {errorDetail}. Try <0>ok status</0> or check <1>.ok/local/last-spawn-error.log</1>."msgstr ""@@ -2659,6 +2667,10 @@ msgstr ""msgid "Couldn't start the agent thread — please try again."msgstr ""+#: src/components/share-receive-miss-content.tsx+msgid "Couldn't start the sync. Check your connection, then retry."+msgstr ""+#. placeholder {0}: result.error#: src/components/skill-actions.tsxmsgid "Couldn't uninstall skill: {0}"@@ -7113,10 +7125,19 @@ msgstr ""msgid "Pull"msgstr ""+#: src/components/share-receive-miss-content.tsx+msgid "Pull latest changes"+msgstr ""++#: src/components/share-receive-miss-content.tsx#: src/components/SyncStatusBadge.tsxmsgid "Pulling"msgstr ""+#: src/components/share-receive-miss-content.tsx+msgid "Pulling the latest changes"+msgstr ""+#: src/components/AutoSyncEnableWarning.tsxmsgid "Pulls may overwrite uncommitted edits in your local files."msgstr ""@@ -8873,6 +8894,10 @@ msgstr ""msgid "Syncing"msgstr ""+#: src/components/share-receive-miss-content.tsx+msgid "Syncing your changes"+msgstr ""+#: src/components/TrashFailureModal.tsxmsgid "System error"msgstr ""@@ -10329,10 +10354,18 @@ msgstr ""msgid "Your knowledge base is now on GitHub at <0>{ownerLogin}/{repoName}</0>."msgstr ""+#: src/components/share-receive-miss-content.tsx+msgid "Your local copy is behind."+msgstr ""+#: src/components/share-receive-miss-content.tsxmsgid "Your local copy is behind. Pull the latest changes, then open the link again."msgstr ""+#: src/components/share-receive-miss-content.tsx+msgid "Your local copy of branch <0>{branch}</0> is behind."+msgstr ""+#: src/components/share-receive-miss-content.tsxmsgid "Your local copy of branch <0>{branch}</0> is behind. Pull the latest changes, then open the link again."msgstr ""