Skip to content

Commit d5a5597

Browse files
committed
fix export PNG title wrapping and hide dropdown chevron in export
1 parent 376bd9d commit d5a5597

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

packages/app/src/components/inference/ui/ChartDisplay.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function E2eXAxisDropdown({
7070
onClick={(e) => e.stopPropagation()}
7171
>
7272
vs. {xAxisLabel}
73-
<ChevronDown className="h-3.5 w-3.5 shrink-0 opacity-60" />
73+
<ChevronDown className="no-export h-3.5 w-3.5 shrink-0 opacity-60" />
7474
</button>
7575
</PopoverTrigger>
7676
<PopoverContent className="w-48 p-1" align="start">

packages/app/src/hooks/useChartExport.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@ export function useChartExport({ chartId, setIsLegendExpanded }: UseChartExportO
198198
// CSS custom properties (e.g. text-muted-foreground → var(--muted-foreground)).
199199
const figcaption = clone.querySelector('figcaption');
200200
if (figcaption) {
201+
// Prevent title from wrapping mid-phrase in the export (e.g. "End-to-end Latency")
202+
const heading = figcaption.querySelector('h2');
203+
if (heading) (heading as HTMLElement).style.whiteSpace = 'nowrap';
204+
201205
const origCaption = element.querySelector('figcaption');
202206
if (origCaption) {
203207
const origEls = [

0 commit comments

Comments
 (0)