refactor(ui): drop narration comments from the migrated usage components

This commit is contained in:
Yuneng Jiang 2026-08-13 15:22:03 -07:00
parent 2d7581e32e
commit 355ef22257
No known key found for this signature in database
3 changed files with 3 additions and 7 deletions

View file

@ -56,7 +56,6 @@ const EndpointUsageTable: React.FC<EndpointUsageTableProps> = ({ endpointData })
return (
<div className="flex items-center space-x-3">
<div className="flex-1 relative">
{/* The failed share is the track showing through behind the successful share. */}
<Meter value={successPercentage} max={totalPercentage || 100} aria-label="Successful requests">
<MeterTrack className={failurePercentage > 0 ? "bg-red-500" : undefined}>
<MeterIndicator className="bg-green-500" />

View file

@ -104,8 +104,7 @@ const UsagePage: React.FC<UsagePageProps> = ({ teams, organizations }) => {
const canViewOrganizationUsage = hasCapability(userRole, "viewOrganizationUsage");
const canViewAgentUsage = hasCapability(userRole, "viewAgentUsage");
// The selector debounces its own input, so this holds the already-settled query.
const [debouncedUserSearch, setDebouncedUserSearch] = useState("");
const [settledUserSearch, setSettledUserSearch] = useState("");
const {
data: usersInfiniteData,
@ -113,7 +112,7 @@ const UsagePage: React.FC<UsagePageProps> = ({ teams, organizations }) => {
hasNextPage: hasNextUsersPage,
isFetchingNextPage: isFetchingNextUsersPage,
isLoading: isLoadingUsers,
} = useInfiniteUsers(50, debouncedUserSearch || undefined);
} = useInfiniteUsers(50, settledUserSearch || undefined);
const userOptions = useMemo(() => {
if (!usersInfiniteData?.pages) return [];
@ -533,7 +532,7 @@ const UsagePage: React.FC<UsagePageProps> = ({ teams, organizations }) => {
options={userOptions}
value={selectedUserId ?? undefined}
onValueChange={(value) => setSelectedUserId(value === "" ? null : value)}
onSearchChange={setDebouncedUserSearch}
onSearchChange={setSettledUserSearch}
onLoadMore={fetchNextUsersPage}
hasNextPage={hasNextUsersPage}
isLoading={isLoadingUsers}

View file

@ -211,8 +211,6 @@ const ModelSection = ({
);
};
// Mirrors the antd Collapse this replaced: a panel's subtree is not built until it is first
// opened, and it stays mounted afterwards so its view-mode state survives being collapsed.
const ModelCollapsible = ({
defaultOpen,
header,