reactoradar 1.5.9 → 1.5.10
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/app.js +69 -29
- package/package.json +1 -1
- package/styles.css +12 -5
package/app.js
CHANGED
|
@@ -2051,9 +2051,8 @@ function _createHighlightedTree(key, val, changedPaths, currentPath, isOld) {
|
|
|
2051
2051
|
|
|
2052
2052
|
const children = document.createElement('div');
|
|
2053
2053
|
children.className = 'ov-children';
|
|
2054
|
-
//
|
|
2055
|
-
children.style.display =
|
|
2056
|
-
if (hasChangedDescendant) { arrow.textContent = '\u25BC'; arrow.classList.add('open'); }
|
|
2054
|
+
// Always start collapsed — user expands what they need
|
|
2055
|
+
children.style.display = 'none';
|
|
2057
2056
|
|
|
2058
2057
|
let populated = false;
|
|
2059
2058
|
function populate() {
|
|
@@ -2065,9 +2064,6 @@ function _createHighlightedTree(key, val, changedPaths, currentPath, isOld) {
|
|
|
2065
2064
|
});
|
|
2066
2065
|
}
|
|
2067
2066
|
|
|
2068
|
-
// Populate immediately if expanded, otherwise lazy
|
|
2069
|
-
if (hasChangedDescendant) populate();
|
|
2070
|
-
|
|
2071
2067
|
header.addEventListener('click', (e) => {
|
|
2072
2068
|
e.stopPropagation();
|
|
2073
2069
|
const open = children.style.display !== 'none';
|
|
@@ -2171,7 +2167,7 @@ function renderRedux() {
|
|
|
2171
2167
|
} else {
|
|
2172
2168
|
typeHtml = `<span class="rdx-type">${esc(a.type)}</span>`;
|
|
2173
2169
|
}
|
|
2174
|
-
header.innerHTML = `<span class="rdx-index">#${a.index}</span>${typeHtml}
|
|
2170
|
+
header.innerHTML = `<span class="rdx-index">#${a.index}</span>${typeHtml}<span class="rdx-header-right">${changesBadge}<span class="rdx-time">${ts(a.ts)}</span></span>`;
|
|
2175
2171
|
// Toggle: click to expand, click again to collapse
|
|
2176
2172
|
header.addEventListener('click', () => {
|
|
2177
2173
|
state.redux.selected = isSelected ? -1 : a.index;
|
|
@@ -2195,6 +2191,18 @@ function renderRedux() {
|
|
|
2195
2191
|
const detail = document.createElement('div');
|
|
2196
2192
|
detail.className = 'rdx-entry-detail';
|
|
2197
2193
|
|
|
2194
|
+
// Close button
|
|
2195
|
+
const closeBtn = document.createElement('button');
|
|
2196
|
+
closeBtn.className = 'rdx-close-btn';
|
|
2197
|
+
closeBtn.textContent = '✕';
|
|
2198
|
+
closeBtn.title = 'Close';
|
|
2199
|
+
closeBtn.addEventListener('click', (e) => {
|
|
2200
|
+
e.stopPropagation();
|
|
2201
|
+
state.redux.selected = -1;
|
|
2202
|
+
renderRedux();
|
|
2203
|
+
});
|
|
2204
|
+
detail.appendChild(closeBtn);
|
|
2205
|
+
|
|
2198
2206
|
// Changed keys badges
|
|
2199
2207
|
if (a.changedKeys?.length > 0) {
|
|
2200
2208
|
const keysEl = document.createElement('div');
|
|
@@ -2213,8 +2221,7 @@ function renderRedux() {
|
|
|
2213
2221
|
detail.appendChild(createTreeNode(null, a.payload, false));
|
|
2214
2222
|
}
|
|
2215
2223
|
|
|
2216
|
-
// Store changes —
|
|
2217
|
-
// with changed sub-keys highlighted
|
|
2224
|
+
// Store changes — two-column layout: Previous | Current
|
|
2218
2225
|
const prevS = a.index > 0 ? states[a.index - 1] : null;
|
|
2219
2226
|
const currS = states[a.index];
|
|
2220
2227
|
if (currS && typeof currS === 'object' && a.changedKeys?.length > 0) {
|
|
@@ -2234,30 +2241,63 @@ function renderRedux() {
|
|
|
2234
2241
|
const changedPaths = new Set();
|
|
2235
2242
|
_findLeafChanges(oldVal, newVal, '').forEach(c => changedPaths.add(c.path));
|
|
2236
2243
|
|
|
2237
|
-
// Previous
|
|
2244
|
+
// Two-column grid: Previous | Current
|
|
2245
|
+
const grid = document.createElement('div');
|
|
2246
|
+
grid.className = 'rdx-diff-grid';
|
|
2247
|
+
|
|
2248
|
+
// Previous column
|
|
2249
|
+
const prevCol = document.createElement('div');
|
|
2250
|
+
prevCol.className = 'rdx-diff-col prev';
|
|
2251
|
+
const prevLabel = document.createElement('div');
|
|
2252
|
+
prevLabel.className = 'rdx-state-label prev';
|
|
2253
|
+
prevLabel.textContent = '- Previous';
|
|
2254
|
+
prevCol.appendChild(prevLabel);
|
|
2238
2255
|
if (oldVal !== undefined) {
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
prevTree.appendChild(_createHighlightedTree(null, oldVal, changedPaths, '', true));
|
|
2246
|
-
keyWrap.appendChild(prevTree);
|
|
2256
|
+
prevCol.appendChild(_createHighlightedTree(null, oldVal, changedPaths, '', true));
|
|
2257
|
+
} else {
|
|
2258
|
+
const na = document.createElement('span');
|
|
2259
|
+
na.style.cssText = 'color:var(--text-dim);font-size:10px;font-style:italic';
|
|
2260
|
+
na.textContent = 'undefined';
|
|
2261
|
+
prevCol.appendChild(na);
|
|
2247
2262
|
}
|
|
2248
|
-
|
|
2249
|
-
|
|
2263
|
+
grid.appendChild(prevCol);
|
|
2264
|
+
|
|
2265
|
+
// Current column
|
|
2266
|
+
const currCol = document.createElement('div');
|
|
2267
|
+
currCol.className = 'rdx-diff-col curr';
|
|
2268
|
+
const currLabel = document.createElement('div');
|
|
2269
|
+
currLabel.className = 'rdx-state-label curr';
|
|
2270
|
+
currLabel.textContent = '+ Current';
|
|
2271
|
+
currCol.appendChild(currLabel);
|
|
2250
2272
|
if (newVal !== undefined) {
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
currTree.appendChild(_createHighlightedTree(null, newVal, changedPaths, '', false));
|
|
2258
|
-
keyWrap.appendChild(currTree);
|
|
2273
|
+
currCol.appendChild(_createHighlightedTree(null, newVal, changedPaths, '', false));
|
|
2274
|
+
} else {
|
|
2275
|
+
const na = document.createElement('span');
|
|
2276
|
+
na.style.cssText = 'color:var(--text-dim);font-size:10px;font-style:italic';
|
|
2277
|
+
na.textContent = 'undefined';
|
|
2278
|
+
currCol.appendChild(na);
|
|
2259
2279
|
}
|
|
2260
|
-
|
|
2280
|
+
grid.appendChild(currCol);
|
|
2281
|
+
|
|
2282
|
+
// Right-click to copy on each column
|
|
2283
|
+
prevCol.addEventListener('contextmenu', (e) => {
|
|
2284
|
+
e.preventDefault(); e.stopPropagation();
|
|
2285
|
+
showContextMenu(e, [
|
|
2286
|
+
{ label: 'Copy Previous Value', action: () => navigator.clipboard.writeText(JSON.stringify(oldVal, null, 2)) },
|
|
2287
|
+
{ label: 'Copy Current Value', action: () => navigator.clipboard.writeText(JSON.stringify(newVal, null, 2)) },
|
|
2288
|
+
{ label: `Copy "${key}" key`, action: () => navigator.clipboard.writeText(key) },
|
|
2289
|
+
]);
|
|
2290
|
+
});
|
|
2291
|
+
currCol.addEventListener('contextmenu', (e) => {
|
|
2292
|
+
e.preventDefault(); e.stopPropagation();
|
|
2293
|
+
showContextMenu(e, [
|
|
2294
|
+
{ label: 'Copy Current Value', action: () => navigator.clipboard.writeText(JSON.stringify(newVal, null, 2)) },
|
|
2295
|
+
{ label: 'Copy Previous Value', action: () => navigator.clipboard.writeText(JSON.stringify(oldVal, null, 2)) },
|
|
2296
|
+
{ label: `Copy "${key}" key`, action: () => navigator.clipboard.writeText(key) },
|
|
2297
|
+
]);
|
|
2298
|
+
});
|
|
2299
|
+
|
|
2300
|
+
keyWrap.appendChild(grid);
|
|
2261
2301
|
detail.appendChild(keyWrap);
|
|
2262
2302
|
});
|
|
2263
2303
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reactoradar",
|
|
3
3
|
"productName": "ReactoRadar",
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.10",
|
|
5
5
|
"description": "macOS debugger for React Native — Console, Sources, Network, Performance, Memory, Redux, AsyncStorage, React tree. Supports RN 0.74+ with Hermes and New Architecture.",
|
|
6
6
|
"main": "main.js",
|
|
7
7
|
"bin": {
|
package/styles.css
CHANGED
|
@@ -924,7 +924,10 @@ body {
|
|
|
924
924
|
.rdx-entry-header:hover { background: var(--bg3); }
|
|
925
925
|
.rdx-entry.selected .rdx-entry-header { border-left: 3px solid var(--accent); }
|
|
926
926
|
.rdx-index { font-size: 9px; color: var(--text-dim); min-width: 20px; text-align: right; flex-shrink: 0; }
|
|
927
|
-
.rdx-type {
|
|
927
|
+
.rdx-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-bright); font-weight: 500; }
|
|
928
|
+
.rdx-type-cat { font-weight: 700; }
|
|
929
|
+
.rdx-type-name { color: var(--text-bright); font-weight: 500; }
|
|
930
|
+
.rdx-header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
|
|
928
931
|
.rdx-changes {
|
|
929
932
|
font-size: 8px; font-weight: 700; padding: 1px 5px; border-radius: 8px;
|
|
930
933
|
background: rgba(255,94,114,.12); color: var(--red); flex-shrink: 0;
|
|
@@ -968,12 +971,16 @@ body {
|
|
|
968
971
|
.rdx-diff-old { color: var(--red); text-decoration: line-through; opacity: 0.8; word-break: break-all; }
|
|
969
972
|
.rdx-diff-arrow { color: var(--text-dim); font-size: 10px; flex-shrink: 0; }
|
|
970
973
|
.rdx-diff-new { color: var(--green); font-weight: 600; word-break: break-all; }
|
|
971
|
-
.rdx-state-label { font-size: 10px; font-weight: 700; padding: 4px
|
|
974
|
+
.rdx-state-label { font-size: 10px; font-weight: 700; padding: 4px 0 2px; letter-spacing: 0.5px; }
|
|
972
975
|
.rdx-state-label.prev { color: var(--red); }
|
|
973
976
|
.rdx-state-label.curr { color: var(--green); }
|
|
974
|
-
.rdx-
|
|
975
|
-
.rdx-
|
|
976
|
-
.rdx-
|
|
977
|
+
.rdx-diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
|
|
978
|
+
.rdx-diff-col { min-width: 0; overflow: auto; max-height: 400px; padding: 4px; border-radius: 4px; font-size: 11px; }
|
|
979
|
+
.rdx-diff-col.prev { background: rgba(255,94,114,.04); border: 1px solid rgba(255,94,114,.12); }
|
|
980
|
+
.rdx-diff-col.curr { background: rgba(61,214,140,.04); border: 1px solid rgba(61,214,140,.12); }
|
|
981
|
+
.rdx-close-btn { position: absolute; top: 6px; right: 8px; background: var(--bg3); border: 1px solid var(--border); color: var(--text-dim); font-size: 11px; width: 22px; height: 22px; border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 1; }
|
|
982
|
+
.rdx-close-btn:hover { background: var(--bg4); color: var(--text); }
|
|
983
|
+
.rdx-entry-detail { position: relative; }
|
|
977
984
|
.rdx-highlight { font-weight: 600; }
|
|
978
985
|
.rdx-diff-sign { font-weight: 700; font-size: 11px; flex-shrink: 0; width: 14px; text-align: center; }
|
|
979
986
|
.rdx-diff-row.removed .rdx-diff-sign { color: var(--red); }
|