diff --git a/packages/ui/src/pages/home/shared/provider-accounts.ts b/packages/ui/src/pages/home/shared/provider-accounts.ts
index ff7b5335..4b187830 100644
--- a/packages/ui/src/pages/home/shared/provider-accounts.ts
+++ b/packages/ui/src/pages/home/shared/provider-accounts.ts
@@ -145,7 +145,10 @@ export function providerAccountProgressClass(status: ProviderAccountSnapshot["st
return "bg-emerald-500";
}
-export function formatProviderAccountMeterValue(meter: ProviderAccountMeter): string {
+export function formatProviderAccountMeterValue(
+ meter: ProviderAccountMeter,
+ translate: (value: string) => string = (value) => value
+): string {
const value = meter.remaining ?? meter.used ?? meter.limit;
if (value === undefined) {
return "-";
@@ -170,10 +173,11 @@ export function formatProviderAccountMeterValue(meter: ProviderAccountMeter): st
if (unit === "minutes") {
return `${formatProviderAccountNumber(value)}m`;
}
+ const displayUnit = translate(unit);
if (meter.kind === "balance") {
- return `${formatProviderAccountNumber(value)} ${unit}`;
+ return `${formatProviderAccountNumber(value)} ${displayUnit}`;
}
- return `${formatCompactNumber(value)} ${unit}`;
+ return `${formatCompactNumber(value)} ${displayUnit}`;
}
export function formatProviderAccountNumber(value: number): string {
diff --git a/packages/ui/test/component/layout.test.tsx b/packages/ui/test/component/layout.test.tsx
index 8c158c9f..e58bb976 100644
--- a/packages/ui/test/component/layout.test.tsx
+++ b/packages/ui/test/component/layout.test.tsx
@@ -2,12 +2,12 @@ import assert from "node:assert/strict";
import test from "node:test";
import * as React from "react";
import { renderToStaticMarkup } from "react-dom/server";
-import { GatewayStartupErrorBanner, groupSidebarNavigation, UpdateEntryButton } from "@ccr/ui/pages/home/components/layout.tsx";
+import { GatewayStartupErrorBanner, groupSidebarNavigation, MainLayout, UpdateEntryButton } from "@ccr/ui/pages/home/components/layout.tsx";
import { MediaModelConfigurationPanel, VirtualModelsView } from "@ccr/ui/pages/home/components/virtual-models.tsx";
import { AppI18nContext, appCopy } from "@ccr/ui/pages/home/shared/i18n.tsx";
import { createVirtualModelDraft } from "@ccr/ui/pages/home/shared/virtual-models.ts";
import { appConfigFixture } from "../fixtures/index.ts";
-import { fallbackUpdateStatus } from "@ccr/ui/pages/home/shared/fallbacks.ts";
+import { fallbackGatewayStatus, fallbackUpdateStatus } from "@ccr/ui/pages/home/shared/fallbacks.ts";
import { navigation } from "@ccr/ui/pages/home/shared/options.ts";
import { shouldCheckForUpdateOnOpen } from "@ccr/ui/pages/home/components/update.tsx";
@@ -32,6 +32,41 @@ test("sidebar navigation groups pages and hides networking from the sidebar", ()
]);
});
+test("sidebar navigation scrolls vertically without displacing the settings footer", () => {
+ const html = renderToStaticMarkup(
+
undefined}
+ onOpenSettings={() => undefined}
+ onOpenUpdate={() => undefined}
+ onSelectNavigationItem={() => undefined}
+ onToggleSidebar={() => undefined}
+ requestLogsEnabled={false}
+ shouldReduceMotion={true}
+ sidebarOpen
+ toggleGatewayService={() => undefined}
+ updateActionBusy={false}
+ updateStatus={fallbackUpdateStatus}
+ viewProps={{} as never}
+ visibleNavigation={navigation}
+ />
+ );
+
+ assert.match(html, /