react-native-debug-toolkit 3.3.8 → 3.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -26
- package/README.zh-CN.md +52 -38
- package/android/src/main/java/com/reactnativedebugtoolkit/DebugToolkitNativeLogsModule.java +146 -0
- package/android/src/main/java/com/reactnativedebugtoolkit/ReactNativeDebugToolkitPackage.java +5 -3
- package/ios/DebugToolkitNativeLogs.mm +92 -0
- package/lib/commonjs/constants/logLevels.js +19 -0
- package/lib/commonjs/constants/logLevels.js.map +1 -0
- package/lib/commonjs/core/initialize.js +32 -19
- package/lib/commonjs/core/initialize.js.map +1 -1
- package/lib/commonjs/features/console/ConsoleLogTab.js +4 -15
- package/lib/commonjs/features/console/ConsoleLogTab.js.map +1 -1
- package/lib/commonjs/features/console/index.js +15 -8
- package/lib/commonjs/features/console/index.js.map +1 -1
- package/lib/commonjs/features/nativeLogs/NativeLogTab.js +156 -0
- package/lib/commonjs/features/nativeLogs/NativeLogTab.js.map +1 -0
- package/lib/commonjs/features/nativeLogs/index.js +97 -0
- package/lib/commonjs/features/nativeLogs/index.js.map +1 -0
- package/lib/commonjs/features/nativeLogs/nativeLogsBridge.js +71 -0
- package/lib/commonjs/features/nativeLogs/nativeLogsBridge.js.map +1 -0
- package/lib/commonjs/features/network/NetworkLogTab.js +90 -95
- package/lib/commonjs/features/network/NetworkLogTab.js.map +1 -1
- package/lib/commonjs/features/network/index.js +7 -4
- package/lib/commonjs/features/network/index.js.map +1 -1
- package/lib/commonjs/features/sessionHistory/SessionHistoryTab.js +1046 -0
- package/lib/commonjs/features/sessionHistory/SessionHistoryTab.js.map +1 -0
- package/lib/commonjs/features/sessionHistory/index.js +104 -0
- package/lib/commonjs/features/sessionHistory/index.js.map +1 -0
- package/lib/commonjs/features/track/index.js +4 -3
- package/lib/commonjs/features/track/index.js.map +1 -1
- package/lib/commonjs/index.js +27 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/DebugView.js +2 -0
- package/lib/commonjs/ui/DebugView.js.map +1 -1
- package/lib/commonjs/ui/panel/DebugPanel.js +67 -34
- package/lib/commonjs/ui/panel/DebugPanel.js.map +1 -1
- package/lib/commonjs/ui/panel/FeatureIntroCard.js +151 -0
- package/lib/commonjs/ui/panel/FeatureIntroCard.js.map +1 -0
- package/lib/commonjs/ui/panel/FeatureRail.js +163 -0
- package/lib/commonjs/ui/panel/FeatureRail.js.map +1 -0
- package/lib/commonjs/ui/panel/FloatPanelView.js +119 -22
- package/lib/commonjs/ui/panel/FloatPanelView.js.map +1 -1
- package/lib/commonjs/ui/panel/buildFeatureSummary.js +207 -0
- package/lib/commonjs/ui/panel/buildFeatureSummary.js.map +1 -0
- package/lib/commonjs/ui/panel/filterFeatureSnapshot.js +43 -0
- package/lib/commonjs/ui/panel/filterFeatureSnapshot.js.map +1 -0
- package/lib/commonjs/ui/theme/colors.js +6 -0
- package/lib/commonjs/ui/theme/colors.js.map +1 -1
- package/lib/commonjs/utils/DaemonClient.js +30 -8
- package/lib/commonjs/utils/DaemonClient.js.map +1 -1
- package/lib/commonjs/utils/SessionManager.js +132 -0
- package/lib/commonjs/utils/SessionManager.js.map +1 -0
- package/lib/commonjs/utils/StorageAdapter.js +104 -0
- package/lib/commonjs/utils/StorageAdapter.js.map +1 -0
- package/lib/commonjs/utils/createChannelFeature.js +22 -5
- package/lib/commonjs/utils/createChannelFeature.js.map +1 -1
- package/lib/commonjs/utils/createPersistedObservableStore.js +14 -8
- package/lib/commonjs/utils/createPersistedObservableStore.js.map +1 -1
- package/lib/commonjs/utils/debugPreferences.js +28 -5
- package/lib/commonjs/utils/debugPreferences.js.map +1 -1
- package/lib/commonjs/utils/deviceReport.js +5 -1
- package/lib/commonjs/utils/deviceReport.js.map +1 -1
- package/lib/commonjs/utils/logRuntime.js +32 -0
- package/lib/commonjs/utils/logRuntime.js.map +1 -0
- package/lib/module/constants/logLevels.js +15 -0
- package/lib/module/constants/logLevels.js.map +1 -0
- package/lib/module/core/initialize.js +32 -19
- package/lib/module/core/initialize.js.map +1 -1
- package/lib/module/features/console/ConsoleLogTab.js +1 -12
- package/lib/module/features/console/ConsoleLogTab.js.map +1 -1
- package/lib/module/features/console/index.js +15 -8
- package/lib/module/features/console/index.js.map +1 -1
- package/lib/module/features/nativeLogs/NativeLogTab.js +151 -0
- package/lib/module/features/nativeLogs/NativeLogTab.js.map +1 -0
- package/lib/module/features/nativeLogs/index.js +91 -0
- package/lib/module/features/nativeLogs/index.js.map +1 -0
- package/lib/module/features/nativeLogs/nativeLogsBridge.js +63 -0
- package/lib/module/features/nativeLogs/nativeLogsBridge.js.map +1 -0
- package/lib/module/features/network/NetworkLogTab.js +90 -95
- package/lib/module/features/network/NetworkLogTab.js.map +1 -1
- package/lib/module/features/network/index.js +7 -4
- package/lib/module/features/network/index.js.map +1 -1
- package/lib/module/features/sessionHistory/SessionHistoryTab.js +1041 -0
- package/lib/module/features/sessionHistory/SessionHistoryTab.js.map +1 -0
- package/lib/module/features/sessionHistory/index.js +100 -0
- package/lib/module/features/sessionHistory/index.js.map +1 -0
- package/lib/module/features/track/index.js +4 -3
- package/lib/module/features/track/index.js.map +1 -1
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/DebugView.js +2 -0
- package/lib/module/ui/DebugView.js.map +1 -1
- package/lib/module/ui/panel/DebugPanel.js +67 -34
- package/lib/module/ui/panel/DebugPanel.js.map +1 -1
- package/lib/module/ui/panel/FeatureIntroCard.js +146 -0
- package/lib/module/ui/panel/FeatureIntroCard.js.map +1 -0
- package/lib/module/ui/panel/FeatureRail.js +158 -0
- package/lib/module/ui/panel/FeatureRail.js.map +1 -0
- package/lib/module/ui/panel/FloatPanelView.js +119 -22
- package/lib/module/ui/panel/FloatPanelView.js.map +1 -1
- package/lib/module/ui/panel/buildFeatureSummary.js +203 -0
- package/lib/module/ui/panel/buildFeatureSummary.js.map +1 -0
- package/lib/module/ui/panel/filterFeatureSnapshot.js +39 -0
- package/lib/module/ui/panel/filterFeatureSnapshot.js.map +1 -0
- package/lib/module/ui/theme/colors.js +6 -0
- package/lib/module/ui/theme/colors.js.map +1 -1
- package/lib/module/utils/DaemonClient.js +30 -8
- package/lib/module/utils/DaemonClient.js.map +1 -1
- package/lib/module/utils/SessionManager.js +127 -0
- package/lib/module/utils/SessionManager.js.map +1 -0
- package/lib/module/utils/StorageAdapter.js +96 -0
- package/lib/module/utils/StorageAdapter.js.map +1 -0
- package/lib/module/utils/createChannelFeature.js +22 -5
- package/lib/module/utils/createChannelFeature.js.map +1 -1
- package/lib/module/utils/createPersistedObservableStore.js +14 -8
- package/lib/module/utils/createPersistedObservableStore.js.map +1 -1
- package/lib/module/utils/debugPreferences.js +27 -5
- package/lib/module/utils/debugPreferences.js.map +1 -1
- package/lib/module/utils/deviceReport.js +4 -1
- package/lib/module/utils/deviceReport.js.map +1 -1
- package/lib/module/utils/logRuntime.js +26 -0
- package/lib/module/utils/logRuntime.js.map +1 -0
- package/lib/typescript/src/constants/logLevels.d.ts +3 -0
- package/lib/typescript/src/constants/logLevels.d.ts.map +1 -0
- package/lib/typescript/src/core/initialize.d.ts +6 -0
- package/lib/typescript/src/core/initialize.d.ts.map +1 -1
- package/lib/typescript/src/features/console/ConsoleLogTab.d.ts.map +1 -1
- package/lib/typescript/src/features/console/index.d.ts +2 -1
- package/lib/typescript/src/features/console/index.d.ts.map +1 -1
- package/lib/typescript/src/features/nativeLogs/NativeLogTab.d.ts +4 -0
- package/lib/typescript/src/features/nativeLogs/NativeLogTab.d.ts.map +1 -0
- package/lib/typescript/src/features/nativeLogs/index.d.ts +12 -0
- package/lib/typescript/src/features/nativeLogs/index.d.ts.map +1 -0
- package/lib/typescript/src/features/nativeLogs/nativeLogsBridge.d.ts +11 -0
- package/lib/typescript/src/features/nativeLogs/nativeLogsBridge.d.ts.map +1 -0
- package/lib/typescript/src/features/network/NetworkLogTab.d.ts.map +1 -1
- package/lib/typescript/src/features/network/index.d.ts +2 -1
- package/lib/typescript/src/features/network/index.d.ts.map +1 -1
- package/lib/typescript/src/features/sessionHistory/SessionHistoryTab.d.ts +20 -0
- package/lib/typescript/src/features/sessionHistory/SessionHistoryTab.d.ts.map +1 -0
- package/lib/typescript/src/features/sessionHistory/index.d.ts +4 -0
- package/lib/typescript/src/features/sessionHistory/index.d.ts.map +1 -0
- package/lib/typescript/src/features/track/index.d.ts +2 -1
- package/lib/typescript/src/features/track/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +7 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/types/feature.d.ts +1 -1
- package/lib/typescript/src/types/feature.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts +3 -1
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/lib/typescript/src/types/logs.d.ts +15 -0
- package/lib/typescript/src/types/logs.d.ts.map +1 -1
- package/lib/typescript/src/ui/DebugView.d.ts.map +1 -1
- package/lib/typescript/src/ui/panel/DebugPanel.d.ts +3 -1
- package/lib/typescript/src/ui/panel/DebugPanel.d.ts.map +1 -1
- package/lib/typescript/src/ui/panel/FeatureIntroCard.d.ts +14 -0
- package/lib/typescript/src/ui/panel/FeatureIntroCard.d.ts.map +1 -0
- package/lib/typescript/src/ui/panel/FeatureRail.d.ts +16 -0
- package/lib/typescript/src/ui/panel/FeatureRail.d.ts.map +1 -0
- package/lib/typescript/src/ui/panel/FloatPanelView.d.ts.map +1 -1
- package/lib/typescript/src/ui/panel/buildFeatureSummary.d.ts +13 -0
- package/lib/typescript/src/ui/panel/buildFeatureSummary.d.ts.map +1 -0
- package/lib/typescript/src/ui/panel/filterFeatureSnapshot.d.ts +3 -0
- package/lib/typescript/src/ui/panel/filterFeatureSnapshot.d.ts.map +1 -0
- package/lib/typescript/src/ui/theme/colors.d.ts +5 -0
- package/lib/typescript/src/ui/theme/colors.d.ts.map +1 -1
- package/lib/typescript/src/utils/DaemonClient.d.ts +7 -1
- package/lib/typescript/src/utils/DaemonClient.d.ts.map +1 -1
- package/lib/typescript/src/utils/SessionManager.d.ts +30 -0
- package/lib/typescript/src/utils/SessionManager.d.ts.map +1 -0
- package/lib/typescript/src/utils/StorageAdapter.d.ts +38 -0
- package/lib/typescript/src/utils/StorageAdapter.d.ts.map +1 -0
- package/lib/typescript/src/utils/createChannelFeature.d.ts +2 -0
- package/lib/typescript/src/utils/createChannelFeature.d.ts.map +1 -1
- package/lib/typescript/src/utils/createPersistedObservableStore.d.ts +4 -1
- package/lib/typescript/src/utils/createPersistedObservableStore.d.ts.map +1 -1
- package/lib/typescript/src/utils/debugPreferences.d.ts +1 -3
- package/lib/typescript/src/utils/debugPreferences.d.ts.map +1 -1
- package/lib/typescript/src/utils/deviceReport.d.ts +1 -0
- package/lib/typescript/src/utils/deviceReport.d.ts.map +1 -1
- package/lib/typescript/src/utils/logRuntime.d.ts +13 -0
- package/lib/typescript/src/utils/logRuntime.d.ts.map +1 -0
- package/node/daemon/src/console/console.html +18 -0
- package/node/mcp/src/logs.js +1 -1
- package/package.json +9 -1
- package/src/constants/logLevels.ts +13 -0
- package/src/core/initialize.ts +54 -25
- package/src/features/console/ConsoleLogTab.tsx +1 -14
- package/src/features/console/index.ts +18 -8
- package/src/features/nativeLogs/NativeLogTab.tsx +66 -0
- package/src/features/nativeLogs/index.ts +94 -0
- package/src/features/nativeLogs/nativeLogsBridge.ts +51 -0
- package/src/features/network/NetworkLogTab.tsx +60 -71
- package/src/features/network/index.ts +12 -3
- package/src/features/sessionHistory/SessionHistoryTab.tsx +693 -0
- package/src/features/sessionHistory/index.ts +102 -0
- package/src/features/track/index.ts +10 -3
- package/src/index.ts +16 -0
- package/src/types/feature.ts +3 -1
- package/src/types/index.ts +13 -0
- package/src/types/logs.ts +17 -0
- package/src/ui/DebugView.tsx +2 -0
- package/src/ui/panel/DebugPanel.tsx +60 -30
- package/src/ui/panel/FeatureIntroCard.tsx +147 -0
- package/src/ui/panel/FeatureRail.tsx +165 -0
- package/src/ui/panel/FloatPanelView.tsx +123 -15
- package/src/ui/panel/buildFeatureSummary.ts +288 -0
- package/src/ui/panel/filterFeatureSnapshot.ts +51 -0
- package/src/ui/theme/colors.ts +7 -0
- package/src/utils/DaemonClient.ts +33 -5
- package/src/utils/SessionManager.ts +174 -0
- package/src/utils/StorageAdapter.ts +135 -0
- package/src/utils/createChannelFeature.ts +28 -6
- package/src/utils/createPersistedObservableStore.ts +18 -10
- package/src/utils/debugPreferences.ts +38 -7
- package/src/utils/deviceReport.ts +5 -1
- package/src/utils/logRuntime.ts +39 -0
- package/lib/commonjs/ui/panel/FeatureTabBar.js +0 -182
- package/lib/commonjs/ui/panel/FeatureTabBar.js.map +0 -1
- package/lib/module/ui/panel/FeatureTabBar.js +0 -177
- package/lib/module/ui/panel/FeatureTabBar.js.map +0 -1
- package/lib/typescript/src/ui/panel/FeatureTabBar.d.ts +0 -13
- package/lib/typescript/src/ui/panel/FeatureTabBar.d.ts.map +0 -1
- package/src/ui/panel/FeatureTabBar.tsx +0 -204
|
@@ -0,0 +1,1041 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useCallback, useMemo, useState } from 'react';
|
|
4
|
+
import { View, Text, StyleSheet, Pressable, ScrollView, ActivityIndicator } from 'react-native';
|
|
5
|
+
import { Colors, getMethodColor } from '../../ui/theme/colors';
|
|
6
|
+
import { CollapsibleSection } from '../../ui/shared/CollapsibleSection';
|
|
7
|
+
import { JsonView } from '../../ui/shared/JsonView';
|
|
8
|
+
import { CopyButton } from '../../ui/shared/CopyButton';
|
|
9
|
+
import { LogListScreen } from '../../ui/shared/LogListScreen';
|
|
10
|
+
import { safeStringify } from '../../utils/safeStringify';
|
|
11
|
+
import { fmt } from '../../utils/copyToComputer';
|
|
12
|
+
import { LEVEL_COLORS, LEVEL_ICONS } from '../../constants/logLevels';
|
|
13
|
+
|
|
14
|
+
// ── Types ──────────────────────────────────────────────────────────────
|
|
15
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
16
|
+
// ── Constants ──────────────────────────────────────────────────────────
|
|
17
|
+
|
|
18
|
+
const FEATURE_LABELS = {
|
|
19
|
+
console_logs: 'Console',
|
|
20
|
+
network_logs: 'Network',
|
|
21
|
+
native_logs: 'Native',
|
|
22
|
+
track_logs: 'Track'
|
|
23
|
+
};
|
|
24
|
+
const FEATURE_COLORS = {
|
|
25
|
+
console_logs: Colors.info,
|
|
26
|
+
network_logs: Colors.success,
|
|
27
|
+
native_logs: '#FF9500',
|
|
28
|
+
track_logs: Colors.purple
|
|
29
|
+
};
|
|
30
|
+
const FEATURE_KEYS = Object.keys(FEATURE_LABELS);
|
|
31
|
+
|
|
32
|
+
// ── Helpers ────────────────────────────────────────────────────────────
|
|
33
|
+
|
|
34
|
+
function relativeTime(ts) {
|
|
35
|
+
const diff = Date.now() - ts;
|
|
36
|
+
const mins = Math.floor(diff / 60000);
|
|
37
|
+
if (mins < 1) return 'Just now';
|
|
38
|
+
if (mins < 60) return `${mins}m ago`;
|
|
39
|
+
const hours = Math.floor(mins / 60);
|
|
40
|
+
if (hours < 24) return `${hours}h ago`;
|
|
41
|
+
const days = Math.floor(hours / 24);
|
|
42
|
+
if (days === 1) return 'Yesterday';
|
|
43
|
+
if (days < 7) return `${days}d ago`;
|
|
44
|
+
return new Date(ts).toLocaleDateString(undefined, {
|
|
45
|
+
month: 'short',
|
|
46
|
+
day: 'numeric'
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function formatTime(ts) {
|
|
50
|
+
return new Date(ts).toLocaleTimeString(undefined, {
|
|
51
|
+
hour: '2-digit',
|
|
52
|
+
minute: '2-digit'
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function formatFullDate(ts) {
|
|
56
|
+
const d = new Date(ts);
|
|
57
|
+
const now = new Date();
|
|
58
|
+
const isToday = d.toDateString() === now.toDateString();
|
|
59
|
+
const time = d.toLocaleTimeString(undefined, {
|
|
60
|
+
hour: '2-digit',
|
|
61
|
+
minute: '2-digit',
|
|
62
|
+
second: '2-digit'
|
|
63
|
+
});
|
|
64
|
+
if (isToday) return `Today ${time}`;
|
|
65
|
+
return d.toLocaleDateString(undefined, {
|
|
66
|
+
month: 'short',
|
|
67
|
+
day: 'numeric'
|
|
68
|
+
}) + ' ' + time;
|
|
69
|
+
}
|
|
70
|
+
function totalCounts(counts) {
|
|
71
|
+
return (counts.console_logs ?? 0) + (counts.network_logs ?? 0) + (counts.track_logs ?? 0);
|
|
72
|
+
}
|
|
73
|
+
function totalLogs(logs) {
|
|
74
|
+
return Object.values(logs).reduce((sum, arr) => sum + arr.length, 0);
|
|
75
|
+
}
|
|
76
|
+
function shortId(id) {
|
|
77
|
+
return id.slice(-6).toUpperCase();
|
|
78
|
+
}
|
|
79
|
+
function flattenLogs(logs, filter) {
|
|
80
|
+
const keys = filter === 'all' ? ['console_logs', 'network_logs', 'track_logs'] : [filter];
|
|
81
|
+
const entries = [];
|
|
82
|
+
for (const key of keys) {
|
|
83
|
+
const items = logs[key] ?? [];
|
|
84
|
+
items.forEach((raw, i) => {
|
|
85
|
+
const e = raw;
|
|
86
|
+
entries.push({
|
|
87
|
+
id: `${key}-${i}`,
|
|
88
|
+
type: key,
|
|
89
|
+
timestamp: e.timestamp ?? 0,
|
|
90
|
+
raw
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
entries.sort((a, b) => b.timestamp - a.timestamp);
|
|
95
|
+
return entries;
|
|
96
|
+
}
|
|
97
|
+
function toRecord(entry) {
|
|
98
|
+
return entry.raw;
|
|
99
|
+
}
|
|
100
|
+
function shortenUrl(url) {
|
|
101
|
+
try {
|
|
102
|
+
const u = new URL(url);
|
|
103
|
+
return u.pathname + u.search;
|
|
104
|
+
} catch {
|
|
105
|
+
return url;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// ── Main Tab ───────────────────────────────────────────────────────────
|
|
110
|
+
|
|
111
|
+
export const SessionHistoryTab = /*#__PURE__*/React.memo(({
|
|
112
|
+
snapshot,
|
|
113
|
+
feature
|
|
114
|
+
}) => {
|
|
115
|
+
const {
|
|
116
|
+
sessions,
|
|
117
|
+
currentSessionId,
|
|
118
|
+
loading,
|
|
119
|
+
selectedSession,
|
|
120
|
+
logCounts
|
|
121
|
+
} = snapshot;
|
|
122
|
+
const handleSelectSession = useCallback(session => {
|
|
123
|
+
if (session.id === currentSessionId) return;
|
|
124
|
+
feature.loadSession(session.id);
|
|
125
|
+
}, [feature, currentSessionId]);
|
|
126
|
+
const handleBack = useCallback(() => {
|
|
127
|
+
feature.loadSession(null);
|
|
128
|
+
}, [feature]);
|
|
129
|
+
if (loading) {
|
|
130
|
+
return /*#__PURE__*/_jsx(View, {
|
|
131
|
+
style: s.center,
|
|
132
|
+
children: /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
133
|
+
color: Colors.primary
|
|
134
|
+
})
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
if (selectedSession) {
|
|
138
|
+
return /*#__PURE__*/_jsx(SessionDetail, {
|
|
139
|
+
logs: selectedSession.logs,
|
|
140
|
+
sessionId: selectedSession.sessionId,
|
|
141
|
+
onBack: handleBack
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
const previousSessions = sessions.filter(s => s.id !== currentSessionId);
|
|
145
|
+
const currentSession = sessions.find(s => s.id === currentSessionId);
|
|
146
|
+
if (previousSessions.length === 0) {
|
|
147
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
148
|
+
style: s.center,
|
|
149
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
150
|
+
style: s.emptyClock,
|
|
151
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
152
|
+
style: s.emptyClockText,
|
|
153
|
+
children: "\u23F1"
|
|
154
|
+
})
|
|
155
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
156
|
+
style: s.emptyTitle,
|
|
157
|
+
children: "No session history"
|
|
158
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
159
|
+
style: s.emptySub,
|
|
160
|
+
children: "Previous sessions will appear here after you restart the app."
|
|
161
|
+
})]
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
return /*#__PURE__*/_jsxs(ScrollView, {
|
|
165
|
+
style: s.container,
|
|
166
|
+
contentContainerStyle: s.scrollContent,
|
|
167
|
+
children: [currentSession && /*#__PURE__*/_jsxs(View, {
|
|
168
|
+
style: s.currentCard,
|
|
169
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
170
|
+
style: s.currentRow,
|
|
171
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
172
|
+
style: s.pulseDot
|
|
173
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
174
|
+
style: s.currentLabel,
|
|
175
|
+
children: "CURRENT"
|
|
176
|
+
})]
|
|
177
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
178
|
+
style: s.currentTime,
|
|
179
|
+
children: formatFullDate(currentSession.startedAt)
|
|
180
|
+
})]
|
|
181
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
182
|
+
style: s.timelineSection,
|
|
183
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
184
|
+
style: s.timelineHeader,
|
|
185
|
+
children: "PREVIOUS SESSIONS"
|
|
186
|
+
}), previousSessions.map((session, idx) => {
|
|
187
|
+
const counts = logCounts[session.id];
|
|
188
|
+
const total = counts ? totalCounts(counts) : 0;
|
|
189
|
+
return /*#__PURE__*/_jsxs(Pressable, {
|
|
190
|
+
style: s.timelineRow,
|
|
191
|
+
onPress: () => handleSelectSession(session),
|
|
192
|
+
android_ripple: {
|
|
193
|
+
color: 'rgba(0,0,0,0.04)'
|
|
194
|
+
},
|
|
195
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
196
|
+
style: s.railCol,
|
|
197
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
198
|
+
style: s.railDot
|
|
199
|
+
}), idx < previousSessions.length - 1 && /*#__PURE__*/_jsx(View, {
|
|
200
|
+
style: s.railLine
|
|
201
|
+
})]
|
|
202
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
203
|
+
style: s.historyCard,
|
|
204
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
205
|
+
style: s.cardTop,
|
|
206
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
207
|
+
style: s.cardTime,
|
|
208
|
+
children: formatTime(session.startedAt)
|
|
209
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
210
|
+
style: s.cardRelative,
|
|
211
|
+
children: relativeTime(session.startedAt)
|
|
212
|
+
})]
|
|
213
|
+
}), counts && total > 0 ? /*#__PURE__*/_jsx(View, {
|
|
214
|
+
style: s.pillRow,
|
|
215
|
+
children: FEATURE_KEYS.map(key => {
|
|
216
|
+
const c = counts[key] ?? 0;
|
|
217
|
+
if (c === 0) return null;
|
|
218
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
219
|
+
style: [s.pill, {
|
|
220
|
+
backgroundColor: FEATURE_COLORS[key] + '18'
|
|
221
|
+
}],
|
|
222
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
223
|
+
style: [s.pillDot, {
|
|
224
|
+
backgroundColor: FEATURE_COLORS[key]
|
|
225
|
+
}]
|
|
226
|
+
}), /*#__PURE__*/_jsxs(Text, {
|
|
227
|
+
style: [s.pillText, {
|
|
228
|
+
color: FEATURE_COLORS[key]
|
|
229
|
+
}],
|
|
230
|
+
children: [c, " ", FEATURE_LABELS[key]]
|
|
231
|
+
})]
|
|
232
|
+
}, key);
|
|
233
|
+
})
|
|
234
|
+
}) : /*#__PURE__*/_jsx(Text, {
|
|
235
|
+
style: s.cardEmpty,
|
|
236
|
+
children: "No logs recorded"
|
|
237
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
238
|
+
style: s.cardFooter,
|
|
239
|
+
children: [/*#__PURE__*/_jsxs(Text, {
|
|
240
|
+
style: s.cardId,
|
|
241
|
+
children: ["#", shortId(session.id)]
|
|
242
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
243
|
+
style: s.cardChevron,
|
|
244
|
+
children: "\u203A"
|
|
245
|
+
})]
|
|
246
|
+
})]
|
|
247
|
+
})]
|
|
248
|
+
}, session.id);
|
|
249
|
+
})]
|
|
250
|
+
})]
|
|
251
|
+
});
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
// ── Session Detail (uses LogListScreen for tap-to-detail) ──────────────
|
|
255
|
+
|
|
256
|
+
const SessionDetail = /*#__PURE__*/React.memo(({
|
|
257
|
+
logs,
|
|
258
|
+
sessionId,
|
|
259
|
+
onBack
|
|
260
|
+
}) => {
|
|
261
|
+
const [filter, setFilter] = useState('all');
|
|
262
|
+
const total = totalLogs(logs);
|
|
263
|
+
const flatEntries = useMemo(() => flattenLogs(logs, filter), [logs, filter]);
|
|
264
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
265
|
+
style: s.container,
|
|
266
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
267
|
+
style: s.sessionHeader,
|
|
268
|
+
children: [/*#__PURE__*/_jsxs(Pressable, {
|
|
269
|
+
onPress: onBack,
|
|
270
|
+
hitSlop: 12,
|
|
271
|
+
style: s.headerBackBtn,
|
|
272
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
273
|
+
style: s.headerArrow,
|
|
274
|
+
children: "\u2039"
|
|
275
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
276
|
+
style: s.headerBackLabel,
|
|
277
|
+
children: "Sessions"
|
|
278
|
+
})]
|
|
279
|
+
}), /*#__PURE__*/_jsxs(Text, {
|
|
280
|
+
style: s.headerMeta,
|
|
281
|
+
children: ["#", shortId(sessionId)]
|
|
282
|
+
})]
|
|
283
|
+
}), /*#__PURE__*/_jsx(LogListScreen, {
|
|
284
|
+
data: flatEntries,
|
|
285
|
+
reversed: false,
|
|
286
|
+
emptyText: filter === 'all' ? 'No logs in this session' : `No ${FEATURE_LABELS[filter]} logs`,
|
|
287
|
+
renderListHeader: () => /*#__PURE__*/_jsxs(View, {
|
|
288
|
+
style: s.filterBar,
|
|
289
|
+
children: [/*#__PURE__*/_jsx(FilterChip, {
|
|
290
|
+
label: "All",
|
|
291
|
+
count: total,
|
|
292
|
+
active: filter === 'all',
|
|
293
|
+
onPress: () => setFilter('all'),
|
|
294
|
+
color: Colors.text
|
|
295
|
+
}), FEATURE_KEYS.map(key => {
|
|
296
|
+
const c = (logs[key] ?? []).length;
|
|
297
|
+
return /*#__PURE__*/_jsx(FilterChip, {
|
|
298
|
+
label: FEATURE_LABELS[key],
|
|
299
|
+
count: c,
|
|
300
|
+
active: filter === key,
|
|
301
|
+
onPress: () => setFilter(key),
|
|
302
|
+
color: FEATURE_COLORS[key]
|
|
303
|
+
}, key);
|
|
304
|
+
})]
|
|
305
|
+
}),
|
|
306
|
+
renderRow: item => /*#__PURE__*/_jsx(LogRow, {
|
|
307
|
+
entry: item
|
|
308
|
+
}),
|
|
309
|
+
renderDetailHeader: item => /*#__PURE__*/_jsx(LogDetailHeader, {
|
|
310
|
+
entry: item
|
|
311
|
+
}),
|
|
312
|
+
renderDetailBody: item => /*#__PURE__*/_jsx(LogDetailBody, {
|
|
313
|
+
entry: item
|
|
314
|
+
})
|
|
315
|
+
})]
|
|
316
|
+
});
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
// ── Filter Chips ───────────────────────────────────────────────────────
|
|
320
|
+
|
|
321
|
+
const FilterChip = /*#__PURE__*/React.memo(({
|
|
322
|
+
label,
|
|
323
|
+
count,
|
|
324
|
+
active,
|
|
325
|
+
onPress,
|
|
326
|
+
color
|
|
327
|
+
}) => /*#__PURE__*/_jsx(Pressable, {
|
|
328
|
+
onPress: onPress,
|
|
329
|
+
style: [s.chip, active && {
|
|
330
|
+
backgroundColor: color
|
|
331
|
+
}],
|
|
332
|
+
hitSlop: 4,
|
|
333
|
+
children: /*#__PURE__*/_jsxs(Text, {
|
|
334
|
+
style: [s.chipLabel, active && s.chipLabelActive],
|
|
335
|
+
children: [label, " ", /*#__PURE__*/_jsx(Text, {
|
|
336
|
+
style: [s.chipCount, active && s.chipCountActive],
|
|
337
|
+
children: count
|
|
338
|
+
})]
|
|
339
|
+
})
|
|
340
|
+
}));
|
|
341
|
+
|
|
342
|
+
// ── Log List Row ───────────────────────────────────────────────────────
|
|
343
|
+
|
|
344
|
+
const LogRow = /*#__PURE__*/React.memo(({
|
|
345
|
+
entry
|
|
346
|
+
}) => {
|
|
347
|
+
const e = toRecord(entry);
|
|
348
|
+
if (entry.type === 'console_logs') {
|
|
349
|
+
const level = e.level ?? 'log';
|
|
350
|
+
const msg = Array.isArray(e.data) ? e.data.map(d => typeof d === 'string' ? d : safeStringify(d)).join(' ') : safeStringify(e.data);
|
|
351
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
352
|
+
style: s.rowContent,
|
|
353
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
354
|
+
style: [s.levelDot, {
|
|
355
|
+
backgroundColor: LEVEL_COLORS[level] ?? '#8E8E93'
|
|
356
|
+
}],
|
|
357
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
358
|
+
style: s.levelIcon,
|
|
359
|
+
children: LEVEL_ICONS[level] ?? '●'
|
|
360
|
+
})
|
|
361
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
362
|
+
style: s.rowBody,
|
|
363
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
364
|
+
style: s.rowMsg,
|
|
365
|
+
numberOfLines: 2,
|
|
366
|
+
children: msg
|
|
367
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
368
|
+
style: s.rowTime,
|
|
369
|
+
children: new Date(e.timestamp).toLocaleTimeString()
|
|
370
|
+
})]
|
|
371
|
+
})]
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
if (entry.type === 'network_logs') {
|
|
375
|
+
const method = e.request?.method ?? '?';
|
|
376
|
+
const url = e.request?.url ?? '';
|
|
377
|
+
const status = e.response?.status;
|
|
378
|
+
const ok = !e.error && (!status || status < 400);
|
|
379
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
380
|
+
style: s.rowContent,
|
|
381
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
382
|
+
style: [s.statusBar, {
|
|
383
|
+
backgroundColor: ok ? Colors.success : Colors.error
|
|
384
|
+
}]
|
|
385
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
386
|
+
style: s.rowBody,
|
|
387
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
388
|
+
style: s.rowMeta,
|
|
389
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
390
|
+
style: [s.methodText, {
|
|
391
|
+
color: getMethodColor(method)
|
|
392
|
+
}],
|
|
393
|
+
children: method
|
|
394
|
+
}), status != null && /*#__PURE__*/_jsx(View, {
|
|
395
|
+
style: [s.miniPill, {
|
|
396
|
+
backgroundColor: ok ? Colors.success : Colors.error
|
|
397
|
+
}],
|
|
398
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
399
|
+
style: s.miniPillText,
|
|
400
|
+
children: status
|
|
401
|
+
})
|
|
402
|
+
})]
|
|
403
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
404
|
+
style: [s.rowMsg, !ok && {
|
|
405
|
+
color: Colors.error
|
|
406
|
+
}],
|
|
407
|
+
numberOfLines: 1,
|
|
408
|
+
children: shortenUrl(url)
|
|
409
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
410
|
+
style: s.rowTime,
|
|
411
|
+
children: new Date(e.timestamp).toLocaleTimeString()
|
|
412
|
+
})]
|
|
413
|
+
})]
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
// track_logs
|
|
418
|
+
const name = e.eventName ?? e.action ?? 'Event';
|
|
419
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
420
|
+
style: s.rowContent,
|
|
421
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
422
|
+
style: s.trackDot
|
|
423
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
424
|
+
style: s.rowBody,
|
|
425
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
426
|
+
style: s.rowMsg,
|
|
427
|
+
numberOfLines: 1,
|
|
428
|
+
children: name
|
|
429
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
430
|
+
style: s.rowTime,
|
|
431
|
+
children: e.timestamp ? new Date(e.timestamp).toLocaleTimeString() : ''
|
|
432
|
+
})]
|
|
433
|
+
})]
|
|
434
|
+
});
|
|
435
|
+
});
|
|
436
|
+
|
|
437
|
+
// ── Log Detail Header ──────────────────────────────────────────────────
|
|
438
|
+
|
|
439
|
+
const LogDetailHeader = /*#__PURE__*/React.memo(({
|
|
440
|
+
entry
|
|
441
|
+
}) => {
|
|
442
|
+
const e = toRecord(entry);
|
|
443
|
+
if (entry.type === 'console_logs') {
|
|
444
|
+
const level = e.level ?? 'log';
|
|
445
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
446
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
447
|
+
style: [s.levelBadge, {
|
|
448
|
+
backgroundColor: LEVEL_COLORS[level] ?? '#8E8E93'
|
|
449
|
+
}],
|
|
450
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
451
|
+
style: s.levelBadgeText,
|
|
452
|
+
children: level.toUpperCase()
|
|
453
|
+
})
|
|
454
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
455
|
+
style: s.detailTimestamp,
|
|
456
|
+
children: new Date(e.timestamp).toLocaleString()
|
|
457
|
+
})]
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
if (entry.type === 'network_logs') {
|
|
461
|
+
const method = e.request?.method ?? '?';
|
|
462
|
+
const status = e.response?.status;
|
|
463
|
+
const ok = !e.error && (!status || status < 400);
|
|
464
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
465
|
+
style: s.networkHeaderBadges,
|
|
466
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
467
|
+
style: [s.methodBadge, {
|
|
468
|
+
backgroundColor: getMethodColor(method)
|
|
469
|
+
}],
|
|
470
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
471
|
+
style: s.methodBadgeText,
|
|
472
|
+
children: method
|
|
473
|
+
})
|
|
474
|
+
}), status != null && /*#__PURE__*/_jsx(View, {
|
|
475
|
+
style: [s.statusPill, {
|
|
476
|
+
backgroundColor: ok ? Colors.success : Colors.error
|
|
477
|
+
}],
|
|
478
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
479
|
+
style: s.statusPillText,
|
|
480
|
+
children: status
|
|
481
|
+
})
|
|
482
|
+
}), e.duration != null && /*#__PURE__*/_jsxs(Text, {
|
|
483
|
+
style: s.durationText,
|
|
484
|
+
children: [e.duration, "ms"]
|
|
485
|
+
})]
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
489
|
+
style: s.detailTimestamp,
|
|
490
|
+
children: new Date(e.timestamp).toLocaleString()
|
|
491
|
+
});
|
|
492
|
+
});
|
|
493
|
+
|
|
494
|
+
// ── Log Detail Body ────────────────────────────────────────────────────
|
|
495
|
+
|
|
496
|
+
const LogDetailBody = /*#__PURE__*/React.memo(({
|
|
497
|
+
entry
|
|
498
|
+
}) => {
|
|
499
|
+
const e = toRecord(entry);
|
|
500
|
+
if (entry.type === 'console_logs') {
|
|
501
|
+
const data = Array.isArray(e.data) ? e.data : [e.data];
|
|
502
|
+
return /*#__PURE__*/_jsx(ScrollView, {
|
|
503
|
+
style: s.detailBody,
|
|
504
|
+
contentContainerStyle: s.detailBodyContent,
|
|
505
|
+
children: data.map((d, i) => {
|
|
506
|
+
const formatted = typeof d === 'object' && d !== null ? fmt(d) : String(d);
|
|
507
|
+
return /*#__PURE__*/_jsx(CollapsibleSection, {
|
|
508
|
+
title: typeof d === 'object' && d !== null ? `Arg ${i + 1} (object)` : `Arg ${i + 1}`,
|
|
509
|
+
initiallyExpanded: i === 0,
|
|
510
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
511
|
+
style: s.sectionWithCopy,
|
|
512
|
+
children: [/*#__PURE__*/_jsx(CopyButton, {
|
|
513
|
+
text: formatted,
|
|
514
|
+
label: `Arg ${i + 1}`
|
|
515
|
+
}), typeof d === 'object' && d !== null ? /*#__PURE__*/_jsx(JsonView, {
|
|
516
|
+
data: d,
|
|
517
|
+
maxHeight: 250
|
|
518
|
+
}) : /*#__PURE__*/_jsx(Text, {
|
|
519
|
+
style: s.plainText,
|
|
520
|
+
selectable: true,
|
|
521
|
+
children: String(d)
|
|
522
|
+
})]
|
|
523
|
+
})
|
|
524
|
+
}, i);
|
|
525
|
+
})
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
if (entry.type === 'network_logs') {
|
|
529
|
+
return /*#__PURE__*/_jsxs(ScrollView, {
|
|
530
|
+
style: s.detailBody,
|
|
531
|
+
contentContainerStyle: s.detailBodyContent,
|
|
532
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
533
|
+
style: s.urlCard,
|
|
534
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
535
|
+
style: s.urlText,
|
|
536
|
+
selectable: true,
|
|
537
|
+
numberOfLines: 3,
|
|
538
|
+
children: e.request?.url
|
|
539
|
+
}), /*#__PURE__*/_jsx(CopyButton, {
|
|
540
|
+
text: e.request?.url ?? '',
|
|
541
|
+
label: "URL"
|
|
542
|
+
})]
|
|
543
|
+
}), e.error && /*#__PURE__*/_jsxs(View, {
|
|
544
|
+
style: s.errorBox,
|
|
545
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
546
|
+
style: s.errorIcon,
|
|
547
|
+
children: "\u26A0"
|
|
548
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
549
|
+
style: s.errorText,
|
|
550
|
+
children: e.error
|
|
551
|
+
})]
|
|
552
|
+
}), /*#__PURE__*/_jsx(CollapsibleSection, {
|
|
553
|
+
title: "Request Body",
|
|
554
|
+
initiallyExpanded: true,
|
|
555
|
+
children: e.request?.body != null ? /*#__PURE__*/_jsxs(View, {
|
|
556
|
+
style: s.sectionWithCopy,
|
|
557
|
+
children: [/*#__PURE__*/_jsx(CopyButton, {
|
|
558
|
+
text: fmt(e.request.body),
|
|
559
|
+
label: "Request Body"
|
|
560
|
+
}), /*#__PURE__*/_jsx(JsonView, {
|
|
561
|
+
data: e.request.body,
|
|
562
|
+
maxHeight: 250
|
|
563
|
+
})]
|
|
564
|
+
}) : /*#__PURE__*/_jsx(Text, {
|
|
565
|
+
style: s.emptySection,
|
|
566
|
+
children: "No request body"
|
|
567
|
+
})
|
|
568
|
+
}), e.request?.headers && /*#__PURE__*/_jsx(CollapsibleSection, {
|
|
569
|
+
title: "Request Headers",
|
|
570
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
571
|
+
style: s.sectionWithCopy,
|
|
572
|
+
children: [/*#__PURE__*/_jsx(CopyButton, {
|
|
573
|
+
text: fmt(e.request.headers),
|
|
574
|
+
label: "Request Headers"
|
|
575
|
+
}), /*#__PURE__*/_jsx(JsonView, {
|
|
576
|
+
data: e.request.headers,
|
|
577
|
+
maxHeight: 200
|
|
578
|
+
})]
|
|
579
|
+
})
|
|
580
|
+
}), /*#__PURE__*/_jsx(CollapsibleSection, {
|
|
581
|
+
title: "Response Body",
|
|
582
|
+
initiallyExpanded: true,
|
|
583
|
+
children: e.response?.data != null ? /*#__PURE__*/_jsxs(View, {
|
|
584
|
+
style: s.sectionWithCopy,
|
|
585
|
+
children: [/*#__PURE__*/_jsx(CopyButton, {
|
|
586
|
+
text: fmt(e.response.data),
|
|
587
|
+
label: "Response Body"
|
|
588
|
+
}), /*#__PURE__*/_jsx(JsonView, {
|
|
589
|
+
data: e.response.data,
|
|
590
|
+
maxHeight: 300
|
|
591
|
+
})]
|
|
592
|
+
}) : /*#__PURE__*/_jsx(Text, {
|
|
593
|
+
style: s.emptySection,
|
|
594
|
+
children: "No response body"
|
|
595
|
+
})
|
|
596
|
+
}), e.response?.headers && /*#__PURE__*/_jsx(CollapsibleSection, {
|
|
597
|
+
title: "Response Headers",
|
|
598
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
599
|
+
style: s.sectionWithCopy,
|
|
600
|
+
children: [/*#__PURE__*/_jsx(CopyButton, {
|
|
601
|
+
text: fmt(e.response.headers),
|
|
602
|
+
label: "Response Headers"
|
|
603
|
+
}), /*#__PURE__*/_jsx(JsonView, {
|
|
604
|
+
data: e.response.headers,
|
|
605
|
+
maxHeight: 200
|
|
606
|
+
})]
|
|
607
|
+
})
|
|
608
|
+
})]
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
return /*#__PURE__*/_jsx(ScrollView, {
|
|
612
|
+
style: s.detailBody,
|
|
613
|
+
contentContainerStyle: s.detailBodyContent,
|
|
614
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
615
|
+
style: s.sectionWithCopy,
|
|
616
|
+
children: [/*#__PURE__*/_jsx(CopyButton, {
|
|
617
|
+
text: fmt(entry.raw),
|
|
618
|
+
label: "Event"
|
|
619
|
+
}), /*#__PURE__*/_jsx(JsonView, {
|
|
620
|
+
data: entry.raw,
|
|
621
|
+
maxHeight: 400
|
|
622
|
+
})]
|
|
623
|
+
})
|
|
624
|
+
});
|
|
625
|
+
});
|
|
626
|
+
|
|
627
|
+
// ── Styles ─────────────────────────────────────────────────────────────
|
|
628
|
+
|
|
629
|
+
const s = StyleSheet.create({
|
|
630
|
+
container: {
|
|
631
|
+
flex: 1,
|
|
632
|
+
backgroundColor: Colors.background
|
|
633
|
+
},
|
|
634
|
+
scrollContent: {
|
|
635
|
+
paddingTop: 12,
|
|
636
|
+
paddingBottom: 60
|
|
637
|
+
},
|
|
638
|
+
// Center (loading / empty)
|
|
639
|
+
center: {
|
|
640
|
+
flex: 1,
|
|
641
|
+
justifyContent: 'center',
|
|
642
|
+
alignItems: 'center',
|
|
643
|
+
backgroundColor: Colors.background,
|
|
644
|
+
padding: 32
|
|
645
|
+
},
|
|
646
|
+
emptyClock: {
|
|
647
|
+
width: 64,
|
|
648
|
+
height: 64,
|
|
649
|
+
borderRadius: 32,
|
|
650
|
+
backgroundColor: Colors.surface,
|
|
651
|
+
alignItems: 'center',
|
|
652
|
+
justifyContent: 'center',
|
|
653
|
+
borderWidth: 1,
|
|
654
|
+
borderColor: Colors.border,
|
|
655
|
+
marginBottom: 16
|
|
656
|
+
},
|
|
657
|
+
emptyClockText: {
|
|
658
|
+
fontSize: 28
|
|
659
|
+
},
|
|
660
|
+
emptyTitle: {
|
|
661
|
+
fontSize: 17,
|
|
662
|
+
fontWeight: '600',
|
|
663
|
+
color: Colors.text,
|
|
664
|
+
marginBottom: 6
|
|
665
|
+
},
|
|
666
|
+
emptySub: {
|
|
667
|
+
fontSize: 14,
|
|
668
|
+
color: Colors.textSecondary,
|
|
669
|
+
textAlign: 'center',
|
|
670
|
+
lineHeight: 20
|
|
671
|
+
},
|
|
672
|
+
// Current session
|
|
673
|
+
currentCard: {
|
|
674
|
+
backgroundColor: Colors.primary,
|
|
675
|
+
marginHorizontal: 16,
|
|
676
|
+
borderRadius: 14,
|
|
677
|
+
padding: 16,
|
|
678
|
+
marginBottom: 20
|
|
679
|
+
},
|
|
680
|
+
currentRow: {
|
|
681
|
+
flexDirection: 'row',
|
|
682
|
+
alignItems: 'center',
|
|
683
|
+
marginBottom: 6
|
|
684
|
+
},
|
|
685
|
+
pulseDot: {
|
|
686
|
+
width: 8,
|
|
687
|
+
height: 8,
|
|
688
|
+
borderRadius: 4,
|
|
689
|
+
backgroundColor: '#4CD964',
|
|
690
|
+
marginRight: 8
|
|
691
|
+
},
|
|
692
|
+
currentLabel: {
|
|
693
|
+
fontSize: 11,
|
|
694
|
+
fontWeight: '700',
|
|
695
|
+
color: 'rgba(255,255,255,0.7)',
|
|
696
|
+
letterSpacing: 0.8
|
|
697
|
+
},
|
|
698
|
+
currentTime: {
|
|
699
|
+
fontSize: 15,
|
|
700
|
+
color: '#FFFFFF',
|
|
701
|
+
fontWeight: '500'
|
|
702
|
+
},
|
|
703
|
+
// Timeline
|
|
704
|
+
timelineSection: {
|
|
705
|
+
paddingHorizontal: 16
|
|
706
|
+
},
|
|
707
|
+
timelineHeader: {
|
|
708
|
+
fontSize: 11,
|
|
709
|
+
fontWeight: '700',
|
|
710
|
+
color: Colors.textLight,
|
|
711
|
+
letterSpacing: 0.8,
|
|
712
|
+
marginBottom: 12
|
|
713
|
+
},
|
|
714
|
+
timelineRow: {
|
|
715
|
+
flexDirection: 'row'
|
|
716
|
+
},
|
|
717
|
+
railCol: {
|
|
718
|
+
width: 24,
|
|
719
|
+
alignItems: 'center',
|
|
720
|
+
paddingTop: 14
|
|
721
|
+
},
|
|
722
|
+
railDot: {
|
|
723
|
+
width: 10,
|
|
724
|
+
height: 10,
|
|
725
|
+
borderRadius: 5,
|
|
726
|
+
backgroundColor: Colors.surface,
|
|
727
|
+
borderWidth: 2,
|
|
728
|
+
borderColor: Colors.textLight,
|
|
729
|
+
zIndex: 1
|
|
730
|
+
},
|
|
731
|
+
railLine: {
|
|
732
|
+
width: 2,
|
|
733
|
+
flex: 1,
|
|
734
|
+
backgroundColor: Colors.border,
|
|
735
|
+
marginTop: -1
|
|
736
|
+
},
|
|
737
|
+
historyCard: {
|
|
738
|
+
flex: 1,
|
|
739
|
+
backgroundColor: Colors.surface,
|
|
740
|
+
borderRadius: 12,
|
|
741
|
+
padding: 14,
|
|
742
|
+
marginBottom: 10,
|
|
743
|
+
marginLeft: 8
|
|
744
|
+
},
|
|
745
|
+
cardTop: {
|
|
746
|
+
flexDirection: 'row',
|
|
747
|
+
alignItems: 'baseline',
|
|
748
|
+
justifyContent: 'space-between',
|
|
749
|
+
marginBottom: 8
|
|
750
|
+
},
|
|
751
|
+
cardTime: {
|
|
752
|
+
fontSize: 15,
|
|
753
|
+
fontWeight: '600',
|
|
754
|
+
color: Colors.text
|
|
755
|
+
},
|
|
756
|
+
cardRelative: {
|
|
757
|
+
fontSize: 13,
|
|
758
|
+
color: Colors.textSecondary
|
|
759
|
+
},
|
|
760
|
+
cardEmpty: {
|
|
761
|
+
fontSize: 13,
|
|
762
|
+
color: Colors.textLight,
|
|
763
|
+
marginBottom: 4
|
|
764
|
+
},
|
|
765
|
+
pillRow: {
|
|
766
|
+
flexDirection: 'row',
|
|
767
|
+
flexWrap: 'wrap',
|
|
768
|
+
gap: 6,
|
|
769
|
+
marginBottom: 8
|
|
770
|
+
},
|
|
771
|
+
pill: {
|
|
772
|
+
flexDirection: 'row',
|
|
773
|
+
alignItems: 'center',
|
|
774
|
+
paddingHorizontal: 8,
|
|
775
|
+
paddingVertical: 3,
|
|
776
|
+
borderRadius: 6
|
|
777
|
+
},
|
|
778
|
+
pillDot: {
|
|
779
|
+
width: 6,
|
|
780
|
+
height: 6,
|
|
781
|
+
borderRadius: 3,
|
|
782
|
+
marginRight: 5
|
|
783
|
+
},
|
|
784
|
+
pillText: {
|
|
785
|
+
fontSize: 12,
|
|
786
|
+
fontWeight: '600'
|
|
787
|
+
},
|
|
788
|
+
cardFooter: {
|
|
789
|
+
flexDirection: 'row',
|
|
790
|
+
justifyContent: 'space-between',
|
|
791
|
+
alignItems: 'center',
|
|
792
|
+
marginTop: 4
|
|
793
|
+
},
|
|
794
|
+
cardId: {
|
|
795
|
+
fontSize: 11,
|
|
796
|
+
color: Colors.textLight,
|
|
797
|
+
fontFamily: 'Courier',
|
|
798
|
+
fontWeight: '500'
|
|
799
|
+
},
|
|
800
|
+
cardChevron: {
|
|
801
|
+
fontSize: 20,
|
|
802
|
+
color: Colors.textLight,
|
|
803
|
+
fontWeight: '400'
|
|
804
|
+
},
|
|
805
|
+
// ── Session detail header ──
|
|
806
|
+
sessionHeader: {
|
|
807
|
+
flexDirection: 'row',
|
|
808
|
+
alignItems: 'center',
|
|
809
|
+
justifyContent: 'space-between',
|
|
810
|
+
paddingHorizontal: 16,
|
|
811
|
+
paddingVertical: 10,
|
|
812
|
+
backgroundColor: Colors.surface,
|
|
813
|
+
borderBottomWidth: StyleSheet.hairlineWidth,
|
|
814
|
+
borderBottomColor: Colors.border
|
|
815
|
+
},
|
|
816
|
+
headerBackBtn: {
|
|
817
|
+
flexDirection: 'row',
|
|
818
|
+
alignItems: 'center',
|
|
819
|
+
paddingVertical: 4
|
|
820
|
+
},
|
|
821
|
+
headerArrow: {
|
|
822
|
+
fontSize: 22,
|
|
823
|
+
color: Colors.primary,
|
|
824
|
+
fontWeight: '400',
|
|
825
|
+
marginRight: 2
|
|
826
|
+
},
|
|
827
|
+
headerBackLabel: {
|
|
828
|
+
fontSize: 15,
|
|
829
|
+
color: Colors.primary,
|
|
830
|
+
fontWeight: '600'
|
|
831
|
+
},
|
|
832
|
+
headerMeta: {
|
|
833
|
+
fontSize: 12,
|
|
834
|
+
color: Colors.textSecondary,
|
|
835
|
+
fontFamily: 'Courier'
|
|
836
|
+
},
|
|
837
|
+
// ── Filter bar ──
|
|
838
|
+
filterBar: {
|
|
839
|
+
flexDirection: 'row',
|
|
840
|
+
paddingHorizontal: 12,
|
|
841
|
+
paddingVertical: 8,
|
|
842
|
+
backgroundColor: Colors.background,
|
|
843
|
+
gap: 6
|
|
844
|
+
},
|
|
845
|
+
chip: {
|
|
846
|
+
paddingHorizontal: 12,
|
|
847
|
+
paddingVertical: 6,
|
|
848
|
+
borderRadius: 8,
|
|
849
|
+
backgroundColor: Colors.surface
|
|
850
|
+
},
|
|
851
|
+
chipLabel: {
|
|
852
|
+
fontSize: 13,
|
|
853
|
+
fontWeight: '500',
|
|
854
|
+
color: Colors.textSecondary
|
|
855
|
+
},
|
|
856
|
+
chipLabelActive: {
|
|
857
|
+
color: '#FFFFFF'
|
|
858
|
+
},
|
|
859
|
+
chipCount: {
|
|
860
|
+
fontSize: 12,
|
|
861
|
+
fontWeight: '600',
|
|
862
|
+
color: Colors.textLight
|
|
863
|
+
},
|
|
864
|
+
chipCountActive: {
|
|
865
|
+
color: 'rgba(255,255,255,0.8)'
|
|
866
|
+
},
|
|
867
|
+
// ── Log rows (inside LogListScreen cards) ──
|
|
868
|
+
rowContent: {
|
|
869
|
+
flexDirection: 'row',
|
|
870
|
+
padding: 14,
|
|
871
|
+
alignItems: 'flex-start'
|
|
872
|
+
},
|
|
873
|
+
levelDot: {
|
|
874
|
+
width: 24,
|
|
875
|
+
height: 24,
|
|
876
|
+
borderRadius: 12,
|
|
877
|
+
alignItems: 'center',
|
|
878
|
+
justifyContent: 'center',
|
|
879
|
+
marginRight: 12,
|
|
880
|
+
marginTop: 1
|
|
881
|
+
},
|
|
882
|
+
levelIcon: {
|
|
883
|
+
color: '#FFF',
|
|
884
|
+
fontSize: 11,
|
|
885
|
+
fontWeight: '700'
|
|
886
|
+
},
|
|
887
|
+
statusBar: {
|
|
888
|
+
width: 3,
|
|
889
|
+
borderRadius: 2,
|
|
890
|
+
marginRight: 12,
|
|
891
|
+
minHeight: 36
|
|
892
|
+
},
|
|
893
|
+
rowBody: {
|
|
894
|
+
flex: 1
|
|
895
|
+
},
|
|
896
|
+
rowMsg: {
|
|
897
|
+
fontSize: 14,
|
|
898
|
+
color: Colors.text,
|
|
899
|
+
lineHeight: 20
|
|
900
|
+
},
|
|
901
|
+
rowTime: {
|
|
902
|
+
fontSize: 12,
|
|
903
|
+
color: Colors.textSecondary,
|
|
904
|
+
marginTop: 4
|
|
905
|
+
},
|
|
906
|
+
rowMeta: {
|
|
907
|
+
flexDirection: 'row',
|
|
908
|
+
alignItems: 'center',
|
|
909
|
+
marginBottom: 4,
|
|
910
|
+
gap: 6
|
|
911
|
+
},
|
|
912
|
+
methodText: {
|
|
913
|
+
fontSize: 13,
|
|
914
|
+
fontWeight: '700'
|
|
915
|
+
},
|
|
916
|
+
miniPill: {
|
|
917
|
+
paddingHorizontal: 7,
|
|
918
|
+
paddingVertical: 2,
|
|
919
|
+
borderRadius: 4
|
|
920
|
+
},
|
|
921
|
+
miniPillText: {
|
|
922
|
+
color: '#FFF',
|
|
923
|
+
fontSize: 10,
|
|
924
|
+
fontWeight: '700'
|
|
925
|
+
},
|
|
926
|
+
trackDot: {
|
|
927
|
+
width: 10,
|
|
928
|
+
height: 10,
|
|
929
|
+
borderRadius: 5,
|
|
930
|
+
backgroundColor: Colors.purple,
|
|
931
|
+
marginRight: 10,
|
|
932
|
+
marginTop: 5
|
|
933
|
+
},
|
|
934
|
+
// ── Log detail header ──
|
|
935
|
+
levelBadge: {
|
|
936
|
+
paddingHorizontal: 10,
|
|
937
|
+
paddingVertical: 4,
|
|
938
|
+
borderRadius: 6
|
|
939
|
+
},
|
|
940
|
+
levelBadgeText: {
|
|
941
|
+
color: '#FFF',
|
|
942
|
+
fontSize: 12,
|
|
943
|
+
fontWeight: '700'
|
|
944
|
+
},
|
|
945
|
+
detailTimestamp: {
|
|
946
|
+
flex: 1,
|
|
947
|
+
fontSize: 13,
|
|
948
|
+
color: Colors.textSecondary,
|
|
949
|
+
textAlign: 'right'
|
|
950
|
+
},
|
|
951
|
+
networkHeaderBadges: {
|
|
952
|
+
flexDirection: 'row',
|
|
953
|
+
alignItems: 'center',
|
|
954
|
+
gap: 8,
|
|
955
|
+
flex: 1
|
|
956
|
+
},
|
|
957
|
+
methodBadge: {
|
|
958
|
+
paddingHorizontal: 10,
|
|
959
|
+
paddingVertical: 4,
|
|
960
|
+
borderRadius: 6
|
|
961
|
+
},
|
|
962
|
+
methodBadgeText: {
|
|
963
|
+
color: '#FFF',
|
|
964
|
+
fontSize: 12,
|
|
965
|
+
fontWeight: '700'
|
|
966
|
+
},
|
|
967
|
+
statusPill: {
|
|
968
|
+
paddingHorizontal: 9,
|
|
969
|
+
paddingVertical: 3,
|
|
970
|
+
borderRadius: 6
|
|
971
|
+
},
|
|
972
|
+
statusPillText: {
|
|
973
|
+
color: '#FFF',
|
|
974
|
+
fontSize: 11,
|
|
975
|
+
fontWeight: '700'
|
|
976
|
+
},
|
|
977
|
+
durationText: {
|
|
978
|
+
fontSize: 12,
|
|
979
|
+
color: Colors.textSecondary,
|
|
980
|
+
fontWeight: '500'
|
|
981
|
+
},
|
|
982
|
+
// ── Log detail body ──
|
|
983
|
+
detailBody: {
|
|
984
|
+
flex: 1
|
|
985
|
+
},
|
|
986
|
+
detailBodyContent: {
|
|
987
|
+
padding: 12,
|
|
988
|
+
paddingBottom: 40
|
|
989
|
+
},
|
|
990
|
+
sectionWithCopy: {
|
|
991
|
+
gap: 8
|
|
992
|
+
},
|
|
993
|
+
plainText: {
|
|
994
|
+
fontFamily: 'Courier',
|
|
995
|
+
fontSize: 13,
|
|
996
|
+
color: Colors.text,
|
|
997
|
+
lineHeight: 20
|
|
998
|
+
},
|
|
999
|
+
urlCard: {
|
|
1000
|
+
flexDirection: 'row',
|
|
1001
|
+
alignItems: 'center',
|
|
1002
|
+
backgroundColor: Colors.surface,
|
|
1003
|
+
borderRadius: 12,
|
|
1004
|
+
padding: 14,
|
|
1005
|
+
marginBottom: 8,
|
|
1006
|
+
gap: 8
|
|
1007
|
+
},
|
|
1008
|
+
urlText: {
|
|
1009
|
+
flex: 1,
|
|
1010
|
+
fontSize: 13,
|
|
1011
|
+
color: Colors.textSecondary,
|
|
1012
|
+
lineHeight: 18
|
|
1013
|
+
},
|
|
1014
|
+
emptySection: {
|
|
1015
|
+
fontSize: 13,
|
|
1016
|
+
color: Colors.textLight,
|
|
1017
|
+
paddingVertical: 4
|
|
1018
|
+
},
|
|
1019
|
+
errorBox: {
|
|
1020
|
+
backgroundColor: 'rgba(255,59,48,0.06)',
|
|
1021
|
+
borderWidth: 1,
|
|
1022
|
+
borderColor: 'rgba(255,59,48,0.15)',
|
|
1023
|
+
borderRadius: 10,
|
|
1024
|
+
padding: 12,
|
|
1025
|
+
marginBottom: 10,
|
|
1026
|
+
flexDirection: 'row',
|
|
1027
|
+
alignItems: 'flex-start',
|
|
1028
|
+
gap: 8
|
|
1029
|
+
},
|
|
1030
|
+
errorIcon: {
|
|
1031
|
+
fontSize: 14,
|
|
1032
|
+
color: Colors.error
|
|
1033
|
+
},
|
|
1034
|
+
errorText: {
|
|
1035
|
+
flex: 1,
|
|
1036
|
+
fontSize: 13,
|
|
1037
|
+
color: Colors.error,
|
|
1038
|
+
lineHeight: 18
|
|
1039
|
+
}
|
|
1040
|
+
});
|
|
1041
|
+
//# sourceMappingURL=SessionHistoryTab.js.map
|