heatmap css fixes

This commit is contained in:
Francis Cao committed 2026-06-16 12:25:32 -07:00
1 parent b51e4b5d12
commit 0a7bd7e6c1
3 files changed
+35 -24

No files matched your search

@@ -120,6 +120,10 @@
overscroll-behavior: contain;
}
.canvasWrapperScrollable {
overflow-x: auto;
}
.snapshotControlRow {
margin-top: 8px;
}
@@ -173,23 +177,6 @@
height: 100%;
}
.snapshotFrame :global(.replayer-wrapper) {
width: 100% !important;
height: 100% !important;
}
.snapshotFrame :global(.replayer-mouse),
.snapshotFrame :global(.replayer-mouse-tail) {
display: none !important;
}
.snapshotFrame :global(iframe) {
width: 100% !important;
height: 100% !important;
border: 0;
display: block !important;
}
.overlay {
position: absolute;
top: 0;
@@ -279,7 +279,11 @@ function ClickHeatmapView({
const renderWidth = snapshot?.pageW ?? baseWidth;
const renderHeight = snapshot?.pageH ?? baseHeight;
const hasMeasuredWidth = Boolean(snapshot?.pageW || viewport?.pageW || maxPointX);
const canvasWidth = hasMeasuredWidth ? `min(100%, ${renderWidth}px)` : '100%';
const canvasWidth = hasMeasuredWidth
? snapshot?.kind === 'replay'
? `${renderWidth}px`
: `min(100%, ${renderWidth}px)`
: '100%';
const overlayPageW = snapshot?.pageW ?? viewport?.pageW ?? baseWidth;
const overlayPageH = snapshot?.pageH ?? viewport?.pageH ?? baseHeight;
const showSnapshot = renderWidth > 0 && showPage && hasSnapshot;
@@ -323,12 +327,13 @@ function ClickHeatmapView({
</Text>
)}
<div className={styles.canvasWrapper}>
<div
className={`${styles.canvasWrapper} ${snapshot?.kind === 'replay' ? styles.canvasWrapperScrollable : ''}`}
>
<div
className={styles.canvas}
style={{
width: canvasWidth,
maxWidth: '100%',
aspectRatio: `${Math.max(1, renderWidth)} / ${Math.max(1, renderHeight)}`,
}}
>
@@ -435,7 +440,11 @@ function ScrollHeatmapView({
const renderWidth = snapshot?.pageW ?? baseWidth;
const renderHeight = snapshot?.pageH ?? baseHeight;
const hasMeasuredWidth = Boolean(snapshot?.pageW || pageW);
const canvasWidth = hasMeasuredWidth ? `min(100%, ${renderWidth}px)` : '100%';
const canvasWidth = hasMeasuredWidth
? snapshot?.kind === 'replay'
? `${renderWidth}px`
: `min(100%, ${renderWidth}px)`
: '100%';
const showSnapshot = renderWidth > 0 && showPage && hasSnapshot;
const showOverlay = !showSnapshot || snapshotReady;
const hasScrollData = Boolean(scroll && totalSessions > 0 && pageW && pageH && viewportW);
@@ -494,12 +503,13 @@ function ScrollHeatmapView({
</Text>
)}
<div className={styles.canvasWrapper}>
<div
className={`${styles.canvasWrapper} ${snapshot?.kind === 'replay' ? styles.canvasWrapperScrollable : ''}`}
>
<div
className={styles.canvas}
style={{
width: canvasWidth,
maxWidth: '100%',
aspectRatio: `${Math.max(1, renderWidth)} / ${Math.max(1, renderHeight)}`,
}}
>
@@ -697,6 +707,16 @@ function ReplaySnapshot({
replayer.iframe.style.width = '100%';
replayer.iframe.style.height = '100%';
replayer.iframe.style.border = '0';
const replayMouse = replayer.wrapper.querySelector<HTMLElement>('.replayer-mouse');
const replayMouseTail = replayer.wrapper.querySelector<HTMLCanvasElement>(
'.replayer-mouse-tail',
);
if (replayMouse) {
replayMouse.style.display = 'none';
}
if (replayMouseTail) {
replayMouseTail.style.display = 'none';
}
onReady();
})
+5 -1
View File
@@ -1,4 +1,4 @@
import { record } from 'rrweb';
import { addCustomEvent, record } from 'rrweb';
(window => {
const { document } = window;
@@ -449,6 +449,10 @@ import { record } from 'rrweb';
flushScroll();
scrollUrl = location.href;
lastFlushedScrollPct = 0;
if (replayStopFn && !replayStopped) {
addCustomEvent('url-change', { url: scrollUrl });
}
};
const hookHistory = method => {