+
+ {sameUsername ? (
+
{t("error.sameUser")}
+ ) : null}
+
+
+
+
diff --git a/components/home-page-client.tsx b/components/home-page-client.tsx
index 59c5917..479ae0c 100644
--- a/components/home-page-client.tsx
+++ b/components/home-page-client.tsx
@@ -228,6 +228,11 @@ export function HomePageClient() {
return inFlightPromiseRef.current;
}
+ // If we've already fetched this exact comparison and have the data, skip.
+ if (lastFetchedKeyRef.current === fetchKey && data) {
+ return Promise.resolve();
+ }
+
lastFetchedKeyRef.current = fetchKey;
const requestPromise = (async () => {
@@ -383,6 +388,14 @@ export function HomePageClient() {
const isRefreshing = loading && Boolean(displayData);
const isExiting = !loading && !data && Boolean(displayData);
+ const currentFetchKey = createFetchKey(username1.trim(), username2.trim(), {
+ selectedLanguages,
+ });
+
+ const disableDuplicateFetch = Boolean(
+ lastFetchedKeyRef.current === currentFetchKey && (data || inFlightFetchKeyRef.current === currentFetchKey),
+ );
+
const handleUsername1Change = (value: string) => {
setUsername1(value);
if (usernameErrors.username1) {
@@ -441,6 +454,7 @@ export function HomePageClient() {
reset={reset}
swapUsers={swapUsers}
hasData={Boolean(data)}
+ disableDuplicateFetch={disableDuplicateFetch}
username1Error={usernameErrors.username1}
username2Error={usernameErrors.username2}
/>
diff --git a/locales/ar.json b/locales/ar.json
index 9431ed5..c1182eb 100644
--- a/locales/ar.json
+++ b/locales/ar.json
@@ -47,6 +47,7 @@
"error.resourceLimit": "تم الوصول إلى حدود موارد GitHub API لهذا الطلب. حاول مرة أخرى بعد قليل.",
"error.missingUsername": "أدخل اسمين للمقارنة.",
"error.userNotFound": "لم يتم العثور على مستخدم GitHub",
+ "error.sameUser": "مطلوب اسمان مختلفان لمستخدمي GitHub.",
"explanations.contribution": "درجة المساهمات",
"explanations.line.contribution.1": "تعتمد درجة المساهمات على المشكلات والنقاشات الخارجية فقط.",
"explanations.line.contribution.2": "لا يتم احتساب الـ commits وطلبات السحب لتجنب العد المزدوج.",
diff --git a/locales/en.json b/locales/en.json
index 4a07471..af52421 100644
--- a/locales/en.json
+++ b/locales/en.json
@@ -47,6 +47,7 @@
"error.resourceLimit": "GitHub API resource limits were reached for this request. Please retry shortly.",
"error.missingUsername": "Provide two usernames to compare.",
"error.userNotFound": "GitHub user not found",
+ "error.sameUser": "Two different GitHub usernames are required.",
"explanations.contribution": "Contribution Score",
"explanations.line.contribution.1": "Contribution score is based on external issues and discussions only.",
"explanations.line.contribution.2": "Commits and pull requests are excluded to avoid double-counting.",
From fe81846af0dfc459b6892eb9fbe98df24ee3bc04 Mon Sep 17 00:00:00 2001
From: Osama Mabkhot <99215291+O2sa@users.noreply.github.com>
Date: Fri, 14 Aug 2026 02:16:07 +0300
Subject: [PATCH 6/6] style: enhance DashboardSkeleton layout and update
Skeleton component styles
Co-authored-by: Copilot
---
components/skeletons.tsx | 81 +++++++++++++++++++++++++++++++++-----
components/ui/skeleton.tsx | 5 ++-
2 files changed, 75 insertions(+), 11 deletions(-)
diff --git a/components/skeletons.tsx b/components/skeletons.tsx
index d6e0e7c..d33ad28 100644
--- a/components/skeletons.tsx
+++ b/components/skeletons.tsx
@@ -1,19 +1,80 @@
import { Skeleton } from "@/components/ui/skeleton";
+import { Card, CardContent, CardHeader, CardTitle } from "./ui/card";
export function DashboardSkeleton() {
return (
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
);
diff --git a/components/ui/skeleton.tsx b/components/ui/skeleton.tsx
index 0118624..8fc953e 100644
--- a/components/ui/skeleton.tsx
+++ b/components/ui/skeleton.tsx
@@ -4,7 +4,10 @@ function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
return (
)