- 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 | 17 | import { SidebarTrigger } from "../ui/sidebar"; |
| 18 | 18 | import { OpenInPicker } from "./OpenInPicker"; |
| 19 | 19 | import { usePrimaryEnvironmentId } from "../../environments/primary"; |
| 20 | +import { resolveVcsTerms } from "../../vcsPresentation"; | |
| 21 | +import type { VcsDriverKind } from "@t3tools/contracts"; | |
| 20 | 22 | |
| 21 | 23 | interface ChatHeaderProps { |
| 22 | 24 | activeThreadEnvironmentId: EnvironmentId; |
| @@ -24,7 +26,8 @@ interface ChatHeaderProps { · 1 unmodified line | ||
| 24 | 26 | draftId?: DraftId; |
| 25 | 27 | activeThreadTitle: string; |
| 26 | 28 | activeProjectName: string | undefined; |
| 27 | − isGitRepo: boolean; | |
| 29 | + isVcsRepo: boolean; | |
| 30 | + vcsKind: VcsDriverKind | null; | |
| 28 | 31 | openInCwd: string | null; |
| 29 | 32 | activeProjectScripts: ProjectScript[] | undefined; |
| 30 | 33 | preferredScriptId: string | null; |
| @@ -50,7 +53,8 @@ export const ChatHeader = memo(function ChatHeader({ · 19 unmodified lines | ||
| 50 | 53 | draftId, |
| 51 | 54 | activeThreadTitle, |
| 52 | 55 | activeProjectName, |
| 53 | − isGitRepo, | |
| 56 | + isVcsRepo, | |
| 57 | + vcsKind, | |
| 54 | 58 | openInCwd, |
| 55 | 59 | activeProjectScripts, |
| 56 | 60 | preferredScriptId, |
| @@ -72,6 +76,7 @@ export const ChatHeader = memo(function ChatHeader({ · 15 unmodified lines | ||
| 72 | 76 | const primaryEnvironmentId = usePrimaryEnvironmentId(); |
| 73 | 77 | const isRemoteEnvironment = |
| 74 | 78 | primaryEnvironmentId !== null && activeThreadEnvironmentId !== primaryEnvironmentId; |
| 79 | + const vcsTerms = resolveVcsTerms(vcsKind); | |
| 75 | 80 | |
| 76 | 81 | return ( |
| 77 | 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 | 93 | <span className="min-w-0 truncate">{activeProjectName}</span> |
| 89 | 94 | </Badge> |
| 90 | 95 | )} |
| 91 | − {activeProjectName && !isGitRepo && ( | |
| 96 | + {activeProjectName && !isVcsRepo && ( | |
| 92 | 97 | <Badge variant="outline" className="shrink-0 text-[10px] text-amber-700"> |
| 93 | − No Git | |
| 98 | + No repository | |
| 94 | 99 | </Badge> |
| 95 | 100 | )} |
| 96 | 101 | </div> |
| @@ -154,15 +159,15 @@ export const ChatHeader = memo(function ChatHeader({ · 57 unmodified lines | ||
| 154 | 159 | aria-label="Toggle diff panel" |
| 155 | 160 | variant="outline" |
| 156 | 161 | size="xs" |
| 157 | − disabled={!isGitRepo && !diffOpen} | |
| 162 | + disabled={!isVcsRepo && !diffOpen} | |
| 158 | 163 | > |
| 159 | 164 | <DiffIcon className="size-3" /> |
| 160 | 165 | </Toggle> |
| 161 | 166 | } |
| 162 | 167 | /> |
| 163 | 168 | <TooltipPopup side="bottom"> |
| 164 | − {!isGitRepo && !diffOpen | |
| 165 | − ? "Diff panel is unavailable because this project is not a git repository." | |
| 169 | + {!isVcsRepo && !diffOpen | |
| 170 | + ? `Diff panel is unavailable because this project is not a supported ${vcsTerms.repositoryNoun}.` | |
| 166 | 171 | : diffToggleShortcutLabel |
| 167 | 172 | ? `Toggle diff panel (${diffToggleShortcutLabel})` |
| 168 | 173 | : "Toggle diff panel"} |