Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 8 additions & 37 deletions apps/app/.ladle/story-fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ import type {
TypeaheadConfig,
} from "../src/components/promptbox/ComposerBox";
import type { WorkspaceStatus } from "bb-plugin-bb--git/contract";
import {
makeWorkspaceMergeBase,
makeWorkspaceStatus as makeGitWorkspaceStatus,
} from "bb-plugin-bb--git/testing";

const noop = () => {};

Expand Down Expand Up @@ -603,16 +607,7 @@ export function makeEnvironment(
export function makeWorkspaceStatus(
overrides: Partial<WorkspaceStatus> = {},
): WorkspaceStatus {
const base: Omit<WorkspaceStatus, "allChanges"> = {
workingTree: {
hasUncommittedChanges: false,
state: "clean",
insertions: 0,
deletions: 0,
lineStatsComplete: true,
fileCount: 0,
files: [],
},
return makeGitWorkspaceStatus({
branch: {
currentBranch: BRANCH_NAMES.feature,
defaultBranch: BRANCH_NAMES.default,
Expand All @@ -622,34 +617,10 @@ export function makeWorkspaceStatus(
branchName: BRANCH_NAMES.feature,
headSha: null,
},
mergeBase: {
mergeBase: makeWorkspaceMergeBase({
mergeBaseBranch: BRANCH_NAMES.default,
baseRef: null,
aheadCount: 0,
behindCount: 0,
squashMergeCheckComplete: true,
hasCommittedUnmergedChanges: false,
commits: [],
insertions: 0,
deletions: 0,
lineStatsComplete: true,
fileCount: 0,
files: [],
},
};
const workingTree = overrides.workingTree ?? base.workingTree;
const mergeBase =
overrides.mergeBase === undefined ? base.mergeBase : overrides.mergeBase;
const committed = mergeBase?.hasCommittedUnmergedChanges ? mergeBase : null;
return {
...base,
allChanges: {
insertions: workingTree.insertions + (committed?.insertions ?? 0),
deletions: workingTree.deletions + (committed?.deletions ?? 0),
lineStatsComplete:
workingTree.lineStatsComplete && (committed?.lineStatsComplete ?? true),
fileCount: workingTree.fileCount + (committed?.fileCount ?? 0),
},
}),
...overrides,
};
});
}
2 changes: 1 addition & 1 deletion apps/app/bundle-budget.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"NewThreadPage decide how slow bb feels on a phone after boot. Their",
"forbiddenPackages are the diff engine, math, file tree and terminal code",
"that only a user action needs.",
"The composer (tiptap/prosemirror) is visible on both pages and is allowed.",
"The composer is the bundled Composer plugin, so core ships no tiptap.",
"Run `node scripts/why-eager.mjs --from=views/SplitWorkspaceRoute.tsx <package>`",
"to print the static chain that pulled a package into the route.",
"",
Expand Down
13 changes: 2 additions & 11 deletions apps/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,6 @@
"@radix-ui/react-tooltip": "^1.2.12",
"@tanstack/react-query": "^5.62.0",
"@tanstack/react-virtual": "3.14.20",
"@tiptap/core": "^3.26.0",
"@tiptap/extension-blockquote": "^3.26.0",
"@tiptap/extension-document": "^3.26.0",
"@tiptap/extension-hard-break": "^3.26.0",
"@tiptap/extension-mention": "^3.26.0",
"@tiptap/extension-paragraph": "^3.26.0",
"@tiptap/extension-text": "^3.26.0",
"@tiptap/extensions": "^3.26.0",
"@tiptap/pm": "^3.26.0",
"@tiptap/react": "^3.26.0",
"@tiptap/suggestion": "^3.26.0",
"@xterm/addon-fit": "0.12.0-beta.292",
"@xterm/addon-search": "0.17.0-beta.292",
"@xterm/addon-unicode11": "^0.9.0",
Expand Down Expand Up @@ -115,6 +104,8 @@
"@rolldown/plugin-babel": "^0.2.3",
"@tailwindcss/vite": "^4.3.0",
"@testing-library/react": "^16.3.2",
"@tiptap/core": "^3.26.0",
"@tiptap/pm": "^3.26.0",
"@types/cacache": "^20.0.1",
"@types/mdast": "^4.0.4",
"@types/node": "^22.0.0",
Expand Down
4 changes: 2 additions & 2 deletions apps/app/src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@

/*
* Light up the `ultracode` keyword in the prompt editor with animated purple
* sparkles (mirrors Claude Code). The wrapping span is added as a ProseMirror
* inline decoration (see prompt-ultracode-highlight-extension.ts); it stays
* sparkles (mirrors Claude Code). The wrapping span is added by the host's
* composer decoration source (see composer-decorations.ts); it stays
* editable text, so this is paint-only. `background-clip: text` shimmers a
* purple gradient through the glyphs, and two pseudo-element glints twinkle at
* opposite corners. `prefers-reduced-motion` keeps the purple, drops motion.
Expand Down
6 changes: 3 additions & 3 deletions apps/app/src/components/promptbox/ComposerBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import type {
} from "@get-bb/plugin-sdk";
import type { ThreadResponse } from "@bb/server-contract";
import {
composerDraftFromPromptDraft,
DEFAULT_PLUGIN_MENTION_TRIGGER,
promptDraftFromComposerDraft,
type PromptDraftAttachment,
Expand Down Expand Up @@ -94,6 +93,7 @@ import {
usePluginFrontendLoadFailed,
usePluginFrontendsSettled,
} from "@/lib/plugin-frontend-boot-state";
import { composerDraftFromPromptDraft } from "@/lib/plugin-composer-handle";
import { schedulePluginFrontendReconcile } from "@/lib/plugin-frontend-lazy";
import { useComposerInputLock } from "@/lib/plugin-sdk-hooks";
import { sdk } from "@/lib/sdk";
Expand Down Expand Up @@ -196,6 +196,7 @@ export type ComposerBoxProps = Omit<
| "resolveMentionLink"
| "attachments"
| "history"
| "maxHeight"
> & {
typeahead: TypeaheadConfig;
attachments?: AttachmentsConfig;
Expand Down Expand Up @@ -497,8 +498,7 @@ function useComposerRendererHostApi({
const queryClient = useContext(QueryClientContext);
const reportTypeaheadLayout = useContext(QueuedEditorTypeaheadLayoutContext);
const isFocusedPane = useOptionalPaneContext()?.isFocused ?? true;
const availableMaxHeight = useContext(ComposerMaxHeightContext);
const maxHeight = input.maxHeight ?? availableMaxHeight;
const maxHeight = useContext(ComposerMaxHeightContext);

const decorationSources = composerDecorationSources(
resolvedEditor.effects,
Expand Down
63 changes: 0 additions & 63 deletions apps/app/src/hooks/mutations/environment-mutations.ts

This file was deleted.

2 changes: 0 additions & 2 deletions apps/app/src/hooks/useCommandSuggestions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export type CommandSuggestionSource = Omit<
>;

interface UseCommandSuggestionsResult {
triggers: readonly PromptMentionCommandTrigger[];
suggestions: ProviderCommandSuggestion[];
isLoading: boolean;
isRefreshing: boolean;
Expand Down Expand Up @@ -234,7 +233,6 @@ export function useCommandSuggestions(
const isError = isActive && commandsQuery.isError;

return {
triggers: args.skillsTriggers,
suggestions,
isLoading,
isRefreshing,
Expand Down
1 change: 0 additions & 1 deletion apps/app/src/lib/fixed-panel-tabs-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export {
buildFixedPanelTabId,
createThreadInfoFixedPanelTab,
createGitDiffFixedPanelTab,
isGitDiffFixedPanelTab,
migrateLegacyFixedPanelTab,
migrateLegacyFixedPanelTabId,
createPluginFixedPanelTab,
Expand Down
1 change: 0 additions & 1 deletion apps/app/src/test/fixtures/composer-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ function fakeUseCommandSuggestions(
): ReturnType<typeof useCommandSuggestions> {
composerSearchQueries.command(args.query, args.activeTrigger);
return {
triggers: args.skillsTriggers,
suggestions: [...state.commandSuggestions],
isLoading: false,
isRefreshing: false,
Expand Down
5 changes: 1 addition & 4 deletions apps/app/src/views/thread-detail/ThreadDetailView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ import {
usePluginDetailTabOpener,
} from "@/components/plugin/plugin-detail-navigation";
import { useForkThreadFromMessage } from "@/hooks/useForkThreadFromMessage";
import { useUpdateEnvironment } from "../../hooks/mutations/environment-mutations";
import { useUpdateThread } from "../../hooks/mutations/thread-state-mutations";
import { useEnvironment } from "../../hooks/queries/environment-queries";
import {
Expand Down Expand Up @@ -545,7 +544,6 @@ function ThreadDetailViewInternal(
threadId,
enabled: timelineEnabled,
});
const updateEnvironment = useUpdateEnvironment();
const updateThread = useUpdateThread({
errorMessage: "Failed to assign parent thread.",
});
Expand Down Expand Up @@ -1764,8 +1762,7 @@ function ThreadDetailViewInternal(
environmentProvisioningFailure,
environmentDisplayHost: environmentDisplayHostContext,
threadEnvironmentId: threadTabEnvironmentId,
updateThreadPending:
updateThread.isPending || updateEnvironment.isPending,
updateThreadPending: updateThread.isPending,
storage: metadataStorage,
onAssignParent: handleAssignParent,
onParentSelectorOpenChange: handleParentSelectorOpenChange,
Expand Down
8 changes: 3 additions & 5 deletions apps/host-daemon/src/command-handlers/host-branches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@ import {
} from "bb-environment-provider-host/branch-options";
import {
detectGitRepoKind,
readDefaultBranchRefs,
} from "bb-environment-provider-host/workspace-git";
import {
detectLinkedWorktree,
getCheckoutRef,
getWorkspaceGitOperation,
hasUncommittedChanges,
} from "@bb/host-workspace";
readDefaultBranchRefs,
} from "bb-environment-provider-host/workspace-git";
import { detectLinkedWorktree } from "@bb/host-workspace";

const NO_GIT_OPERATION: WorkspaceGitOperation = { kind: "none" };

Expand Down
7 changes: 4 additions & 3 deletions docs/api_to_audit.md
Original file line number Diff line number Diff line change
Expand Up @@ -3225,9 +3225,10 @@ hook on the initial attempt as an `experimental_submission` envelope carrying
the submitting plugin's id. Core validates the data as JSON but neither
persists nor interprets it.

There is one implementation. `PromptBoxInternal` publishes `submit` on the
composer editor bridge; it picks Enter's handler, the queue handler or the
steer handler and gates it exactly as the matching shortcut is gated, then
There is one implementation. The host's `ComposerBox` publishes `submit` on
the composer editor bridge for every composer plugin; it picks Enter's handler,
the queue handler or the steer handler and gates it exactly as the matching
shortcut is gated, then
calls the same `onSubmit` or `onModifierSubmit` the shortcuts and the send
button call, passing `sendAt` and the plugin submission. Only hosts that set
`sendsOnEnter` (the thread, embedded thread chat and New thread composers)
Expand Down
2 changes: 1 addition & 1 deletion docs/vcs-process-admission.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ use background priority. Git status and diff reads run in the Git plugin's
host entry, which has its own budget in the plugin host worker and keeps those
priorities. The CLI and SDK reach the same reads through the Git plugin.
The daemon's `workspace.status`, `workspace.diff`, `workspace.diffFiles` and
`workspace.diffPatch` commands are gone (`HOST_DAEMON_PROTOCOL_VERSION` 252);
`workspace.diffPatch` commands are gone (`HOST_DAEMON_PROTOCOL_VERSION` 255);
no user configuration changed. The Plugin Guide lists
`experimental_runVcsProcess` for plugins that spawn their own git/gh commands.
10 changes: 0 additions & 10 deletions packages/client-core/src/panel/fixed-panel-tabs-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -593,16 +593,6 @@ export function createGitDiffFixedPanelTab(): PluginFixedPanelTab {
});
}

export function isGitDiffFixedPanelTab(
tab: FixedPanelTab | null | undefined,
): boolean {
return (
tab?.kind === "plugin-fixed" &&
tab.pluginId === GIT_PLUGIN_ID &&
tab.tabId === "diff"
);
}

export function migrateLegacyFixedPanelTabId(id: string): string {
if (id === THREAD_INFO_TAB_ID) return createThreadInfoFixedPanelTab().id;
if (id === GIT_DIFF_TAB_ID || id === CORE_GIT_DIFF_TAB_ID) {
Expand Down
10 changes: 0 additions & 10 deletions packages/client-core/src/prompt/mentions/composer-mention.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,6 @@ export function promptTextMentionFromComposerMention(
};
}

export function composerDraftFromPromptDraft(
draft: PromptDraftState,
): ComposerDraftShape {
return {
text: draft.text,
mentions: draft.mentions.map(composerMentionFromPromptTextMention),
attachments: draft.attachments,
};
}

export function promptDraftFromComposerDraft(
draft: ComposerDraftShape,
): PromptDraftState {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ export interface OrderedMentionSuggestions {
readonly suggestions: readonly PromptMentionSuggestion[];
}

export const EMPTY_ORDERED_MENTION_SUGGESTIONS: OrderedMentionSuggestions = {
groups: [],
suggestions: [],
};

const MENTION_MATCH_RANK = {
exact: 0,
prefix: 1,
Expand Down
7 changes: 5 additions & 2 deletions packages/client-core/test/composer-mention.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { orderMentionCandidates } from "../src/prompt/mentions/mention-candidate
import { composerMentionGroupsFromOrdered } from "../src/prompt/mentions/composer-suggestions.js";
import type { PromptMentionSuggestion } from "../src/prompt/mentions/types.js";
import {
composerDraftFromPromptDraft,
composerMentionFromPromptTextMention,
composerMentionTargetFromResource,
promptDraftFromComposerDraft,
promptMentionResourceFromComposerMention,
Expand Down Expand Up @@ -54,7 +54,10 @@ describe("composer mention conversion", () => {
{ type: "localFile" as const, path: "a.txt", name: "a.txt" },
],
};
const composer = composerDraftFromPromptDraft(draft);
const composer = {
...draft,
mentions: draft.mentions.map(composerMentionFromPromptTextMention),
};
expect(composer.mentions[0]).toMatchObject({
from: 4,
to: 11,
Expand Down
Loading
Loading