Repository navigation
Conversation
"Show Git changes and Commit button" moves from core general settings to the Git plugin (showGitChanges), and the GitHub PR Status plugin gets its own showPullRequest setting for the composer's pull request segment. Core no longer folds the setting into ExperimentalThreadEnvironment; each plugin hides its own UI. Migration 0147 copies the saved value into both plugins and retires the general-settings row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
showGitChanges now gates only the composer's changed-files segment. A new showCommitButton setting (default off for everyone) gates the Commit thread action in the header and overflow menu. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ymichael
force-pushed
the
bb/git-and-github-pr-status-plugins-own-their-show-thr_w9e5zkyr67
branch
from
October 27, 2026 23:24
20cdd5f to
47d427d
Compare
ymichael
deleted the
bb/git-and-github-pr-status-plugins-own-their-show-thr_w9e5zkyr67
branch
October 27, 2026 23:34
ymichael
added a commit
that referenced
this pull request
Nov 3, 2026
## Human comments ## What was wrong Moving the composer (#6122) and git (#6165, #6157, #6388, #6410) into plugins left dead code and duplicate implementations in core and in neighbouring plugins. An audit of those moves (thread thr_7hk642w2es) found code that could be deleted with no protocol bump, no plugin SDK change and no change in behaviour. This PR implements the audit's steps 1 (pure deletions) and 2 (consolidations). Every item was re-checked against the current code before it was deleted; the items that turned out to change behaviour are left out and listed below. ## What changed Two commits. Together they remove 643 lines net. No `HOST_DAEMON_PROTOCOL_VERSION` change, no plugin SDK change, and no CLI or config change. **Step 1: deletions (+42 / −423, net −381)** - `useUpdateEnvironment` (built but never mutated) and its always-false `isPending` read in `ThreadDetailView`. - `isGitDiffFixedPanelTab`, `EMPTY_ORDERED_MENTION_SUGGESTIONS`, the `useCommandSuggestions().triggers` field that only echoed its input, and the `maxHeight` prop on `ComposerBox`, which no caller passes (the max height comes from `ComposerMaxHeightContext`). - client-core's uncached `composerDraftFromPromptDraft`. `ComposerBox` now uses the cached apps/app copy. The history object is rebuilt on every render and drafts are compared by value, so the result is the same. - 9 unused `@tiptap/*` dependencies of `@bb/app`. `@tiptap/core` and `@tiptap/pm` become devDependencies because only `PromptBoxInternal.test.tsx` uses them. - host-workspace's porcelain v1 quoted-path parser. Its only caller is the conflict check, which reads just the two status letters. - host-workspace's copy of the checkout admission lock (it now reuses the one in `locks.ts`) and its copy of `throwIfProvisionAborted`. Also a `withGitRefMutationLock` re-export nothing imports, and `export` on helpers only used inside their own file. - Stale docs: `vcs-process-admission.md` now cites protocol 255. `api_to_audit.md` now says `ComposerBox` owns `submit`. The `app.css` comment and the `bundle-budget.json` note no longer describe the pre-plugin composer. **Step 2: consolidations (+299 / −561, net −262)** - Checkout-ref, uncommitted-changes and in-progress-operation inspection had two implementations: host-workspace (used by the daemon's `host.inspect_git_source`) and `plugins/environment-project-checkout/host/git.ts`. Both now use one implementation in `createGitQueries` (`bb-environment-provider-host/workspace-git`), and the plugin's file is deleted. Because it goes through each side's runner, the daemon keeps its default git priority and the plugin keeps `background`. Every caller already confirms a work tree before calling, so the result is identical; the daemon just runs two fewer `git rev-parse` checks per inspection. - `plugins/git/host/workspace-reads.ts` (−85): - The HEAD-to-empty-tree fallback is now generic over the result type, so the record-limited tracked diff reuses it instead of keeping its own copy. - One `rangeGitRunner`, one lstat/ENOENT helper and `sumNumstatLines` replace the inline copies. - Local copies of contract types and unused exports are gone. - Ladle's `makeWorkspaceStatus` is now built on `bb-plugin-bb--git/testing`, keeping the same defaults. **Planned items left out** - **Server-contract "unused" schemas:** not dead. They are the source of `EnvironmentDiffViewedResponse` and `EnvironmentActionApiError`, which the SDK and `public-api.ts` use. - **The `ComposerPluginActions` wrapper:** it discards any props a plugin passes at runtime. Passing `ComposerActionsSlot` directly would start honouring them. - **One-off migrations for the git-era ids (`diff.toggle`, Info section ids):** these would change behaviour. - The UI-preference transform also runs on writes (`PUT /ui-preferences` and `bb settings`). - The keybinding `PUT` stores any command id and returns the overrides read back through the read-time migration. - A one-off database migration would stop converting legacy ids written later, for example by a cached older client. - **A fake segment instead of the real Git segment in core banner tests:** those tests are the only coverage of the plugin's `ChangedFilesSegmentView` (deferred list mount, merge-base action, file buttons). A fake would drop that coverage unless the tests move into the plugin, which is relocation rather than deletion. - **Lifting the small boundary copies (`commit-errors.ts`, overflow-mode, label-class and debounce constants) into shared-ui:** each new shared-ui entry needs a 5-line `exports` block, and the copies are 1–3-line constants or helpers with a different shape, so this would add lines. - **The shared-ui workspace-status fixture:** shared-ui can't depend on the plugin's test builders, and #6935 deletes this fixture by moving its modules into plugins/git. ## How you verified - `pnpm exec turbo run typecheck lint` for `@bb/app`, `@bb/client-core`, `@bb/host-workspace`, `bb-environment-provider-host`, `@bb/host-daemon`, `bb-plugin-bb--git`, `bb-plugin-bb--composer`, `bb-plugin-environment-git-worktree` and `bb-plugin-environment-project-checkout`: all pass. - `pnpm exec turbo run test` with the same filters: every package passes after the rebase. Two `@bb/app` tests failed under a local load average of about 50 and are not caused by this PR: - `PluginSettings.test.tsx` passes when run on its own. - `lazy-plugin-renderers.cold-load.test.tsx` fails the same way on the base commit. - `pnpm exec turbo run build --filter=@bb/app` plus `check-bundle-budget.mjs`: budget OK. - `pnpm exec turbo run prepare:bundled` for the git, git-worktree and project-checkout plugins: the host bundles build with the shared helpers. - The existing `getCheckoutRef` and `getWorkspaceGitOperation` tests (bare repo, detached, unborn, merge and rebase conflicts) now run against the shared implementation and pass. > AGENT GENERATED --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
After #6388 moved Commit into the Git plugin, nothing in core needed "Show Git changes and Commit button" except one fold. Core still owned the setting in general settings (
AppSettings.showGitChanges). The Git plugin read it throughsdk.system.config().ThreadDetailViewnulled theenvironmentit hands every thread context segment when the setting was off, so the GitHub PR Status plugin's pull request segment hid along with changed files. Thedocs/api_to_audit.mdthread context segments entry called this out as a Known coupling.What changed
bb.settings.defineinplugins/git/server.tsand read withuseSettings()(plugins/git/ui/queries.ts):showGitChanges, "Show Git changes above the composer", defaulttrue. It gates the changed-files segment and its merge-base picker (useChangedFilesSegmentVisible).showCommitButton, "Show Commit button", defaultfalsefor everyone, existing users included. It gates the Commit thread action in the header and overflow menu (commit-action.ts, which drops its ownsystem.configsubscription). This is the one intended user-visible change: Commit disappears until a user turns it on. The old switch can't tell an explicittrueapart from the untouched default, so the migration doesn't copy it here.showPullRequest. Defaulttrue, labelled "Show pull request above the composer".usePullRequestSegmentVisiblereads it. When it's off, the plugin skips the PR read, just as the null environment did before. It gates only the composer's pull request segment, which is all the Git switch hid for this plugin. The Info tab's Pull request row was never gated and still isn't.ThreadDetailViewpassesthreadEnvironmentIdstraight through.ExperimentalThreadEnvironmentis no longer null because of a setting. Its SDK doc comment is updated, and the plugin SDK is bumped to 0.6.93.appSettingsSchema, its defaults and update schemas, thePUT /settings/generalmerge, the General switch (SettingsViewand stories) and its settings-search entry. Both new switches stay searchable because settings search indexes plugin settings by label and description.0147_git_and_pr_status_plugin_show_settings. This is a custom Drizzle migration generated on current main, using the same pattern as0105_provider_settings_to_plugins. It copies the savedapp_settings_values.showGitChangesinto bothbb--git/showGitChangesandbb--github-pr-status/showPullRequest(an existing plugin row wins), then deletes the old row. Users with no saved value get both plugin defaults (true), which matches the old default. Nothing is written forshowCommitButton, so it starts off.showGitChangesgets. This follows the provider-settings move: the key is deleted from the.strict()general-settings schema. APUT /api/v1/settings/generalthat still includes it gets 400{"code":"invalid_request","message":"Invalid input"}, and nothing is saved. In practice only an old client toggling the old switch, or an old CLI runningbb settings general showGitChanges …, sends it. Clients send{ ...cachedSettings, ...patch }, and after the upgrade the server's config no longer returns the key.docs/configuration.md: the general-settings row is removed and there's a new "Git and GitHub PR Status plugins" section.bb guide customizationpoints tobb plugin config bb--git set showGitChanges false,bb plugin config bb--git set showCommitButton trueandbb plugin config bb--github-pr-status set showPullRequest false.docs/api_to_audit.md(thread context segments), the environment-null-when-setting-off clause and the Known coupling bullet are gone.No server/daemon wire change.
How you verified
pnpm exec turbo run typecheck lint --filter='...[origin/main]'passes.turbo run testpasses for@bb/db(634),bb-plugin-bb--git(248),bb-plugin-bb--github-pr-status(160),@get-bb/plugin-sdk(403),@bb/domain,@bb/templatesandbb-plugin-bb-guide.@bb/server: 3688/3689. The one failure wasbuiltin-plugins.test.ts"hot-reloads a source-layout builtin server", a 40 s file-watcher timing test that ran while a dev instance was building. Re-run alone, the file passes 28/28.@bb/app: the settings, thread-detail, promptbox banner, plugin and settings-mutation tests pass (1193 across 126 files).migrate.test.ts: a savedshowGitChanges: falselands in both plugins and the core row is removed.PullRequestContextSegment.test.tsx: the segment hides whileshowPullRequestis off or loading.commit-action.test.tsx: Commit hides whileshowCommitButtonis off. It now reads plugin settings instead of mockingsystem.config.pnpm devwith a fresh data dir. The fixture was a project checkout on PR Keep the timeline pinned when content collapses for a single task #6405's branch with two uncommitted files.pnpm start:worktreewith a project on this PR's branch and two uncommitted files:showCommitButtonon, Commit appears. Turning offshowGitChangesthen hides the changed files and leaves Commit and the PR.showGitChanges=falseseeded, the realmigrate()wrotefalseto both plugin settings.PUT /api/v1/settings/generalwithshowGitChangesreturned 400invalid_request. The same payload without it returned 200.🤖 Generated with Claude Code