Skip to content

Commit 1924b01

Browse files
committed
Update SimDeck docs and workflow guidance
1 parent 31e0c56 commit 1924b01

4 files changed

Lines changed: 63 additions & 55 deletions

File tree

client/src/app/AppShell.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -782,10 +782,14 @@ export function AppShell({
782782
}
783783
}
784784

785-
document.addEventListener("pointerdown", handleDocumentPointerDown);
785+
document.addEventListener("pointerdown", handleDocumentPointerDown, true);
786786
window.addEventListener("keydown", handleWindowKeyDown);
787787
return () => {
788-
document.removeEventListener("pointerdown", handleDocumentPointerDown);
788+
document.removeEventListener(
789+
"pointerdown",
790+
handleDocumentPointerDown,
791+
true,
792+
);
789793
window.removeEventListener("keydown", handleWindowKeyDown);
790794
};
791795
}, [menuOpen]);
@@ -1477,6 +1481,7 @@ export function AppShell({
14771481
<DebugPanel
14781482
fps={fps}
14791483
inline
1484+
onClose={() => setDebugVisible(false)}
14801485
runtimeInfo={runtimeInfo}
14811486
stats={stats}
14821487
status={streamStatus}

client/src/features/toolbar/DebugPanel.tsx

Lines changed: 16 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import type {
77
interface DebugPanelProps {
88
fps: number;
99
inline?: boolean;
10+
onClose?: () => void;
1011
runtimeInfo: StreamRuntimeInfo;
1112
stats: StreamStats;
1213
status: StreamStatus;
@@ -26,90 +27,61 @@ function formatMs(value: number): string {
2627
return `${value.toFixed(1)} ms`;
2728
}
2829

29-
function formatGpuStatus(runtimeInfo: StreamRuntimeInfo): string {
30-
if (!runtimeInfo.webGL2) {
31-
return "No";
32-
}
33-
if (runtimeInfo.gpuLikelyHardware == null) {
34-
return "Unknown";
35-
}
36-
return runtimeInfo.gpuLikelyHardware ? "Yes" : "No";
37-
}
38-
3930
function formatResolution(stats: StreamStats): string {
4031
if (!stats.width || !stats.height) {
4132
return "—";
4233
}
4334
return `${stats.width}×${stats.height}`;
4435
}
4536

46-
function formatValue(value: string | number | undefined): string {
47-
if (value == null || value === "") {
48-
return "—";
49-
}
50-
return String(value);
51-
}
52-
5337
export function DebugPanel({
5438
fps,
5539
inline = false,
40+
onClose,
5641
runtimeInfo,
5742
stats,
5843
status,
5944
}: DebugPanelProps) {
6045
const rows: Array<{ label: string; value: string }> = [
6146
{ label: "State", value: status.state },
6247
{ label: "FPS", value: formatFps(fps) },
63-
{ label: "Codec", value: formatValue(stats.codec) },
6448
{ label: "Resolution", value: formatResolution(stats) },
6549
{ label: "Packets", value: String(stats.receivedPackets) },
6650
{ label: "Dropped", value: String(stats.droppedFrames) },
6751
{ label: "Reconnects", value: String(stats.reconnects) },
68-
{ label: "Frame Seq", value: String(stats.frameSequence) },
6952
{ label: "Decoded", value: String(stats.decodedFrames) },
7053
{ label: "Rendered", value: String(stats.renderedFrames) },
71-
{ label: "Decode Q", value: String(stats.decodeQueueSize) },
7254
{ label: "Render", value: formatMs(stats.latestRenderMs) },
7355
{ label: "Frame Gap", value: formatMs(stats.latestFrameGapMs) },
7456
{ label: "Path", value: runtimeInfo.streamBackend },
75-
{ label: "Renderer", value: runtimeInfo.renderBackend },
76-
{ label: "GPU", value: formatGpuStatus(runtimeInfo) },
7757
];
7858

79-
const gpuRenderer = runtimeInfo.gpuRenderer.trim();
80-
const gpuVendor = runtimeInfo.gpuVendor.trim();
81-
8259
return (
8360
<section
8461
aria-label="Stream debug info"
8562
className={`debug-panel ${inline ? "debug-panel-inline" : "debug-panel-popover"}`}
8663
>
87-
<div className="debug-panel-header">Debug Info</div>
64+
<div className="debug-panel-header">
65+
<span>Debug Info</span>
66+
{onClose ? (
67+
<button
68+
aria-label="Close debug info"
69+
className="debug-close"
70+
onClick={onClose}
71+
title="Close"
72+
type="button"
73+
>
74+
x
75+
</button>
76+
) : null}
77+
</div>
8878
<dl className="debug-grid">
8979
{rows.map((row) => (
9080
<div className="debug-row" key={row.label}>
9181
<dt className="debug-label">{row.label}</dt>
9282
<dd className="debug-value">{row.value}</dd>
9383
</div>
9484
))}
95-
{gpuVendor ? (
96-
<div className="debug-row debug-row-wide">
97-
<dt className="debug-label">GPU Vendor</dt>
98-
<dd className="debug-value debug-value-wrap">{gpuVendor}</dd>
99-
</div>
100-
) : null}
101-
{gpuRenderer ? (
102-
<div className="debug-row debug-row-wide">
103-
<dt className="debug-label">GPU Renderer</dt>
104-
<dd className="debug-value debug-value-wrap">{gpuRenderer}</dd>
105-
</div>
106-
) : null}
107-
{status.detail ? (
108-
<div className="debug-row debug-row-wide">
109-
<dt className="debug-label">Detail</dt>
110-
<dd className="debug-value debug-value-wrap">{status.detail}</dd>
111-
</div>
112-
) : null}
11385
</dl>
11486
</section>
11587
);

client/src/styles/components.css

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@
170170
}
171171

172172
.debug-panel-header {
173+
display: flex;
174+
align-items: center;
175+
justify-content: space-between;
176+
gap: 8px;
173177
margin-bottom: 10px;
174178
color: var(--text-secondary);
175179
font-size: 11px;
@@ -178,6 +182,27 @@
178182
text-transform: uppercase;
179183
}
180184

185+
.debug-close {
186+
display: inline-grid;
187+
place-items: center;
188+
width: 24px;
189+
height: 24px;
190+
margin: -6px -4px -4px 0;
191+
padding: 0;
192+
color: var(--text-secondary);
193+
background: transparent;
194+
border: 0;
195+
border-radius: 6px;
196+
cursor: pointer;
197+
font-size: 18px;
198+
line-height: 1;
199+
}
200+
201+
.debug-close:hover {
202+
color: var(--text);
203+
background: var(--surface-raised);
204+
}
205+
181206
.debug-grid {
182207
display: grid;
183208
grid-template-columns: repeat(2, minmax(0, 1fr));
@@ -423,6 +448,7 @@
423448

424449
.hierarchy-panel {
425450
position: relative;
451+
box-sizing: border-box;
426452
flex: 0 0 auto;
427453
min-width: 240px;
428454
max-width: 55vw;
@@ -476,6 +502,7 @@
476502

477503
.hierarchy-tree {
478504
flex: 1;
505+
min-height: 0;
479506
overflow: auto;
480507
padding: 4px;
481508
scrollbar-width: thin;

client/src/styles/layout.css

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
}
8484

8585
.main {
86+
position: relative;
8687
display: flex;
8788
overflow: hidden;
8889
min-height: 0;
@@ -145,10 +146,6 @@
145146
display: block;
146147
}
147148

148-
.main {
149-
flex-direction: column;
150-
}
151-
152149
.debug-grid {
153150
grid-template-columns: 1fr;
154151
}
@@ -168,12 +165,19 @@
168165
}
169166

170167
.hierarchy-panel {
171-
width: 100%;
168+
position: absolute;
169+
top: 8px;
170+
left: 8px;
171+
bottom: 8px;
172+
z-index: 18;
173+
width: min(360px, calc(100vw - 16px));
172174
min-width: 0;
173-
max-width: none;
174-
max-height: min(42dvh, 360px);
175-
border-right: 0;
176-
border-bottom: 1px solid var(--border);
175+
max-width: calc(100vw - 16px);
176+
max-height: none;
177+
height: calc(100% - 16px);
178+
border: 1px solid var(--border);
179+
border-radius: 8px;
180+
box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
177181
}
178182

179183
.toolbar-sim-detail {

0 commit comments

Comments
 (0)