From a2e27aa26d308d9517a53ecbcd81e9aeb046b56f Mon Sep 17 00:00:00 2001 From: Innei Date: Tue, 11 Nov 2025 01:50:05 +0800 Subject: [PATCH] chore(ai): remove ai window rate limit - Simplified the layout of the usage overview card for better visual clarity. - Removed the `StatCompact` component as it was no longer needed. - Adjusted the size of the `UsageProgressRing` for a more cohesive design. - Cleaned up unused variables to streamline the code. Signed-off-by: Innei --- .../usage/components/DetailedUsageModal.tsx | 83 +++++-------------- 1 file changed, 21 insertions(+), 62 deletions(-) diff --git a/apps/desktop/layer/renderer/src/modules/settings/tabs/ai/usage/components/DetailedUsageModal.tsx b/apps/desktop/layer/renderer/src/modules/settings/tabs/ai/usage/components/DetailedUsageModal.tsx index 13dc332e2..e8b041c85 100644 --- a/apps/desktop/layer/renderer/src/modules/settings/tabs/ai/usage/components/DetailedUsageModal.tsx +++ b/apps/desktop/layer/renderer/src/modules/settings/tabs/ai/usage/components/DetailedUsageModal.tsx @@ -10,7 +10,7 @@ import { useTranslation } from "react-i18next" import { followApi } from "~/lib/api-client" import { useAIConfiguration } from "~/modules/ai-chat/hooks/useAIConfiguration" -import { formatTimeRemaining, formatTokenCount } from "../utils" +import { formatTokenCount } from "../utils" import { EfficiencyTab } from "./EfficiencyTab" import { HistoryTab } from "./HistoryTab" import { OverviewTab } from "./OverviewTab" @@ -76,7 +76,6 @@ export const DetailedUsageModal = () => { const maxHourCount = Math.max(1, ...hourBuckets) const formattedUsageTokens = formatTokenCount(usage.used) - const formattedRemainingTokens = formatTokenCount(rateLimit.remainingTokens) const formattedTotalTokens = formatTokenCount(usage.total) return ( @@ -93,44 +92,27 @@ export const DetailedUsageModal = () => { /> )} - {/* Layout Option 4: Asymmetric Modern */} -
-
-
- + {/* Unified Usage Overview Card */} +
+
+ {/* Progress Ring Section */} +
+
-
-
-
- -
-
- -
-
-
-
- -
-
- -
-
+ + {/* Metrics Section */} +
+ +
+
@@ -180,26 +162,3 @@ function Metric({ label, value, unit }: { label: string; value: string; unit?: s
) } - -function StatCompact({ - label, - value, - unit, - hint, -}: { - label: string - value: string - unit?: string - hint?: string -}) { - return ( -
-
{label}
-
- {value} - {unit ? {unit} : null} -
- {hint ?
{hint}
: null} -
- ) -}