Skip to content

feat(dashboard): disable branch creation behind flag and show deprecation banner#8890

Merged
christianalfoni merged 5 commits into
mainfrom
disable-branch-creation-flag
Jun 16, 2026
Merged

feat(dashboard): disable branch creation behind flag and show deprecation banner#8890
christianalfoni merged 5 commits into
mainfrom
disable-branch-creation-flag

Conversation

@christianalfoni

Copy link
Copy Markdown
Contributor

What

Introduces a new server-provided disableBranchCreation team feature flag and uses it to wind down the repositories/branches product:

  • Disables every "Create branch" entry point in the dashboard when the flag is on:
    • The "Create branch" button in the repository branches page header
    • The "Create branch" item in the repository context menu
    • The create-branch carousel on the Recent page (CreateBranchesRow)
  • Shows a deprecation banner on the repositories list and repository branches pages letting users know branch creation is deprecated and the repositories product will be removed on July 15th, prompting them to commit and push any branch work before then. The banner links to the migration guide.

How

Adds disableBranchCreation following the exact pattern of the existing blockRepoImport flag (added in #8873):

  • GraphQL fragments (teamFragmentDashboard, currentTeamInfoFragment) and generated types.ts
  • Exposed via the useWorkspaceFeatureFlags hook (defaults false with no active team)

The banner is a new shared RepositoryDeprecationStripe component (a warning MessageStripe), placed under the header on both repository views following the existing InstallGHAppStripe pattern. Both the disabling and the banner are gated on the same flag so the deprecation rolls out together.

Notes

  • node_modules was not installed in the working checkout, so the typechecker was not run locally. Changes follow existing patterns; MessageStripe.Action supports the as="a"/href/target/rel props used (verified against ButtonProps).

🤖 Generated with Claude Code

…tion banner

Add a disableBranchCreation team feature flag (server-provided) that:
- hides all "Create branch" entry points in the dashboard (header button,
  repository context menu, and the Recent page create-branch carousel)
- shows a deprecation banner on the repositories and repository branches
  pages noting the repositories product will be removed on July 15th and
  that users should commit and push branch work before then

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codesandbox

codesandbox Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

christianalfoni and others added 4 commits June 11, 2026 09:23
The server feature flag is block_branch_creation, which maps to
blockBranchCreation in the GraphQL schema (matching the blockRepoImport
precedent).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Hiding the UI buttons alone was not enough: createDraftBranch creates the
branch via the createBranch GraphQL mutation and then navigates to the v2
editor, which materializes the branch (POST /beta/sandboxes/github/...).
Guard the action itself so branch creation is blocked end-to-end regardless
of which entry point triggers it, surfacing a warning notification instead.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Read the GraphQL error message instead of JSON.stringify-ing the whole
error object, so a server-side block_branch_creation rejection shows a
readable message.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…tons

Rather than hiding the "Create branch" buttons, keep them clickable and
surface a deprecation modal (mirroring the banner content, close-only)
when a user attempts to create a branch.

- Add a branchCreationDeprecated modal
- createDraftBranch opens it when the blockBranchCreation flag is set, and
  also when the server rejects with extensions.code BRANCH_CREATION_DISABLED
  (the stable code from the server enforcement) as a backstop
- Revert the button-hiding in Header, RepositoryMenu and CreateBranchesRow
- Keep the dashboard deprecation banner

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@christianalfoni christianalfoni merged commit ef7dbd4 into main Jun 16, 2026
11 checks passed
@christianalfoni christianalfoni deleted the disable-branch-creation-flag branch June 16, 2026 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants