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
4 changes: 0 additions & 4 deletions apps/app/src/components/settings/settings-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ export const SETTINGS_SEARCH_INDEX: Record<
title: "Navigate to threads on creation",
keywords: ["new thread", "open", "background"],
},
{
title: "Show Git changes and Commit button",
keywords: ["pull request", "pr", "diff", "composer"],
},
{
title: "Default thread followup behavior",
keywords: ["enter", "steer", "queue", "follow-up"],
Expand Down
16 changes: 8 additions & 8 deletions apps/app/src/hooks/mutations/settings-mutations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,29 +198,29 @@ describe("general settings mutation", () => {
.mockReturnValueOnce(secondWrite.promise);
const save = generalSettingsSave(queryClient);

const firstSave = save.mutate({ showGitChanges: false });
const firstSave = save.mutate({ summarizeShellCommands: false });
const secondSave = save.mutate({ confirmThreadArchive: false });
await vi.waitFor(() =>
expect(
queryClient.getQueryData<SystemConfigResponse>(configKey)
?.generalSettings,
).toMatchObject({ showGitChanges: false, confirmThreadArchive: false }),
).toMatchObject({ summarizeShellCommands: false, confirmThreadArchive: false }),
);
expect(sdk.system.updateGeneralSettings).toHaveBeenCalledOnce();

firstWrite.resolve({ ...defaultAppSettings, showGitChanges: false });
firstWrite.resolve({ ...defaultAppSettings, summarizeShellCommands: false });
await firstSave;
await vi.waitFor(() =>
expect(sdk.system.updateGeneralSettings).toHaveBeenCalledTimes(2),
);
expect(queryClient.getQueryState(configKey)?.isInvalidated).toBe(false);
expect(
vi.mocked(sdk.system.updateGeneralSettings).mock.calls[1]?.[0],
).toMatchObject({ showGitChanges: false, confirmThreadArchive: false });
).toMatchObject({ summarizeShellCommands: false, confirmThreadArchive: false });

secondWrite.resolve({
...defaultAppSettings,
showGitChanges: false,
summarizeShellCommands: false,
confirmThreadArchive: false,
});
await secondSave;
Expand All @@ -237,7 +237,7 @@ describe("general settings mutation", () => {
.mockReturnValueOnce(new Promise(() => {}));
const save = generalSettingsSave(queryClient);

const firstSave = save.mutate({ showGitChanges: false });
const firstSave = save.mutate({ summarizeShellCommands: false });
void save.mutate({ confirmThreadArchive: false });
await vi.waitFor(() =>
expect(
Expand All @@ -254,10 +254,10 @@ describe("general settings mutation", () => {
expect(
queryClient.getQueryData<SystemConfigResponse>(configKey)
?.generalSettings,
).toMatchObject({ showGitChanges: true, confirmThreadArchive: false });
).toMatchObject({ summarizeShellCommands: true, confirmThreadArchive: false });
expect(
vi.mocked(sdk.system.updateGeneralSettings).mock.calls[1]?.[0],
).toMatchObject({ showGitChanges: true, confirmThreadArchive: false });
).toMatchObject({ summarizeShellCommands: true, confirmThreadArchive: false });
});

it("drops cached model catalogs when streamer mode flips", async () => {
Expand Down
2 changes: 0 additions & 2 deletions apps/app/src/views/SettingsView.branch-prefix.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ function renderSection(overrides?: {
}) {
return render(
<GeneralSettingsSection
showGitChanges={true}
onShowGitChangesChange={vi.fn()}
confirmThreadArchive={true}
onConfirmThreadArchiveChange={vi.fn()}
keepHistoryAfterContextClear={false}
Expand Down
5 changes: 0 additions & 5 deletions apps/app/src/views/SettingsView.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ function useSettingsStoryState() {
const [keepHistoryAfterContextClear, setKeepHistoryAfterContextClear] =
useState(false);
const [summarizeShellCommands, setSummarizeShellCommands] = useState(true);
const [showGitChanges, setShowGitChanges] = useState(true);
const [streamerMode, setStreamerMode] = useState(false);
const [telemetryEnabled, setTelemetryEnabled] = useState(true);
const [managedBranchPrefix, setManagedBranchPrefix] = useState(
Expand All @@ -150,8 +149,6 @@ function useSettingsStoryState() {
openLinksInAppBrowser,
rewriteLocalhostLinks,
steerActiveThreadOnEnter,
showGitChanges,
setShowGitChanges,
confirmThreadArchive,
setConfirmThreadArchive,
keepHistoryAfterContextClear,
Expand Down Expand Up @@ -203,8 +200,6 @@ function GeneralSettingsStory({
return (
<>
<GeneralSettingsSection
showGitChanges={state.showGitChanges}
onShowGitChangesChange={state.setShowGitChanges}
confirmThreadArchive={state.confirmThreadArchive}
onConfirmThreadArchiveChange={state.setConfirmThreadArchive}
keepHistoryAfterContextClear={state.keepHistoryAfterContextClear}
Expand Down
22 changes: 0 additions & 22 deletions apps/app/src/views/SettingsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,6 @@ interface AppearanceSettingsSectionProps {
}

interface GeneralSettingsSectionProps {
showGitChanges: boolean;
onShowGitChangesChange: (enabled: boolean) => void;
confirmThreadArchive: boolean;
onConfirmThreadArchiveChange: (enabled: boolean) => void;
keepHistoryAfterContextClear: boolean;
Expand Down Expand Up @@ -861,8 +859,6 @@ export function AppearanceSettingsSection({
}

export function GeneralSettingsSection({
showGitChanges,
onShowGitChangesChange,
confirmThreadArchive,
onConfirmThreadArchiveChange,
keepHistoryAfterContextClear,
Expand Down Expand Up @@ -902,18 +898,6 @@ export function GeneralSettingsSection({
/>
</SettingsWithControl>

<SettingsWithControl
label="Show Git changes and Commit button"
description="Show Git and PR controls above the composer, and Commit in the header."
>
<Switch
checked={showGitChanges}
disabled={generalSettingsDisabled}
onCheckedChange={onShowGitChangesChange}
aria-label="Show Git changes and Commit button"
/>
</SettingsWithControl>

<SettingsWithControl
label={FOLLOW_UP_BEHAVIOR_SETTING_LABEL}
description="What Enter does in the prompt box while the thread runs."
Expand Down Expand Up @@ -1444,12 +1428,6 @@ export function SettingsView() {
content = (
<>
<GeneralSettingsSection
showGitChanges={generalSettings.showGitChanges}
onShowGitChangesChange={(enabled) =>
updateGeneralSettingsMutation.mutate({
showGitChanges: enabled,
})
}
confirmThreadArchive={generalSettings.confirmThreadArchive}
onConfirmThreadArchiveChange={(enabled) =>
updateGeneralSettingsMutation.mutate({
Expand Down
4 changes: 1 addition & 3 deletions apps/app/src/views/thread-detail/ThreadDetailView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1630,8 +1630,6 @@ function ThreadDetailViewInternal(
},
}))
: [];
const showGitChanges =
systemConfigQuery.data?.generalSettings.showGitChanges ?? false;
const threadActionTarget = toThreadActionTarget(
thread,
isThreadOnReusableEnvironment && thread.environmentId !== null
Expand Down Expand Up @@ -1730,7 +1728,7 @@ function ThreadDetailViewInternal(
composer={{
environmentCheckout: threadCheckoutDisplay,
environmentChrome: composerEnvironmentChrome,
contextEnvironmentId: showGitChanges ? threadEnvironmentId : null,
contextEnvironmentId: threadEnvironmentId,
onCreateNewThreadInEnvironment,
onOpenThreadInfo: openThreadInfo,
permissionPolicy: "editable",
Expand Down
1 change: 0 additions & 1 deletion apps/server/src/routes/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@ export function registerSystemRoutes(
telemetryEnabled: settings.telemetryEnabled ?? current.telemetryEnabled,
terminalCopyOnSelect:
settings.terminalCopyOnSelect ?? current.terminalCopyOnSelect,
showGitChanges: settings.showGitChanges ?? current.showGitChanges,
keepHistoryAfterContextClear:
settings.keepHistoryAfterContextClear ??
current.keepHistoryAfterContextClear,
Expand Down
1 change: 0 additions & 1 deletion apps/server/test/system/general-settings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,6 @@ it("preserves telemetry opt-out when older clients update other settings", async

it.each([
"confirmThreadArchive",
"showGitChanges",
"summarizeShellCommands",
] as const)(
"persists %s opt-out and preserves it for older clients",
Expand Down
3 changes: 1 addition & 2 deletions docs/api_to_audit.md
Original file line number Diff line number Diff line change
Expand Up @@ -3776,9 +3776,8 @@ own value, so plugins built against the old constant keep working.
## Thread context segments (`app.slots.experimental_threadContextSegment` / `experimental_THREAD_CONTEXT_SEGMENT_GROUPS`)

- **Surface:** `PluginAppSlots.experimental_threadContextSegment`, `PluginSdkApp.experimental_THREAD_CONTEXT_SEGMENT_GROUPS`, `ExperimentalThreadContextSegmentRegistration`, `ExperimentalThreadContextSegmentProps`, `ExperimentalThreadContextSegmentInput`, `ExperimentalThreadContextSegmentReference` and `ExperimentalThreadEnvironment` (also used by `ExperimentalThreadInfoProps.environment`).
- **Behavior:** a registration is `{ id, title, group, order?, summary, action?, details?, useVisible? }`. Segments share the context row above an existing thread's composer, and the host mounts each component in its own crash boundary: `summary` in the row (wrapped in a group named by `title`), `action` at the row's end after every summary, and `details` below the row. Segments sort like Info rows and thread actions: by `group` (string compare), then `order` within it (unset last), then registration order, core first on a tie. Core's groups are `experimental_THREAD_CONTEXT_SEGMENT_GROUPS`: `thread` (`1_thread`: parent thread) and `git` (`3_git`: changed files). The constant names only groups core renders; a plugin names its own group, placed where its string sorts. Each entry of `segments` is `{ key, pluginId }` with `key` `<pluginId>/<id>`, the key shape thread actions use; core's segments use `bb--core`. `useVisible(input)` runs in plugin scope per thread; false, or a crash, leaves the segment out of the row and of `segments`. Props carry `threadId`, `projectId`, `environment`, the visible `segments` in row order, and the shared disclosure state: one segment of the row is expanded at a time, keyed by `key`. `environment` is `{ id }`, or null when the thread has no environment, its host is not active, the environment is not a usable checkout, or the user turned off "Show Git changes and Commit button". The row is withheld while core's workspace status loads and while a question is pending, and read-only history (archived thread or gone environment) shows core's parent thread only. The banner renders under every composer plugin, because the host draws it above `ComposerBox`.
- **Behavior:** a registration is `{ id, title, group, order?, summary, action?, details?, useVisible? }`. Segments share the context row above an existing thread's composer, and the host mounts each component in its own crash boundary: `summary` in the row (wrapped in a group named by `title`), `action` at the row's end after every summary, and `details` below the row. Segments sort like Info rows and thread actions: by `group` (string compare), then `order` within it (unset last), then registration order, core first on a tie. Core's groups are `experimental_THREAD_CONTEXT_SEGMENT_GROUPS`: `thread` (`1_thread`: parent thread) and `git` (`3_git`: changed files). The constant names only groups core renders; a plugin names its own group, placed where its string sorts. Each entry of `segments` is `{ key, pluginId }` with `key` `<pluginId>/<id>`, the key shape thread actions use; core's segments use `bb--core`. `useVisible(input)` runs in plugin scope per thread; false, or a crash, leaves the segment out of the row and of `segments`. Props carry `threadId`, `projectId`, `environment`, the visible `segments` in row order, and the shared disclosure state: one segment of the row is expanded at a time, keyed by `key`. `environment` is `{ id }`, or null when the thread has no environment, its host is not active, or the environment is not a usable checkout. The row is withheld while core's workspace status loads and while a question is pending, and read-only history (archived thread or gone environment) shows core's parent thread only. The banner renders under every composer plugin, because the host draws it above `ComposerBox`.
- **Core callers:** `ThreadPromptContextBanner` (`apps/app/src/components/promptbox/banner/ThreadPromptContextBanner.tsx`) registers the parent thread (summary and details, including read-only history) and changed files (summary, merge-base action, details) through `definePluginApp` and the same collector, and renders them with plugin registrations through `useThreadContextSegments` and `ThreadContextSegmentMount` (`apps/app/src/components/plugin/PluginThreadContextSegments.tsx`). Core segments read pane-local data from a React context and render without a plugin crash boundary, as core Info rows do. The GitHub PR Status plugin registers the pull request segment in its own group `2_pullRequest`, between core's two and its Mark ready and merge actions. Active child threads are a separate core row above the context row (`ThreadChildThreadsBanner`), not a segment. Contract tests: `ThreadPromptContextBanner.segments.test.tsx`.
- **Known coupling:** `environment` folds in the "Show Git changes and Commit button" setting so the pull request segment hides with core's changed files, as before; that setting should become the git plugin's own when changed files move out of core.
- **Stabilization:** audit per-component mounts and crash recovery across reloads and plugin disable, `segments` stability while visibility settles, focus handoff between a plugin's summary and details, independent panes, and compact widths with several plugin segments. Then rename project-wide and remove this entry.

## Provider skills index
Expand Down
Loading
Loading