Skip to content

Commit 9c90051

Browse files
committed
feat: Optimize JSON Explorer default expansion and enhance inactive status detection for improved user experience
1 parent 420d3c9 commit 9c90051

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

src/components/common/DataExplorer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function DataExplorer({ data, error, isDarkMode, title, emptyMessage = "N
3131
{data !== undefined && data !== null ? (
3232
<JsonView
3333
src={data}
34-
collapsed={2}
34+
collapsed={1}
3535
displayDataTypes={false}
3636
displayObjectSize={true}
3737
enableClipboard={true}

src/utils/status.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ import type { QueryData, MutationData, StatusDisplay } from "../types/query";
22

33
// Helper function to get status display with state-based colors
44
export function getQueryStatusDisplay(query: QueryData): StatusDisplay {
5+
// Check for inactive status first, regardless of other states
6+
if (!query.isActive) {
7+
return {
8+
icon: "Moon",
9+
text: "Inactive",
10+
bgColor: "status status-gray",
11+
textColor: "text-gray-500",
12+
};
13+
}
14+
515
if (query.state.isFetching) {
616
return {
717
icon: "RotateCw",
@@ -42,14 +52,6 @@ export function getQueryStatusDisplay(query: QueryData): StatusDisplay {
4252
textColor: "text-orange-600",
4353
};
4454
default:
45-
if (!query.isActive) {
46-
return {
47-
icon: "Moon",
48-
text: "Inactive",
49-
bgColor: "status status-gray",
50-
textColor: "text-gray-500",
51-
};
52-
}
5355
return {
5456
icon: "HelpCircle",
5557
text: "Unknown",

0 commit comments

Comments
 (0)