- Detect and route jj repositories alongside git - Thread VCS kind through status and UI labels - Add jj driver contract coverage and shared freshness helper
Showing the changes to apps/web/src/components/chat (1 of 30 files). Show all
Unified · Split
| @@ -17,6 +17,8 @@ import { Toggle } from "../ui/toggle"; · 16 unmodified lines | |||
| 17 | import { SidebarTrigger } from "../ui/sidebar"; | 17 | import { SidebarTrigger } from "../ui/sidebar"; |
| 18 | import { OpenInPicker } from "./OpenInPicker"; | 18 | import { OpenInPicker } from "./OpenInPicker"; |
| 19 | import { usePrimaryEnvironmentId } from "../../environments/primary"; | 19 | import { usePrimaryEnvironmentId } from "../../environments/primary"; |
| 20 | import { resolveVcsTerms } from "../../vcsPresentation"; | ||
| 21 | import type { VcsDriverKind } from "@t3tools/contracts"; | ||
| 20 | 22 | ||
| 21 | interface ChatHeaderProps { | 23 | interface ChatHeaderProps { |
| 22 | activeThreadEnvironmentId: EnvironmentId; | 24 | activeThreadEnvironmentId: EnvironmentId; |
| @@ -24,7 +26,8 @@ interface ChatHeaderProps { · 1 unmodified line | |||
| 24 | draftId?: DraftId; | 26 | draftId?: DraftId; |
| 25 | activeThreadTitle: string; | 27 | activeThreadTitle: string; |
| 26 | activeProjectName: string | undefined; | 28 | activeProjectName: string | undefined; |
| 27 | isGitRepo: boolean; | 29 | isVcsRepo: boolean; |
| 30 | vcsKind: VcsDriverKind | null; | ||
| 28 | openInCwd: string | null; | 31 | openInCwd: string | null; |
| 29 | activeProjectScripts: ProjectScript[] | undefined; | 32 | activeProjectScripts: ProjectScript[] | undefined; |
| 30 | preferredScriptId: string | null; | 33 | preferredScriptId: string | null; |
| @@ -50,7 +53,8 @@ export const ChatHeader = memo(function ChatHeader({ · 19 unmodified lines | |||
| 50 | draftId, | 53 | draftId, |
| 51 | activeThreadTitle, | 54 | activeThreadTitle, |
| 52 | activeProjectName, | 55 | activeProjectName, |
| 53 | isGitRepo, | 56 | isVcsRepo, |
| 57 | vcsKind, | ||
| 54 | openInCwd, | 58 | openInCwd, |
| 55 | activeProjectScripts, | 59 | activeProjectScripts, |
| 56 | preferredScriptId, | 60 | preferredScriptId, |
| @@ -72,6 +76,7 @@ export const ChatHeader = memo(function ChatHeader({ · 15 unmodified lines | |||
| 72 | const primaryEnvironmentId = usePrimaryEnvironmentId(); | 76 | const primaryEnvironmentId = usePrimaryEnvironmentId(); |
| 73 | const isRemoteEnvironment = | 77 | const isRemoteEnvironment = |
| 74 | primaryEnvironmentId !== null && activeThreadEnvironmentId !== primaryEnvironmentId; | 78 | primaryEnvironmentId !== null && activeThreadEnvironmentId !== primaryEnvironmentId; |
| 79 | const vcsTerms = resolveVcsTerms(vcsKind); | ||
| 75 | 80 | ||
| 76 | return ( | 81 | return ( |
| 77 | <div className="@container/header-actions flex min-w-0 flex-1 items-center gap-2"> | 82 | <div className="@container/header-actions flex min-w-0 flex-1 items-center gap-2"> |
| @@ -88,9 +93,9 @@ export const ChatHeader = memo(function ChatHeader({ · 10 unmodified lines | |||
| 88 | <span className="min-w-0 truncate">{activeProjectName}</span> | 93 | <span className="min-w-0 truncate">{activeProjectName}</span> |
| 89 | </Badge> | 94 | </Badge> |
| 90 | )} | 95 | )} |
| 91 | {activeProjectName && !isGitRepo && ( | 96 | {activeProjectName && !isVcsRepo && ( |
| 92 | <Badge variant="outline" className="shrink-0 text-[10px] text-amber-700"> | 97 | <Badge variant="outline" className="shrink-0 text-[10px] text-amber-700"> |
| 93 | No Git | 98 | No repository |
| 94 | </Badge> | 99 | </Badge> |
| 95 | )} | 100 | )} |
| 96 | </div> | 101 | </div> |
| @@ -154,15 +159,15 @@ export const ChatHeader = memo(function ChatHeader({ · 57 unmodified lines | |||
| 154 | aria-label="Toggle diff panel" | 159 | aria-label="Toggle diff panel" |
| 155 | variant="outline" | 160 | variant="outline" |
| 156 | size="xs" | 161 | size="xs" |
| 157 | disabled={!isGitRepo && !diffOpen} | 162 | disabled={!isVcsRepo && !diffOpen} |
| 158 | > | 163 | > |
| 159 | <DiffIcon className="size-3" /> | 164 | <DiffIcon className="size-3" /> |
| 160 | </Toggle> | 165 | </Toggle> |
| 161 | } | 166 | } |
| 162 | /> | 167 | /> |
| 163 | <TooltipPopup side="bottom"> | 168 | <TooltipPopup side="bottom"> |
| 164 | {!isGitRepo && !diffOpen | 169 | {!isVcsRepo && !diffOpen |
| 165 | ? "Diff panel is unavailable because this project is not a git repository." | 170 | ? `Diff panel is unavailable because this project is not a supported ${vcsTerms.repositoryNoun}.` |
| 166 | : diffToggleShortcutLabel | 171 | : diffToggleShortcutLabel |
| 167 | ? `Toggle diff panel (${diffToggleShortcutLabel})` | 172 | ? `Toggle diff panel (${diffToggleShortcutLabel})` |
| 168 | : "Toggle diff panel"} | 173 | : "Toggle diff panel"} |