Skip to content
Merged
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
6 changes: 6 additions & 0 deletions .changeset/late-guests-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@spotlightjs/overlay': patch
---

- Fixed some conditional rendering in TraceIcon and SpanDetails which was showing 0 on UI.
- Fixed routing for query summary page by encoding the query description which can be a long text.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ const Queries = ({ showAll }: { showAll: boolean }) => {
{queriesData.map(query => (
<tr key={query.description} className="hover:bg-primary-900">
<td className="text-primary-200 w-2/5 truncate whitespace-nowrap px-6 py-4 text-left text-sm font-medium">
<Link className="truncate hover:underline" to={`/performance/queries/${query.description}`}>
{/* Ref: https://developer.mozilla.org/en-US/docs/Web/API/Window/btoa */}
<Link className="truncate hover:underline" to={`/performance/queries/${btoa(query.description)}`}>
{query.description}
</Link>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ const QuerySummary = ({ showAll }: { showAll: boolean }) => {
const spans = showAll ? allSpans : localSpans;
const compareSpanInfo = COMPARATORS[sort.active] || COMPARATORS[QUERY_SUMMARY_SORT_KEYS.timeSpent];

// Ref: https://developer.mozilla.org/en-US/docs/Web/API/Window/atob
const decodedType: string = atob(type);

return spans
.filter(span => span.description === type)
.filter(span => span.description === decodedType)
.sort((a, b) => (sort.asc ? compareSpanInfo(a, b) : compareSpanInfo(b, a)));
}, [allSpans, localSpans, showAll, sort, type]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function TraceIcon({ trace }: TraceIconProps) {
{dominantPlatforms.map(platform => (
<PlatformIcon key={platform} title={platform} size={21} platform={platform} />
))}
{remainingPlatforms.length && (
{remainingPlatforms.length > 0 && (
Comment thread
BYK marked this conversation as resolved.
<div
title={remainingPlatforms.join(', ')}
className="h-[21px] w-[21px] bg-black p-0.5 text-xs font-bold text-white"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default function SpanDetails({
</div>
</div>

{errors.length && (
{errors.length > 0 && (
<div className="flex flex-col items-start">
<h2 className="mb-2 font-bold uppercase">Related Errors</h2>
{errors.map(event => (
Expand Down