Unverified 提交 a720e007 authored 作者: Will Chen's avatar Will Chen 提交者: GitHub

Max versions shown (#83)

上级 43cf62a9
...@@ -52,6 +52,8 @@ export function ChatHeader({ ...@@ -52,6 +52,8 @@ export function ChatHeader({
navigate({ to: "/" }); navigate({ to: "/" });
} }
}; };
// TODO: KEEP UP TO DATE WITH app_handlers.ts
const versionPostfix = versions.length === 10_000 ? `+` : "";
return ( return (
<div className="@container flex items-center justify-between py-1.5"> <div className="@container flex items-center justify-between py-1.5">
<div className="flex items-center space-x-2"> <div className="flex items-center space-x-2">
...@@ -69,7 +71,7 @@ export function ChatHeader({ ...@@ -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" className="hidden @6xs:flex cursor-pointer items-center gap-1 text-sm px-2 py-1 rounded-md"
> >
<History size={16} /> <History size={16} />
{loading ? "..." : `Version ${versions.length}`} {loading ? "..." : `Version ${versions.length}${versionPostfix}`}
</Button> </Button>
</div> </div>
......
...@@ -474,7 +474,8 @@ export function registerAppHandlers() { ...@@ -474,7 +474,8 @@ export function registerAppHandlers() {
const commits = await git.log({ const commits = await git.log({
fs, fs,
dir: appPath, 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) => ({ return commits.map((commit) => ({
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论