History

Add JJ VCS driver support

- Detect and route jj repositories alongside git - Thread VCS kind through status and UI labels - Add jj driver contract coverage and shared freshness helper

Julius Marminge committed 6 months ago

Commit c31beca1 parent 128b43230 files · +838 −44Browse files

Showing the changes to apps/web/src/components/chat (1 of 30 files). Show all

Unified · Split

apps/web/src/components/chat/ChatHeader.tsx+12−7
@@ -17,6 +17,8 @@ import { Toggle } from "../ui/toggle"; · 16 unmodified lines
1717 import { SidebarTrigger } from "../ui/sidebar";
1818 import { OpenInPicker } from "./OpenInPicker";
1919 import { usePrimaryEnvironmentId } from "../../environments/primary";
20+import { resolveVcsTerms } from "../../vcsPresentation";
21+import type { VcsDriverKind } from "@t3tools/contracts";
2022
2123 interface ChatHeaderProps {
2224 activeThreadEnvironmentId: EnvironmentId;
@@ -24,7 +26,8 @@ interface ChatHeaderProps { · 1 unmodified line
2426 draftId?: DraftId;
2527 activeThreadTitle: string;
2628 activeProjectName: string | undefined;
27− isGitRepo: boolean;
29+ isVcsRepo: boolean;
30+ vcsKind: VcsDriverKind | null;
2831 openInCwd: string | null;
2932 activeProjectScripts: ProjectScript[] | undefined;
3033 preferredScriptId: string | null;
@@ -50,7 +53,8 @@ export const ChatHeader = memo(function ChatHeader({ · 19 unmodified lines
5053 draftId,
5154 activeThreadTitle,
5255 activeProjectName,
53− isGitRepo,
56+ isVcsRepo,
57+ vcsKind,
5458 openInCwd,
5559 activeProjectScripts,
5660 preferredScriptId,
@@ -72,6 +76,7 @@ export const ChatHeader = memo(function ChatHeader({ · 15 unmodified lines
7276 const primaryEnvironmentId = usePrimaryEnvironmentId();
7377 const isRemoteEnvironment =
7478 primaryEnvironmentId !== null && activeThreadEnvironmentId !== primaryEnvironmentId;
79+ const vcsTerms = resolveVcsTerms(vcsKind);
7580
7681 return (
7782 <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
8893 <span className="min-w-0 truncate">{activeProjectName}</span>
8994 </Badge>
9095 )}
91− {activeProjectName && !isGitRepo && (
96+ {activeProjectName && !isVcsRepo && (
9297 <Badge variant="outline" className="shrink-0 text-[10px] text-amber-700">
93− No Git
98+ No repository
9499 </Badge>
95100 )}
96101 </div>
@@ -154,15 +159,15 @@ export const ChatHeader = memo(function ChatHeader({ · 57 unmodified lines
154159 aria-label="Toggle diff panel"
155160 variant="outline"
156161 size="xs"
157− disabled={!isGitRepo && !diffOpen}
162+ disabled={!isVcsRepo && !diffOpen}
158163 >
159164 <DiffIcon className="size-3" />
160165 </Toggle>
161166 }
162167 />
163168 <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}.`
166171 : diffToggleShortcutLabel
167172 ? `Toggle diff panel (${diffToggleShortcutLabel})`
168173 : "Toggle diff panel"}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t