@@ -1006,7 +1006,9 @@ function ComposerCommandMenuLayer(props: { anchor: HTMLElement | null; children: |
1006 | 1006 | ); |
1007 | 1007 | } |
1008 | 1008 | import { toastManager } from "../ui/toast"; |
1009 | | -import { CircleAlertIcon, PlayIcon, ShieldIcon } from "lucide-react"; |
| 1009 | +import { Button } from "../ui/button"; |
| 1010 | +import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; |
| 1011 | +import { CircleAlertIcon, EllipsisIcon, PlayIcon, ShieldIcon } from "lucide-react"; |
1010 | 1012 | import { proposedPlanTitle } from "@t3tools/shared/proposedPlanText"; |
1011 | 1013 | import { hasProviderSetup } from "./ProviderStatusBanner"; |
1012 | 1014 | import { |
@@ -1265,7 +1267,8 @@ export interface ChatComposerProps { |
1265 | 1267 | isLocalDraftThread: boolean; |
1266 | 1268 | forceExpandedOnMobile: boolean; |
1267 | 1269 | projectSelectionRequired: boolean; |
1268 | | - |
| 1270 | + /** Present on the new-thread splash: opens the "start from PR, branch, or issue" picker. */ |
| 1271 | + onStartFrom?: () => void; |
1269 | 1272 | phase: SessionPhase; |
1270 | 1273 | canInterrupt: boolean; |
1271 | 1274 | isConnecting: boolean; |
@@ -1702,6 +1705,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps) |
1702 | 1705 | isLocalDraftThread: _isLocalDraftThread, |
1703 | 1706 | forceExpandedOnMobile, |
1704 | 1707 | projectSelectionRequired, |
| 1708 | + onStartFrom, |
1705 | 1709 | phase, |
1706 | 1710 | canInterrupt, |
1707 | 1711 | isConnecting, |
@@ -4785,6 +4789,11 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps) |
4785 | 4789 | composerSubmissionError !== null || |
4786 | 4790 | providerInputSubmissionError !== null || |
4787 | 4791 | hasImageAttachmentAttention; |
| 4792 | + const startFromShortcutLabel = onStartFrom |
| 4793 | + ? shortcutLabelForCommand(keybindings, "chat.startFrom", { |
| 4794 | + context: { terminalFocus: false, terminalOpen, modelPickerOpen: false }, |
| 4795 | + }) |
| 4796 | + : null; |
4788 | 4797 | const isComposerResting = shouldUseRestingComposerLayout({ |
4789 | 4798 | isExistingThread: routeKind === "server" && activeThreadId !== null, |
4790 | 4799 | isMobileViewport, |
@@ -6886,6 +6895,28 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps) |
6886 | 6895 | isComposerResting && "py-2 sm:py-2", |
6887 | 6896 | )} |
6888 | 6897 | > |
| 6898 | + {onStartFrom && !isComposerResting ? ( |
| 6899 | + <Tooltip> |
| 6900 | + <TooltipTrigger |
| 6901 | + render={ |
| 6902 | + <Button |
| 6903 | + type="button" |
| 6904 | + variant="ghost" |
| 6905 | + size="icon-sm" |
| 6906 | + className="absolute end-2 top-2 z-10 sm:end-2.5 sm:top-2.5" |
| 6907 | + aria-label="Start from a pull request, branch, issue, or automation" |
| 6908 | + onClick={onStartFrom} |
| 6909 | + /> |
| 6910 | + } |
| 6911 | + > |
| 6912 | + <EllipsisIcon /> |
| 6913 | + </TooltipTrigger> |
| 6914 | + <TooltipPopup> |
| 6915 | + Start from a PR, branch, issue, or automation |
| 6916 | + {startFromShortcutLabel ? ` (${startFromShortcutLabel})` : null} |
| 6917 | + </TooltipPopup> |
| 6918 | + </Tooltip> |
| 6919 | + ) : null} |
6889 | 6920 | {isStashMenuOpen && !composerMenuOpen && ( |
6890 | 6921 | <ComposerCommandMenuLayer anchor={composerMenuAnchor}> |
6891 | 6922 | <ComposerStashMenu |
@@ -7029,7 +7060,10 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps) |
7029 | 7060 | buildContextClipboardFragment={buildContextClipboardFragmentStable} |
7030 | 7061 | importContextFragment={importContextFragmentStable} |
7031 | 7062 | skills={selectedProviderSkills} |
7032 | | - containerClassName={cn(isComposerResting && "min-w-0 flex-1")} |
| 7063 | + containerClassName={cn( |
| 7064 | + isComposerResting && "min-w-0 flex-1", |
| 7065 | + onStartFrom && !isComposerResting && "pe-7", |
| 7066 | + )} |
7033 | 7067 | className={cn( |
7034 | 7068 | showMobilePendingAnswerActions && "max-sm:pb-12", |
7035 | 7069 | isComposerResting && |
|