Max versions shown (#83)

This commit is contained in:
Will Chen
2025-05-05 14:29:06 -07:00
committed by GitHub
parent 43cf62a93c
commit a720e0073d
2 changed files with 5 additions and 2 deletions

View File

@@ -52,6 +52,8 @@ export function ChatHeader({
navigate({ to: "/" });
}
};
// TODO: KEEP UP TO DATE WITH app_handlers.ts
const versionPostfix = versions.length === 10_000 ? `+` : "";
return (
<div className="@container flex items-center justify-between py-1.5">
<div className="flex items-center space-x-2">
@@ -69,7 +71,7 @@ export function ChatHeader({
className="hidden @6xs:flex cursor-pointer items-center gap-1 text-sm px-2 py-1 rounded-md"
>
<History size={16} />
{loading ? "..." : `Version ${versions.length}`}
{loading ? "..." : `Version ${versions.length}${versionPostfix}`}
</Button>
</div>

View File

@@ -474,7 +474,8 @@ export function registerAppHandlers() {
const commits = await git.log({
fs,
dir: appPath,
depth: 1000, // Limit to last 1000 commits for performance
// KEEP UP TO DATE WITH ChatHeader.tsx
depth: 10_000, // Limit to last 10_000 commits for performance
});
return commits.map((commit) => ({