Skip to content
Open
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
173 changes: 168 additions & 5 deletions DebugProbe.AspNetCore/Assets/css/debugprobe.css
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,51 @@ h4 {
margin-top: 22px;
}

.compare-page .compare-card {
margin-top: 0;
}

.compare-header-actions {
display: inline-flex;
align-items: center;
gap: 6px;
}

.compare-icon-action {
display: inline-flex;
align-items: center;
justify-content: center;
flex: 0 0 30px;
width: 30px;
height: 30px;
padding: 0;
background: #fff;
border: 1px solid #e5e7eb;
border-radius: 6px;
color: #6b7280;
cursor: pointer;
}

.compare-icon-action:hover {
background: #f9fafb;
border-color: #d1d5db;
color: #111827;
}

.compare-icon-action[hidden] {
display: none;
}

.compare-icon-action svg {
width: 15px;
height: 15px;
stroke: currentColor;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
fill: none;
}

.mono-value {
overflow: hidden;
max-width: min(520px, 58vw);
Expand Down Expand Up @@ -477,9 +522,11 @@ tbody tr:last-child td {

#compareResult:not(:empty) {
margin: 0 10px 10px;
overflow: hidden;
display: grid;
gap: 8px;
border: 1px solid #eceff3;
border-radius: 6px;
padding: 8px;
}

.payload-panel {
Expand Down Expand Up @@ -634,24 +681,29 @@ tbody tr:last-child td {

.code-block {
position: relative;
min-width: 0;
border-top: 1px solid #2d3748;
}

.code-block pre {
min-height: 18px;
max-height: 360px;
max-height: 420px;
margin: 0;
}

pre {
overflow: auto;
box-sizing: border-box;
max-width: 100%;
overflow-x: auto;
overflow-y: auto;
margin: 0;
padding: 12px 84px 12px 12px;
background: #1e1e1e;
border-radius: 0 0 6px 6px;
color: #dcdcdc;
font-size: 13px;
line-height: 1.4;
white-space: pre;
tab-size: 2;
}

Expand All @@ -662,6 +714,7 @@ pre {
.json-compare {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
align-items: stretch;
gap: 10px;
}

Expand All @@ -685,7 +738,7 @@ pre {

.compare-row {
display: grid;
grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1fr) minmax(0, 1fr);
grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1fr) minmax(0, 1fr) minmax(100px, 0.45fr);
gap: 12px;
padding: 8px 10px;
border-bottom: 1px solid #f2f4f7;
Expand Down Expand Up @@ -715,6 +768,11 @@ pre {
font-size: 12px;
}

.compare-row strong {
color: #4b5563;
font-size: 12px;
}

.compare-row-changed {
background: rgba(255, 200, 0, 0.12);
}
Expand All @@ -724,7 +782,30 @@ pre {
}

.compare-pane {
display: flex;
flex-direction: column;
min-width: 0;
min-height: 0;
}

.compare-pane .code-block {
display: flex;
flex: 1 1 auto;
flex-direction: column;
min-height: 0;
max-height: 420px;
overflow: hidden;
border-radius: 0 0 6px 6px;
}

.compare-pane .code-block pre {
flex: 1 1 auto;
height: 100%;
max-height: none;
}

.compare-pane .compare-empty {
flex: 1 1 auto;
}

.compare-pane-title {
Expand Down Expand Up @@ -764,6 +845,85 @@ pre {
color: #b42318;
}

.compare-summary {
display: grid;
gap: 8px;
padding: 10px;
background: #fff;
border: 1px solid #eceff3;
border-radius: 6px;
}

.compare-summary-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding-bottom: 8px;
border-bottom: 1px solid #f2f4f7;
}

.compare-summary-head strong {
color: #111827;
font-size: 15px;
}

.compare-summary-head span,
.compare-summary-empty {
color: #6b7280;
font-size: 12px;
font-weight: 700;
}

.compare-summary-group {
display: grid;
gap: 6px;
}

.compare-summary-group h4,
.compare-subhead {
margin: 0;
color: #4b5563;
font-size: 12px;
font-weight: 800;
text-transform: uppercase;
}

.compare-summary-item {
display: grid;
grid-template-columns: minmax(110px, auto) minmax(160px, 0.8fr) minmax(0, 1fr);
gap: 10px;
align-items: center;
padding: 7px 8px;
background: #fbfbfc;
border: 1px solid #f2f4f7;
border-radius: 6px;
font-size: 12px;
}

.compare-summary-item strong {
color: #111827;
}

.compare-summary-item small {
overflow-wrap: anywhere;
color: #4b5563;
font-size: 12px;
}

.compare-tag {
display: inline-flex;
align-items: center;
justify-content: center;
min-height: 22px;
padding: 0 8px;
background: #eef2ff;
border-radius: 999px;
color: #3730a3;
font-size: 11px;
font-weight: 800;
}

/* =========================
Badges
========================= */
Expand Down Expand Up @@ -792,10 +952,13 @@ pre {
========================= */

.diff-line {
box-sizing: border-box;
width: max-content;
min-height: 18px;
padding-left: 6px;
padding: 0 6px;
background: rgba(255, 200, 0, 0.12);
border-left: 3px solid #f1c40f;
white-space: pre;
}

.diff-line-added {
Expand Down
28 changes: 27 additions & 1 deletion DebugProbe.AspNetCore/Assets/html/details.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,33 @@
<div class="trace-card-title">
<span class="trace-dot" aria-hidden="true"></span>
<span class="trace-label">Compare Trace</span>
<strong>Remote environment</strong>
</div>
<div class="compare-header-actions">
<button id="copyCompareLink"
class="compare-icon-action"
type="button"
title="Copy share link"
aria-label="Copy share link"
onclick="copyCompareShareLink()"
hidden>
<svg viewBox="0 0 24 24" aria-hidden="true">
<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path>
<path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path>
</svg>
</button>
<button id="openCompareTab"
class="compare-icon-action"
type="button"
title="Open in new tab"
aria-label="Open in new tab"
onclick="openCompareInNewTab()"
hidden>
<svg viewBox="0 0 24 24" aria-hidden="true">
<path d="M14 3h7v7"></path>
<path d="M10 14 21 3"></path>
<path d="M21 14v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5"></path>
</svg>
</button>
</div>
</div>

Expand Down
18 changes: 13 additions & 5 deletions DebugProbe.AspNetCore/Assets/js/debugprobe-compare-engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@

if ((!local.ok && !localEmpty) || (!remote.ok && !remoteEmpty)) {
return {
local: (localEmpty ? '(empty)' : local.raw)
.split('\n')
local: linesForParsedOrRaw(local, localEmpty)
.map(x => ({
text: x,
state: !local.ok && !localEmpty ? 'invalid' : ''
})),

remote: (remoteEmpty ? '(empty)' : remote.raw)
.split('\n')
remote: linesForParsedOrRaw(remote, remoteEmpty)
.map(x => ({
text: x,
state: !remote.ok && !remoteEmpty ? 'invalid' : ''
Expand Down Expand Up @@ -68,6 +66,16 @@
return rows;
}

function linesForParsedOrRaw(payload, empty) {
if (empty) {
return ['(empty)'];
}

return payload.ok
? stringifyLines(payload.value, 0, false)
: payload.raw.split('\n');
}

function parseJson(json) {
if (!json || json.trim() === '') {
return {
Expand Down Expand Up @@ -816,4 +824,4 @@ function indent(depth) {
return ' '.repeat(depth);
}

window.compareJsonBodies = compareJsonBodies;
window.compareJsonBodies = compareJsonBodies;
Loading
Loading