mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
feat: add Optimize Repository button to project dropdown
Single self-contained recovery action: consolidates all git pack files into one pack of every reachable object (from all branches, tags, remotes, stash, and HEAD), removes the old packs and redundant loose objects, and reports the size reduction in a toast. Shows a spinner while running. All logic (UI, gc algorithm, run state) lives in one new file; the only other change is its render line in ProjectTitleMenu, so the feature can be removed by deleting the file and that line. Safety guarantees: the repository is left completely untouched if any object fails to read during the reachability walk (an already-damaged repo can never lose history), and also if the new undeltified pack would not actually shrink the repo (isomorphic-git's packObjects does no delta compression, so repacking a server-deltified clone could otherwise grow it permanently).
This commit is contained in:
2 files changed
+347
No files matched your search
@@ -19,6 +19,7 @@ import {
|
||||
import { cn } from '@/lib/utils';
|
||||
import { useLocalStorage } from '@/hooks/useLocalStorage';
|
||||
import { useQueryClient } from '@tanstack/react-query';
|
||||
import { OptimizeRepositoryMenuItem } from '@/components/OptimizeRepositoryMenuItem';
|
||||
|
||||
interface ProjectTitleMenuProps {
|
||||
projectId: string;
|
||||
@@ -119,6 +120,8 @@ export function ProjectTitleMenu({
|
||||
Rollback
|
||||
</DropdownMenuItem>
|
||||
|
||||
<OptimizeRepositoryMenuItem projectId={projectId} disabled={isAnyLoading} />
|
||||
|
||||
<DropdownMenuItem
|
||||
onClick={onNewChat}
|
||||
disabled={isAnyLoading}
|
||||
|
||||
Reference in new issue
Block a user