Skip to content

batches: hide "Create" button on search results unless enabled

Administrator requested to merge kr/no-create-when-disabled into main

Created by: courier-new

Closes https://github.com/sourcegraph/sourcegraph/issues/40612.

Just adds an additional site settings check to only show the "Create Batch Change" button on the search results page if the instance has batch changes enabled in its configuration. Since we changed the default for the experimental flag batchChangesExecutionEnabled to true for beta, the condition to show this button was evaluating to true even if the entire instance didn't have batch changes enabled.

I could use this as an opportunity to launch into a big, pedantic lecture about how the *correct* solution is to redesign our settings matrix to not allow such impossible states (e.g. where batch changes is disabled and simultaneously server-side execution is enabled), but I don't think this is a battle anyone can reasonably fight at this point. 😅

Test plan

Manually verified:

batchChanges.enabled experimentalFeatures.batchChangesExecution Button present?
true true
false true
true false
true unset (= true)

App preview:

Check out the client app preview documentation to learn more.

Merge request reports

Loading