-
Notifications
You must be signed in to change notification settings - Fork 53
feat(drafts): Draft & Releases mode behind a per-agent flag #6851
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
aeb9b10
feat(drafts): Draft & Releases mode behind a per-agent flag
guitavano b9dc277
Merge remote-tracking branch 'origin/main' into guitavano/simplify-br…
guitavano 127fbd4
refactor(drafts): discard keeps the branch, drop GITHUB_DELETE_BRANCH
guitavano d34ca17
feat(drafts): Advanced PRs tab + branch name on hover
guitavano dbacd9f
feat(drafts): use AlertDialog for discard confirmation
guitavano 97ec1e2
feat(drafts): switch to production when enabling Draft & Releases mode
guitavano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,32 +1,88 @@ | ||
| import type { SandboxMap } from "@/sdk"; | ||
| import { BranchPicker } from "../../thread/github/branch-picker"; | ||
| import { BranchPickerLegacy } from "../../thread/github/branch-picker-legacy"; | ||
|
|
||
| interface Props { | ||
| /** Draft & Releases mode: on → the releases switcher; off → the classic | ||
| * branch/PR picker. */ | ||
| draftsMode: boolean; | ||
| virtualMcpId: string; | ||
| userLabel: string | null | undefined; | ||
| value: string | null | undefined; | ||
| onChange: (branch: string) => void; | ||
| onCreateBranch?: (branch: string) => void; | ||
| locked: boolean; | ||
| placement?: "chat" | "header"; | ||
| /** Drafts-mode only: production branch shown as "Produção". */ | ||
| baseBranch?: string | null; | ||
| /** Classic-picker only: repo scope for listing branches/PRs. */ | ||
| orgId: string; | ||
| orgSlug: string; | ||
| userId: string; | ||
| userLabel: string | null | undefined; | ||
| virtualMcpId: string; | ||
| connectionId: string | null; | ||
| owner: string; | ||
| repo: string; | ||
| sandboxMap: SandboxMap | undefined; | ||
| value: string | null | undefined; | ||
| onChange: (branch: string) => void; | ||
| onCreateBranch?: (branch: string) => void; | ||
| locked: boolean; | ||
| placement?: "chat" | "header"; | ||
| } | ||
|
|
||
| /** Thin wrapper over `BranchPicker`: a `locked` chat has a fixed branch, so any | ||
| * pick/create opens a new chat on it instead of switching (`spawnsNewChat`). */ | ||
| export function BranchPill({ locked, placement, value, ...props }: Props) { | ||
| /** Routes to the drafts switcher or the classic branch/PR picker by the | ||
| * per-agent flag. A `locked` chat has a fixed branch, so any pick/create opens | ||
| * a new chat on it instead of switching (`spawnsNewChat`). */ | ||
| export function BranchPill({ | ||
| draftsMode, | ||
| locked, | ||
| placement, | ||
| value, | ||
| virtualMcpId, | ||
| userLabel, | ||
| baseBranch, | ||
| onChange, | ||
| onCreateBranch, | ||
| orgId, | ||
| orgSlug, | ||
| userId, | ||
| connectionId, | ||
| owner, | ||
| repo, | ||
| sandboxMap, | ||
| }: Props) { | ||
| if (draftsMode) { | ||
| return ( | ||
| <BranchPicker | ||
| virtualMcpId={virtualMcpId} | ||
| userLabel={userLabel} | ||
| value={value} | ||
| baseBranch={baseBranch} | ||
| orgId={orgId} | ||
| orgSlug={orgSlug} | ||
| userId={userId} | ||
| connectionId={connectionId} | ||
| owner={owner} | ||
| repo={repo} | ||
| sandboxMap={sandboxMap} | ||
| onChange={onChange} | ||
| onCreateBranch={onCreateBranch} | ||
| spawnsNewChat={locked} | ||
| placement={placement} | ||
| /> | ||
| ); | ||
| } | ||
| return ( | ||
| <BranchPicker | ||
| {...props} | ||
| <BranchPickerLegacy | ||
| orgId={orgId} | ||
| orgSlug={orgSlug} | ||
| userId={userId} | ||
| userLabel={userLabel} | ||
| virtualMcpId={virtualMcpId} | ||
| connectionId={connectionId} | ||
| owner={owner} | ||
| repo={repo} | ||
| sandboxMap={sandboxMap} | ||
| value={value} | ||
| placement={placement} | ||
| onChange={onChange} | ||
| onCreateBranch={onCreateBranch} | ||
| spawnsNewChat={locked} | ||
| placement={placement} | ||
| /> | ||
| ); | ||
| } |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: When a web thread is pinned to an unsupported coding harness, this production branch returns the draft CTA before
hostedRuntimeBlockedis checked. Check the hosted-runtime guard before offering the CTA so coding-agent threads cannot bypass the desktop-only restriction.Prompt for AI agents