Skip to content

Commit b02e33a

Browse files
cristipufuclaude
andcommitted
fix: unify span details sections styling and behavior
Make Attributes and Identifiers sections consistent: both collapsible with same accent header color, and Identifiers items rendered as key-value rows matching the Attributes style. Bump version to 0.0.44. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 49a7cc3 commit b02e33a

6 files changed

Lines changed: 80 additions & 91 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath-dev"
3-
version = "0.0.43"
3+
version = "0.0.44"
44
description = "UiPath Developer Console"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"

src/uipath/dev/server/frontend/src/components/traces/SpanDetails.tsx

Lines changed: 33 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -109,39 +109,8 @@ function AttributeValue({ value }: { value: unknown }) {
109109
);
110110
}
111111

112-
function IdRow({ label, value }: { label: string; value: string }) {
113-
const [copied, setCopied] = useState(false);
114-
const copy = useCallback(() => {
115-
navigator.clipboard.writeText(value).then(() => {
116-
setCopied(true);
117-
setTimeout(() => setCopied(false), 1500);
118-
});
119-
}, [value]);
120-
121-
return (
122-
<div className="flex items-center gap-2 group">
123-
<span className="text-[10px] uppercase font-semibold shrink-0 w-12" style={{ color: "var(--text-muted)" }}>
124-
{label}
125-
</span>
126-
<span
127-
className="text-[11px] font-mono truncate flex-1"
128-
style={{ color: "var(--text-secondary)" }}
129-
title={value}
130-
>
131-
{value}
132-
</span>
133-
<button
134-
onClick={copy}
135-
className="opacity-0 group-hover:opacity-100 text-[10px] cursor-pointer shrink-0"
136-
style={{ color: copied ? "var(--success)" : "var(--text-muted)" }}
137-
>
138-
{copied ? "copied" : "copy"}
139-
</button>
140-
</div>
141-
);
142-
}
143-
144112
export default function SpanDetails({ span }: Props) {
113+
const [attrsOpen, setAttrsOpen] = useState(true);
145114
const [idsOpen, setIdsOpen] = useState(false);
146115
const status = STATUS_CONFIG[span.status.toLowerCase()] ?? { ...DEFAULT_STATUS, label: span.status };
147116

@@ -188,16 +157,20 @@ export default function SpanDetails({ span }: Props) {
188157
</span>
189158
</div>
190159

191-
{/* Attributes — flat rows */}
160+
{/* Attributes — collapsible */}
192161
{attrEntries.length > 0 && (
193162
<>
194163
<div
195-
className="px-2 py-1 text-[10px] uppercase font-bold tracking-wider border-b"
164+
className="px-2 py-1 text-[10px] uppercase font-bold tracking-wider border-b cursor-pointer flex items-center"
196165
style={{ color: "var(--accent)", borderColor: "var(--border)", background: "var(--bg-secondary)" }}
166+
onClick={() => setAttrsOpen((o) => !o)}
197167
>
198-
Attributes ({attrEntries.length})
168+
<span className="flex-1">Attributes ({attrEntries.length})</span>
169+
<span style={{ color: "var(--text-muted)", transform: attrsOpen ? "rotate(0deg)" : "rotate(-90deg)" }}>
170+
&#x25BE;
171+
</span>
199172
</div>
200-
{attrEntries.map(([key, value], idx) => (
173+
{attrsOpen && attrEntries.map(([key, value], idx) => (
201174
<div
202175
key={key}
203176
className="flex gap-2 px-2 py-1 items-start border-b"
@@ -224,21 +197,37 @@ export default function SpanDetails({ span }: Props) {
224197
{/* Identifiers — collapsible */}
225198
<div
226199
className="px-2 py-1 text-[10px] uppercase font-bold tracking-wider border-b cursor-pointer flex items-center"
227-
style={{ color: "var(--info)", borderColor: "var(--border)", background: "var(--bg-secondary)" }}
200+
style={{ color: "var(--accent)", borderColor: "var(--border)", background: "var(--bg-secondary)" }}
228201
onClick={() => setIdsOpen((o) => !o)}
229202
>
230-
<span className="flex-1">Identifiers</span>
203+
<span className="flex-1">Identifiers ({ids.length})</span>
231204
<span style={{ color: "var(--text-muted)", transform: idsOpen ? "rotate(0deg)" : "rotate(-90deg)" }}>
232205
&#x25BE;
233206
</span>
234207
</div>
235-
{idsOpen && (
236-
<div className="px-2 py-1 space-y-0.5" style={{ background: "var(--bg-primary)" }}>
237-
{ids.map((id) => (
238-
<IdRow key={id.label} label={id.label} value={id.value} />
239-
))}
208+
{idsOpen && ids.map((id, idx) => (
209+
<div
210+
key={id.label}
211+
className="flex gap-2 px-2 py-1 items-start border-b"
212+
style={{
213+
borderColor: "var(--border)",
214+
background: idx % 2 === 0 ? "var(--bg-primary)" : "var(--bg-secondary)",
215+
}}
216+
>
217+
<span
218+
className="font-mono font-semibold shrink-0 pt-px truncate text-[11px]"
219+
style={{ color: "var(--info)", width: "35%" }}
220+
title={id.label}
221+
>
222+
{id.label}
223+
</span>
224+
<span className="flex-1 min-w-0">
225+
<span className="font-mono text-[11px] break-all" style={{ color: "var(--text-primary)" }}>
226+
{id.value}
227+
</span>
228+
</span>
240229
</div>
241-
)}
230+
))}
242231
</div>
243232
);
244233
}

0 commit comments

Comments
 (0)