Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

Revert "feat(open-knowledge): worktree selector for per-branch windows (#2322)" (#2346)

Andrew Mikofalvyfc1d99b4f86f
diff --git a/.changeset/worktree-selector.md b/.changeset/worktree-selector.md
deleted file mode 100644
index 3873d141d..000000000
--- a/.changeset/worktree-selector.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-"@inkeep/open-knowledge": patch
----
-
-You can now work on several branches of a project at once, each in its own window. The project switcher in the sidebar footer (and the File menu) has a new Worktrees section: pick a branch to open its worktree in a new window — if it doesn't have one yet, OpenKnowledge creates it on demand — or choose "New worktree…" to start a fresh branch. Worktrees are stored inside the project under `.ok/worktrees/` and kept out of git status automatically, so each window stays fully isolated (its own editor and server) without touching your working copy.
diff --git a/packages/app/src/components/CommandPalette.dom.test.tsx b/packages/app/src/components/CommandPalette.dom.test.tsx
index d2992e635..3bf433a15 100644
--- a/packages/app/src/components/CommandPalette.dom.test.tsx
+++ b/packages/app/src/components/CommandPalette.dom.test.tsx
@@ -183,13 +183,6 @@ mock.module('@/components/command-palette-tag-search', () => ({
fetchDocsForTag: mock(() => Promise.resolve([])),
}));
-let worktreeModelMock: import('@inkeep/open-knowledge-core').WorktreeSelectorModel | null = null;
-mock.module('@/hooks/use-worktrees', () => ({
- useWorktrees: () => worktreeModelMock,
-}));
-const refreshWorktreesMock = mock(() => {});
-mock.module('@/lib/worktree-store', () => ({ refreshWorktrees: refreshWorktreesMock }));
-
function recent(name: string, path = `/projects/${name.toLowerCase()}`) {
return { name, path: path.replaceAll(' ', '-') };
}
@@ -216,15 +209,6 @@ function createBridge() {
navigator: {
open: mock(() => Promise.resolve()),
},
- worktree: {
- create: mock(() =>
- Promise.resolve({
- ok: true as const,
- path: '/projects/current/.ok/worktrees/feature-x',
- created: true,
- }),
- ),
- },
};
}
@@ -263,8 +247,6 @@ describe('CommandPalette DOM behavior', () => {
createProjectDialogProps = [];
commandDialogProps = [];
refreshInstallStatesCalls = 0;
- worktreeModelMock = null;
- refreshWorktreesMock.mockClear();
window.location.hash = '';
globalThis.fetch = mock(() =>
Promise.resolve(new Response(JSON.stringify({ results: [] }), { status: 200 })),
@@ -559,64 +541,6 @@ describe('CommandPalette DOM behavior', () => {
expect(screen.queryByTestId('command-palette-search-preparing')).toBeNull(),
);
});
-
- test('surfaces worktrees of the current project — opens an existing one and creates one on demand', async () => {
- worktreeModelMock = {
- mainRoot: '/projects/current',
- currentBranch: 'main',
- entries: [
- {
- branch: 'main',
- worktreePath: '/projects/current',
- isCurrent: true,
- isMain: true,
- locked: false,
- },
- {
- branch: 'dev',
- worktreePath: '/projects/current/.ok/worktrees/dev',
- isCurrent: false,
- isMain: false,
- locked: false,
- },
- {
- branch: 'feature-x',
- worktreePath: null,
- isCurrent: false,
- isMain: false,
- locked: false,
- },
- ],
- };
- const { bridge } = await renderPalette();
-
- expect(screen.queryByTestId('command-palette-worktree-main')).toBeNull();
-
- fireEvent.click(screen.getByTestId('command-palette-worktree-dev'));
- await waitFor(() => {
- expect(bridge?.project.open).toHaveBeenCalledWith({
- path: '/projects/current/.ok/worktrees/dev',
- target: 'new-window',
- entryPoint: 'worktree',
- });
- });
-
- fireEvent.click(screen.getByTestId('command-palette-worktree-feature-x'));
- await waitFor(() => {
- expect(bridge?.worktree.create).toHaveBeenCalledWith({
- branch: 'feature-x',
- createBranch: false,
- });
- });
- await waitFor(() => {
- expect(bridge?.project.open).toHaveBeenCalledWith({
- path: '/projects/current/.ok/worktrees/feature-x',
- target: 'new-window',
- entryPoint: 'worktree',
- });
- });
- expect(refreshWorktreesMock).toHaveBeenCalled();
- });
});
describe('NavigationItem path subtitle', () => {
diff --git a/packages/app/src/components/CommandPalette.tsx b/packages/app/src/components/CommandPalette.tsx
index add9bc080..b2b1b8cee 100644
--- a/packages/app/src/components/CommandPalette.tsx
+++ b/packages/app/src/components/CommandPalette.tsx
@@ -1,6 +1,6 @@
// biome-ignore-all lint/plugin/no-raw-html-interactive-element: pre-rule backlog — file uses raw <button>/<input>/<textarea> awaiting shadcn migration; tracked at https://github.com/inkeep/open-knowledge/blob/main/biome-plugins/README.md#no-raw-html-interactive-elementgrit
-import { SHOW_INSTALL_SKILL, type WorktreeSelectorEntry } from '@inkeep/open-knowledge-core';
+import { SHOW_INSTALL_SKILL } from '@inkeep/open-knowledge-core';
import { Plural, Trans, useLingui } from '@lingui/react/macro';
import {
Box,
@@ -9,7 +9,6 @@ import {
FileText,
FolderOpen,
FolderPlus,
- GitBranch,
Hash,
LayoutGrid,
Loader2,
@@ -76,7 +75,6 @@ import { useDocumentContext } from '@/editor/DocumentContext';
import type { TagSummaryEntry } from '@/editor/extensions/tag-suggestion';
import { useIsEmbedded } from '@/hooks/use-is-embedded';
import { useSemanticSearchStatus } from '@/hooks/use-semantic-search-status';
-import { useWorktrees } from '@/hooks/use-worktrees';
import type { OkDesktopBridge, RecentProjectEntry } from '@/lib/desktop-bridge-types';
import { hashFromDocName } from '@/lib/doc-hash';
import { runWithToast as runWithToastBase } from '@/lib/error-state';
@@ -86,7 +84,6 @@ import { useSingleFileMode } from '@/lib/single-file-mode';
import { SETTINGS_OPEN_HASH } from '@/lib/use-settings-route';
import { useWorkspace } from '@/lib/use-workspace';
import { cn } from '@/lib/utils.ts';
-import { refreshWorktrees } from '@/lib/worktree-store';
import { buildHandoffInput, useHandoffDispatch } from './handoff/useHandoffDispatch';
import { useInstalledAgents } from './handoff/useInstalledAgents';
@@ -313,11 +310,6 @@ export function CommandPalette({ bridge = null, open, onOpenChange }: CommandPal
const visibleRecents = filterOmnibarRecents(recentNavigation, validRecentKeys);
const currentPath = bridge?.config.projectPath ?? null;
const switchableProjects = bridge ? projectRecents.filter((row) => row.path !== currentPath) : [];
- const worktreeModel = useWorktrees();
- const switchableWorktrees =
- bridge && worktreeModel
- ? worktreeModel.entries.filter((entry) => entry.branch !== null && !entry.isCurrent)
- : [];
const initialCreateDir = resolveCreateInitialDir(activeTarget, activeDocName);
const fallbackSearchResults =
trimmedDeferredQuery === ''
@@ -529,31 +521,6 @@ export function CommandPalette({ bridge = null, open, onOpenChange }: CommandPal
}, fallback);
};
- const openWorktreeEntry = (entry: WorktreeSelectorEntry) => {
- if (!bridge) return;
- const existingPath = entry.worktreePath;
- if (existingPath !== null) {
- runAction(
- () =>
- bridge.project.open({ path: existingPath, target: 'new-window', entryPoint: 'worktree' }),
- t`Failed to open worktree.`,
- );
- return;
- }
- const branch = entry.branch;
- if (branch === null) return;
- runAction(async () => {
- const result = await bridge.worktree.create({ branch, createBranch: false });
- if (!result.ok) throw new Error(result.reason);
- refreshWorktrees();
- await bridge.project.open({
- path: result.path,
- target: 'new-window',
- entryPoint: 'worktree',
- });
- }, t`Failed to open worktree.`);
- };
-
function rememberNavigation(entry: WorkspaceEntry | OmnibarRecentEntry) {
const nextEntry = {
kind: entry.kind,
@@ -637,12 +604,6 @@ export function CommandPalette({ bridge = null, open, onOpenChange }: CommandPal
switchableProjects.some((row) =>
matchesCommandQuery(`${row.name} ${row.path}`, deferredQuery, ['open recent project']),
));
- const matchedWorktrees = switchableWorktrees.filter(
- (entry) =>
- trimmedDeferredQuery === '' ||
- matchesCommandQuery(entry.branch ?? '', deferredQuery, ['worktree branch']),
- );
- const showWorktrees = !inExclusiveMode && bridge !== null && matchedWorktrees.length > 0;
const isEmbedded = useIsEmbedded();
const showAgentGroup =
!inExclusiveMode &&
@@ -1335,28 +1296,6 @@ export function CommandPalette({ bridge = null, open, onOpenChange }: CommandPal
</CommandGroup>
) : null}
- {showWorktrees && bridge ? (
- <CommandGroup heading={t`Worktrees`}>
- {matchedWorktrees.slice(0, 10).map((entry) => (
- <CommandItem
- key={entry.branch}
- value={`${entry.branch} worktree branch`}
- onSelect={() => openWorktreeEntry(entry)}
- data-testid={`command-palette-worktree-${entry.branch}`}
- className="items-start"
- >
- <GitBranch className="mt-0.5" />
- <div className="flex min-w-0 flex-col gap-1">
- <span className="truncate font-medium">{entry.branch}</span>
- <span className="truncate text-muted-foreground text-xs">
- {entry.worktreePath ?? t`Create worktree`}
- </span>
- </div>
- </CommandItem>
- ))}
- </CommandGroup>
- ) : null}
-
{showNavigation ? (
<CommandGroup heading={t`Search`}>
{visibleSearchResults.map((entry) => (
diff --git a/packages/app/src/components/NewWorktreeDialog.dom.test.tsx b/packages/app/src/components/NewWorktreeDialog.dom.test.tsx
deleted file mode 100644
index fd99657fe..000000000
--- a/packages/app/src/components/NewWorktreeDialog.dom.test.tsx
+++ /dev/null
@@ -1,145 +0,0 @@
-import { beforeEach, describe, expect, mock, test } from 'bun:test';
-import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react';
-import { NewWorktreeDialog } from './NewWorktreeDialog';
-
-const refreshWorktrees = mock(() => {});
-mock.module('@/lib/worktree-store', () => ({ refreshWorktrees }));
-
-function createBridge(createResult: unknown) {
- return {
- worktree: { create: mock(() => Promise.resolve(createResult)) },
- project: { open: mock(() => Promise.resolve()) },
- };
-}
-
-const noop = () => {};
-
-describe('NewWorktreeDialog', () => {
- beforeEach(() => {
- cleanup();
- refreshWorktrees.mockClear();
- });
-
- test('creates a new branch worktree and opens it (entryPoint worktree)', async () => {
- const bridge = createBridge({
- ok: true,
- path: '/repo/.ok/worktrees/my-feature',
- created: true,
- });
- render(
- <NewWorktreeDialog
- open={true}
- onOpenChange={noop}
- bridge={bridge as never}
- currentBranch="main"
- />,
- );
- const input = await screen.findByTestId('new-worktree-branch');
- fireEvent.change(input, { target: { value: 'my-feature' } });
- fireEvent.click(screen.getByTestId('new-worktree-create'));
-
- await waitFor(() => expect(bridge.worktree.create).toHaveBeenCalledTimes(1));
- expect(bridge.worktree.create).toHaveBeenCalledWith({
- branch: 'my-feature',
- createBranch: true,
- baseBranch: 'main',
- });
- await waitFor(() =>
- expect(bridge.project.open).toHaveBeenCalledWith({
- path: '/repo/.ok/worktrees/my-feature',
- target: 'new-window',
- entryPoint: 'worktree',
- }),
- );
- });
-
- test('surfaces a branch-exists failure inline without opening a window', async () => {
- const bridge = createBridge({ ok: false, reason: 'branch-exists' });
- render(
- <NewWorktreeDialog
- open={true}
- onOpenChange={noop}
- bridge={bridge as never}
- currentBranch="main"
- />,
- );
- fireEvent.change(await screen.findByTestId('new-worktree-branch'), {
- target: { value: 'dev' },
- });
- fireEvent.click(screen.getByTestId('new-worktree-create'));
- const err = await screen.findByTestId('new-worktree-error');
- expect(err.textContent).toContain('already exists');
- expect(bridge.project.open).not.toHaveBeenCalled();
- });
-
- test('checks out an existing branch (createBranch false, no base) and refreshes the cache', async () => {
- const bridge = createBridge({
- ok: true,
- path: '/repo/.ok/worktrees/dev',
- created: false,
- });
- render(
- <NewWorktreeDialog
- open={true}
- onOpenChange={noop}
- bridge={bridge as never}
- currentBranch="main"
- branches={['main', 'dev', 'release']}
- />,
- );
- const input = await screen.findByTestId('new-worktree-branch');
- fireEvent.change(input, { target: { value: 'dev' } });
-
- expect(screen.getByTestId('new-worktree-create').textContent).toContain('Check out');
-
- fireEvent.click(screen.getByTestId('new-worktree-create'));
- await waitFor(() => expect(bridge.worktree.create).toHaveBeenCalledTimes(1));
- expect(bridge.worktree.create).toHaveBeenCalledWith({
- branch: 'dev',
- createBranch: false,
- baseBranch: undefined,
- });
- await waitFor(() =>
- expect(bridge.project.open).toHaveBeenCalledWith({
- path: '/repo/.ok/worktrees/dev',
- target: 'new-window',
- entryPoint: 'worktree',
- }),
- );
- expect(refreshWorktrees).toHaveBeenCalled();
- });
-
- test('offers existing branches as datalist options for selection', async () => {
- const bridge = createBridge({ ok: true, path: '/x', created: true });
- render(
- <NewWorktreeDialog
- open={true}
- onOpenChange={noop}
- bridge={bridge as never}
- currentBranch="main"
- branches={['main', 'dev']}
- />,
- );
- const list = await screen.findByTestId('new-worktree-branch-list');
- const options = Array.from(list.querySelectorAll('option')).map((o) => o.getAttribute('value'));
- expect(options).toEqual(['main', 'dev']);
- const input = screen.getByTestId('new-worktree-branch');
- expect(input.getAttribute('list')).toBe(list.getAttribute('id'));
- });
-
- test('the create button is disabled until a branch name is entered', async () => {
- const bridge = createBridge({ ok: true, path: '/x', created: true });
- render(
- <NewWorktreeDialog
- open={true}
- onOpenChange={noop}
- bridge={bridge as never}
- currentBranch={null}
- />,
- );
- const button = (await screen.findByTestId('new-worktree-create')) as HTMLButtonElement;
- expect(button.disabled).toBe(true);
- fireEvent.change(screen.getByTestId('new-worktree-branch'), { target: { value: 'x' } });
- await waitFor(() => expect(button.disabled).toBe(false));
- });
-});
diff --git a/packages/app/src/components/NewWorktreeDialog.tsx b/packages/app/src/components/NewWorktreeDialog.tsx
deleted file mode 100644
index 5ade22db6..000000000
--- a/packages/app/src/components/NewWorktreeDialog.tsx
+++ /dev/null
@@ -1,219 +0,0 @@
-import type { MessageDescriptor } from '@lingui/core';
-import { msg } from '@lingui/core/macro';
-import { Trans, useLingui } from '@lingui/react/macro';
-import { useEffect, useId, useRef, useState } from 'react';
-import { toast } from 'sonner';
-import { Button } from '@/components/ui/button';
-import {
- Dialog,
- DialogBody,
- DialogContent,
- DialogDescription,
- DialogFooter,
- DialogHeader,
- DialogTitle,
-} from '@/components/ui/dialog';
-import { Input } from '@/components/ui/input';
-import { Label } from '@/components/ui/label';
-import type { OkDesktopBridge } from '@/lib/desktop-bridge-types';
-import { refreshWorktrees } from '@/lib/worktree-store';
-
-interface NewWorktreeDialogProps {
- open: boolean;
- onOpenChange: (open: boolean) => void;
- bridge: OkDesktopBridge;
- currentBranch: string | null;
- branches?: readonly string[];
-}
-
-function createErrorCopy(reason: string): MessageDescriptor {
- switch (reason) {
- case 'branch-exists':
- return msg`A branch with that name already exists. Open its worktree from the switcher instead.`;
- case 'already-checked-out':
- return msg`That branch is already open in another worktree.`;
- case 'path-exists':
- return msg`A worktree folder for that branch already exists.`;
- case 'invalid-branch':
- return msg`Enter a valid branch name (no spaces, no leading dot, no "..").`;
- case 'no-git':
- return msg`This project isn't a git repository, so worktrees aren't available.`;
- default:
- return msg`Couldn't create the worktree. Try a different name.`;
- }
-}
-
-export function NewWorktreeDialog({
- open,
- onOpenChange,
- bridge,
- currentBranch,
- branches = [],
-}: NewWorktreeDialogProps) {
- const { t } = useLingui();
- const formId = useId();
- const nameInputId = useId();
- const captionId = useId();
- const errorId = useId();
- const branchListId = useId();
- const [branch, setBranch] = useState('');
- const [busy, setBusy] = useState(false);
- const [error, setError] = useState<MessageDescriptor | null>(null);
- const inputRef = useRef<HTMLInputElement | null>(null);
-
- useEffect(() => {
- if (!open) return;
- setBranch('');
- setBusy(false);
- setError(null);
- const raf = requestAnimationFrame(() => inputRef.current?.focus());
- return () => cancelAnimationFrame(raf);
- }, [open]);
-
- const trimmed = branch.trim();
- const canSubmit = !busy && trimmed.length > 0;
- const isCheckout = trimmed.length > 0 && branches.includes(trimmed);
-
- async function onSubmit(e: React.SyntheticEvent<HTMLFormElement, SubmitEvent>) {
- e.preventDefault();
- if (!canSubmit) return;
- setBusy(true);
- setError(null);
- try {
- const result = await bridge.worktree.create({
- branch: trimmed,
- createBranch: !isCheckout,
- baseBranch: isCheckout ? undefined : (currentBranch ?? undefined),
- });
- if (!result.ok) {
- setError(createErrorCopy(result.reason));
- setBusy(false);
- return;
- }
- refreshWorktrees();
- onOpenChange(false);
- await bridge.project.open({
- path: result.path,
- target: 'new-window',
- entryPoint: 'worktree',
- });
- } catch (err) {
- console.warn('[NewWorktreeDialog] worktree create/open failed:', err);
- toast.error(t`Couldn't open the worktree. Try again.`);
- setBusy(false);
- }
- }
-
- return (
- <Dialog
- open={open}
- onOpenChange={(next) => {
- if (busy) return;
- onOpenChange(next);
- }}
- >
- <DialogContent className="sm:max-w-md" data-testid="new-worktree-dialog">
- <DialogHeader>
- <DialogTitle>
- <Trans>New worktree</Trans>
- </DialogTitle>
- <DialogDescription>
- <Trans>Create a new branch, or check out an existing one, in its own window.</Trans>
- </DialogDescription>
- </DialogHeader>
-
- <DialogBody>
- <form id={formId} onSubmit={onSubmit} className="flex flex-col gap-2">
- <Label htmlFor={nameInputId}>
- <Trans>Branch name</Trans>
- </Label>
- <Input
- id={nameInputId}
- ref={inputRef}
- value={branch}
- placeholder={t`my-feature`}
- list={branches.length > 0 ? branchListId : undefined}
- onChange={(e) => {
- setBranch(e.target.value);
- if (error !== null) setError(null);
- }}
- disabled={busy}
- autoComplete="off"
- autoCorrect="off"
- spellCheck={false}
- aria-invalid={error !== null}
- aria-describedby={error !== null ? `${captionId} ${errorId}` : captionId}
- data-testid="new-worktree-branch"
- />
- {branches.length > 0 ? (
- <datalist id={branchListId} data-testid="new-worktree-branch-list">
- {branches.map((b) => (
- <option key={b} value={b} />
- ))}
- </datalist>
- ) : null}
- <p
- id={captionId}
- className="text-1sm text-muted-foreground"
- data-testid="new-worktree-base"
- >
- {isCheckout ? (
- <Trans>
- Checks out <code className="font-mono break-all">{trimmed}</code> into its own
- window, under <code className="font-mono">.ok/worktrees/</code>.
- </Trans>
- ) : currentBranch !== null ? (
- <Trans>
- New branch based on <code className="font-mono break-all">{currentBranch}</code>.
- The worktree lives inside the project, under{' '}
- <code className="font-mono">.ok/worktrees/</code>.
- </Trans>
- ) : (
- <Trans>
- New branch based on the current commit. The worktree lives inside the project,
- under <code className="font-mono">.ok/worktrees/</code>.
- </Trans>
- )}
- </p>
- {error !== null ? (
- <p
- id={errorId}
- role="alert"
- className="text-1sm text-destructive"
- data-testid="new-worktree-error"
- >
- {t(error)}
- </p>
- ) : null}
- </form>
- </DialogBody>
-
- <DialogFooter>
- <Button
- type="button"
- variant="outline"
- onClick={() => onOpenChange(false)}
- disabled={busy}
- data-testid="new-worktree-cancel"
- >
- <Trans>Cancel</Trans>
- </Button>
- <Button
- type="submit"
- form={formId}
- disabled={!canSubmit}
- data-testid="new-worktree-create"
- >
- {busy ? (
- <Trans>Working</Trans>
- ) : isCheckout ? (
- <Trans>Check out worktree</Trans>
- ) : (
- <Trans>Create worktree</Trans>
- )}
- </Button>
- </DialogFooter>
- </DialogContent>
- </Dialog>
- );
-}
diff --git a/packages/app/src/components/ProjectSwitcher.dom.test.tsx b/packages/app/src/components/ProjectSwitcher.dom.test.tsx
index bc8ba271f..cc556891b 100644
--- a/packages/app/src/components/ProjectSwitcher.dom.test.tsx
+++ b/packages/app/src/components/ProjectSwitcher.dom.test.tsx
@@ -37,13 +37,6 @@ mock.module('@/components/ui/dropdown-menu', () => ({
DropdownMenuLabel: ({ children, ...props }: ItemProps) => <div {...props}>{children}</div>,
DropdownMenuSeparator: () => <hr />,
DropdownMenuTrigger: ({ children }: { children?: ReactNode }) => <>{children}</>,
- DropdownMenuSub: ({ children }: { children?: ReactNode }) => <div>{children}</div>,
- DropdownMenuSubTrigger: ({ children, ...props }: ItemProps) => (
- <button type="button" role="menuitem" {...props}>
- {children}
- </button>
- ),
- DropdownMenuSubContent: ({ children, ...props }: ItemProps) => <div {...props}>{children}</div>,
}));
mock.module('@/components/ui/input-group', () => ({
@@ -76,21 +69,6 @@ mock.module('./CreateProjectDialog', () => ({
},
}));
-let newWorktreeProps: Array<{ open: boolean }> = [];
-mock.module('./NewWorktreeDialog', () => ({
- NewWorktreeDialog: (props: { open: boolean }) => {
- newWorktreeProps.push(props);
- return <div data-testid="new-worktree-dialog" data-open={String(props.open)} />;
- },
-}));
-
-mock.module('@/hooks/use-current-branch', () => ({
- useCurrentBranch: () => 'main',
-}));
-mock.module('@/hooks/use-worktrees', () => ({
- useWorktrees: () => null,
-}));
-
function recent(name: string, path = `/projects/${name.toLowerCase()}`) {
return { name, path: path.replaceAll(' ', '-') };
}
@@ -117,21 +95,9 @@ function createBridge() {
navigator: {
open: mock(() => Promise.resolve()),
},
- worktree: {
- list: mock(() => Promise.resolve({ ok: false as const, reason: 'no-git' as const })),
- create: mock(() => Promise.resolve({ ok: false as const, reason: 'no-git' as const })),
- },
- onMenuAction: mock((cb: (action: string) => void) => {
- menuActionCb = cb;
- return () => {
- menuActionCb = null;
- };
- }),
};
}
-let menuActionCb: ((action: string) => void) | null = null;
-
async function openMenu() {
fireEvent.click(screen.getByTestId('project-switcher-trigger'));
act(() => {
@@ -148,9 +114,6 @@ describe('ProjectSwitcher dropdown behavior', () => {
lastDropdownOpenChange = null;
keydownBubbleCount = 0;
createDialogProps = [];
- newWorktreeProps = [];
- menuActionCb = null;
- (window as unknown as { okDesktop?: unknown }).okDesktop = undefined;
});
test('renders footer actions in order and routes each action through the expected bridge entry point', async () => {
@@ -205,7 +168,7 @@ describe('ProjectSwitcher dropdown behavior', () => {
expect(createDialogProps.at(-1)?.bridge).toBe(bridge);
});
- test('search matches across recents, announces empty results, stops typeahead bubbling, and clears on close', async () => {
+ test('search filters before the ten-item slice, announces empty results, stops typeahead bubbling, and clears on close', async () => {
const bridge = createBridge();
render(<ProjectSwitcher bridge={bridge as never} />);
@@ -225,9 +188,7 @@ describe('ProjectSwitcher dropdown behavior', () => {
fireEvent.change(search, { target: { value: 'does-not-exist' } });
- expect((await screen.findByRole('status')).textContent).toBe(
- 'No matching projects or worktrees.',
- );
+ expect((await screen.findByRole('status')).textContent).toBe('No matching projects.');
act(() => {
lastDropdownOpenChange?.(false);
@@ -238,45 +199,4 @@ describe('ProjectSwitcher dropdown behavior', () => {
expect((screen.getByTestId('project-switcher-search') as HTMLInputElement).value).toBe('');
});
});
-
- test('the top-level "New worktree…" item opens the New Worktree dialog', async () => {
- const bridge = createBridge();
- render(<ProjectSwitcher bridge={bridge as never} />);
- await openMenu();
-
- fireEvent.click(screen.getByTestId('project-switcher-new-worktree'));
- await waitFor(() =>
- expect(screen.getByTestId('new-worktree-dialog').getAttribute('data-open')).toBe('true'),
- );
- });
-
- test('File menu "new-worktree" action opens the New Worktree dialog; "switch-worktree" opens the dropdown', async () => {
- const bridge = createBridge();
- render(<ProjectSwitcher bridge={bridge as never} />);
- expect(menuActionCb).not.toBeNull();
-
- act(() => menuActionCb?.('new-worktree'));
- await waitFor(() =>
- expect(screen.getByTestId('new-worktree-dialog').getAttribute('data-open')).toBe('true'),
- );
-
- act(() => menuActionCb?.('switch-worktree'));
- await waitFor(() => {
- expect(screen.getByTestId('project-switcher-search')).not.toBeNull();
- });
- });
-
- test('on the Electron host, a row selection within the open-click guard window is swallowed, then works after it', async () => {
- (window as unknown as { okDesktop?: unknown }).okDesktop = {};
- const bridge = createBridge();
- render(<ProjectSwitcher bridge={bridge as never} />);
- await openMenu();
-
- fireEvent.click(screen.getByTestId('project-switcher-recent-/projects/project-1'));
- expect(bridge.project.open).not.toHaveBeenCalled();
-
- await new Promise((resolve) => setTimeout(resolve, 450));
- fireEvent.click(screen.getByTestId('project-switcher-recent-/projects/project-1'));
- await waitFor(() => expect(bridge.project.open).toHaveBeenCalledTimes(1));
- });
});
diff --git a/packages/app/src/components/ProjectSwitcher.tsx b/packages/app/src/components/ProjectSwitcher.tsx
index 89ac06c5f..be4cb9b38 100644
--- a/packages/app/src/components/ProjectSwitcher.tsx
+++ b/packages/app/src/components/ProjectSwitcher.tsx
@@ -12,13 +12,10 @@ import {
import { InputGroup, InputGroupAddon, InputGroupInput } from '@/components/ui/input-group';
import { SidebarMenuButton } from '@/components/ui/sidebar';
import { useCurrentBranch } from '@/hooks/use-current-branch';
-import { useWorktrees } from '@/hooks/use-worktrees';
import type { OkDesktopBridge, RecentProjectEntry } from '@/lib/desktop-bridge-types';
import { runWithToast as runWithToastBase } from '@/lib/error-state';
import { cn } from '@/lib/utils';
import { CreateProjectDialog } from './CreateProjectDialog';
-import { NewWorktreeDialog } from './NewWorktreeDialog';
-import { RecentProjectsMenu } from './RecentProjectsMenu';
export const runWithToast = (
fn: () => Promise<void>,
@@ -26,8 +23,6 @@ export const runWithToast = (
toastApi?: { error(msg: string): void },
): Promise<void> => runWithToastBase(fn, fallback, toastApi, 'ProjectSwitcher');
-const SELECT_GUARD_MS = 350;
-
interface ProjectSwitcherProps {
bridge: OkDesktopBridge;
}
@@ -38,33 +33,16 @@ export function ProjectSwitcher({ bridge }: ProjectSwitcherProps) {
const [open, setOpen] = useState(false);
const [search, setSearch] = useState('');
const [createProjectOpen, setCreateProjectOpen] = useState(false);
- const [newWorktreeOpen, setNewWorktreeOpen] = useState(false);
const branch = useCurrentBranch();
- const worktreeModel = useWorktrees();
const isElectronHost = typeof window !== 'undefined' && window.okDesktop != null;
const sawPointerDownRef = useRef(false);
- const withinOpenGuardRef = useRef(false);
- const openGuardTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
const handleOpenChange = (next: boolean): void => {
- if (next) {
- withinOpenGuardRef.current = true;
- if (openGuardTimerRef.current !== null) clearTimeout(openGuardTimerRef.current);
- openGuardTimerRef.current = setTimeout(() => {
- withinOpenGuardRef.current = false;
- }, SELECT_GUARD_MS);
- }
setOpen(next);
if (!next) setSearch('');
};
- const guardStaleSelect = (event: Event): boolean => {
- if (!isElectronHost || !withinOpenGuardRef.current) return false;
- event.preventDefault();
- return true;
- };
-
useEffect(() => {
if (!open) return;
let cancelled = false;
@@ -77,16 +55,13 @@ export function ProjectSwitcher({ bridge }: ProjectSwitcherProps) {
};
}, [open, bridge, t]);
- useEffect(() => {
- return bridge.onMenuAction((action) => {
- if (action === 'new-worktree') {
- setOpen(false);
- setNewWorktreeOpen(true);
- } else if (action === 'switch-worktree') {
- setOpen(true);
- }
- });
- }, [bridge]);
+ const openProject = (path: string) => {
+ setOpen(false);
+ void runWithToast(
+ () => bridge.project.open({ path, target: 'new-window', entryPoint: 'recents' }),
+ t`Failed to open project.`,
+ );
+ };
const onOpenFolder = () => {
setOpen(false);
@@ -108,7 +83,14 @@ export function ProjectSwitcher({ bridge }: ProjectSwitcherProps) {
};
const currentPath = bridge.config.projectPath;
+ const switchable = recents.filter((r) => r.path !== currentPath);
+
const query = search.trim().toLowerCase();
+ const filtered = query
+ ? switchable.filter(
+ (r) => r.name.toLowerCase().includes(query) || r.path.toLowerCase().includes(query),
+ )
+ : switchable;
return (
<>
@@ -172,9 +154,9 @@ export function ProjectSwitcher({ bridge }: ProjectSwitcherProps) {
className="min-w-[260px]"
data-testid="project-switcher-menu"
>
- {recents.length === 0 ? (
+ {switchable.length === 0 ? (
<DropdownMenuLabel className="font-normal text-muted-foreground text-xs">
- <Trans>No recent projects.</Trans>
+ <Trans>No other recent projects.</Trans>
</DropdownMenuLabel>
) : (
<>
@@ -182,8 +164,8 @@ export function ProjectSwitcher({ bridge }: ProjectSwitcherProps) {
swallow keystrokes meant for the filter field. */}
<InputGroup className="mb-1 h-8 border-0 shadow-none has-[[data-slot=input-group-control]:focus-visible]:ring-0">
<InputGroupInput
- aria-label={t`Search projects and worktrees`}
- placeholder={t`Search projects and worktrees...`}
+ aria-label={t`Search recent projects`}
+ placeholder={t`Search recent projects...`}
value={search}
onChange={(e) => setSearch(e.target.value)}
onKeyDown={(e) => e.stopPropagation()}
@@ -194,69 +176,53 @@ export function ProjectSwitcher({ bridge }: ProjectSwitcherProps) {
</InputGroupAddon>
</InputGroup>
<DropdownMenuSeparator />
- {/* Only the items list scrolls — the search field above and the
- New / Switch / Open actions below stay pinned. Radix resolves the
- DropdownMenuItem / DropdownMenuSub descendants for keyboard nav
- through this plain wrapper; submenu flyouts portal out, so the
- scroll clip doesn't cut them off. overscroll-contain stops scroll
- chaining to the page behind the dropdown at the list edges. */}
- <div className="max-h-64 overflow-x-hidden overflow-y-auto overscroll-contain subtle-scrollbar scroll-fade-mask">
- <RecentProjectsMenu
- bridge={bridge}
- recents={recents}
- currentPath={currentPath}
- query={query}
- worktreeModel={worktreeModel}
- closeMenu={() => setOpen(false)}
- guardStaleSelect={guardStaleSelect}
- />
- </div>
+ {filtered.length === 0 ? (
+ <DropdownMenuLabel
+ className="font-normal text-muted-foreground text-xs"
+ role="status"
+ aria-live="polite"
+ >
+ <Trans>No matching projects.</Trans>
+ </DropdownMenuLabel>
+ ) : (
+ <div className="max-h-64 overflow-x-hidden overflow-y-auto overscroll-contain subtle-scrollbar scroll-fade-mask">
+ {filtered.slice(0, 10).map((row) => (
+ <DropdownMenuItem
+ key={row.path}
+ disabled={row.missing}
+ onSelect={() => openProject(row.path)}
+ className="flex w-full min-w-0 flex-col items-start gap-0.5"
+ data-testid={`project-switcher-recent-${row.path}`}
+ >
+ <span className="w-full truncate font-medium text-sm" title={row.name}>
+ {row.name}
+ </span>
+ <span
+ className="w-full truncate text-muted-foreground text-xs"
+ title={row.path}
+ >
+ {row.path}
+ {row.missing ? t` (missing)` : ''}
+ </span>
+ </DropdownMenuItem>
+ ))}
+ </div>
+ )}
</>
)}
- {branch !== null ? (
- <>
- <DropdownMenuSeparator />
- <DropdownMenuItem
- onSelect={(e) => {
- if (guardStaleSelect(e)) return;
- setOpen(false);
- setNewWorktreeOpen(true);
- }}
- data-testid="project-switcher-new-worktree"
- >
- <GitBranch aria-hidden="true" className="text-muted-foreground" />
- <Trans>New worktree</Trans>
- </DropdownMenuItem>
- </>
- ) : null}
<DropdownMenuSeparator />
- <DropdownMenuItem
- onSelect={(e) => {
- if (guardStaleSelect(e)) return;
- onCreateProject();
- }}
- data-testid="project-switcher-new-project"
- >
+ <DropdownMenuItem onSelect={onCreateProject} data-testid="project-switcher-new-project">
<Plus aria-hidden="true" className="text-muted-foreground" />
<Trans>New project</Trans>
</DropdownMenuItem>
<DropdownMenuItem
- onSelect={(e) => {
- if (guardStaleSelect(e)) return;
- onSwitchProject();
- }}
+ onSelect={onSwitchProject}
data-testid="project-switcher-switch-project"
>
<LayoutGrid aria-hidden="true" className="text-muted-foreground" />
<Trans>Switch project</Trans>
</DropdownMenuItem>
- <DropdownMenuItem
- onSelect={(e) => {
- if (guardStaleSelect(e)) return;
- onOpenFolder();
- }}
- data-testid="project-switcher-open-folder"
- >
+ <DropdownMenuItem onSelect={onOpenFolder} data-testid="project-switcher-open-folder">
<FolderOpen aria-hidden="true" className="text-muted-foreground" />
<Trans>Open folder</Trans>
</DropdownMenuItem>
@@ -267,15 +233,6 @@ export function ProjectSwitcher({ bridge }: ProjectSwitcherProps) {
onOpenChange={setCreateProjectOpen}
bridge={bridge}
/>
- <NewWorktreeDialog
- open={newWorktreeOpen}
- onOpenChange={setNewWorktreeOpen}
- bridge={bridge}
- currentBranch={branch}
- branches={worktreeModel?.entries
- .map((entry) => entry.branch)
- .filter((b): b is string => b !== null)}
- />
</>
);
}
diff --git a/packages/app/src/components/RecentProjectsMenu.dom.test.tsx b/packages/app/src/components/RecentProjectsMenu.dom.test.tsx
deleted file mode 100644
index cddf0c6a6..000000000
--- a/packages/app/src/components/RecentProjectsMenu.dom.test.tsx
+++ /dev/null
@@ -1,274 +0,0 @@
-import { beforeEach, describe, expect, mock, test } from 'bun:test';
-import type { WorktreeSelectorModel } from '@inkeep/open-knowledge-core';
-import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react';
-import type { ReactNode } from 'react';
-import type { RecentProjectEntry } from '@/lib/desktop-bridge-types';
-import { RecentProjectsMenu } from './RecentProjectsMenu';
-
-type ItemProps = {
- children?: ReactNode;
- disabled?: boolean;
- onSelect?: () => void;
- [key: string]: unknown;
-};
-
-mock.module('@/components/ui/dropdown-menu', () => ({
- DropdownMenuItem: ({ children, disabled, onSelect, ...props }: ItemProps) => (
- <button type="button" role="menuitem" disabled={disabled} onClick={onSelect} {...props}>
- {children}
- </button>
- ),
- DropdownMenuLabel: ({ children, ...props }: ItemProps) => <div {...props}>{children}</div>,
- DropdownMenuSub: ({ children }: { children?: ReactNode }) => <div>{children}</div>,
- DropdownMenuSubTrigger: ({ children, ...props }: ItemProps) => (
- <button type="button" role="menuitem" {...props}>
- {children}
- </button>
- ),
- DropdownMenuSubContent: ({ children, ...props }: ItemProps) => <div {...props}>{children}</div>,
-}));
-
-const refreshWorktrees = mock(() => {});
-mock.module('@/lib/worktree-store', () => ({ refreshWorktrees }));
-const toastError = mock((_msg: string) => {});
-mock.module('sonner', () => ({ toast: { error: toastError, success: mock(() => {}) } }));
-
-function main(path: string, commonDir: string): RecentProjectEntry {
- return {
- path,
- name: path.split('/').pop() ?? path,
- lastOpenedAt: '2026-07-01',
- gitCommonDir: commonDir,
- mainRoot: path,
- isLinkedWorktree: false,
- branch: 'main',
- };
-}
-function worktree(
- path: string,
- commonDir: string,
- mainRoot: string,
- branch: string,
-): RecentProjectEntry {
- return {
- path,
- name: path.split('/').pop() ?? path,
- lastOpenedAt: '2026-07-01',
- gitCommonDir: commonDir,
- mainRoot,
- isLinkedWorktree: true,
- branch,
- };
-}
-function nonGit(path: string): RecentProjectEntry {
- return { path, name: path.split('/').pop() ?? path, lastOpenedAt: '2026-07-01' };
-}
-
-function model(entries: WorktreeSelectorModel['entries']): WorktreeSelectorModel {
- return { mainRoot: '/repo', currentBranch: 'main', entries };
-}
-
-function createBridge() {
- return {
- project: { open: mock(() => Promise.resolve()) },
- worktree: {
- create: mock(() =>
- Promise.resolve({
- ok: true as const,
- path: '/repo/.ok/worktrees/feature-x',
- created: true,
- }),
- ),
- },
- };
-}
-
-const noGuard = () => false;
-
-function renderMenu(
- overrides: Partial<{
- bridge: ReturnType<typeof createBridge>;
- recents: RecentProjectEntry[];
- currentPath: string;
- query: string;
- worktreeModel: WorktreeSelectorModel | null;
- closeMenu: () => void;
- }> = {},
-) {
- const bridge = overrides.bridge ?? createBridge();
- const closeMenu = overrides.closeMenu ?? mock(() => {});
- render(
- <RecentProjectsMenu
- bridge={bridge as never}
- recents={overrides.recents ?? []}
- currentPath={overrides.currentPath ?? '/other'}
- query={overrides.query ?? ''}
- worktreeModel={overrides.worktreeModel ?? null}
- closeMenu={closeMenu}
- guardStaleSelect={noGuard}
- />,
- );
- return { bridge, closeMenu };
-}
-
-describe('RecentProjectsMenu — grouped browse (no query)', () => {
- beforeEach(cleanup);
-
- test('nests a repo main + its linked worktrees under one submenu', async () => {
- const { bridge } = renderMenu({
- recents: [
- main('/repo', '/repo/.git'),
- worktree('/repo/.ok/worktrees/dev', '/repo/.git', '/repo', 'dev'),
- ],
- });
-
- expect(screen.getByTestId('project-switcher-group-/repo')).not.toBeNull();
- expect(screen.getByTestId('project-switcher-open-/repo')).not.toBeNull();
-
- fireEvent.click(screen.getByTestId('project-switcher-worktree-/repo/.ok/worktrees/dev'));
- await waitFor(() => {
- expect(bridge.project.open).toHaveBeenCalledWith({
- path: '/repo/.ok/worktrees/dev',
- target: 'new-window',
- entryPoint: 'worktree',
- });
- });
- });
-
- test('opening the project row from the submenu uses the recents entry point', async () => {
- const { bridge } = renderMenu({
- recents: [
- main('/repo', '/repo/.git'),
- worktree('/repo/.ok/worktrees/dev', '/repo/.git', '/repo', 'dev'),
- ],
- });
- fireEvent.click(screen.getByTestId('project-switcher-open-/repo'));
- await waitFor(() => {
- expect(bridge.project.open).toHaveBeenCalledWith({
- path: '/repo',
- target: 'new-window',
- entryPoint: 'recents',
- });
- });
- });
-
- test('a non-git recent is a flat row that opens with the recents entry point', async () => {
- const { bridge } = renderMenu({ recents: [nonGit('/notes')] });
- expect(screen.queryByTestId('project-switcher-group-/notes')).toBeNull();
- fireEvent.click(screen.getByTestId('project-switcher-recent-/notes'));
- await waitFor(() => {
- expect(bridge.project.open).toHaveBeenCalledWith({
- path: '/notes',
- target: 'new-window',
- entryPoint: 'recents',
- });
- });
- });
-
- test('the current project row no-ops on select and just closes the menu', async () => {
- const { bridge, closeMenu } = renderMenu({
- recents: [nonGit('/notes')],
- currentPath: '/notes',
- });
- fireEvent.click(screen.getByTestId('project-switcher-recent-/notes'));
- expect(bridge.project.open).not.toHaveBeenCalled();
- expect(closeMenu).toHaveBeenCalled();
- });
-
- test('a repo present only via a worktree synthesizes the project row (no "Open project")', () => {
- renderMenu({
- recents: [worktree('/repo/.ok/worktrees/dev', '/repo/.git', '/repo', 'dev')],
- });
- expect(screen.getByTestId('project-switcher-group-/repo')).not.toBeNull();
- expect(screen.queryByTestId('project-switcher-open-/repo')).toBeNull();
- expect(screen.getByTestId('project-switcher-worktree-/repo/.ok/worktrees/dev')).not.toBeNull();
- });
-});
-
-describe('RecentProjectsMenu — search', () => {
- beforeEach(cleanup);
-
- test('matches an opened worktree by branch name and opens it as a worktree', async () => {
- const { bridge } = renderMenu({
- recents: [
- main('/repo', '/repo/.git'),
- worktree('/repo/.ok/worktrees/dev', '/repo/.git', '/repo', 'dev'),
- ],
- query: 'dev',
- });
- fireEvent.click(screen.getByTestId('project-switcher-worktree-/repo/.ok/worktrees/dev'));
- await waitFor(() => {
- expect(bridge.project.open).toHaveBeenCalledWith({
- path: '/repo/.ok/worktrees/dev',
- target: 'new-window',
- entryPoint: 'worktree',
- });
- });
- });
-
- test('matches an un-opened branch from the cached model and creates its worktree on demand', async () => {
- const { bridge } = renderMenu({
- query: 'feature',
- worktreeModel: model([
- { branch: 'feature-x', worktreePath: null, isCurrent: false, isMain: false, locked: false },
- ]),
- });
- fireEvent.click(screen.getByTestId('project-switcher-branch-feature-x'));
- await waitFor(() => {
- expect(bridge.worktree.create).toHaveBeenCalledWith({
- branch: 'feature-x',
- createBranch: false,
- });
- });
- await waitFor(() => {
- expect(bridge.project.open).toHaveBeenCalledWith({
- path: '/repo/.ok/worktrees/feature-x',
- target: 'new-window',
- entryPoint: 'worktree',
- });
- });
- expect(refreshWorktrees).toHaveBeenCalled();
- });
-
- test('does not double-list a branch already shown as an opened worktree', () => {
- renderMenu({
- recents: [worktree('/repo/.ok/worktrees/dev', '/repo/.git', '/repo', 'dev')],
- query: 'dev',
- worktreeModel: model([
- {
- branch: 'dev',
- worktreePath: '/repo/.ok/worktrees/dev',
- isCurrent: false,
- isMain: false,
- locked: false,
- },
- ]),
- });
- expect(screen.getByTestId('project-switcher-worktree-/repo/.ok/worktrees/dev')).not.toBeNull();
- expect(screen.queryByTestId('project-switcher-branch-dev')).toBeNull();
- });
-
- test('announces when nothing matches', () => {
- renderMenu({ recents: [main('/repo', '/repo/.git')], query: 'zzz-nothing' });
- expect(screen.getByRole('status').textContent).toBe('No matching projects or worktrees.');
- });
-
- test('a failed create-on-demand toasts and does not open a window', async () => {
- toastError.mockClear();
- const bridge = createBridge();
- bridge.worktree.create = mock(() =>
- Promise.resolve({ ok: false as const, reason: 'branch-exists' as const }),
- );
- renderMenu({
- bridge,
- query: 'feature',
- worktreeModel: model([
- { branch: 'feature-x', worktreePath: null, isCurrent: false, isMain: false, locked: false },
- ]),
- });
- fireEvent.click(screen.getByTestId('project-switcher-branch-feature-x'));
- await waitFor(() => expect(bridge.worktree.create).toHaveBeenCalledTimes(1));
- await waitFor(() => expect(toastError).toHaveBeenCalled());
- expect(bridge.project.open).not.toHaveBeenCalled();
- });
-});
diff --git a/packages/app/src/components/RecentProjectsMenu.tsx b/packages/app/src/components/RecentProjectsMenu.tsx
deleted file mode 100644
index 022629441..000000000
--- a/packages/app/src/components/RecentProjectsMenu.tsx
+++ /dev/null
@@ -1,329 +0,0 @@
-import type { WorktreeSelectorEntry, WorktreeSelectorModel } from '@inkeep/open-knowledge-core';
-import { Trans, useLingui } from '@lingui/react/macro';
-import { Check, FolderGit2, GitBranch } from 'lucide-react';
-import { toast } from 'sonner';
-import {
- DropdownMenuItem,
- DropdownMenuLabel,
- DropdownMenuSub,
- DropdownMenuSubContent,
- DropdownMenuSubTrigger,
-} from '@/components/ui/dropdown-menu';
-import type { OkDesktopBridge, RecentProjectEntry } from '@/lib/desktop-bridge-types';
-import { cn } from '@/lib/utils';
-import { refreshWorktrees } from '@/lib/worktree-store';
-import { groupRecentsByRepo, type RecentRepoGroup } from './project-switcher-recents';
-
-type TFn = ReturnType<typeof useLingui>['t'];
-
-interface RecentProjectsMenuProps {
- bridge: OkDesktopBridge;
- recents: readonly RecentProjectEntry[];
- currentPath: string;
- query: string;
- worktreeModel: WorktreeSelectorModel | null;
- closeMenu: () => void;
- guardStaleSelect: (event: Event) => boolean;
-}
-
-export function RecentProjectsMenu({
- bridge,
- recents,
- currentPath,
- query,
- worktreeModel,
- closeMenu,
- guardStaleSelect,
-}: RecentProjectsMenuProps) {
- const { t } = useLingui();
-
- function openPath(path: string, entryPoint: 'recents' | 'worktree'): void {
- closeMenu();
- void bridge.project.open({ path, target: 'new-window', entryPoint }).catch((err) => {
- console.warn('[RecentProjectsMenu] project.open failed:', err);
- toast.error(t`Failed to open.`);
- });
- }
-
- async function createAndOpenBranch(branch: string): Promise<void> {
- try {
- const result = await bridge.worktree.create({ branch, createBranch: false });
- if (!result.ok) {
- toast.error(t`Couldn't open a worktree for that branch.`);
- return;
- }
- refreshWorktrees();
- await bridge.project.open({
- path: result.path,
- target: 'new-window',
- entryPoint: 'worktree',
- });
- } catch (err) {
- console.warn('[RecentProjectsMenu] create/open branch failed:', err);
- toast.error(t`Failed to open worktree.`);
- }
- }
-
- function onPickEntry(entry: RecentProjectEntry): void {
- if (entry.path === currentPath) {
- closeMenu();
- return;
- }
- openPath(entry.path, entry.isLinkedWorktree ? 'worktree' : 'recents');
- }
-
- if (query !== '') {
- return (
- <SearchResults
- recents={recents}
- currentPath={currentPath}
- query={query}
- worktreeModel={worktreeModel}
- onPickEntry={onPickEntry}
- onPickBranch={(branch) => {
- closeMenu();
- void createAndOpenBranch(branch);
- }}
- guardStaleSelect={guardStaleSelect}
- t={t}
- />
- );
- }
-
- const groups = groupRecentsByRepo(recents);
- return (
- <>
- {groups.map((group) => (
- <GroupRow
- key={group.project.path}
- group={group}
- currentPath={currentPath}
- onPickEntry={onPickEntry}
- onPickProject={() => {
- if (group.project.path === currentPath) {
- closeMenu();
- return;
- }
- openPath(group.project.path, 'recents');
- }}
- guardStaleSelect={guardStaleSelect}
- t={t}
- />
- ))}
- </>
- );
-}
-
-function GroupRow({
- group,
- currentPath,
- onPickEntry,
- onPickProject,
- guardStaleSelect,
- t,
-}: {
- group: RecentRepoGroup;
- currentPath: string;
- onPickEntry: (entry: RecentProjectEntry) => void;
- onPickProject: () => void;
- guardStaleSelect: (event: Event) => boolean;
- t: TFn;
-}) {
- const projectIsCurrent = group.project.path === currentPath;
-
- if (group.worktrees.length === 0) {
- return (
- <DropdownMenuItem
- onSelect={(e) => {
- if (guardStaleSelect(e)) return;
- onPickProject();
- }}
- className="flex w-full min-w-0 flex-col items-start gap-0.5"
- data-testid={`project-switcher-recent-${group.project.path}`}
- data-current={projectIsCurrent ? 'true' : undefined}
- >
- <ProjectLabel
- name={group.project.name}
- path={group.project.path}
- current={projectIsCurrent}
- />
- </DropdownMenuItem>
- );
- }
-
- return (
- <DropdownMenuSub>
- <DropdownMenuSubTrigger
- className="flex min-w-0"
- data-testid={`project-switcher-group-${group.project.path}`}
- >
- <FolderGit2 aria-hidden="true" className="text-muted-foreground" />
- <span className="min-w-0 flex-1 truncate">{group.project.name}</span>
- </DropdownMenuSubTrigger>
- <DropdownMenuSubContent className="min-w-[220px]">
- {group.projectSynthesized ? null : (
- <DropdownMenuItem
- onSelect={(e) => {
- if (guardStaleSelect(e)) return;
- onPickProject();
- }}
- className="flex items-center gap-2"
- data-testid={`project-switcher-open-${group.project.path}`}
- data-current={projectIsCurrent ? 'true' : undefined}
- >
- <FolderGit2 aria-hidden="true" className="size-3.5 shrink-0 text-muted-foreground" />
- {/* <Trans> (not t`Open ${x}`): the React Compiler can't lower a
- tagged template with interpolations, and it only surfaces in the
- vite build's Babel pass, not tsc or bun tests. */}
- <span className="min-w-0 flex-1 truncate">
- <Trans>Open {group.project.name}</Trans>
- </span>
- {projectIsCurrent ? <CurrentCheck t={t} /> : null}
- </DropdownMenuItem>
- )}
- {group.worktrees.map((wt) => {
- const wtCurrent = wt.path === currentPath;
- return (
- <DropdownMenuItem
- key={wt.path}
- onSelect={(e) => {
- if (guardStaleSelect(e)) return;
- onPickEntry(wt);
- }}
- className="flex items-center gap-2"
- data-testid={`project-switcher-worktree-${wt.path}`}
- data-current={wtCurrent ? 'true' : undefined}
- >
- <GitBranch aria-hidden="true" className="size-3.5 shrink-0" />
- <span className="min-w-0 flex-1 truncate">{wt.branch ?? t`(detached)`}</span>
- {wtCurrent ? <CurrentCheck t={t} /> : null}
- </DropdownMenuItem>
- );
- })}
- </DropdownMenuSubContent>
- </DropdownMenuSub>
- );
-}
-
-function SearchResults({
- recents,
- currentPath,
- query,
- worktreeModel,
- onPickEntry,
- onPickBranch,
- guardStaleSelect,
- t,
-}: {
- recents: readonly RecentProjectEntry[];
- currentPath: string;
- query: string;
- worktreeModel: WorktreeSelectorModel | null;
- onPickEntry: (entry: RecentProjectEntry) => void;
- onPickBranch: (branch: string) => void;
- guardStaleSelect: (event: Event) => boolean;
- t: TFn;
-}) {
- const matches = (text: string): boolean => text.toLowerCase().includes(query);
-
- const projectMatches = recents.filter(
- (r) => !r.isLinkedWorktree && (matches(r.name) || matches(r.path)),
- );
- const openedWorktreeMatches = recents.filter(
- (r) => r.isLinkedWorktree === true && (matches(r.branch ?? '') || matches(r.path)),
- );
- const openedWorktreePaths = new Set(openedWorktreeMatches.map((w) => w.path));
- const branchMatches: WorktreeSelectorEntry[] = (worktreeModel?.entries ?? []).filter(
- (e) =>
- e.branch !== null &&
- matches(e.branch) &&
- (e.worktreePath === null || !openedWorktreePaths.has(e.worktreePath)) &&
- e.worktreePath !== currentPath,
- );
-
- if (
- projectMatches.length === 0 &&
- openedWorktreeMatches.length === 0 &&
- branchMatches.length === 0
- ) {
- return (
- <DropdownMenuLabel
- className="font-normal text-muted-foreground text-xs"
- role="status"
- aria-live="polite"
- >
- {t`No matching projects or worktrees.`}
- </DropdownMenuLabel>
- );
- }
-
- return (
- <>
- {projectMatches.map((r) => (
- <DropdownMenuItem
- key={r.path}
- onSelect={(e) => {
- if (guardStaleSelect(e)) return;
- onPickEntry(r);
- }}
- className="flex w-full min-w-0 flex-col items-start gap-0.5"
- data-testid={`project-switcher-recent-${r.path}`}
- >
- <ProjectLabel name={r.name} path={r.path} current={r.path === currentPath} />
- </DropdownMenuItem>
- ))}
- {openedWorktreeMatches.map((r) => (
- <DropdownMenuItem
- key={r.path}
- onSelect={(e) => {
- if (guardStaleSelect(e)) return;
- onPickEntry(r);
- }}
- className="flex items-center gap-2"
- data-testid={`project-switcher-worktree-${r.path}`}
- data-current={r.path === currentPath ? 'true' : undefined}
- >
- <GitBranch aria-hidden="true" className="size-3.5 shrink-0" />
- <span className="min-w-0 flex-1 truncate">{r.branch ?? r.name}</span>
- </DropdownMenuItem>
- ))}
- {branchMatches.map((e) => (
- <DropdownMenuItem
- key={`branch:${e.branch}`}
- onSelect={(ev) => {
- if (guardStaleSelect(ev)) return;
- if (e.branch !== null) onPickBranch(e.branch);
- }}
- className="flex items-center gap-2"
- data-testid={`project-switcher-branch-${e.branch}`}
- >
- <GitBranch aria-hidden="true" className="size-3.5 shrink-0 opacity-40" />
- <span className="min-w-0 flex-1 truncate">{e.branch}</span>
- <span className="shrink-0 text-muted-foreground text-xs">{t`worktree`}</span>
- </DropdownMenuItem>
- ))}
- </>
- );
-}
-
-function ProjectLabel({ name, path, current }: { name: string; path: string; current: boolean }) {
- return (
- <>
- <span className={cn('flex w-full items-center gap-1.5', current && 'font-medium')}>
- <span className="truncate font-medium text-sm" title={name}>
- {name}
- </span>
- {current ? (
- <Check aria-hidden="true" className="size-3.5 shrink-0 text-muted-foreground" />
- ) : null}
- </span>
- <span className="w-full truncate text-muted-foreground text-xs" title={path}>
- {path}
- </span>
- </>
- );
-}
-
-function CurrentCheck({ t }: { t: TFn }) {
- return <Check aria-label={t`Current`} className="size-3.5 shrink-0 text-muted-foreground" />;
-}
diff --git a/packages/app/src/components/project-switcher-recents.test.ts b/packages/app/src/components/project-switcher-recents.test.ts
deleted file mode 100644
index c4cebbb1e..000000000
--- a/packages/app/src/components/project-switcher-recents.test.ts
+++ /dev/null
@@ -1,95 +0,0 @@
-import { describe, expect, test } from 'bun:test';
-import type { RecentProjectEntry } from '@/lib/desktop-bridge-types';
-import { basenameOf, groupRecentsByRepo } from './project-switcher-recents.ts';
-
-function main(path: string, commonDir: string): RecentProjectEntry {
- return {
- path,
- name: path.split('/').pop() ?? path,
- lastOpenedAt: '2026-07-01',
- gitCommonDir: commonDir,
- mainRoot: path,
- isLinkedWorktree: false,
- branch: 'main',
- };
-}
-function worktree(
- path: string,
- commonDir: string,
- mainRoot: string,
- branch: string,
-): RecentProjectEntry {
- return {
- path,
- name: path.split('/').pop() ?? path,
- lastOpenedAt: '2026-07-01',
- gitCommonDir: commonDir,
- mainRoot,
- isLinkedWorktree: true,
- branch,
- };
-}
-function nonGit(path: string): RecentProjectEntry {
- return { path, name: path.split('/').pop() ?? path, lastOpenedAt: '2026-07-01' };
-}
-
-describe('basenameOf', () => {
- test('handles / and \\ and trailing slashes', () => {
- expect(basenameOf('/a/b/test')).toBe('test');
- expect(basenameOf('/a/b/test/')).toBe('test');
- expect(basenameOf('C:\\a\\b\\test')).toBe('test');
- expect(basenameOf('solo')).toBe('solo');
- });
-});
-
-describe('groupRecentsByRepo', () => {
- test('groups a repo main + its linked worktrees under one group', () => {
- const groups = groupRecentsByRepo([
- main('/repo', '/repo/.git'),
- worktree('/repo/.ok/worktrees/dev', '/repo/.git', '/repo', 'dev'),
- worktree('/repo/.ok/worktrees/feat', '/repo/.git', '/repo', 'feat'),
- ]);
- expect(groups).toHaveLength(1);
- expect(groups[0]?.project.path).toBe('/repo');
- expect(groups[0]?.projectSynthesized).toBe(false);
- expect(groups[0]?.worktrees.map((w) => w.branch)).toEqual(['dev', 'feat']);
- });
-
- test('non-git recents become singleton groups with no worktrees', () => {
- const groups = groupRecentsByRepo([nonGit('/notes'), nonGit('/scratch')]);
- expect(groups).toHaveLength(2);
- expect(groups.every((g) => g.worktrees.length === 0)).toBe(true);
- expect(groups.map((g) => g.project.path)).toEqual(['/notes', '/scratch']);
- });
-
- test('synthesizes the project row when only a worktree is in recents', () => {
- const groups = groupRecentsByRepo([
- worktree('/repo/.ok/worktrees/dev', '/repo/.git', '/repo', 'dev'),
- ]);
- expect(groups).toHaveLength(1);
- expect(groups[0]?.project.path).toBe('/repo');
- expect(groups[0]?.project.name).toBe('repo');
- expect(groups[0]?.projectSynthesized).toBe(true);
- expect(groups[0]?.worktrees).toHaveLength(1);
- });
-
- test('preserves recents order across groups', () => {
- const groups = groupRecentsByRepo([
- main('/alpha', '/alpha/.git'),
- nonGit('/notes'),
- main('/beta', '/beta/.git'),
- worktree('/alpha/.ok/worktrees/x', '/alpha/.git', '/alpha', 'x'),
- ]);
- expect(groups.map((g) => g.project.path)).toEqual(['/alpha', '/notes', '/beta']);
- expect(groups[0]?.worktrees).toHaveLength(1);
- });
-
- test('two different repos stay separate', () => {
- const groups = groupRecentsByRepo([
- main('/a', '/a/.git'),
- worktree('/a/.ok/worktrees/x', '/a/.git', '/a', 'x'),
- main('/b', '/b/.git'),
- ]);
- expect(groups).toHaveLength(2);
- });
-});
diff --git a/packages/app/src/components/project-switcher-recents.ts b/packages/app/src/components/project-switcher-recents.ts
deleted file mode 100644
index aa5884e3e..000000000
--- a/packages/app/src/components/project-switcher-recents.ts
+++ /dev/null
@@ -1,52 +0,0 @@
-import type { RecentProjectEntry } from '@/lib/desktop-bridge-types';
-
-export interface RecentRepoGroup {
- readonly project: RecentProjectEntry;
- readonly worktrees: readonly RecentProjectEntry[];
- readonly projectSynthesized: boolean;
-}
-
-export function basenameOf(path: string): string {
- const segments = path.split(/[/\\]/).filter((s) => s.length > 0);
- return segments.length > 0 ? (segments[segments.length - 1] ?? path) : path;
-}
-
-interface GroupBuilder {
- project: RecentProjectEntry | null;
- mainRoot: string;
- worktrees: RecentProjectEntry[];
-}
-
-export function groupRecentsByRepo(recents: readonly RecentProjectEntry[]): RecentRepoGroup[] {
- const builders: GroupBuilder[] = [];
- const gitGroupIndex = new Map<string, number>();
-
- for (const entry of recents) {
- const commonDir = entry.gitCommonDir;
- const mainRoot = entry.mainRoot;
- if (commonDir === undefined || mainRoot === undefined) {
- builders.push({ project: entry, mainRoot: entry.path, worktrees: [] });
- continue;
- }
- let idx = gitGroupIndex.get(commonDir);
- if (idx === undefined) {
- idx = builders.length;
- gitGroupIndex.set(commonDir, idx);
- builders.push({ project: null, mainRoot, worktrees: [] });
- }
- const builder = builders[idx];
- if (builder === undefined) continue;
- if (entry.isLinkedWorktree) builder.worktrees.push(entry);
- else if (builder.project === null) builder.project = entry;
- }
-
- return builders.map((builder) => {
- const synthesized = builder.project === null;
- const project = builder.project ?? {
- path: builder.mainRoot,
- name: basenameOf(builder.mainRoot),
- lastOpenedAt: '',
- };
- return { project, worktrees: builder.worktrees, projectSynthesized: synthesized };
- });
-}
diff --git a/packages/app/src/hooks/use-worktrees.ts b/packages/app/src/hooks/use-worktrees.ts
deleted file mode 100644
index 4303ad31d..000000000
--- a/packages/app/src/hooks/use-worktrees.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import { useSyncExternalStore } from 'react';
-import { getWorktreesSnapshot, subscribeToWorktrees } from '@/lib/worktree-store';
-
-export function useWorktrees() {
- return useSyncExternalStore(subscribeToWorktrees, getWorktreesSnapshot, getWorktreesSnapshot);
-}
diff --git a/packages/app/src/lib/desktop-bridge-types.ts b/packages/app/src/lib/desktop-bridge-types.ts
index 76e4009bb..5a161d2a6 100644
--- a/packages/app/src/lib/desktop-bridge-types.ts
+++ b/packages/app/src/lib/desktop-bridge-types.ts
@@ -7,9 +7,6 @@ import type {
OkFolderState,
RecentProjectEntry,
TerminalCli,
- WorktreeCreateRequest,
- WorktreeCreateResult,
- WorktreeListResult,
} from '@inkeep/open-knowledge-core';
export type { OkFolderState, RecentProjectEntry };
@@ -154,9 +151,7 @@ type OkMenuAction =
| 'toggle-doc-panel'
| 'toggle-terminal'
| 'new-terminal'
- | 'kill-terminal'
- | 'new-worktree'
- | 'switch-worktree';
+ | 'kill-terminal';
type OkUnsubscribe = () => void;
@@ -167,8 +162,7 @@ export type OkProjectEntryPoint =
| 'recents'
| 'deep-link'
| 'drag-drop'
- | 'share-receive'
- | 'worktree';
+ | 'share-receive';
interface ProjectSessionState {
openTabs: string[];
@@ -618,11 +612,6 @@ export interface OkDesktopBridge {
close(): Promise<void>;
};
- worktree: {
- list(): Promise<WorktreeListResult>;
- create(request: WorktreeCreateRequest): Promise<WorktreeCreateResult>;
- };
-
sharing: {
status(): Promise<OkSharingStatusResult>;
setMode(mode: 'shared' | 'local-only'): Promise<OkSharingSetModeResult>;
diff --git a/packages/app/src/lib/worktree-store.test.ts b/packages/app/src/lib/worktree-store.test.ts
deleted file mode 100644
index 015b19e32..000000000
--- a/packages/app/src/lib/worktree-store.test.ts
+++ /dev/null
@@ -1,102 +0,0 @@
-import { describe, expect, mock, test } from 'bun:test';
-import type { WorktreeSelectorModel } from '@inkeep/open-knowledge-core';
-import { createWorktreeStore } from './worktree-store.ts';
-
-function model(mainRoot: string): WorktreeSelectorModel {
- return { mainRoot, currentBranch: 'main', entries: [] };
-}
-
-const flush = () => new Promise((r) => setTimeout(r, 0));
-
-describe('createWorktreeStore', () => {
- test('fetches once on first subscribe and caches the snapshot', async () => {
- const fetchModel = mock(() => Promise.resolve(model('/repo')));
- const store = createWorktreeStore({ fetchModel });
- expect(store.getSnapshot()).toBeNull();
-
- const unsub = store.subscribe(() => {});
- await flush();
- expect(fetchModel).toHaveBeenCalledTimes(1);
- expect(store.getSnapshot()?.mainRoot).toBe('/repo');
-
- store.subscribe(() => {});
- await flush();
- expect(fetchModel).toHaveBeenCalledTimes(1);
- unsub();
- });
-
- test('notifies subscribers when the model arrives', async () => {
- const fetchModel = mock(() => Promise.resolve(model('/repo')));
- const store = createWorktreeStore({ fetchModel });
- const listener = mock(() => {});
- store.subscribe(listener);
- await flush();
- expect(listener).toHaveBeenCalled();
- });
-
- test('refresh re-fetches and updates the snapshot', async () => {
- let next = model('/repo');
- const fetchModel = mock(() => Promise.resolve(next));
- const store = createWorktreeStore({ fetchModel });
- store.subscribe(() => {});
- await flush();
- expect(store.getSnapshot()?.mainRoot).toBe('/repo');
-
- next = model('/repo2');
- store.refresh();
- await flush();
- expect(fetchModel).toHaveBeenCalledTimes(2);
- expect(store.getSnapshot()?.mainRoot).toBe('/repo2');
- });
-
- test('keeps the prior cache when a fetch resolves null (transient failure)', async () => {
- let result: WorktreeSelectorModel | null = model('/repo');
- const fetchModel = mock(() => Promise.resolve(result));
- const store = createWorktreeStore({ fetchModel });
- store.subscribe(() => {});
- await flush();
- expect(store.getSnapshot()?.mainRoot).toBe('/repo');
-
- result = null;
- store.refresh();
- await flush();
- expect(store.getSnapshot()?.mainRoot).toBe('/repo');
- });
-
- test('coalesces a refresh that arrives while the initial load is still in-flight', async () => {
- let resolveFirst: ((m: WorktreeSelectorModel) => void) | null = null;
- let call = 0;
- const fetchModel = mock(() => {
- call += 1;
- if (call === 1) {
- return new Promise<WorktreeSelectorModel>((r) => {
- resolveFirst = r;
- });
- }
- return Promise.resolve(model('/repo-after-create'));
- });
- const store = createWorktreeStore({ fetchModel });
- store.subscribe(() => {});
- await flush();
- store.refresh();
- resolveFirst?.(model('/repo'));
- await flush();
- await flush();
- expect(fetchModel).toHaveBeenCalledTimes(2);
- expect(store.getSnapshot()?.mainRoot).toBe('/repo-after-create');
- });
-
- test('a rejected fetch keeps the prior snapshot', async () => {
- let shouldThrow = false;
- const fetchModel = mock(() =>
- shouldThrow ? Promise.reject(new Error('ipc down')) : Promise.resolve(model('/repo')),
- );
- const store = createWorktreeStore({ fetchModel });
- store.subscribe(() => {});
- await flush();
- shouldThrow = true;
- store.refresh();
- await flush();
- expect(store.getSnapshot()?.mainRoot).toBe('/repo');
- });
-});
diff --git a/packages/app/src/lib/worktree-store.ts b/packages/app/src/lib/worktree-store.ts
deleted file mode 100644
index 6e9d792d5..000000000
--- a/packages/app/src/lib/worktree-store.ts
+++ /dev/null
@@ -1,79 +0,0 @@
-import type { WorktreeSelectorModel } from '@inkeep/open-knowledge-core';
-
-export interface WorktreeStore {
- getSnapshot(): WorktreeSelectorModel | null;
- subscribe(listener: () => void): () => void;
- refresh(): void;
-}
-
-interface WorktreeStoreDeps {
- fetchModel: () => Promise<WorktreeSelectorModel | null>;
-}
-
-export function createWorktreeStore(deps: WorktreeStoreDeps): WorktreeStore {
- let model: WorktreeSelectorModel | null = null;
- let bootstrapped = false;
- let inFlight = false;
- let reloadQueued = false;
- const listeners = new Set<() => void>();
-
- function emit(): void {
- for (const listener of listeners) listener();
- }
-
- async function load(): Promise<void> {
- if (inFlight) {
- reloadQueued = true;
- return;
- }
- inFlight = true;
- try {
- const next = await deps.fetchModel();
- if (next !== null && next !== model) {
- model = next;
- emit();
- }
- } catch {
- } finally {
- inFlight = false;
- if (reloadQueued) {
- reloadQueued = false;
- void load();
- }
- }
- }
-
- return {
- getSnapshot: () => model,
- subscribe(listener) {
- listeners.add(listener);
- if (!bootstrapped) {
- bootstrapped = true;
- void load();
- }
- return () => {
- listeners.delete(listener);
- };
- },
- refresh() {
- void load();
- },
- };
-}
-
-async function fetchWorktreeModel(): Promise<WorktreeSelectorModel | null> {
- const bridge = typeof window !== 'undefined' ? window.okDesktop : undefined;
- if (!bridge) return null;
- const result = await bridge.worktree.list();
- return result.ok ? result.model : null;
-}
-
-const productionStore: WorktreeStore =
- typeof window === 'undefined'
- ? // SSR / non-browser: nothing to fetch. Consumers render their empty state.
- { getSnapshot: () => null, subscribe: () => () => {}, refresh: () => {} }
- : createWorktreeStore({ fetchModel: fetchWorktreeModel });
-
-export const subscribeToWorktrees = productionStore.subscribe;
-export const getWorktreesSnapshot = productionStore.getSnapshot;
-export const refreshWorktrees = productionStore.refresh;
diff --git a/packages/app/src/locales/en/messages.json b/packages/app/src/locales/en/messages.json
index 5d71456d3..2741445c0 100644
--- a/packages/app/src/locales/en/messages.json
+++ b/packages/app/src/locales/en/messages.json
@@ -27,7 +27,6 @@
"-wePNM": [
"Search matches file names, paths, and folders. Open a file to search its body (⌘F)."
],
- "-zA2E7": ["Couldn't create the worktree. Try a different name."],
"-zy2Nq": ["Type"],
"0-31GV": ["Removing"],
"02P3hL": ["Upload failed: ", ["message"]],
@@ -106,6 +105,7 @@
"2XQ8Ww": ["Open preview when agent edits"],
"2YOwme": ["Restarted — now running v", ["appRuntime"], "."],
"2YZwPB": ["Forward-links response did not match expected shape."],
+ "2Znqb1": [" (missing)"],
"2bVHbB": ["Available in every project on this computer."],
"2fkdnR": ["Nothing to undo on this file"],
"2hYmUH": ["[email protected]"],
@@ -199,9 +199,6 @@
"4sKwf6": ["File already exists"],
"4uNLmk": ["Pulling"],
"4v2Yyz": ["Select every visible file-tree row when focus is in the Files sidebar."],
- "4vPsaF": [
- "New branch based on the current commit. The worktree lives inside the project, under <0>.ok/worktrees/</0>."
- ],
"4xtLTl": ["Hidden folder “", ["basename"], "”"],
"4zGlN_": ["Paste image URL or click upload"],
"5-FeN2": ["Share URL"],
@@ -267,7 +264,6 @@
"67f-3g": ["Duplicate succeeded but the sidebar may be out of date — refresh to resync"],
"6Aih4U": ["Offline"],
"6EKG_c": ["What agents match on to decide when to use the skill."],
- "6HCOwA": ["Failed to open."],
"6I7cJR": ["Open chat"],
"6LbUG7": ["The repository is private and your GitHub account doesn't have access to it."],
"6MnZEC": ["Terminal failed to load"],
@@ -356,6 +352,7 @@
"8OxKZy": ["Move succeeded but the sidebar may be out of date — refresh to resync"],
"8PmoQF": ["Open the insert menu in an empty or active text position."],
"8RtNI0": ["Failed to load documents"],
+ "8S1E33": ["Search recent projects..."],
"8XQRON": ["Loading repositories"],
"8_brI5": ["Name is required"],
"8cS0nH": ["Config sharing unavailable: ", ["0"], "."],
@@ -478,7 +475,6 @@
"C7XjNB": ["Global Skill"],
"C9TBvF": ["No Outgoing"],
"CCTop_": ["Recent"],
- "CFnavk": ["This project isn't a git repository, so worktrees aren't available."],
"CKyk7Q": ["Go back"],
"COr1Y7": [
"Pick <0>openknowledge.skill</0> from your <1>Downloads</1> folder. It enables automatically."
@@ -505,7 +501,6 @@
"DId6MT": ["Project-level pages with no outgoing graph edges."],
"DPfwMq": ["Done"],
"DVh_Tb": ["Failed to clean up after trash"],
- "DXd9LM": ["New worktree"],
"D_WKe_": ["Click an agent's avatar in the presence bar to view their session."],
"DbILZA": ["No matches. Some files are excluded from search (hidden or ignored files)."],
"DeDYLr": ["Unrecognized wiki link"],
@@ -668,12 +663,13 @@
"H-vDm3": ["Relaunching to install the update…"],
"H0WlWQ": ["Grid of rows and columns with a header row."],
"H86f9p": ["Collapse"],
+ "H8Ng4Z": ["Search recent projects"],
"HCn0Ay": ["Toggle strikethrough formatting."],
"HGNCsl": ["Connection lost — keep this tab open, your edits will sync when reconnected"],
"HIb0vl": ["Network error — please try again"],
"HM56Bx": ["Creating..."],
+ "HNnVG1": ["No other recent projects."],
"HPTPGr": ["Create a new spec file for my user story"],
- "HWAICJ": ["Open ", ["0"]],
"HXFyWD": ["Split diff"],
"HdkSiO": ["New file"],
"HfI1dR": ["I already have it locally →"],
@@ -701,7 +697,6 @@
"IRv9cH": ["Cloned ", ["repoName"], "."],
"IWGfGF": ["Checking your GitHub connection"],
"IX7-sq": ["Something went wrong opening \"", ["docName"], "\"."],
- "IX_uXB": ["my-feature"],
"IajAbS": ["Add a starter pack"],
"If0crP": ["Open with AI ", ["targetDisplayName"], ", ", ["hint"]],
"IgTwLt": ["Open this document in the editor and collapse the graph."],
@@ -828,7 +823,6 @@
}
]
],
- "LwMxXg": ["Failed to open worktree."],
"M1OfV9": ["Next source diagnostic"],
"M3ytY_": [
"This looks like a drive root (e.g., C:\\). Scaffolding here will scan an entire drive."
@@ -844,7 +838,6 @@
"MQIM_Y": ["Couldn't copy. Select the URL above to copy it manually."],
"MTs6g3": ["Couldn't reconnect after server restart"],
"MUBR8r": ["Rename succeeded but the tabstrip may be out of date — refresh to resync"],
- "MUrVEo": ["No recent projects."],
"MV-Dkb": ["Found ", ["countDisplay"], " markdown files"],
"MVxpbf": ["Find and replace"],
"MWrUEd": ["Undo all"],
@@ -878,7 +871,6 @@
"N55YNr": [
"Choose whether this project's OpenKnowledge setup, including its AI-tool connections, is saved with the project so teammates get it too, or kept only on your computer."
],
- "NEzPEh": ["Create a new branch, or check out an existing one, in its own window."],
"NIWAux": ["No docs registered under #", ["tagDocsName"], "."],
"NJyQi_": ["Branch ", ["shareBranch"], " no longer exists on the remote."],
"NKkZXl": ["Initialize and open"],
@@ -891,7 +883,6 @@
"N_7kkF": [
"Read through this codebase and draft a technical spec for the most complex module: an overview, the architecture, key files, and open questions, all linked from a specs index page."
],
- "NaTLh6": ["Search projects and worktrees"],
"NjrIak": ["File: <0>", ["fixedName"], ".md</0>"],
"NkXEFS": ["Restore failed — document unchanged"],
"NmPNJJ": ["Copy code"],
@@ -928,7 +919,6 @@
"OYnx7O": ["Path cannot start with \"/\""],
"OdmsFg": ["Failed to delete item"],
"OeAl1e": ["e.g. assets/uploads"],
- "Ogur1T": ["Search projects and worktrees..."],
"OgyJSr": ["Local only"],
"OiHJdA": [
"Move through slash, wiki-link, tag, and path suggestions; accept or dismiss the active suggestion."
@@ -945,11 +935,6 @@
"Oxyd5f": ["Pick a name"],
"OyIC0Q": ["Project name"],
"P-ye9o": ["Could not open folder picker"],
- "P366P-": [
- "New branch based on <0>",
- ["currentBranch"],
- "</0>. The worktree lives inside the project, under <1>.ok/worktrees/</1>."
- ],
"P3NS4G": ["Pattern syntax error (line ", ["lineNumber"], "): ", ["message"]],
"P3hnm0": ["File too large to open"],
"P47EWZ": ["Could not update sidebar settings"],
@@ -1464,11 +1449,6 @@
"euc6Ns": ["Duplicate"],
"evs0iw": ["Tags matching \"", ["tagListQuery"], "\""],
"f1XQyZ": ["Move block"],
- "f5R032": [
- "Checks out <0>",
- ["trimmed"],
- "</0> into its own window, under <1>.ok/worktrees/</1>."
- ],
"f65AOQ": ["Start from"],
"f8jU-L": [["0"], "/", ["1"], " — ", ["2"]],
"fBHvBn": ["There's no project folder for this window, so a terminal can't start here."],
@@ -1584,7 +1564,6 @@
"iKZkk1": ["Property value"],
"iMkWoF": ["Turn on"],
"iNFKkm": ["No diff."],
- "iO8V-7": ["Create worktree"],
"iOHg1t": ["Open embedded URL in new tab"],
"iSQTsg": ["Ordered list"],
"iSnkwB": ["Failed to open cloned project."],
@@ -1688,7 +1667,6 @@
"lb_UU4": ["Sync now"],
"lbkOif": ["Undo or redo visual-editor changes through TipTap collaboration history."],
"lhjq3G": ["Reset ", ["labelText"], " to default"],
- "ljHjfg": ["That branch is already open in another worktree."],
"lkYioO": ["Show or hide document panel"],
"ll2yNl": ["Content directory"],
"lond3p": ["Shows above the code body. Round-trips as `title=\"...\"` in markdown."],
@@ -1714,7 +1692,6 @@
"mWVJRX": ["Collapsible section with a clickable summary."],
"mY8U64": ["Teach agents a repeatable task. You can edit the body after creating."],
"mYGY3B": ["Date"],
- "mYzDD_": ["A worktree folder for that branch already exists."],
"mZ1r4i": ["Create a document from ", ["label"]],
"maDWIB": ["Mirror source <0>api-spec</0>"],
"makN88": ["No patterns yet. Type a folder or file name below to start hiding files."],
@@ -1771,7 +1748,6 @@
"nft48x": [
"Stored at <0>.ok/templates/</0> in this project. Available in every folder (folder-scoped templates can override by filename)."
],
- "ng2Ibo": ["Branch name"],
"nh3wwx": ["Embeddings provider key"],
"njBeMm": ["Both"],
"njU86j": ["Property \"", ["trimmed"], "\" already exists"],
@@ -1830,6 +1806,7 @@
"p9sdCy": ["New ignore pattern"],
"pAgkuZ": ["Reopening \"", ["docName"], "\" with a fresh local collaboration cache."],
"pBROkv": ["Thanks for subscribing. Watch your inbox for product updates."],
+ "pEQFsW": ["No matching projects."],
"pFagOn": ["Source editing"],
"pHYP6v": ["Open <0>Customize</0> in the sidebar <1/> <2>Skills</2>."],
"pRc-Im": ["Undone all edits on ", ["docName"]],
@@ -1884,7 +1861,6 @@
"qpQwGC": ["Describe what you're working on and the agent sets it up for you."],
"qvWGzP": ["Collapse all"],
"qyLmWw": ["Source editor search panel"],
- "r-OJYm": ["Enter a valid branch name (no spaces, no leading dot, no \"..\")."],
"r2huLx": ["Undo, redo, or undo selection changes through CodeMirror history."],
"r4R7AZ": ["Network error during cleanup"],
"r51jLC": ["File saved & Claude Desktop App opened"],
@@ -1960,7 +1936,6 @@
"On — your search queries and the text of matching pages are sent to your embeddings provider (OpenAI by default) to compute embeddings."
],
"sxTdZI": ["Loading paths…"],
- "sxjyRq": ["Worktrees"],
"sxkWRg": ["Advanced"],
"t-JXbf": ["Notion-style inline row for a downloadable file. Drag-drop also works."],
"t18QYR": ["Unpin ", ["accessibleLabel"]],
@@ -1972,7 +1947,6 @@
"tUvUfp": ["Use a folder you already have."],
"tW_yvQ": ["Expand ", ["docName"]],
"t_YqKh": ["Remove"],
- "teD0H9": ["Couldn't open a worktree for that branch."],
"tfDRzk": ["Save"],
"tfi40B": ["Failed to create page"],
"tgWuMB": ["Modified"],
@@ -1994,7 +1968,6 @@
"uFOL2y": [
"No project skills yet. Author one to teach agents a repeatable task scoped to this knowledge base."
],
- "uGaIIS": ["Check out worktree"],
"uH_S-u": [["loadErrorTitle"], ": ", ["message"]],
"uKRYiW": ["Sync status unavailable — server error."],
"uL_Wx8": ["The terminal stopped unexpectedly."],
@@ -2035,7 +2008,6 @@
],
"v7hK0U": ["Use lowercase letters, digits, and hyphens only."],
"v7lbnC": ["Find next match"],
- "vAYoCZ": ["Couldn't open the worktree. Try again."],
"vDXqVv": ["Insert a markdown hard break."],
"vEJDlt": ["The file is in your Trash; the file-watcher will reconcile."],
"vGeNNQ": ["Copy a prompt and paste it into your agent to set up your project."],
@@ -2082,9 +2054,6 @@
"wndeIl": ["Project-level pages with neither incoming nor outgoing graph edges."],
"wtcxiD": ["Share this setup with your team?"],
"wvbc1r": ["Couldn't open document"],
- "wzq9Rv": [
- "A branch with that name already exists. Open its worktree from the switcher instead."
- ],
"x-5mJ1": ["Install on all"],
"x2fr_j": ["Graph"],
"x3-2ta": [
diff --git a/packages/app/src/locales/en/messages.po b/packages/app/src/locales/en/messages.po
index b57a53bf3..6df8e56d0 100644
--- a/packages/app/src/locales/en/messages.po
+++ b/packages/app/src/locales/en/messages.po
@@ -13,6 +13,10 @@ msgstr ""
"Language-Team: \n"
"Plural-Forms: \n"
+#: src/components/ProjectSwitcher.tsx
+msgid " (missing)"
+msgstr " (missing)"
+
#: src/components/settings/SettingsDialogBody.tsx
msgid " or "
msgstr " or "
@@ -435,10 +439,6 @@ msgstr "<0>Mirror source removed.</0> The doc <1>{src}</1> is no longer availabl
msgid "📝 or assets/icon.png"
msgstr "📝 or assets/icon.png"
-#: src/components/NewWorktreeDialog.tsx
-msgid "A branch with that name already exists. Open its worktree from the switcher instead."
-msgstr "A branch with that name already exists. Open its worktree from the switcher instead."
-
#: src/components/CreateProjectDialog.tsx
msgid "A folder named <0>{sanitized}</0> already has files here. Pick a different name."
msgstr "A folder named <0>{sanitized}</0> already has files here. Pick a different name."
@@ -504,10 +504,6 @@ msgstr "A template named <0>{trimmedSlug}</0> already exists here. Saving create
msgid "A title, description, tags — anything that describes this folder."
msgstr "A title, description, tags — anything that describes this folder."
-#: src/components/NewWorktreeDialog.tsx
-msgid "A worktree folder for that branch already exists."
-msgstr "A worktree folder for that branch already exists."
-
#: src/editor/slash-command/items.tsx
msgid "Above"
msgstr "Above"
@@ -903,10 +899,6 @@ msgstr "Branch {shareBranch} no longer exists on the remote."
msgid "Branch <0>{shareBranch}</0> is checked out in:"
msgstr "Branch <0>{shareBranch}</0> is checked out in:"
-#: src/components/NewWorktreeDialog.tsx
-msgid "Branch name"
-msgstr "Branch name"
-
#: src/components/ShareBranchSwitchDialog.tsx
msgid "Branch switch failed — try opening the {targetNoun} manually."
msgstr "Branch switch failed — try opening the {targetNoun} manually."
@@ -985,7 +977,6 @@ msgstr "Can't nest projects. An OpenKnowledge project already exists at <0>{root
#: src/components/NewItemDialog.tsx
#: src/components/NewSkillDialog.tsx
#: src/components/NewTemplateDialog.tsx
-#: src/components/NewWorktreeDialog.tsx
#: src/components/PublishToGitHubDialog.tsx
#: src/components/SeedDialog.tsx
#: src/components/settings/SearchSection.tsx
@@ -1009,10 +1000,6 @@ msgstr "Cancelled"
msgid "Cannot upload: no document is open"
msgstr "Cannot upload: no document is open"
-#: src/components/NewWorktreeDialog.tsx
-msgid "Check out worktree"
-msgstr "Check out worktree"
-
#: src/components/PropertyWidgets.tsx
msgid "Checkbox"
msgstr "Checkbox"
@@ -1048,10 +1035,6 @@ msgstr "Checking..."
msgid "Checklist with checkboxes."
msgstr "Checklist with checkboxes."
-#: src/components/NewWorktreeDialog.tsx
-msgid "Checks out <0>{trimmed}</0> into its own window, under <1>.ok/worktrees/</1>."
-msgstr "Checks out <0>{trimmed}</0> into its own window, under <1>.ok/worktrees/</1>."
-
#: src/components/BottomComposer.tsx
#: src/components/empty-state/CreatePromptComposer.tsx
msgid "Choose agent"
@@ -1695,10 +1678,6 @@ msgstr "Couldn't create skill: {0}"
msgid "Couldn't create template: {error}"
msgstr "Couldn't create template: {error}"
-#: src/components/NewWorktreeDialog.tsx
-msgid "Couldn't create the worktree. Try a different name."
-msgstr "Couldn't create the worktree. Try a different name."
-
#: src/components/SkillDeleteDialog.tsx
msgid "Couldn't delete skill: {error}"
msgstr "Couldn't delete skill: {error}"
@@ -1763,10 +1742,6 @@ msgstr "Couldn't move skill: {0}"
msgid "Couldn't move to Trash"
msgstr "Couldn't move to Trash"
-#: src/components/RecentProjectsMenu.tsx
-msgid "Couldn't open a worktree for that branch."
-msgstr "Couldn't open a worktree for that branch."
-
#: src/components/DocumentErrorBoundary.tsx
msgid "Couldn't open document"
msgstr "Couldn't open document"
@@ -1775,10 +1750,6 @@ msgstr "Couldn't open document"
msgid "Couldn't open the terminal — please try again."
msgstr "Couldn't open the terminal — please try again."
-#: src/components/NewWorktreeDialog.tsx
-msgid "Couldn't open the worktree. Try again."
-msgstr "Couldn't open the worktree. Try again."
-
#: src/components/ConnectingBanner.tsx
msgid "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>."
@@ -1885,10 +1856,6 @@ msgstr "Create a file from the current document or folder context."
msgid "Create a folder from the current document or folder context."
msgstr "Create a folder from the current document or folder context."
-#: src/components/NewWorktreeDialog.tsx
-msgid "Create a new branch, or check out an existing one, in its own window."
-msgstr "Create a new branch, or check out an existing one, in its own window."
-
#: src/lib/keyboard-shortcuts.ts
msgid "Create a new list item from the current list item."
msgstr "Create a new list item from the current list item."
@@ -1942,11 +1909,6 @@ msgstr "Create with {0}"
msgid "Create with {0} CLI"
msgstr "Create with {0} CLI"
-#: src/components/CommandPalette.tsx
-#: src/components/NewWorktreeDialog.tsx
-msgid "Create worktree"
-msgstr "Create worktree"
-
#: src/components/FileTree.tsx
#: src/components/OnboardingCard.tsx
msgid "Create your first file"
@@ -2498,10 +2460,6 @@ msgstr "Enter a repository URL or owner/repo"
msgid "Enter a title for this template."
msgstr "Enter a title for this template."
-#: src/components/NewWorktreeDialog.tsx
-msgid "Enter a valid branch name (no spaces, no leading dot, no \"..\")."
-msgstr "Enter a valid branch name (no spaces, no leading dot, no \"..\")."
-
#: src/components/ShareReceiveDialog.tsx
msgid "Error:"
msgstr "Error:"
@@ -2717,18 +2675,10 @@ msgstr "Failed to open Project Navigator."
#: src/components/CommandPalette.tsx
#: src/components/NavigatorApp.tsx
+#: src/components/ProjectSwitcher.tsx
msgid "Failed to open project."
msgstr "Failed to open project."
-#: src/components/CommandPalette.tsx
-#: src/components/RecentProjectsMenu.tsx
-msgid "Failed to open worktree."
-msgstr "Failed to open worktree."
-
-#: src/components/RecentProjectsMenu.tsx
-msgid "Failed to open."
-msgstr "Failed to open."
-
#: src/components/LinksPanel.tsx
msgid "Failed to parse backlinks error response (HTTP {status})"
msgstr "Failed to parse backlinks error response (HTTP {status})"
@@ -3866,10 +3816,6 @@ msgstr "moved template"
msgid "Multi-page PDF viewer with toolbar controls (thumbnails, page nav, zoom)."
msgstr "Multi-page PDF viewer with toolbar controls (thumbnails, page nav, zoom)."
-#: src/components/NewWorktreeDialog.tsx
-msgid "my-feature"
-msgstr "my-feature"
-
#: src/components/SubscribeForm.tsx
@@ -3952,14 +3898,6 @@ msgstr "never"
msgid "New"
msgstr "New"
-#: src/components/NewWorktreeDialog.tsx
-msgid "New branch based on <0>{currentBranch}</0>. The worktree lives inside the project, under <1>.ok/worktrees/</1>."
-msgstr "New branch based on <0>{currentBranch}</0>. The worktree lives inside the project, under <1>.ok/worktrees/</1>."
-
-#: src/components/NewWorktreeDialog.tsx
-msgid "New branch based on the current commit. The worktree lives inside the project, under <0>.ok/worktrees/</0>."
-msgstr "New branch based on the current commit. The worktree lives inside the project, under <0>.ok/worktrees/</0>."
-
#: src/components/TerminalTabStrip.tsx
msgid "New chat"
msgstr "New chat"
@@ -4026,11 +3964,6 @@ msgstr "New template"
msgid "New terminal tab"
msgstr "New terminal tab"
-#: src/components/NewWorktreeDialog.tsx
-#: src/components/ProjectSwitcher.tsx
-msgid "New worktree"
-msgstr "New worktree"
-
#: src/editor/find-replace/FindReplaceBar.tsx
msgid "Next match"
msgstr "Next match"
@@ -4158,10 +4091,18 @@ msgstr "No matching docs"
msgid "No matching paths"
msgstr "No matching paths"
+#: src/components/ProjectSwitcher.tsx
+msgid "No matching projects."
+msgstr "No matching projects."
+
#: src/components/CloneDialog.tsx
msgid "No matching repositories."
msgstr "No matching repositories."
+#: src/components/ProjectSwitcher.tsx
+msgid "No other recent projects."
+msgstr "No other recent projects."
+
#: src/components/GraphPanel.tsx
msgid "No Outgoing"
msgstr "No Outgoing"
@@ -4202,10 +4143,6 @@ msgstr "No project skills yet. Author one to teach agents a repeatable task scop
msgid "No project templates yet. Create one to make it available everywhere in this project. Folder-scoped templates live on each folder's overview page."
msgstr "No project templates yet. Create one to make it available everywhere in this project. Folder-scoped templates live on each folder's overview page."
-#: src/components/ProjectSwitcher.tsx
-msgid "No recent projects."
-msgstr "No recent projects."
-
#: src/components/CloneDialog.tsx
msgid "No repositories found on your GitHub account."
msgstr "No repositories found on your GitHub account."
@@ -4364,11 +4301,6 @@ msgstr "Only the current document uses <0>#{tag}</0>."
msgid "Open"
msgstr "Open"
-#. placeholder {0}: group.project.name
-#: src/components/RecentProjectsMenu.tsx
-msgid "Open {0}"
-msgstr "Open {0}"
-
#. placeholder {0}: status.remote.label
#: src/components/settings/SettingsDialogBody.tsx
#: src/components/SyncStatusBadge.tsx
@@ -5522,12 +5454,12 @@ msgid "Search matches file names, paths, and folders. Open a file to search its
msgstr "Search matches file names, paths, and folders. Open a file to search its body (⌘F)."
#: src/components/ProjectSwitcher.tsx
-msgid "Search projects and worktrees"
-msgstr "Search projects and worktrees"
+msgid "Search recent projects"
+msgstr "Search recent projects"
#: src/components/ProjectSwitcher.tsx
-msgid "Search projects and worktrees..."
-msgstr "Search projects and worktrees..."
+msgid "Search recent projects..."
+msgstr "Search recent projects..."
#: src/components/settings/SearchSection.tsx
msgid "Search settings not yet loaded — try again in a moment"
@@ -6305,10 +6237,6 @@ msgstr "Text"
msgid "Thanks for subscribing. Watch your inbox for product updates."
msgstr "Thanks for subscribing. Watch your inbox for product updates."
-#: src/components/NewWorktreeDialog.tsx
-msgid "That branch is already open in another worktree."
-msgstr "That branch is already open in another worktree."
-
#: src/components/ShareReceiveDialog.tsx
msgid "That folder isn't an OpenKnowledge project yet. Initialize it and open?"
msgstr "That folder isn't an OpenKnowledge project yet. Initialize it and open?"
@@ -6505,10 +6433,6 @@ msgstr "This project is running a different, incompatible build of OpenKnowledge
msgid "This project is running an older version of OpenKnowledge (v{0}) than this app (v{1})."
msgstr "This project is running an older version of OpenKnowledge (v{0}) than this app (v{1})."
-#: src/components/NewWorktreeDialog.tsx
-msgid "This project isn't a git repository, so worktrees aren't available."
-msgstr "This project isn't a git repository, so worktrees aren't available."
-
#: src/components/settings/SettingsDialogBody.tsx
msgid "This project lives only on this computer. Connect it to GitHub to back it up and share it with other people."
msgstr "This project lives only on this computer. Connect it to GitHub to back it up and share it with other people."
@@ -7089,7 +7013,6 @@ msgid "Word wrap"
msgstr "Word wrap"
#: src/components/McpConsentDialogBody.tsx
-#: src/components/NewWorktreeDialog.tsx
#: src/components/SkillEditorActions.tsx
msgid "Working"
msgstr "Working"
@@ -7102,10 +7025,6 @@ msgstr "Workspace"
msgid "Workspace Command Palette"
msgstr "Workspace Command Palette"
-#: src/components/CommandPalette.tsx
-msgid "Worktrees"
-msgstr "Worktrees"
-
#: src/components/settings/SettingsDialogBody.tsx
msgid "Wrap long lines in the markdown source editor."
msgstr "Wrap long lines in the markdown source editor."
diff --git a/packages/app/src/locales/pseudo/messages.json b/packages/app/src/locales/pseudo/messages.json
index b39f87b95..8b46c2359 100644
--- a/packages/app/src/locales/pseudo/messages.json
+++ b/packages/app/src/locales/pseudo/messages.json
@@ -27,7 +27,6 @@
"-wePNM": [
"Śēàŕćĥ ḿàţćĥēś ƒĩĺē ńàḿēś, ƥàţĥś, àńď ƒōĺďēŕś. Ōƥēń à ƒĩĺē ţō śēàŕćĥ ĩţś ƀōďŷ (⌘Ƒ)."
],
- "-zA2E7": ["Ćōũĺďń'ţ ćŕēàţē ţĥē ŵōŕķţŕēē. Ţŕŷ à ďĩƒƒēŕēńţ ńàḿē."],
"-zy2Nq": ["Ţŷƥē"],
"0-31GV": ["Ŕēḿōvĩńĝ"],
"02P3hL": ["Ũƥĺōàď ƒàĩĺēď: ", ["message"]],
@@ -106,6 +105,7 @@
"2XQ8Ww": ["Ōƥēń ƥŕēvĩēŵ ŵĥēń àĝēńţ ēďĩţś"],
"2YOwme": ["Ŕēśţàŕţēď — ńōŵ ŕũńńĩńĝ v", ["appRuntime"], "."],
"2YZwPB": ["Ƒōŕŵàŕď-ĺĩńķś ŕēśƥōńśē ďĩď ńōţ ḿàţćĥ ēxƥēćţēď śĥàƥē."],
+ "2Znqb1": [" (ḿĩśśĩńĝ)"],
"2bVHbB": ["Àvàĩĺàƀĺē ĩń ēvēŕŷ ƥŕōĴēćţ ōń ţĥĩś ćōḿƥũţēŕ."],
"2fkdnR": ["Ńōţĥĩńĝ ţō ũńďō ōń ţĥĩś ƒĩĺē"],
"2hYmUH": ["ḿŷ@ēḿàĩĺ.ćōḿ"],
@@ -199,9 +199,6 @@
"4sKwf6": ["Ƒĩĺē àĺŕēàďŷ ēxĩśţś"],
"4uNLmk": ["Ƥũĺĺĩńĝ"],
"4v2Yyz": ["Śēĺēćţ ēvēŕŷ vĩśĩƀĺē ƒĩĺē-ţŕēē ŕōŵ ŵĥēń ƒōćũś ĩś ĩń ţĥē Ƒĩĺēś śĩďēƀàŕ."],
- "4vPsaF": [
- "Ńēŵ ƀŕàńćĥ ƀàśēď ōń ţĥē ćũŕŕēńţ ćōḿḿĩţ. Ţĥē ŵōŕķţŕēē ĺĩvēś ĩńśĩďē ţĥē ƥŕōĴēćţ, ũńďēŕ <0>.ōķ/ŵōŕķţŕēēś/</0>."
- ],
"4xtLTl": ["Ĥĩďďēń ƒōĺďēŕ “", ["basename"], "”"],
"4zGlN_": ["Ƥàśţē ĩḿàĝē ŨŔĹ ōŕ ćĺĩćķ ũƥĺōàď"],
"5-FeN2": ["Śĥàŕē ŨŔĹ"],
@@ -267,7 +264,6 @@
"67f-3g": ["Ďũƥĺĩćàţē śũććēēďēď ƀũţ ţĥē śĩďēƀàŕ ḿàŷ ƀē ōũţ ōƒ ďàţē — ŕēƒŕēśĥ ţō ŕēśŷńć"],
"6Aih4U": ["Ōƒƒĺĩńē"],
"6EKG_c": ["Ŵĥàţ àĝēńţś ḿàţćĥ ōń ţō ďēćĩďē ŵĥēń ţō ũśē ţĥē śķĩĺĺ."],
- "6HCOwA": ["Ƒàĩĺēď ţō ōƥēń."],
"6I7cJR": ["Ōƥēń ćĥàţ"],
"6LbUG7": ["Ţĥē ŕēƥōśĩţōŕŷ ĩś ƥŕĩvàţē àńď ŷōũŕ ĜĩţĤũƀ àććōũńţ ďōēśń'ţ ĥàvē àććēśś ţō ĩţ."],
"6MnZEC": ["Ţēŕḿĩńàĺ ƒàĩĺēď ţō ĺōàď"],
@@ -356,6 +352,7 @@
"8OxKZy": ["Ḿōvē śũććēēďēď ƀũţ ţĥē śĩďēƀàŕ ḿàŷ ƀē ōũţ ōƒ ďàţē — ŕēƒŕēśĥ ţō ŕēśŷńć"],
"8PmoQF": ["Ōƥēń ţĥē ĩńśēŕţ ḿēńũ ĩń àń ēḿƥţŷ ōŕ àćţĩvē ţēxţ ƥōśĩţĩōń."],
"8RtNI0": ["Ƒàĩĺēď ţō ĺōàď ďōćũḿēńţś"],
+ "8S1E33": ["Śēàŕćĥ ŕēćēńţ ƥŕōĴēćţś..."],
"8XQRON": ["Ĺōàďĩńĝ ŕēƥōśĩţōŕĩēś"],
"8_brI5": ["Ńàḿē ĩś ŕēǫũĩŕēď"],
"8cS0nH": ["Ćōńƒĩĝ śĥàŕĩńĝ ũńàvàĩĺàƀĺē: ", ["0"], "."],
@@ -478,7 +475,6 @@
"C7XjNB": ["Ĝĺōƀàĺ Śķĩĺĺ"],
"C9TBvF": ["Ńō Ōũţĝōĩńĝ"],
"CCTop_": ["Ŕēćēńţ"],
- "CFnavk": ["Ţĥĩś ƥŕōĴēćţ ĩśń'ţ à ĝĩţ ŕēƥōśĩţōŕŷ, śō ŵōŕķţŕēēś àŕēń'ţ àvàĩĺàƀĺē."],
"CKyk7Q": ["Ĝō ƀàćķ"],
"COr1Y7": [
"Ƥĩćķ <0>ōƥēńķńōŵĺēďĝē.śķĩĺĺ</0> ƒŕōḿ ŷōũŕ <1>Ďōŵńĺōàďś</1> ƒōĺďēŕ. Ĩţ ēńàƀĺēś àũţōḿàţĩćàĺĺŷ."
@@ -505,7 +501,6 @@
"DId6MT": ["ƤŕōĴēćţ-ĺēvēĺ ƥàĝēś ŵĩţĥ ńō ōũţĝōĩńĝ ĝŕàƥĥ ēďĝēś."],
"DPfwMq": ["Ďōńē"],
"DVh_Tb": ["Ƒàĩĺēď ţō ćĺēàń ũƥ àƒţēŕ ţŕàśĥ"],
- "DXd9LM": ["Ńēŵ ŵōŕķţŕēē"],
"D_WKe_": ["Ćĺĩćķ àń àĝēńţ'ś àvàţàŕ ĩń ţĥē ƥŕēśēńćē ƀàŕ ţō vĩēŵ ţĥēĩŕ śēśśĩōń."],
"DbILZA": ["Ńō ḿàţćĥēś. Śōḿē ƒĩĺēś àŕē ēxćĺũďēď ƒŕōḿ śēàŕćĥ (ĥĩďďēń ōŕ ĩĝńōŕēď ƒĩĺēś)."],
"DeDYLr": ["Ũńŕēćōĝńĩźēď ŵĩķĩ ĺĩńķ"],
@@ -668,12 +663,13 @@
"H-vDm3": ["Ŕēĺàũńćĥĩńĝ ţō ĩńśţàĺĺ ţĥē ũƥďàţē…"],
"H0WlWQ": ["Ĝŕĩď ōƒ ŕōŵś àńď ćōĺũḿńś ŵĩţĥ à ĥēàďēŕ ŕōŵ."],
"H86f9p": ["Ćōĺĺàƥśē"],
+ "H8Ng4Z": ["Śēàŕćĥ ŕēćēńţ ƥŕōĴēćţś"],
"HCn0Ay": ["Ţōĝĝĺē śţŕĩķēţĥŕōũĝĥ ƒōŕḿàţţĩńĝ."],
"HGNCsl": ["Ćōńńēćţĩōń ĺōśţ — ķēēƥ ţĥĩś ţàƀ ōƥēń, ŷōũŕ ēďĩţś ŵĩĺĺ śŷńć ŵĥēń ŕēćōńńēćţēď"],
"HIb0vl": ["Ńēţŵōŕķ ēŕŕōŕ — ƥĺēàśē ţŕŷ àĝàĩń"],
"HM56Bx": ["Ćŕēàţĩńĝ..."],
+ "HNnVG1": ["Ńō ōţĥēŕ ŕēćēńţ ƥŕōĴēćţś."],
"HPTPGr": ["Ćŕēàţē à ńēŵ śƥēć ƒĩĺē ƒōŕ ḿŷ ũśēŕ śţōŕŷ"],
- "HWAICJ": ["Ōƥēń ", ["0"]],
"HXFyWD": ["Śƥĺĩţ ďĩƒƒ"],
"HdkSiO": ["Ńēŵ ƒĩĺē"],
"HfI1dR": ["Ĩ àĺŕēàďŷ ĥàvē ĩţ ĺōćàĺĺŷ →"],
@@ -701,7 +697,6 @@
"IRv9cH": ["Ćĺōńēď ", ["repoName"], "."],
"IWGfGF": ["Ćĥēćķĩńĝ ŷōũŕ ĜĩţĤũƀ ćōńńēćţĩōń"],
"IX7-sq": ["Śōḿēţĥĩńĝ ŵēńţ ŵŕōńĝ ōƥēńĩńĝ \"", ["docName"], "\"."],
- "IX_uXB": ["ḿŷ-ƒēàţũŕē"],
"IajAbS": ["Àďď à śţàŕţēŕ ƥàćķ"],
"If0crP": ["Ōƥēń ŵĩţĥ ÀĨ ", ["targetDisplayName"], ", ", ["hint"]],
"IgTwLt": ["Ōƥēń ţĥĩś ďōćũḿēńţ ĩń ţĥē ēďĩţōŕ àńď ćōĺĺàƥśē ţĥē ĝŕàƥĥ."],
@@ -828,7 +823,6 @@
}
]
],
- "LwMxXg": ["Ƒàĩĺēď ţō ōƥēń ŵōŕķţŕēē."],
"M1OfV9": ["Ńēxţ śōũŕćē ďĩàĝńōśţĩć"],
"M3ytY_": [
"Ţĥĩś ĺōōķś ĺĩķē à ďŕĩvē ŕōōţ (ē.ĝ., Ć:\\). Śćàƒƒōĺďĩńĝ ĥēŕē ŵĩĺĺ śćàń àń ēńţĩŕē ďŕĩvē."
@@ -844,7 +838,6 @@
"MQIM_Y": ["Ćōũĺďń'ţ ćōƥŷ. Śēĺēćţ ţĥē ŨŔĹ àƀōvē ţō ćōƥŷ ĩţ ḿàńũàĺĺŷ."],
"MTs6g3": ["Ćōũĺďń'ţ ŕēćōńńēćţ àƒţēŕ śēŕvēŕ ŕēśţàŕţ"],
"MUBR8r": ["Ŕēńàḿē śũććēēďēď ƀũţ ţĥē ţàƀśţŕĩƥ ḿàŷ ƀē ōũţ ōƒ ďàţē — ŕēƒŕēśĥ ţō ŕēśŷńć"],
- "MUrVEo": ["Ńō ŕēćēńţ ƥŕōĴēćţś."],
"MV-Dkb": ["Ƒōũńď ", ["countDisplay"], " ḿàŕķďōŵń ƒĩĺēś"],
"MVxpbf": ["Ƒĩńď àńď ŕēƥĺàćē"],
"MWrUEd": ["Ũńďō àĺĺ"],
@@ -878,7 +871,6 @@
"N55YNr": [
"Ćĥōōśē ŵĥēţĥēŕ ţĥĩś ƥŕōĴēćţ'ś ŌƥēńĶńōŵĺēďĝē śēţũƥ, ĩńćĺũďĩńĝ ĩţś ÀĨ-ţōōĺ ćōńńēćţĩōńś, ĩś śàvēď ŵĩţĥ ţĥē ƥŕōĴēćţ śō ţēàḿḿàţēś ĝēţ ĩţ ţōō, ōŕ ķēƥţ ōńĺŷ ōń ŷōũŕ ćōḿƥũţēŕ."
],
- "NEzPEh": ["Ćŕēàţē à ńēŵ ƀŕàńćĥ, ōŕ ćĥēćķ ōũţ àń ēxĩśţĩńĝ ōńē, ĩń ĩţś ōŵń ŵĩńďōŵ."],
"NIWAux": ["Ńō ďōćś ŕēĝĩśţēŕēď ũńďēŕ #", ["tagDocsName"], "."],
"NJyQi_": ["ßŕàńćĥ ", ["shareBranch"], " ńō ĺōńĝēŕ ēxĩśţś ōń ţĥē ŕēḿōţē."],
"NKkZXl": ["Ĩńĩţĩàĺĩźē àńď ōƥēń"],
@@ -891,7 +883,6 @@
"N_7kkF": [
"Ŕēàď ţĥŕōũĝĥ ţĥĩś ćōďēƀàśē àńď ďŕàƒţ à ţēćĥńĩćàĺ śƥēć ƒōŕ ţĥē ḿōśţ ćōḿƥĺēx ḿōďũĺē: àń ōvēŕvĩēŵ, ţĥē àŕćĥĩţēćţũŕē, ķēŷ ƒĩĺēś, àńď ōƥēń ǫũēśţĩōńś, àĺĺ ĺĩńķēď ƒŕōḿ à śƥēćś ĩńďēx ƥàĝē."
],
- "NaTLh6": ["Śēàŕćĥ ƥŕōĴēćţś àńď ŵōŕķţŕēēś"],
"NjrIak": ["Ƒĩĺē: <0>", ["fixedName"], ".ḿď</0>"],
"NkXEFS": ["Ŕēśţōŕē ƒàĩĺēď — ďōćũḿēńţ ũńćĥàńĝēď"],
"NmPNJJ": ["Ćōƥŷ ćōďē"],
@@ -928,7 +919,6 @@
"OYnx7O": ["Ƥàţĥ ćàńńōţ śţàŕţ ŵĩţĥ \"/\""],
"OdmsFg": ["Ƒàĩĺēď ţō ďēĺēţē ĩţēḿ"],
"OeAl1e": ["ē.ĝ. àśśēţś/ũƥĺōàďś"],
- "Ogur1T": ["Śēàŕćĥ ƥŕōĴēćţś àńď ŵōŕķţŕēēś..."],
"OgyJSr": ["Ĺōćàĺ ōńĺŷ"],
"OiHJdA": [
"Ḿōvē ţĥŕōũĝĥ śĺàśĥ, ŵĩķĩ-ĺĩńķ, ţàĝ, àńď ƥàţĥ śũĝĝēśţĩōńś; àććēƥţ ōŕ ďĩśḿĩśś ţĥē àćţĩvē śũĝĝēśţĩōń."
@@ -945,11 +935,6 @@
"Oxyd5f": ["Ƥĩćķ à ńàḿē"],
"OyIC0Q": ["ƤŕōĴēćţ ńàḿē"],
"P-ye9o": ["Ćōũĺď ńōţ ōƥēń ƒōĺďēŕ ƥĩćķēŕ"],
- "P366P-": [
- "Ńēŵ ƀŕàńćĥ ƀàśēď ōń <0>",
- ["currentBranch"],
- "</0>. Ţĥē ŵōŕķţŕēē ĺĩvēś ĩńśĩďē ţĥē ƥŕōĴēćţ, ũńďēŕ <1>.ōķ/ŵōŕķţŕēēś/</1>."
- ],
"P3NS4G": ["Ƥàţţēŕń śŷńţàx ēŕŕōŕ (ĺĩńē ", ["lineNumber"], "): ", ["message"]],
"P3hnm0": ["Ƒĩĺē ţōō ĺàŕĝē ţō ōƥēń"],
"P47EWZ": ["Ćōũĺď ńōţ ũƥďàţē śĩďēƀàŕ śēţţĩńĝś"],
@@ -1464,11 +1449,6 @@
"euc6Ns": ["Ďũƥĺĩćàţē"],
"evs0iw": ["Ţàĝś ḿàţćĥĩńĝ \"", ["tagListQuery"], "\""],
"f1XQyZ": ["Ḿōvē ƀĺōćķ"],
- "f5R032": [
- "Ćĥēćķś ōũţ <0>",
- ["trimmed"],
- "</0> ĩńţō ĩţś ōŵń ŵĩńďōŵ, ũńďēŕ <1>.ōķ/ŵōŕķţŕēēś/</1>."
- ],
"f65AOQ": ["Śţàŕţ ƒŕōḿ"],
"f8jU-L": [["0"], "/", ["1"], " — ", ["2"]],
"fBHvBn": ["Ţĥēŕē'ś ńō ƥŕōĴēćţ ƒōĺďēŕ ƒōŕ ţĥĩś ŵĩńďōŵ, śō à ţēŕḿĩńàĺ ćàń'ţ śţàŕţ ĥēŕē."],
@@ -1584,7 +1564,6 @@
"iKZkk1": ["Ƥŕōƥēŕţŷ vàĺũē"],
"iMkWoF": ["Ţũŕń ōń"],
"iNFKkm": ["Ńō ďĩƒƒ."],
- "iO8V-7": ["Ćŕēàţē ŵōŕķţŕēē"],
"iOHg1t": ["Ōƥēń ēḿƀēďďēď ŨŔĹ ĩń ńēŵ ţàƀ"],
"iSQTsg": ["Ōŕďēŕēď ĺĩśţ"],
"iSnkwB": ["Ƒàĩĺēď ţō ōƥēń ćĺōńēď ƥŕōĴēćţ."],
@@ -1688,7 +1667,6 @@
"lb_UU4": ["Śŷńć ńōŵ"],
"lbkOif": ["Ũńďō ōŕ ŕēďō vĩśũàĺ-ēďĩţōŕ ćĥàńĝēś ţĥŕōũĝĥ ŢĩƥŢàƥ ćōĺĺàƀōŕàţĩōń ĥĩśţōŕŷ."],
"lhjq3G": ["Ŕēśēţ ", ["labelText"], " ţō ďēƒàũĺţ"],
- "ljHjfg": ["Ţĥàţ ƀŕàńćĥ ĩś àĺŕēàďŷ ōƥēń ĩń àńōţĥēŕ ŵōŕķţŕēē."],
"lkYioO": ["Śĥōŵ ōŕ ĥĩďē ďōćũḿēńţ ƥàńēĺ"],
"ll2yNl": ["Ćōńţēńţ ďĩŕēćţōŕŷ"],
"lond3p": ["Śĥōŵś àƀōvē ţĥē ćōďē ƀōďŷ. Ŕōũńď-ţŕĩƥś àś `ţĩţĺē=\"...\"` ĩń ḿàŕķďōŵń."],
@@ -1714,7 +1692,6 @@
"mWVJRX": ["Ćōĺĺàƥśĩƀĺē śēćţĩōń ŵĩţĥ à ćĺĩćķàƀĺē śũḿḿàŕŷ."],
"mY8U64": ["Ţēàćĥ àĝēńţś à ŕēƥēàţàƀĺē ţàśķ. Ŷōũ ćàń ēďĩţ ţĥē ƀōďŷ àƒţēŕ ćŕēàţĩńĝ."],
"mYGY3B": ["Ďàţē"],
- "mYzDD_": ["À ŵōŕķţŕēē ƒōĺďēŕ ƒōŕ ţĥàţ ƀŕàńćĥ àĺŕēàďŷ ēxĩśţś."],
"mZ1r4i": ["Ćŕēàţē à ďōćũḿēńţ ƒŕōḿ ", ["label"]],
"maDWIB": ["Ḿĩŕŕōŕ śōũŕćē <0>àƥĩ-śƥēć</0>"],
"makN88": ["Ńō ƥàţţēŕńś ŷēţ. Ţŷƥē à ƒōĺďēŕ ōŕ ƒĩĺē ńàḿē ƀēĺōŵ ţō śţàŕţ ĥĩďĩńĝ ƒĩĺēś."],
@@ -1771,7 +1748,6 @@
"nft48x": [
"Śţōŕēď àţ <0>.ōķ/ţēḿƥĺàţēś/</0> ĩń ţĥĩś ƥŕōĴēćţ. Àvàĩĺàƀĺē ĩń ēvēŕŷ ƒōĺďēŕ (ƒōĺďēŕ-śćōƥēď ţēḿƥĺàţēś ćàń ōvēŕŕĩďē ƀŷ ƒĩĺēńàḿē)."
],
- "ng2Ibo": ["ßŕàńćĥ ńàḿē"],
"nh3wwx": ["Ēḿƀēďďĩńĝś ƥŕōvĩďēŕ ķēŷ"],
"njBeMm": ["ßōţĥ"],
"njU86j": ["Ƥŕōƥēŕţŷ \"", ["trimmed"], "\" àĺŕēàďŷ ēxĩśţś"],
@@ -1830,6 +1806,7 @@
"p9sdCy": ["Ńēŵ ĩĝńōŕē ƥàţţēŕń"],
"pAgkuZ": ["Ŕēōƥēńĩńĝ \"", ["docName"], "\" ŵĩţĥ à ƒŕēśĥ ĺōćàĺ ćōĺĺàƀōŕàţĩōń ćàćĥē."],
"pBROkv": ["Ţĥàńķś ƒōŕ śũƀśćŕĩƀĩńĝ. Ŵàţćĥ ŷōũŕ ĩńƀōx ƒōŕ ƥŕōďũćţ ũƥďàţēś."],
+ "pEQFsW": ["Ńō ḿàţćĥĩńĝ ƥŕōĴēćţś."],
"pFagOn": ["Śōũŕćē ēďĩţĩńĝ"],
"pHYP6v": ["Ōƥēń <0>Ćũśţōḿĩźē</0> ĩń ţĥē śĩďēƀàŕ <1/> <2>Śķĩĺĺś</2>."],
"pRc-Im": ["Ũńďōńē àĺĺ ēďĩţś ōń ", ["docName"]],
@@ -1884,7 +1861,6 @@
"qpQwGC": ["Ďēśćŕĩƀē ŵĥàţ ŷōũ'ŕē ŵōŕķĩńĝ ōń àńď ţĥē àĝēńţ śēţś ĩţ ũƥ ƒōŕ ŷōũ."],
"qvWGzP": ["Ćōĺĺàƥśē àĺĺ"],
"qyLmWw": ["Śōũŕćē ēďĩţōŕ śēàŕćĥ ƥàńēĺ"],
- "r-OJYm": ["Ēńţēŕ à vàĺĩď ƀŕàńćĥ ńàḿē (ńō śƥàćēś, ńō ĺēàďĩńĝ ďōţ, ńō \"..\")."],
"r2huLx": ["Ũńďō, ŕēďō, ōŕ ũńďō śēĺēćţĩōń ćĥàńĝēś ţĥŕōũĝĥ ĆōďēḾĩŕŕōŕ ĥĩśţōŕŷ."],
"r4R7AZ": ["Ńēţŵōŕķ ēŕŕōŕ ďũŕĩńĝ ćĺēàńũƥ"],
"r51jLC": ["Ƒĩĺē śàvēď & Ćĺàũďē Ďēśķţōƥ Àƥƥ ōƥēńēď"],
@@ -1960,7 +1936,6 @@
"Ōń — ŷōũŕ śēàŕćĥ ǫũēŕĩēś àńď ţĥē ţēxţ ōƒ ḿàţćĥĩńĝ ƥàĝēś àŕē śēńţ ţō ŷōũŕ ēḿƀēďďĩńĝś ƥŕōvĩďēŕ (ŌƥēńÀĨ ƀŷ ďēƒàũĺţ) ţō ćōḿƥũţē ēḿƀēďďĩńĝś."
],
"sxTdZI": ["Ĺōàďĩńĝ ƥàţĥś…"],
- "sxjyRq": ["Ŵōŕķţŕēēś"],
"sxkWRg": ["Àďvàńćēď"],
"t-JXbf": ["Ńōţĩōń-śţŷĺē ĩńĺĩńē ŕōŵ ƒōŕ à ďōŵńĺōàďàƀĺē ƒĩĺē. Ďŕàĝ-ďŕōƥ àĺśō ŵōŕķś."],
"t18QYR": ["Ũńƥĩń ", ["accessibleLabel"]],
@@ -1972,7 +1947,6 @@
"tUvUfp": ["Ũśē à ƒōĺďēŕ ŷōũ àĺŕēàďŷ ĥàvē."],
"tW_yvQ": ["Ēxƥàńď ", ["docName"]],
"t_YqKh": ["Ŕēḿōvē"],
- "teD0H9": ["Ćōũĺďń'ţ ōƥēń à ŵōŕķţŕēē ƒōŕ ţĥàţ ƀŕàńćĥ."],
"tfDRzk": ["Śàvē"],
"tfi40B": ["Ƒàĩĺēď ţō ćŕēàţē ƥàĝē"],
"tgWuMB": ["Ḿōďĩƒĩēď"],
@@ -1994,7 +1968,6 @@
"uFOL2y": [
"Ńō ƥŕōĴēćţ śķĩĺĺś ŷēţ. Àũţĥōŕ ōńē ţō ţēàćĥ àĝēńţś à ŕēƥēàţàƀĺē ţàśķ śćōƥēď ţō ţĥĩś ķńōŵĺēďĝē ƀàśē."
],
- "uGaIIS": ["Ćĥēćķ ōũţ ŵōŕķţŕēē"],
"uH_S-u": [["loadErrorTitle"], ": ", ["message"]],
"uKRYiW": ["Śŷńć śţàţũś ũńàvàĩĺàƀĺē — śēŕvēŕ ēŕŕōŕ."],
"uL_Wx8": ["Ţĥē ţēŕḿĩńàĺ śţōƥƥēď ũńēxƥēćţēďĺŷ."],
@@ -2035,7 +2008,6 @@
],
"v7hK0U": ["Ũśē ĺōŵēŕćàśē ĺēţţēŕś, ďĩĝĩţś, àńď ĥŷƥĥēńś ōńĺŷ."],
"v7lbnC": ["Ƒĩńď ńēxţ ḿàţćĥ"],
- "vAYoCZ": ["Ćōũĺďń'ţ ōƥēń ţĥē ŵōŕķţŕēē. Ţŕŷ àĝàĩń."],
"vDXqVv": ["Ĩńśēŕţ à ḿàŕķďōŵń ĥàŕď ƀŕēàķ."],
"vEJDlt": ["Ţĥē ƒĩĺē ĩś ĩń ŷōũŕ Ţŕàśĥ; ţĥē ƒĩĺē-ŵàţćĥēŕ ŵĩĺĺ ŕēćōńćĩĺē."],
"vGeNNQ": ["Ćōƥŷ à ƥŕōḿƥţ àńď ƥàśţē ĩţ ĩńţō ŷōũŕ àĝēńţ ţō śēţ ũƥ ŷōũŕ ƥŕōĴēćţ."],
@@ -2082,9 +2054,6 @@
"wndeIl": ["ƤŕōĴēćţ-ĺēvēĺ ƥàĝēś ŵĩţĥ ńēĩţĥēŕ ĩńćōḿĩńĝ ńōŕ ōũţĝōĩńĝ ĝŕàƥĥ ēďĝēś."],
"wtcxiD": ["Śĥàŕē ţĥĩś śēţũƥ ŵĩţĥ ŷōũŕ ţēàḿ?"],
"wvbc1r": ["Ćōũĺďń'ţ ōƥēń ďōćũḿēńţ"],
- "wzq9Rv": [
- "À ƀŕàńćĥ ŵĩţĥ ţĥàţ ńàḿē àĺŕēàďŷ ēxĩśţś. Ōƥēń ĩţś ŵōŕķţŕēē ƒŕōḿ ţĥē śŵĩţćĥēŕ ĩńśţēàď."
- ],
"x-5mJ1": ["Ĩńśţàĺĺ ōń àĺĺ"],
"x2fr_j": ["Ĝŕàƥĥ"],
"x3-2ta": [
diff --git a/packages/app/src/locales/pseudo/messages.po b/packages/app/src/locales/pseudo/messages.po
index 9b41e1e0a..c2b217ab6 100644
--- a/packages/app/src/locales/pseudo/messages.po
+++ b/packages/app/src/locales/pseudo/messages.po
@@ -13,6 +13,10 @@ msgstr ""
"Language-Team: \n"
"Plural-Forms: \n"
+#: src/components/ProjectSwitcher.tsx
+msgid " (missing)"
+msgstr ""
+
#: src/components/settings/SettingsDialogBody.tsx
msgid " or "
msgstr ""
@@ -430,10 +434,6 @@ msgstr ""
msgid "📝 or assets/icon.png"
msgstr ""
-#: src/components/NewWorktreeDialog.tsx
-msgid "A branch with that name already exists. Open its worktree from the switcher instead."
-msgstr ""
-
#: src/components/CreateProjectDialog.tsx
msgid "A folder named <0>{sanitized}</0> already has files here. Pick a different name."
msgstr ""
@@ -499,10 +499,6 @@ msgstr ""
msgid "A title, description, tags — anything that describes this folder."
msgstr ""
-#: src/components/NewWorktreeDialog.tsx
-msgid "A worktree folder for that branch already exists."
-msgstr ""
-
#: src/editor/slash-command/items.tsx
msgid "Above"
msgstr ""
@@ -898,10 +894,6 @@ msgstr ""
msgid "Branch <0>{shareBranch}</0> is checked out in:"
msgstr ""
-#: src/components/NewWorktreeDialog.tsx
-msgid "Branch name"
-msgstr ""
-
#: src/components/ShareBranchSwitchDialog.tsx
msgid "Branch switch failed — try opening the {targetNoun} manually."
msgstr ""
@@ -980,7 +972,6 @@ msgstr ""
#: src/components/NewItemDialog.tsx
#: src/components/NewSkillDialog.tsx
#: src/components/NewTemplateDialog.tsx
-#: src/components/NewWorktreeDialog.tsx
#: src/components/PublishToGitHubDialog.tsx
#: src/components/SeedDialog.tsx
#: src/components/settings/SearchSection.tsx
@@ -1004,10 +995,6 @@ msgstr ""
msgid "Cannot upload: no document is open"
msgstr ""
-#: src/components/NewWorktreeDialog.tsx
-msgid "Check out worktree"
-msgstr ""
-
#: src/components/PropertyWidgets.tsx
msgid "Checkbox"
msgstr ""
@@ -1043,10 +1030,6 @@ msgstr ""
msgid "Checklist with checkboxes."
msgstr ""
-#: src/components/NewWorktreeDialog.tsx
-msgid "Checks out <0>{trimmed}</0> into its own window, under <1>.ok/worktrees/</1>."
-msgstr ""
-
#: src/components/BottomComposer.tsx
#: src/components/empty-state/CreatePromptComposer.tsx
msgid "Choose agent"
@@ -1690,10 +1673,6 @@ msgstr ""
msgid "Couldn't create template: {error}"
msgstr ""
-#: src/components/NewWorktreeDialog.tsx
-msgid "Couldn't create the worktree. Try a different name."
-msgstr ""
-
#: src/components/SkillDeleteDialog.tsx
msgid "Couldn't delete skill: {error}"
msgstr ""
@@ -1758,10 +1737,6 @@ msgstr ""
msgid "Couldn't move to Trash"
msgstr ""
-#: src/components/RecentProjectsMenu.tsx
-msgid "Couldn't open a worktree for that branch."
-msgstr ""
-
#: src/components/DocumentErrorBoundary.tsx
msgid "Couldn't open document"
msgstr ""
@@ -1770,10 +1745,6 @@ msgstr ""
msgid "Couldn't open the terminal — please try again."
msgstr ""
-#: src/components/NewWorktreeDialog.tsx
-msgid "Couldn't open the worktree. Try again."
-msgstr ""
-
#: src/components/ConnectingBanner.tsx
msgid "Couldn't reach collab server — {errorDetail}. Try <0>ok status</0> or check <1>.ok/local/last-spawn-error.log</1>."
msgstr ""
@@ -1880,10 +1851,6 @@ msgstr ""
msgid "Create a folder from the current document or folder context."
msgstr ""
-#: src/components/NewWorktreeDialog.tsx
-msgid "Create a new branch, or check out an existing one, in its own window."
-msgstr ""
-
#: src/lib/keyboard-shortcuts.ts
msgid "Create a new list item from the current list item."
msgstr ""
@@ -1937,11 +1904,6 @@ msgstr ""
msgid "Create with {0} CLI"
msgstr ""
-#: src/components/CommandPalette.tsx
-#: src/components/NewWorktreeDialog.tsx
-msgid "Create worktree"
-msgstr ""
-
#: src/components/FileTree.tsx
#: src/components/OnboardingCard.tsx
msgid "Create your first file"
@@ -2493,10 +2455,6 @@ msgstr ""
msgid "Enter a title for this template."
msgstr ""
-#: src/components/NewWorktreeDialog.tsx
-msgid "Enter a valid branch name (no spaces, no leading dot, no \"..\")."
-msgstr ""
-
#: src/components/ShareReceiveDialog.tsx
msgid "Error:"
msgstr ""
@@ -2712,18 +2670,10 @@ msgstr ""
#: src/components/CommandPalette.tsx
#: src/components/NavigatorApp.tsx
+#: src/components/ProjectSwitcher.tsx
msgid "Failed to open project."
msgstr ""
-#: src/components/CommandPalette.tsx
-#: src/components/RecentProjectsMenu.tsx
-msgid "Failed to open worktree."
-msgstr ""
-
-#: src/components/RecentProjectsMenu.tsx
-msgid "Failed to open."
-msgstr ""
-
#: src/components/LinksPanel.tsx
msgid "Failed to parse backlinks error response (HTTP {status})"
msgstr ""
@@ -3861,10 +3811,6 @@ msgstr ""
msgid "Multi-page PDF viewer with toolbar controls (thumbnails, page nav, zoom)."
msgstr ""
-#: src/components/NewWorktreeDialog.tsx
-msgid "my-feature"
-msgstr ""
-
#: src/components/SubscribeForm.tsx
msgstr ""
@@ -3947,14 +3893,6 @@ msgstr ""
msgid "New"
msgstr ""
-#: src/components/NewWorktreeDialog.tsx
-msgid "New branch based on <0>{currentBranch}</0>. The worktree lives inside the project, under <1>.ok/worktrees/</1>."
-msgstr ""
-
-#: src/components/NewWorktreeDialog.tsx
-msgid "New branch based on the current commit. The worktree lives inside the project, under <0>.ok/worktrees/</0>."
-msgstr ""
-
#: src/components/TerminalTabStrip.tsx
msgid "New chat"
msgstr ""
@@ -4021,11 +3959,6 @@ msgstr ""
msgid "New terminal tab"
msgstr ""
-#: src/components/NewWorktreeDialog.tsx
-#: src/components/ProjectSwitcher.tsx
-msgid "New worktree"
-msgstr ""
-
#: src/editor/find-replace/FindReplaceBar.tsx
msgid "Next match"
msgstr ""
@@ -4153,10 +4086,18 @@ msgstr ""
msgid "No matching paths"
msgstr ""
+#: src/components/ProjectSwitcher.tsx
+msgid "No matching projects."
+msgstr ""
+
#: src/components/CloneDialog.tsx
msgid "No matching repositories."
msgstr ""
+#: src/components/ProjectSwitcher.tsx
+msgid "No other recent projects."
+msgstr ""
+
#: src/components/GraphPanel.tsx
msgid "No Outgoing"
msgstr ""
@@ -4197,10 +4138,6 @@ msgstr ""
msgid "No project templates yet. Create one to make it available everywhere in this project. Folder-scoped templates live on each folder's overview page."
msgstr ""
-#: src/components/ProjectSwitcher.tsx
-msgid "No recent projects."
-msgstr ""
-
#: src/components/CloneDialog.tsx
msgid "No repositories found on your GitHub account."
msgstr ""
@@ -4359,11 +4296,6 @@ msgstr ""
msgid "Open"
msgstr ""
-#. placeholder {0}: group.project.name
-#: src/components/RecentProjectsMenu.tsx
-msgid "Open {0}"
-msgstr ""
-
#. placeholder {0}: status.remote.label
#: src/components/settings/SettingsDialogBody.tsx
#: src/components/SyncStatusBadge.tsx
@@ -5517,11 +5449,11 @@ msgid "Search matches file names, paths, and folders. Open a file to search its
msgstr ""
#: src/components/ProjectSwitcher.tsx
-msgid "Search projects and worktrees"
+msgid "Search recent projects"
msgstr ""
#: src/components/ProjectSwitcher.tsx
-msgid "Search projects and worktrees..."
+msgid "Search recent projects..."
msgstr ""
#: src/components/settings/SearchSection.tsx
@@ -6300,10 +6232,6 @@ msgstr ""
msgid "Thanks for subscribing. Watch your inbox for product updates."
msgstr ""
-#: src/components/NewWorktreeDialog.tsx
-msgid "That branch is already open in another worktree."
-msgstr ""
-
#: src/components/ShareReceiveDialog.tsx
msgid "That folder isn't an OpenKnowledge project yet. Initialize it and open?"
msgstr ""
@@ -6500,10 +6428,6 @@ msgstr ""
msgid "This project is running an older version of OpenKnowledge (v{0}) than this app (v{1})."
msgstr ""
-#: src/components/NewWorktreeDialog.tsx
-msgid "This project isn't a git repository, so worktrees aren't available."
-msgstr ""
-
#: src/components/settings/SettingsDialogBody.tsx
msgid "This project lives only on this computer. Connect it to GitHub to back it up and share it with other people."
msgstr ""
@@ -7084,7 +7008,6 @@ msgid "Word wrap"
msgstr ""
#: src/components/McpConsentDialogBody.tsx
-#: src/components/NewWorktreeDialog.tsx
#: src/components/SkillEditorActions.tsx
msgid "Working"
msgstr ""
@@ -7097,10 +7020,6 @@ msgstr ""
msgid "Workspace Command Palette"
msgstr ""
-#: src/components/CommandPalette.tsx
-msgid "Worktrees"
-msgstr ""
-
#: src/components/settings/SettingsDialogBody.tsx
msgid "Wrap long lines in the markdown source editor."
msgstr ""
diff --git a/packages/app/tests/stress/fixtures/handoff-mocks.ts b/packages/app/tests/stress/fixtures/handoff-mocks.ts
index c7d457473..6855caa6e 100644
--- a/packages/app/tests/stress/fixtures/handoff-mocks.ts
+++ b/packages/app/tests/stress/fixtures/handoff-mocks.ts
@@ -269,10 +269,6 @@ export async function installHandoffMocks(page: Page, cfg: HandoffMockConfig): P
}),
close: async () => {},
},
- worktree: {
- list: async () => ({ ok: false as const, reason: 'no-git' as const }),
- create: async () => ({ ok: false as const, reason: 'no-git' as const }),
- },
sharing: {
status: async () =>
({
diff --git a/packages/core/src/desktop-bridge.ts b/packages/core/src/desktop-bridge.ts
index b14e86f19..a430d1dc3 100644
--- a/packages/core/src/desktop-bridge.ts
+++ b/packages/core/src/desktop-bridge.ts
@@ -1,11 +1,6 @@
import type { CreateNewBannerKind } from './constants/create-new-banner.ts';
import type { EditorId } from './constants/editors.ts';
import type { OkFolderState } from './constants/folder-state.ts';
-import type {
- WorktreeCreateRequest,
- WorktreeCreateResult,
- WorktreeListResult,
-} from './git/worktree-selector-model.ts';
import type { TerminalCli } from './handoff/terminal-launch.ts';
import type { LocalOpOkInitResponse } from './schemas/api/local-op.ts';
import type { BranchInfoResponse, CheckoutResponse } from './schemas/api/share.ts';
@@ -47,9 +42,7 @@ type OkMenuAction =
| 'toggle-doc-panel'
| 'toggle-terminal'
| 'new-terminal'
- | 'kill-terminal'
- | 'new-worktree'
- | 'switch-worktree';
+ | 'kill-terminal';
type OkUnsubscribe = () => void;
@@ -68,8 +61,7 @@ type OkProjectEntryPoint =
| 'recents'
| 'deep-link'
| 'drag-drop'
- | 'share-receive'
- | 'worktree';
+ | 'share-receive';
interface OkProjectOpenRequest {
path: string;
@@ -609,11 +601,6 @@ export interface OkDesktopBridge {
close(): Promise<void>;
};
- worktree: {
- list(): Promise<WorktreeListResult>;
- create(request: WorktreeCreateRequest): Promise<WorktreeCreateResult>;
- };
-
sharing: {
status(): Promise<OkSharingStatusResult>;
setMode(mode: 'shared' | 'local-only'): Promise<OkSharingSetModeResult>;
diff --git a/packages/core/src/git/branch-list-parser.test.ts b/packages/core/src/git/branch-list-parser.test.ts
deleted file mode 100644
index 6285c3478..000000000
--- a/packages/core/src/git/branch-list-parser.test.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import { describe, expect, test } from 'bun:test';
-import { parseBranchList } from './branch-list-parser.ts';
-
-describe('parseBranchList', () => {
- test('empty stdout yields empty array', () => {
- expect(parseBranchList('')).toEqual([]);
- expect(parseBranchList('\n\n')).toEqual([]);
- });
-
- test('parses one branch per line, preserving order', () => {
- expect(parseBranchList('main\nfeat/foo\nrelease-1\n')).toEqual([
- 'main',
- 'feat/foo',
- 'release-1',
- ]);
- });
-
- test('tolerates missing trailing newline, CRLF, and surrounding whitespace', () => {
- expect(parseBranchList('main\r\n feat/bar ')).toEqual(['main', 'feat/bar']);
- });
-
- test('drops blank lines and de-duplicates', () => {
- expect(parseBranchList('main\n\nmain\ndev\n')).toEqual(['main', 'dev']);
- });
-
- test('keeps slash-namespaced branch names intact', () => {
- expect(parseBranchList('feat/a/b\nfix/c')).toEqual(['feat/a/b', 'fix/c']);
- });
-});
diff --git a/packages/core/src/git/branch-list-parser.ts b/packages/core/src/git/branch-list-parser.ts
deleted file mode 100644
index 6d2e449f5..000000000
--- a/packages/core/src/git/branch-list-parser.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-export function parseBranchList(stdout: string): string[] {
- if (stdout.length === 0) return [];
-
- const seen = new Set<string>();
- const branches: string[] = [];
- for (const rawLine of stdout.split('\n')) {
- const branch = rawLine.replace(/\r$/, '').trim();
- if (branch.length === 0 || seen.has(branch)) continue;
- seen.add(branch);
- branches.push(branch);
- }
- return branches;
-}
diff --git a/packages/core/src/git/worktree-path.test.ts b/packages/core/src/git/worktree-path.test.ts
deleted file mode 100644
index b292490f7..000000000
--- a/packages/core/src/git/worktree-path.test.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import { describe, expect, test } from 'bun:test';
-import { WORKTREES_PARENT_DIR, worktreeRelativeDir } from './worktree-path.ts';
-
-describe('worktreeRelativeDir', () => {
- test('places a simple branch under .ok/worktrees/', () => {
- expect(worktreeRelativeDir('feature-x')).toBe(`${WORKTREES_PARENT_DIR}/feature-x`);
- });
-
- test('keeps slash-namespaced branches as nested dirs', () => {
- expect(worktreeRelativeDir('feat/foo')).toBe(`${WORKTREES_PARENT_DIR}/feat/foo`);
- });
-
- test('trims surrounding whitespace', () => {
- expect(worktreeRelativeDir(' dev ')).toBe(`${WORKTREES_PARENT_DIR}/dev`);
- });
-
- test('rejects empty / whitespace-only', () => {
- expect(worktreeRelativeDir('')).toBeNull();
- expect(worktreeRelativeDir(' ')).toBeNull();
- });
-
- test('rejects path-escape attempts', () => {
- expect(worktreeRelativeDir('../evil')).toBeNull();
- expect(worktreeRelativeDir('a/../../b')).toBeNull();
- expect(worktreeRelativeDir('/abs')).toBeNull();
- expect(worktreeRelativeDir('trailing/')).toBeNull();
- expect(worktreeRelativeDir('a//b')).toBeNull();
- expect(worktreeRelativeDir('.')).toBeNull();
- });
-
- test('rejects backslash and NUL', () => {
- expect(worktreeRelativeDir('a\\b')).toBeNull();
- expect(worktreeRelativeDir('a\0b')).toBeNull();
- });
-});
diff --git a/packages/core/src/git/worktree-path.ts b/packages/core/src/git/worktree-path.ts
deleted file mode 100644
index 497c31011..000000000
--- a/packages/core/src/git/worktree-path.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-export const WORKTREES_PARENT_DIR = '.ok/worktrees';
-
-export function worktreeRelativeDir(branch: string): string | null {
- const trimmed = branch.trim();
- if (trimmed.length === 0) return null;
- if (trimmed.startsWith('/') || trimmed.endsWith('/')) return null;
- const segments = trimmed.split('/');
- for (const seg of segments) {
- if (seg.length === 0 || seg === '.' || seg === '..') return null;
- if (seg.includes('\\') || seg.includes('\0')) return null;
- }
- return `${WORKTREES_PARENT_DIR}/${trimmed}`;
-}
diff --git a/packages/core/src/git/worktree-selector-model.test.ts b/packages/core/src/git/worktree-selector-model.test.ts
deleted file mode 100644
index 4e5d7f551..000000000
--- a/packages/core/src/git/worktree-selector-model.test.ts
+++ /dev/null
@@ -1,107 +0,0 @@
-import { describe, expect, test } from 'bun:test';
-import type { BridgeWorktreeEntry } from './worktree-list-parser.ts';
-import { buildWorktreeSelectorModel } from './worktree-selector-model.ts';
-
-function wt(partial: Partial<BridgeWorktreeEntry> & { path: string }): BridgeWorktreeEntry {
- return {
- branch: null,
- headSha: 'abc123',
- locked: false,
- prunable: false,
- ...partial,
- };
-}
-
-describe('buildWorktreeSelectorModel', () => {
- test('main root is the first worktree entry', () => {
- const model = buildWorktreeSelectorModel({
- worktrees: [
- wt({ path: '/repo', branch: 'main' }),
- wt({ path: '/repo/.ok/worktrees/dev', branch: 'dev' }),
- ],
- branches: ['main', 'dev'],
- currentProjectPath: '/repo',
- });
- expect(model.mainRoot).toBe('/repo');
- });
-
- test('every local branch yields an entry; worktree-backed branches carry their path', () => {
- const model = buildWorktreeSelectorModel({
- worktrees: [
- wt({ path: '/repo', branch: 'main' }),
- wt({ path: '/repo/.ok/worktrees/dev', branch: 'dev' }),
- ],
- branches: ['main', 'dev', 'feature-x'],
- currentProjectPath: '/repo',
- });
- const byBranch = new Map(model.entries.map((e) => [e.branch, e]));
- expect(byBranch.get('main')?.worktreePath).toBe('/repo');
- expect(byBranch.get('dev')?.worktreePath).toBe('/repo/.ok/worktrees/dev');
- expect(byBranch.get('feature-x')?.worktreePath).toBeNull();
- });
-
- test('flags the current window and the main worktree', () => {
- const model = buildWorktreeSelectorModel({
- worktrees: [
- wt({ path: '/repo', branch: 'main' }),
- wt({ path: '/repo/.ok/worktrees/dev', branch: 'dev' }),
- ],
- branches: ['main', 'dev'],
- currentProjectPath: '/repo/.ok/worktrees/dev',
- });
- const main = model.entries.find((e) => e.branch === 'main');
- const dev = model.entries.find((e) => e.branch === 'dev');
- expect(main?.isMain).toBe(true);
- expect(main?.isCurrent).toBe(false);
- expect(dev?.isCurrent).toBe(true);
- expect(dev?.isMain).toBe(false);
- expect(model.currentBranch).toBe('dev');
- });
-
- test('orders current first, then main, then worktree-backed, then plain branches', () => {
- const model = buildWorktreeSelectorModel({
- worktrees: [
- wt({ path: '/repo', branch: 'main' }),
- wt({ path: '/repo/.ok/worktrees/zeta', branch: 'zeta' }),
- ],
- branches: ['main', 'zeta', 'alpha', 'beta'],
- currentProjectPath: '/repo/.ok/worktrees/zeta',
- });
- expect(model.entries.map((e) => e.branch)).toEqual(['zeta', 'main', 'alpha', 'beta']);
- });
-
- test('ignores prunable worktrees', () => {
- const model = buildWorktreeSelectorModel({
- worktrees: [
- wt({ path: '/repo', branch: 'main' }),
- wt({ path: '/gone', branch: 'ghost', prunable: true }),
- ],
- branches: ['main', 'ghost'],
- currentProjectPath: '/repo',
- });
- expect(model.entries.find((e) => e.branch === 'ghost')?.worktreePath).toBeNull();
- });
-
- test('includes a detached-HEAD worktree not present in the branch list', () => {
- const model = buildWorktreeSelectorModel({
- worktrees: [
- wt({ path: '/repo', branch: 'main' }),
- wt({ path: '/repo/.ok/worktrees/detached', branch: null }),
- ],
- branches: ['main'],
- currentProjectPath: '/repo/.ok/worktrees/detached',
- });
- const detached = model.entries.find((e) => e.worktreePath === '/repo/.ok/worktrees/detached');
- expect(detached?.branch).toBeNull();
- expect(detached?.isCurrent).toBe(true);
- });
-
- test('falls back to currentProjectPath as mainRoot when no worktrees reported', () => {
- const model = buildWorktreeSelectorModel({
- worktrees: [],
- branches: ['main'],
- currentProjectPath: '/repo',
- });
- expect(model.mainRoot).toBe('/repo');
- });
-});
diff --git a/packages/core/src/git/worktree-selector-model.ts b/packages/core/src/git/worktree-selector-model.ts
deleted file mode 100644
index 5be1cc457..000000000
--- a/packages/core/src/git/worktree-selector-model.ts
+++ /dev/null
@@ -1,108 +0,0 @@
-import type { BridgeWorktreeEntry } from './worktree-list-parser.ts';
-
-export interface WorktreeSelectorEntry {
- readonly branch: string | null;
- readonly worktreePath: string | null;
- readonly isCurrent: boolean;
- readonly isMain: boolean;
- readonly locked: boolean;
-}
-
-export interface WorktreeSelectorModel {
- readonly mainRoot: string;
- readonly currentBranch: string | null;
- readonly entries: readonly WorktreeSelectorEntry[];
-}
-
-export type WorktreeListResult =
- | { readonly ok: true; readonly model: WorktreeSelectorModel }
- | { readonly ok: false; readonly reason: 'no-git' };
-
-export interface WorktreeCreateRequest {
- readonly branch: string;
- readonly baseBranch?: string | null;
- readonly createBranch: boolean;
-}
-
-export type WorktreeCreateResult =
- | { readonly ok: true; readonly path: string; readonly created: boolean }
- | {
- readonly ok: false;
- readonly reason:
- | 'invalid-branch'
- | 'branch-exists'
- | 'already-checked-out'
- | 'path-exists'
- | 'no-git'
- | 'error';
- readonly message?: string;
- };
-
-export interface BuildWorktreeSelectorModelInput {
- readonly worktrees: readonly BridgeWorktreeEntry[];
- readonly branches: readonly string[];
- readonly currentProjectPath: string;
-}
-
-export function buildWorktreeSelectorModel(
- input: BuildWorktreeSelectorModelInput,
-): WorktreeSelectorModel {
- const liveWorktrees = input.worktrees.filter((w) => !w.prunable);
- const mainRoot = liveWorktrees[0]?.path ?? input.currentProjectPath;
-
- const worktreeByBranch = new Map<string, BridgeWorktreeEntry>();
- for (const w of liveWorktrees) {
- if (w.branch !== null && !worktreeByBranch.has(w.branch)) {
- worktreeByBranch.set(w.branch, w);
- }
- }
-
- const isCurrentPath = (p: string): boolean => p === input.currentProjectPath;
-
- const entries: WorktreeSelectorEntry[] = [];
-
- for (const branch of input.branches) {
- const wt = worktreeByBranch.get(branch) ?? null;
- entries.push({
- branch,
- worktreePath: wt?.path ?? null,
- isCurrent: wt !== null && isCurrentPath(wt.path),
- isMain: wt !== null && wt.path === mainRoot,
- locked: wt?.locked ?? false,
- });
- }
-
- const branchPaths = new Set(
- entries.map((e) => e.worktreePath).filter((p): p is string => p !== null),
- );
- for (const w of liveWorktrees) {
- if (w.branch === null && !branchPaths.has(w.path)) {
- entries.push({
- branch: null,
- worktreePath: w.path,
- isCurrent: isCurrentPath(w.path),
- isMain: w.path === mainRoot,
- locked: w.locked,
- });
- }
- }
-
- const currentBranch = entries.find((e) => e.isCurrent)?.branch ?? null;
-
- entries.sort(compareEntries);
-
- return { mainRoot, currentBranch, entries };
-}
-
-function compareEntries(a: WorktreeSelectorEntry, b: WorktreeSelectorEntry): number {
- const rank = (e: WorktreeSelectorEntry): number => {
- if (e.isCurrent) return 0;
- if (e.isMain) return 1;
- if (e.worktreePath !== null) return 2;
- return 3;
- };
- const ra = rank(a);
- const rb = rank(b);
- if (ra !== rb) return ra - rb;
- return (a.branch ?? '').localeCompare(b.branch ?? '');
-}
diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts
index 7ea82f4f6..23ad52a40 100644
--- a/packages/core/src/index.ts
+++ b/packages/core/src/index.ts
@@ -366,21 +366,10 @@ export {
serializeFrontmatterMap,
withFences,
} from './frontmatter/yaml-codec.ts';
-export { parseBranchList } from './git/branch-list-parser.ts';
export {
type BridgeWorktreeEntry,
parseWorktreeListPorcelain,
} from './git/worktree-list-parser.ts';
-export { WORKTREES_PARENT_DIR, worktreeRelativeDir } from './git/worktree-path.ts';
-export {
- type BuildWorktreeSelectorModelInput,
- buildWorktreeSelectorModel,
- type WorktreeCreateRequest,
- type WorktreeCreateResult,
- type WorktreeListResult,
- type WorktreeSelectorEntry,
- type WorktreeSelectorModel,
-} from './git/worktree-selector-model.ts';
export {
type AssembleHandoffPromptInput,
assembleHandoffPrompt,
diff --git a/packages/core/src/sharing/receive-flow.ts b/packages/core/src/sharing/receive-flow.ts
index 13e843bd0..710d0df5b 100644
--- a/packages/core/src/sharing/receive-flow.ts
+++ b/packages/core/src/sharing/receive-flow.ts
@@ -17,10 +17,6 @@ export interface RecentProjectEntry {
lastOpenedAt: string;
missing?: boolean;
gitRemoteUrl?: string;
- gitCommonDir?: string;
- mainRoot?: string;
- isLinkedWorktree?: boolean;
- branch?: string | null;
}
export interface ExpectedShareRepo {
diff --git a/packages/desktop/src/main/index.ts b/packages/desktop/src/main/index.ts
index 0033dd340..af360159b 100644
--- a/packages/desktop/src/main/index.ts
+++ b/packages/desktop/src/main/index.ts
@@ -261,8 +261,6 @@ import {
WindowManager,
} from './window-manager.ts';
import { WINDOW_MIN_SIZE } from './window-min-size.ts';
-import { classifyRecentGit } from './worktree-recents.ts';
-import { createWorktree, listWorktreeSelector } from './worktree-service.ts';
const VIBRANCY_DEFAULT: VibrancyMaterial = 'sidebar';
@@ -1083,10 +1081,6 @@ async function openProject(
tryCloseNavigator(navigatorWindow, { projectPath });
const gitRemoteUrl = readCanonicalGitHubRemoteUrl(resolvedProjectDir) ?? undefined;
appState = addRecentProject(appState, resolvedProjectDir, ctx.projectName, gitRemoteUrl);
- if (entryPoint === 'worktree') {
- const mainRoot = classifyRecentGit(resolvedProjectDir).mainRoot;
- if (mainRoot !== null) appState = { ...appState, lastOpenedProject: mainRoot };
- }
saveAppState(appState);
refreshApplicationMenu();
}
@@ -1286,8 +1280,6 @@ async function runApplicationMenuRefresh(): Promise<void> {
onNewFolder: () => sendMenuActionToFocused('new-folder'),
onNewFromTemplate: () => sendMenuActionToFocused('new-from-template'),
onNewProject: () => sendMenuActionToFocused('new-project'),
- onNewWorktree: () => sendMenuActionToFocused('new-worktree'),
- onSwitchWorktree: () => sendMenuActionToFocused('switch-worktree'),
onRename: () => sendMenuActionToFocused('rename'),
onDuplicate: () => sendMenuActionToFocused('duplicate'),
onMoveToTrash: () => sendMenuActionToFocused('move-to-trash'),
@@ -2037,18 +2029,7 @@ function registerIpcHandlers() {
});
handle('ok:project:list-recent', async () => {
- return annotateMissing(appState).map((entry): RecentProject => {
- if (entry.missing) return entry;
- const git = classifyRecentGit(entry.path);
- if (git.gitCommonDir === null) return entry;
- return {
- ...entry,
- gitCommonDir: git.gitCommonDir,
- mainRoot: git.mainRoot ?? undefined,
- isLinkedWorktree: git.isLinkedWorktree,
- branch: readHeadBranchImpl(entry.path).currentBranch,
- };
- });
+ return annotateMissing(appState) as RecentProject[];
});
handle('ok:project:remove-recent', async (_event, projectPath) => {
@@ -2138,37 +2119,6 @@ function registerIpcHandlers() {
return undefined;
});
- handle('ok:worktree:dispatch', async (event, request) => {
- const win = BrowserWindow.fromWebContents(event.sender);
- const ctx =
- win && wm ? wm.getContextForBrowserWindow(win as unknown as BrowserWindowLike) : null;
- const projectPath = ctx?.projectPath ?? null;
- if (!projectPath) {
- logIpcError({
- event: 'ipc.error',
- channel: 'ok:worktree:dispatch',
- reason: 'no-git',
- handler: 'worktreeDispatch',
- });
- return { ok: false, reason: 'no-git' };
- }
- let anchor: string;
- try {
- anchor = realpathSync(projectPath);
- } catch {
- anchor = projectPath;
- }
- if (request.kind === 'list') {
- return listWorktreeSelector(anchor, anchor);
- }
- return createWorktree({
- anchorPath: anchor,
- branch: request.branch,
- baseBranch: request.baseBranch,
- createBranch: request.createBranch,
- });
- });
-
handle('ok:share:validate-folder', async (_event, request) => {
return validateLocalFolderForShare(request.folderPath, {
owner: request.owner,
diff --git a/packages/desktop/src/main/menu.ts b/packages/desktop/src/main/menu.ts
index 1329524d4..7842c2e09 100644
--- a/packages/desktop/src/main/menu.ts
+++ b/packages/desktop/src/main/menu.ts
@@ -26,8 +26,6 @@ export interface MenuDeps {
onNewFolder?(): void;
onNewFromTemplate?(): void;
onNewProject?(): void;
- onNewWorktree?(): void;
- onSwitchWorktree?(): void;
onRename?(): void;
onDuplicate?(): void;
onMoveToTrash?(): void;
@@ -164,17 +162,6 @@ export function buildMenuTemplate(deps: MenuDeps): MenuItemConstructorOptions[]
},
},
{ type: 'separator' },
- {
- label: 'New worktree…',
- enabled: deps.onNewWorktree !== undefined,
- click: () => deps.onNewWorktree?.(),
- },
- {
- label: 'Switch worktree…',
- enabled: deps.onSwitchWorktree !== undefined,
- click: () => deps.onSwitchWorktree?.(),
- },
- { type: 'separator' },
{
label: MENU_LABELS.duplicate,
accelerator: 'CmdOrCtrl+D',
diff --git a/packages/desktop/src/main/worktree-recents.test.ts b/packages/desktop/src/main/worktree-recents.test.ts
deleted file mode 100644
index cd0e61f42..000000000
--- a/packages/desktop/src/main/worktree-recents.test.ts
+++ /dev/null
@@ -1,97 +0,0 @@
-import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
-import { execFile } from 'node:child_process';
-import { mkdirSync, mkdtempSync, realpathSync, rmSync, writeFileSync } from 'node:fs';
-import { tmpdir } from 'node:os';
-import { join } from 'node:path';
-import { promisify } from 'node:util';
-import { classifyRecentGit, clearRecentGitCache } from './worktree-recents.ts';
-
-const execFileAsync = promisify(execFile);
-const GIT_ENV = { ...process.env, LANG: 'C', LC_ALL: 'C', GIT_CONFIG_GLOBAL: '/dev/null' };
-
-async function git(cwd: string, ...args: string[]): Promise<void> {
- await execFileAsync('git', args, { cwd, env: GIT_ENV });
-}
-
-interface Handle {
- readonly root: string;
- readonly mainRepo: string;
- readonly worktree: string;
- cleanup(): void;
-}
-
-async function makeRepoWithWorktree(): Promise<Handle> {
- const root = realpathSync(mkdtempSync(join(tmpdir(), 'wt-recents-test-')));
- const mainRepo = join(root, 'main');
- mkdirSync(mainRepo);
- await git(mainRepo, 'init', '--initial-branch=main', '.');
- await git(mainRepo, 'config', 'user.email', '[email protected]');
- await git(mainRepo, 'config', 'user.name', 'Test');
- writeFileSync(join(mainRepo, 'README.md'), '# main\n');
- await git(mainRepo, 'add', '-A');
- await git(mainRepo, 'commit', '-m', 'initial');
- const worktree = join(root, 'wt', 'feature');
- mkdirSync(join(root, 'wt'), { recursive: true });
- await git(mainRepo, 'worktree', 'add', '-b', 'feature', worktree);
- return {
- root,
- mainRepo,
- worktree,
- cleanup: () => rmSync(root, { recursive: true, force: true }),
- };
-}
-
-describe('classifyRecentGit', () => {
- let handle: Handle | null = null;
- beforeEach(() => clearRecentGitCache());
- afterEach(() => {
- handle?.cleanup();
- handle = null;
- });
-
- test('main worktree: same repo, not linked', async () => {
- handle = await makeRepoWithWorktree();
- const info = classifyRecentGit(handle.mainRepo);
- expect(info.gitCommonDir).toBe(join(handle.mainRepo, '.git'));
- expect(info.mainRoot).toBe(handle.mainRepo);
- expect(info.isLinkedWorktree).toBe(false);
- });
-
- test('linked worktree: shares the main repo common-dir + main root, flagged linked', async () => {
- handle = await makeRepoWithWorktree();
- const info = classifyRecentGit(handle.worktree);
- expect(info.gitCommonDir).toBe(join(handle.mainRepo, '.git'));
- expect(info.mainRoot).toBe(handle.mainRepo);
- expect(info.isLinkedWorktree).toBe(true);
- });
-
- test('main + linked worktree share the same gitCommonDir (grouping key)', async () => {
- handle = await makeRepoWithWorktree();
- const main = classifyRecentGit(handle.mainRepo);
- const linked = classifyRecentGit(handle.worktree);
- expect(main.gitCommonDir).toBe(linked.gitCommonDir);
- });
-
- test('non-git dir → empty classification', () => {
- const tmp = realpathSync(mkdtempSync(join(tmpdir(), 'wt-recents-nogit-')));
- try {
- const info = classifyRecentGit(tmp);
- expect(info.gitCommonDir).toBeNull();
- expect(info.mainRoot).toBeNull();
- expect(info.isLinkedWorktree).toBe(false);
- } finally {
- rmSync(tmp, { recursive: true, force: true });
- }
- });
-
- test('non-absolute path → empty', () => {
- expect(classifyRecentGit('relative/path').gitCommonDir).toBeNull();
- });
-
- test('result is memoized per path (cache hit after clear + recompute)', async () => {
- handle = await makeRepoWithWorktree();
- const first = classifyRecentGit(handle.mainRepo);
- const second = classifyRecentGit(handle.mainRepo);
- expect(first).toBe(second);
- });
-});
diff --git a/packages/desktop/src/main/worktree-recents.ts b/packages/desktop/src/main/worktree-recents.ts
deleted file mode 100644
index 1d3b8b23e..000000000
--- a/packages/desktop/src/main/worktree-recents.ts
+++ /dev/null
@@ -1,72 +0,0 @@
-import { execFileSync } from 'node:child_process';
-import { realpathSync } from 'node:fs';
-import { basename, dirname, isAbsolute, resolve } from 'node:path';
-
-const GIT_ENV = { ...process.env, LANG: 'C', LC_ALL: 'C' } as const;
-
-export interface RecentGitInfo {
- readonly gitCommonDir: string | null;
- readonly mainRoot: string | null;
- readonly isLinkedWorktree: boolean;
-}
-
-const EMPTY: RecentGitInfo = { gitCommonDir: null, mainRoot: null, isLinkedWorktree: false };
-
-const cache = new Map<string, RecentGitInfo>();
-
-export function clearRecentGitCache(): void {
- cache.clear();
-}
-
-export function classifyRecentGit(projectPath: string): RecentGitInfo {
- if (!isAbsolute(projectPath)) return EMPTY;
- let key: string;
- try {
- key = realpathSync(projectPath);
- } catch {
- return EMPTY;
- }
- const cached = cache.get(key);
- if (cached !== undefined) return cached;
-
- const info = computeRecentGit(key);
- cache.set(key, info);
- return info;
-}
-
-function computeRecentGit(realPath: string): RecentGitInfo {
- let out: string;
- try {
- out = String(
- execFileSync(
- 'git',
- ['rev-parse', '--path-format=absolute', '--show-toplevel', '--git-common-dir'],
- { cwd: realPath, env: GIT_ENV },
- ),
- );
- } catch {
- return EMPTY;
- }
- const [topLevelRaw, commonDirRaw] = out.split('\n');
- const topLevel = topLevelRaw?.trim();
- const commonDir = commonDirRaw?.trim();
- if (!topLevel || !commonDir) return EMPTY;
-
- const mainRoot = basename(commonDir) === '.git' ? dirname(commonDir) : topLevel;
- const isLinkedWorktree = realpathEq(topLevel, mainRoot) === false;
- return { gitCommonDir: commonDir, mainRoot, isLinkedWorktree };
-}
-
-function realpathEq(a: string, b: string): boolean {
- const ra = safeRealpath(a);
- const rb = safeRealpath(b);
- return resolve(ra) === resolve(rb);
-}
-
-function safeRealpath(p: string): string {
- try {
- return realpathSync(p);
- } catch {
- return p;
- }
-}
diff --git a/packages/desktop/src/main/worktree-service.test.ts b/packages/desktop/src/main/worktree-service.test.ts
deleted file mode 100644
index 3cfba0e59..000000000
--- a/packages/desktop/src/main/worktree-service.test.ts
+++ /dev/null
@@ -1,153 +0,0 @@
-import { afterEach, describe, expect, test } from 'bun:test';
-import { execFile } from 'node:child_process';
-import { existsSync, mkdirSync, mkdtempSync, realpathSync, rmSync, writeFileSync } from 'node:fs';
-import { tmpdir } from 'node:os';
-import { join } from 'node:path';
-import { promisify } from 'node:util';
-import { createWorktree, listWorktreeSelector } from './worktree-service.ts';
-
-const execFileAsync = promisify(execFile);
-const GIT_ENV = { ...process.env, LANG: 'C', LC_ALL: 'C', GIT_CONFIG_GLOBAL: '/dev/null' };
-
-async function git(cwd: string, ...args: string[]): Promise<string> {
- const { stdout } = await execFileAsync('git', args, { cwd, env: GIT_ENV });
- return String(stdout);
-}
-
-interface Handle {
- readonly root: string;
- readonly mainRepo: string;
- cleanup(): void;
-}
-
-/** A clean main repo on `main` with a committed README + `.ok/config.yml` so a
- * worktree checked out from it carries the OK config (mirrors production). */
-async function makeRepo(extraBranches: string[] = []): Promise<Handle> {
- const root = realpathSync(mkdtempSync(join(tmpdir(), 'wt-svc-test-')));
- const mainRepo = join(root, 'main');
- mkdirSync(mainRepo);
- await git(mainRepo, 'init', '--initial-branch=main', '.');
- await git(mainRepo, 'config', 'user.email', '[email protected]');
- await git(mainRepo, 'config', 'user.name', 'Test');
- mkdirSync(join(mainRepo, '.ok'));
- writeFileSync(join(mainRepo, '.ok', 'config.yml'), 'version: 1\n');
- writeFileSync(join(mainRepo, 'README.md'), '# main\n');
- await git(mainRepo, 'add', '-A');
- await git(mainRepo, 'commit', '-m', 'initial');
- for (const b of extraBranches) await git(mainRepo, 'branch', b);
- return { root, mainRepo, cleanup: () => rmSync(root, { recursive: true, force: true }) };
-}
-
-describe('worktree-service', () => {
- let handle: Handle | null = null;
- afterEach(() => {
- handle?.cleanup();
- handle = null;
- });
-
- test('listWorktreeSelector returns every branch, flags current + main', async () => {
- handle = await makeRepo(['dev', 'feature-x']);
- const res = await listWorktreeSelector(handle.mainRepo, handle.mainRepo);
- expect(res.ok).toBe(true);
- if (!res.ok) return;
- expect(res.model.mainRoot).toBe(handle.mainRepo);
- const byBranch = new Map(res.model.entries.map((e) => [e.branch, e]));
- expect(byBranch.get('main')?.isMain).toBe(true);
- expect(byBranch.get('main')?.isCurrent).toBe(true);
- expect(byBranch.get('dev')?.worktreePath).toBeNull();
- expect(byBranch.get('feature-x')?.worktreePath).toBeNull();
- });
-
- test('createWorktree (existing branch) checks it out under .ok/worktrees/ and carries the OK config', async () => {
- handle = await makeRepo(['dev']);
- const res = await createWorktree({
- anchorPath: handle.mainRepo,
- branch: 'dev',
- createBranch: false,
- });
- expect(res.ok).toBe(true);
- if (!res.ok) return;
- expect(res.created).toBe(true);
- expect(res.path).toBe(join(handle.mainRepo, '.ok', 'worktrees', 'dev'));
- expect(existsSync(join(res.path, 'README.md'))).toBe(true);
- expect(existsSync(join(res.path, '.ok', 'config.yml'))).toBe(true);
- const status = await git(handle.mainRepo, 'status', '--porcelain');
- expect(status).not.toContain('.ok/worktrees');
- });
-
- test('createWorktree (-b) creates a new branch + worktree from HEAD', async () => {
- handle = await makeRepo();
- const res = await createWorktree({
- anchorPath: handle.mainRepo,
- branch: 'brand-new',
- createBranch: true,
- });
- expect(res.ok).toBe(true);
- if (!res.ok) return;
- expect(res.created).toBe(true);
- const branches = await git(handle.mainRepo, 'branch', '--list', 'brand-new');
- expect(branches).toContain('brand-new');
- });
-
- test('createWorktree returns the existing path (created:false) when the branch already has a worktree', async () => {
- handle = await makeRepo(['dev']);
- const first = await createWorktree({
- anchorPath: handle.mainRepo,
- branch: 'dev',
- createBranch: false,
- });
- expect(first.ok).toBe(true);
- const second = await createWorktree({
- anchorPath: handle.mainRepo,
- branch: 'dev',
- createBranch: false,
- });
- expect(second.ok).toBe(true);
- if (!second.ok || !first.ok) return;
- expect(second.created).toBe(false);
- expect(second.path).toBe(first.path);
- });
-
- test('createWorktree from inside a linked worktree still anchors under the MAIN root', async () => {
- handle = await makeRepo(['dev', 'other']);
- const dev = await createWorktree({
- anchorPath: handle.mainRepo,
- branch: 'dev',
- createBranch: false,
- });
- expect(dev.ok).toBe(true);
- if (!dev.ok) return;
- const other = await createWorktree({
- anchorPath: dev.path,
- branch: 'other',
- createBranch: false,
- });
- expect(other.ok).toBe(true);
- if (!other.ok) return;
- expect(other.path).toBe(join(handle.mainRepo, '.ok', 'worktrees', 'other'));
- });
-
- test('createWorktree rejects a path-escaping branch name', async () => {
- handle = await makeRepo();
- const res = await createWorktree({
- anchorPath: handle.mainRepo,
- branch: '../evil',
- createBranch: false,
- });
- expect(res.ok).toBe(false);
- if (res.ok) return;
- expect(res.reason).toBe('invalid-branch');
- });
-
- test('listWorktreeSelector on a non-git dir returns no-git', async () => {
- const tmp = realpathSync(mkdtempSync(join(tmpdir(), 'wt-svc-nogit-')));
- try {
- const res = await listWorktreeSelector(tmp, tmp);
- expect(res.ok).toBe(false);
- if (res.ok) return;
- expect(res.reason).toBe('no-git');
- } finally {
- rmSync(tmp, { recursive: true, force: true });
- }
- });
-});
diff --git a/packages/desktop/src/main/worktree-service.ts b/packages/desktop/src/main/worktree-service.ts
deleted file mode 100644
index 3a08ce33f..000000000
--- a/packages/desktop/src/main/worktree-service.ts
+++ /dev/null
@@ -1,144 +0,0 @@
-import { execFile, execFileSync } from 'node:child_process';
-import { appendFileSync, readFileSync } from 'node:fs';
-import { isAbsolute, join } from 'node:path';
-import { promisify } from 'node:util';
-import {
- buildWorktreeSelectorModel,
- parseBranchList,
- WORKTREES_PARENT_DIR,
- type WorktreeCreateRequest,
- type WorktreeCreateResult,
- type WorktreeListResult,
- worktreeRelativeDir,
-} from '@inkeep/open-knowledge-core';
-import { listGitWorktrees } from './list-git-worktrees.ts';
-
-const execFileAsync = promisify(execFile);
-
-/** English-stable git env — mirrors `list-git-worktrees.ts` so stderr
- * classification survives a non-English host locale. */
-const GIT_ENV = { ...process.env, LANG: 'C', LC_ALL: 'C' } as const;
-
-export type { WorktreeCreateResult, WorktreeListResult };
-
-export interface CreateWorktreeArgs extends WorktreeCreateRequest {
- readonly anchorPath: string;
-}
-
-export async function listWorktreeSelector(
- anchorPath: string,
- currentProjectPath: string,
-): Promise<WorktreeListResult> {
- const worktrees = await listGitWorktrees(anchorPath);
- if (worktrees.length === 0) return { ok: false, reason: 'no-git' };
- const branches = await listLocalBranches(anchorPath);
- const model = buildWorktreeSelectorModel({ worktrees, branches, currentProjectPath });
- return { ok: true, model };
-}
-
-export async function createWorktree(args: CreateWorktreeArgs): Promise<WorktreeCreateResult> {
- const rel = worktreeRelativeDir(args.branch);
- if (rel === null || !isAbsolute(args.anchorPath)) {
- return { ok: false, reason: 'invalid-branch' };
- }
-
- const worktrees = await listGitWorktrees(args.anchorPath);
- if (worktrees.length === 0) return { ok: false, reason: 'no-git' };
- const mainRoot = worktrees[0]?.path;
- if (mainRoot === undefined) return { ok: false, reason: 'no-git' };
-
- const existing = worktrees.find((w) => !w.prunable && w.branch === args.branch.trim());
- if (existing) return { ok: true, path: existing.path, created: false };
-
- const worktreePath = join(mainRoot, rel);
-
- ensureWorktreesExcluded(args.anchorPath);
-
- const addArgs = args.createBranch
- ? [
- 'worktree',
- 'add',
- '-b',
- args.branch.trim(),
- worktreePath,
- ...(args.baseBranch ? [args.baseBranch] : []),
- ]
- : ['worktree', 'add', worktreePath, args.branch.trim()];
-
- try {
- await execFileAsync('git', addArgs, { cwd: args.anchorPath, env: GIT_ENV });
- return { ok: true, path: worktreePath, created: true };
- } catch (err) {
- return { ok: false, ...classifyAddError(err) };
- }
-}
-
-async function listLocalBranches(anchorPath: string): Promise<string[]> {
- if (!isAbsolute(anchorPath)) return [];
- try {
- const { stdout } = await execFileAsync(
- 'git',
- ['for-each-ref', '--format=%(refname:short)', 'refs/heads/'],
- { cwd: anchorPath, env: GIT_ENV },
- );
- return parseBranchList(String(stdout));
- } catch {
- return [];
- }
-}
-
-function ensureWorktreesExcluded(anchorPath: string): void {
- try {
- const commonDir = execFileSyncTrim(
- 'git',
- ['rev-parse', '--path-format=absolute', '--git-common-dir'],
- anchorPath,
- );
- if (commonDir === null) return;
- const excludePath = join(commonDir, 'info', 'exclude');
- const line = `/${WORKTREES_PARENT_DIR}/`;
- let current = '';
- try {
- current = readFileSync(excludePath, 'utf-8');
- } catch {}
- if (current.split('\n').some((l) => l.trim() === line)) return;
- const prefix = current.length > 0 && !current.endsWith('\n') ? '\n' : '';
- appendFileSync(excludePath, `${prefix}${line}\n`);
- } catch {}
-}
-
-function execFileSyncTrim(cmd: string, cmdArgs: string[], cwd: string): string | null {
- try {
- return String(execFileSync(cmd, cmdArgs, { cwd, env: GIT_ENV })).trim();
- } catch {
- return null;
- }
-}
-
-interface ExecErr {
- stderr?: string | Buffer;
- message?: string;
-}
-
-interface AddErrorClassification {
- readonly reason: 'branch-exists' | 'already-checked-out' | 'path-exists' | 'error';
- readonly message?: string;
-}
-
-function classifyAddError(err: unknown): AddErrorClassification {
- const e = typeof err === 'object' && err !== null ? (err as ExecErr) : null;
- const stderrRaw = e?.stderr;
- const raw: string =
- stderrRaw !== undefined && stderrRaw !== null
- ? Buffer.isBuffer(stderrRaw)
- ? stderrRaw.toString('utf-8')
- : String(stderrRaw)
- : String(e?.message ?? err);
- const stderr = raw.toLowerCase();
- if (stderr.includes('already checked out')) return { reason: 'already-checked-out' };
- if (stderr.includes('already exists') && stderr.includes('branch')) {
- return { reason: 'branch-exists' };
- }
- if (stderr.includes('already exists')) return { reason: 'path-exists' };
- return { reason: 'error', message: raw.replace(/\s+/g, ' ').slice(0, 300) };
-}
diff --git a/packages/desktop/src/preload/index.ts b/packages/desktop/src/preload/index.ts
index b3e0ded37..894211e91 100644
--- a/packages/desktop/src/preload/index.ts
+++ b/packages/desktop/src/preload/index.ts
@@ -1,8 +1,3 @@
-import type {
- WorktreeCreateRequest,
- WorktreeCreateResult,
- WorktreeListResult,
-} from '@inkeep/open-knowledge-core';
import { contextBridge, type IpcRendererEvent, ipcRenderer, webUtils } from 'electron';
import type {
OkDesktopBridge,
@@ -336,15 +331,6 @@ const bridge: OkDesktopBridge = {
close: () => invoke('ok:project:close'),
},
- worktree: {
- list: () => invoke('ok:worktree:dispatch', { kind: 'list' }) as Promise<WorktreeListResult>,
- create: (request: WorktreeCreateRequest) =>
- invoke('ok:worktree:dispatch', {
- kind: 'create',
- ...request,
- }) as Promise<WorktreeCreateResult>,
- },
-
sharing: {
status: async () => {
const result = await invoke('ok:sharing:dispatch', { kind: 'status' });
diff --git a/packages/desktop/src/shared/bridge-contract.ts b/packages/desktop/src/shared/bridge-contract.ts
index c1a6d6919..e7c4a3f72 100644
--- a/packages/desktop/src/shared/bridge-contract.ts
+++ b/packages/desktop/src/shared/bridge-contract.ts
@@ -7,9 +7,6 @@ import type {
LocalOpOkInitResponse,
OkFolderState,
TerminalCli,
- WorktreeCreateRequest,
- WorktreeCreateResult,
- WorktreeListResult,
} from '@inkeep/open-knowledge-core';
export type { BridgeWorktreeEntry };
@@ -112,9 +109,7 @@ export type OkMenuAction =
| 'toggle-doc-panel'
| 'toggle-terminal'
| 'new-terminal'
- | 'kill-terminal'
- | 'new-worktree'
- | 'switch-worktree';
+ | 'kill-terminal';
type OkUnsubscribe = () => void;
@@ -592,11 +587,6 @@ export interface OkDesktopBridge {
close(): Promise<void>;
};
- worktree: {
- list(): Promise<WorktreeListResult>;
- create(request: WorktreeCreateRequest): Promise<WorktreeCreateResult>;
- };
-
sharing: {
status(): Promise<OkSharingStatusResult>;
setMode(mode: 'shared' | 'local-only'): Promise<OkSharingSetModeResult>;
diff --git a/packages/desktop/src/shared/entry-point.ts b/packages/desktop/src/shared/entry-point.ts
index 64f9ffbff..00d19d9f0 100644
--- a/packages/desktop/src/shared/entry-point.ts
+++ b/packages/desktop/src/shared/entry-point.ts
@@ -5,8 +5,7 @@ export type EntryPoint =
| 'recents'
| 'deep-link'
| 'drag-drop'
- | 'share-receive'
- | 'worktree';
+ | 'share-receive';
const ENTRY_POINT_VALUES: ReadonlySet<EntryPoint> = new Set([
'create-new',
@@ -16,7 +15,6 @@ const ENTRY_POINT_VALUES: ReadonlySet<EntryPoint> = new Set([
'deep-link',
'drag-drop',
'share-receive',
- 'worktree',
]);
export function isEntryPoint(value: unknown): value is EntryPoint {
diff --git a/packages/desktop/src/shared/ipc-channels.ts b/packages/desktop/src/shared/ipc-channels.ts
index 5cf65f7c2..e8d1b7f53 100644
--- a/packages/desktop/src/shared/ipc-channels.ts
+++ b/packages/desktop/src/shared/ipc-channels.ts
@@ -6,9 +6,6 @@ import type {
LocalOpOkInitResponse,
OkFolderState,
TerminalCli,
- WorktreeCreateRequest,
- WorktreeCreateResult,
- WorktreeListResult,
} from '@inkeep/open-knowledge-core';
import type {
FindEnclosingGitRootResult,
@@ -69,10 +66,6 @@ export interface RecentProject {
lastOpenedAt: string;
missing?: boolean;
gitRemoteUrl?: string;
- gitCommonDir?: string;
- mainRoot?: string;
- isLinkedWorktree?: boolean;
- branch?: string | null;
}
interface ProjectOpenRequest {
@@ -344,10 +337,6 @@ export interface RequestChannels {
args: [request: { projectPath: string }];
result: LocalOpOkInitResponse;
};
- 'ok:worktree:dispatch': {
- args: [request: { kind: 'list' } | ({ kind: 'create' } & WorktreeCreateRequest)];
- result: WorktreeListResult | WorktreeCreateResult;
- };
'ok:project:close': { args: []; result: undefined };
'ok:project:restart-server': { args: [projectPath: string]; result: OkServerRestartOutcome };
'ok:share:validate-folder': {
diff --git a/packages/desktop/tests/integration/ipc-channel-count-ratchet.test.ts b/packages/desktop/tests/integration/ipc-channel-count-ratchet.test.ts
index 3a5bb7feb..63579edb0 100644
--- a/packages/desktop/tests/integration/ipc-channel-count-ratchet.test.ts
+++ b/packages/desktop/tests/integration/ipc-channel-count-ratchet.test.ts
@@ -5,7 +5,7 @@ import { join } from 'node:path';
const SRC_PATH = join(__dirname, '..', '..', 'src', 'shared', 'ipc-channels.ts');
const CHANNELS_SRC = readFileSync(SRC_PATH, 'utf-8');
-const REQUEST_CHANNEL_CAP = 75;
+const REQUEST_CHANNEL_CAP = 74;
function extractInterfaceBody(src: string, interfaceName: string): string {
const re = new RegExp(`(^|\\n)export\\s+interface\\s+${interfaceName}\\s*\\{`);
diff --git a/packages/desktop/tests/integration/m1-smoke.test.ts b/packages/desktop/tests/integration/m1-smoke.test.ts
index 75dd7b604..4c2b241ae 100644
--- a/packages/desktop/tests/integration/m1-smoke.test.ts
+++ b/packages/desktop/tests/integration/m1-smoke.test.ts
@@ -439,12 +439,10 @@ describe('M1 smoke', () => {
expect(desktopMembers.size).toBeGreaterThan(0);
expect(coreMembers.size).toBeGreaterThan(0);
expect(appMembers.size).toBeGreaterThan(0);
- expect(desktopMembers.size).toBe(28);
+ expect(desktopMembers.size).toBe(26);
expect(desktopMembers).toEqual(coreMembers);
expect(desktopMembers).toEqual(appMembers);
expect(desktopMembers.has('toggle-show-hidden-files')).toBe(true);
- expect(desktopMembers.has('new-worktree')).toBe(true);
- expect(desktopMembers.has('switch-worktree')).toBe(true);
});
test('M1 invariant: EntryPoint / OkProjectEntryPoint literal-union drift catcher', async () => {
@@ -479,7 +477,7 @@ describe('M1 smoke', () => {
expect(coreMembers.size).toBeGreaterThan(0);
expect(appMembers.size).toBeGreaterThan(0);
- expect(desktopMembers.size).toBe(8);
+ expect(desktopMembers.size).toBe(7);
expect(desktopMembers).toEqual(coreMembers);
expect(desktopMembers).toEqual(appMembers);
diff --git a/packages/desktop/tests/main/menu.test.ts b/packages/desktop/tests/main/menu.test.ts
index e2eb34089..2f155b956 100644
--- a/packages/desktop/tests/main/menu.test.ts
+++ b/packages/desktop/tests/main/menu.test.ts
@@ -157,32 +157,6 @@ describe('buildMenuTemplate', () => {
expect(findByLabel(template, 'New Project…')).toBeUndefined();
});
- describe('Worktree items (SPEC: worktree = window)', () => {
- test('New worktree… / Switch worktree… are disabled when their deps are unwired', () => {
- const template = buildMenuTemplate(makeDeps());
- expect(findByLabel(template, 'New worktree…')?.enabled).toBe(false);
- expect(findByLabel(template, 'Switch worktree…')?.enabled).toBe(false);
- });
-
- test('New worktree… click dispatches deps.onNewWorktree()', () => {
- const onNewWorktree = mock(() => {});
- const template = buildMenuTemplate(makeDeps({ onNewWorktree }));
- const item = findByLabel(template, 'New worktree…');
- expect(item?.enabled).toBe(true);
- (item?.click as () => void)?.();
- expect(onNewWorktree).toHaveBeenCalledTimes(1);
- });
-
- test('Switch worktree… click dispatches deps.onSwitchWorktree()', () => {
- const onSwitchWorktree = mock(() => {});
- const template = buildMenuTemplate(makeDeps({ onSwitchWorktree }));
- const item = findByLabel(template, 'Switch worktree…');
- expect(item?.enabled).toBe(true);
- (item?.click as () => void)?.();
- expect(onSwitchWorktree).toHaveBeenCalledTimes(1);
- });
- });
-
test('top-level menus include File / Edit / View / Terminal / Window / Help', () => {
const template = buildMenuTemplate(makeDeps());
const topLabels = template.map((t) => t.label);