Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 30 additions & 18 deletions src/commands/blueprint/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,13 @@ const ListBlueprintsUI = ({
// Calculate pagination info for display
const totalPages = Math.max(1, Math.ceil(totalCount / PAGE_SIZE));
const startIndex = currentPage * PAGE_SIZE;
const endIndex = Math.min(startIndex + blueprints.length, totalCount);
const showingRange =
endIndex === startIndex + 1
const endIndex =
totalCount > 0
? Math.min(startIndex + blueprints.length, totalCount)
: startIndex + blueprints.length;
const showingRange = navigating
? `${startIndex + 1}+`
: endIndex === startIndex + 1
? `${startIndex + 1}`
: `${startIndex + 1}-${endIndex}`;

Expand Down Expand Up @@ -908,14 +912,18 @@ const ListBlueprintsUI = ({
{/* Statistics Bar */}
{!showPopup && (
<Box marginTop={1} paddingX={1}>
<Text color={colors.primary} bold>
{figures.hamburger} {totalCount}
</Text>
<Text color={colors.textDim} dimColor>
{" "}
total
</Text>
{totalPages > 1 && (
{totalCount > 0 && (
<>
<Text color={colors.primary} bold>
{figures.hamburger} {totalCount}
</Text>
<Text color={colors.textDim} dimColor>
{" "}
total
</Text>
</>
)}
{totalCount > 0 && totalPages > 1 && (
<>
<Text color={colors.textDim} dimColor>
{" "}
Expand All @@ -932,13 +940,17 @@ const ListBlueprintsUI = ({
)}
</>
)}
<Text color={colors.textDim} dimColor>
{" "}
•{" "}
</Text>
<Text color={colors.textDim} dimColor>
Showing {showingRange} of {totalCount}
</Text>
{endIndex > startIndex && (
<>
<Text color={colors.textDim} dimColor>
{totalCount > 0 ? " • " : ""}
</Text>
<Text color={colors.textDim} dimColor>
Showing {showingRange}
{totalCount > 0 ? ` of ${totalCount}` : ""}
</Text>
</>
)}
{search.submittedSearchQuery && (
<>
<Text color={colors.textDim} dimColor>
Expand Down
52 changes: 34 additions & 18 deletions src/commands/devbox/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,13 @@ const ListDevboxesUI = ({
// Calculate pagination info for display
const totalPages = Math.max(1, Math.ceil(totalCount / PAGE_SIZE));
const startIndex = currentPage * PAGE_SIZE;
const endIndex = Math.min(startIndex + devboxes.length, totalCount);
const showingRange =
endIndex === startIndex + 1
const endIndex =
totalCount > 0
? Math.min(startIndex + devboxes.length, totalCount)
: startIndex + devboxes.length;
const showingRange = navigating
? `${startIndex + 1}+`
: endIndex === startIndex + 1
? `${startIndex + 1}`
: `${startIndex + 1}-${endIndex}`;

Expand Down Expand Up @@ -732,14 +736,18 @@ const ListDevboxesUI = ({
{/* Statistics Bar - hide when popup is shown */}
{!showPopup && (
<Box marginTop={1} paddingX={1}>
<Text color={colors.primary} bold>
{figures.hamburger} {totalCount}
</Text>
<Text color={colors.textDim} dimColor>
{" "}
total
</Text>
{totalPages > 1 && (
{totalCount > 0 && (
<>
<Text color={colors.primary} bold>
{figures.hamburger} {totalCount}
</Text>
<Text color={colors.textDim} dimColor>
{" "}
total
</Text>
</>
)}
{totalCount > 0 && totalPages > 1 && (
<>
<Text color={colors.textDim} dimColor>
{" "}
Expand All @@ -756,13 +764,21 @@ const ListDevboxesUI = ({
)}
</>
)}
<Text color={colors.textDim} dimColor>
{" "}
•{" "}
</Text>
<Text color={colors.textDim} dimColor>
Showing {showingRange} of {totalCount}
</Text>
{devboxes.length > 0 && (
<>
{endIndex > startIndex && (
<>
<Text color={colors.textDim} dimColor>
{totalCount > 0 ? " • " : ""}
</Text>
<Text color={colors.textDim} dimColor>
Showing {showingRange}
{totalCount > 0 ? ` of ${totalCount}` : ""}
</Text>
</>
)}
</>
)}
{search.submittedSearchQuery && (
<>
<Text color={colors.textDim} dimColor>
Expand Down
48 changes: 30 additions & 18 deletions src/commands/gateway-config/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,13 @@ const ListGatewayConfigsUI = ({
// Calculate pagination info for display
const totalPages = Math.max(1, Math.ceil(totalCount / PAGE_SIZE));
const startIndex = currentPage * PAGE_SIZE;
const endIndex = Math.min(startIndex + configs.length, totalCount);
const showingRange =
endIndex === startIndex + 1
const endIndex =
totalCount > 0
? Math.min(startIndex + configs.length, totalCount)
: startIndex + configs.length;
const showingRange = navigating
? `${startIndex + 1}+`
: endIndex === startIndex + 1
? `${startIndex + 1}`
: `${startIndex + 1}-${endIndex}`;

Expand Down Expand Up @@ -679,14 +683,18 @@ const ListGatewayConfigsUI = ({
{/* Statistics Bar - hide when popup is shown */}
{!showPopup && (
<Box marginTop={1} paddingX={1}>
<Text color={colors.primary} bold>
{figures.hamburger} {totalCount}
</Text>
<Text color={colors.textDim} dimColor>
{" "}
total
</Text>
{totalPages > 1 && (
{totalCount > 0 && (
<>
<Text color={colors.primary} bold>
{figures.hamburger} {totalCount}
</Text>
<Text color={colors.textDim} dimColor>
{" "}
total
</Text>
</>
)}
{totalCount > 0 && totalPages > 1 && (
<>
<Text color={colors.textDim} dimColor>
{" "}
Expand All @@ -703,13 +711,17 @@ const ListGatewayConfigsUI = ({
)}
</>
)}
<Text color={colors.textDim} dimColor>
{" "}
•{" "}
</Text>
<Text color={colors.textDim} dimColor>
Showing {showingRange} of {totalCount}
</Text>
{endIndex > startIndex && (
<>
<Text color={colors.textDim} dimColor>
{totalCount > 0 ? " • " : ""}
</Text>
<Text color={colors.textDim} dimColor>
Showing {showingRange}
{totalCount > 0 ? ` of ${totalCount}` : ""}
</Text>
</>
)}
{search.submittedSearchQuery && (
<>
<Text color={colors.textDim} dimColor>
Expand Down
48 changes: 30 additions & 18 deletions src/commands/mcp-config/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,13 @@ const ListMcpConfigsUI = ({

const totalPages = Math.max(1, Math.ceil(totalCount / PAGE_SIZE));
const startIndex = currentPage * PAGE_SIZE;
const endIndex = Math.min(startIndex + configs.length, totalCount);
const showingRange =
endIndex === startIndex + 1
const endIndex =
totalCount > 0
? Math.min(startIndex + configs.length, totalCount)
: startIndex + configs.length;
const showingRange = navigating
? `${startIndex + 1}+`
: endIndex === startIndex + 1
? `${startIndex + 1}`
: `${startIndex + 1}-${endIndex}`;

Expand Down Expand Up @@ -604,14 +608,18 @@ const ListMcpConfigsUI = ({

{!showPopup && (
<Box marginTop={1} paddingX={1}>
<Text color={colors.primary} bold>
{figures.hamburger} {totalCount}
</Text>
<Text color={colors.textDim} dimColor>
{" "}
total
</Text>
{totalPages > 1 && (
{totalCount > 0 && (
<>
<Text color={colors.primary} bold>
{figures.hamburger} {totalCount}
</Text>
<Text color={colors.textDim} dimColor>
{" "}
total
</Text>
</>
)}
{totalCount > 0 && totalPages > 1 && (
<>
<Text color={colors.textDim} dimColor>
{" "}
Expand All @@ -628,13 +636,17 @@ const ListMcpConfigsUI = ({
)}
</>
)}
<Text color={colors.textDim} dimColor>
{" "}
•{" "}
</Text>
<Text color={colors.textDim} dimColor>
Showing {showingRange} of {totalCount}
</Text>
{endIndex > startIndex && (
<>
<Text color={colors.textDim} dimColor>
{totalCount > 0 ? " • " : ""}
</Text>
<Text color={colors.textDim} dimColor>
Showing {showingRange}
{totalCount > 0 ? ` of ${totalCount}` : ""}
</Text>
</>
)}
{search.submittedSearchQuery && (
<>
<Text color={colors.textDim} dimColor>
Expand Down
48 changes: 30 additions & 18 deletions src/commands/network-policy/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,13 @@ const ListNetworkPoliciesUI = ({
// Calculate pagination info for display
const totalPages = Math.max(1, Math.ceil(totalCount / PAGE_SIZE));
const startIndex = currentPage * PAGE_SIZE;
const endIndex = Math.min(startIndex + policies.length, totalCount);
const showingRange =
endIndex === startIndex + 1
const endIndex =
totalCount > 0
? Math.min(startIndex + policies.length, totalCount)
: startIndex + policies.length;
const showingRange = navigating
? `${startIndex + 1}+`
: endIndex === startIndex + 1
? `${startIndex + 1}`
: `${startIndex + 1}-${endIndex}`;

Expand Down Expand Up @@ -708,14 +712,18 @@ const ListNetworkPoliciesUI = ({
{/* Statistics Bar - hide when popup is shown */}
{!showPopup && (
<Box marginTop={1} paddingX={1}>
<Text color={colors.primary} bold>
{figures.hamburger} {totalCount}
</Text>
<Text color={colors.textDim} dimColor>
{" "}
total
</Text>
{totalPages > 1 && (
{totalCount > 0 && (
<>
<Text color={colors.primary} bold>
{figures.hamburger} {totalCount}
</Text>
<Text color={colors.textDim} dimColor>
{" "}
total
</Text>
</>
)}
{totalCount > 0 && totalPages > 1 && (
<>
<Text color={colors.textDim} dimColor>
{" "}
Expand All @@ -732,13 +740,17 @@ const ListNetworkPoliciesUI = ({
)}
</>
)}
<Text color={colors.textDim} dimColor>
{" "}
•{" "}
</Text>
<Text color={colors.textDim} dimColor>
Showing {showingRange} of {totalCount}
</Text>
{endIndex > startIndex && (
<>
<Text color={colors.textDim} dimColor>
{totalCount > 0 ? " • " : ""}
</Text>
<Text color={colors.textDim} dimColor>
Showing {showingRange}
{totalCount > 0 ? ` of ${totalCount}` : ""}
</Text>
</>
)}
{search.submittedSearchQuery && (
<>
<Text color={colors.textDim} dimColor>
Expand Down
Loading
Loading