Skip to content

Commit ca11485

Browse files
feat(web): add skeleton to LatestCommitInfo while loading
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f006651 commit ca11485

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

packages/web/src/app/(app)/browse/components/latestCommitInfo.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ import { isServiceError } from "@/lib/utils";
88
import { useBrowseParams } from "../hooks/useBrowseParams";
99
import { formatAuthorsText, getCommitAuthors } from "./commitAuthors";
1010
import { AuthorsAvatarGroup } from "./commitParts";
11+
import { Skeleton } from "@/components/ui/skeleton";
1112

1213
export const LatestCommitInfo = () => {
1314
const { repoName, revisionName, path } = useBrowseParams();
1415

15-
const { data: commit } = useQuery({
16+
const { data: commit, isPending } = useQuery({
1617
queryKey: ['latestCommitInfo', repoName, revisionName ?? null, path],
1718
queryFn: async () => {
1819
const result = await listCommits({
@@ -34,6 +35,17 @@ export const LatestCommitInfo = () => {
3435
[commit],
3536
);
3637

38+
if (isPending) {
39+
return (
40+
<div className="flex flex-row items-center gap-2 min-w-0 overflow-hidden">
41+
<Skeleton className="h-5 w-5 rounded-full" />
42+
<Skeleton className="h-4 w-24 flex-shrink-0" />
43+
<Skeleton className="h-4 w-64 max-w-full" />
44+
<Skeleton className="h-4 w-20 flex-shrink-0" />
45+
</div>
46+
);
47+
}
48+
3749
if (!commit) {
3850
return null;
3951
}

0 commit comments

Comments
 (0)