Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Improve columnar display depending on journey state (#6297)

Adam Rutkowski2d42d5f0a61d
diff --git a/assets/js/dashboard/extra/exploration.js b/assets/js/dashboard/extra/exploration.js
index 7afd4e051c..430a697d34 100644
--- a/assets/js/dashboard/extra/exploration.js
+++ b/assets/js/dashboard/extra/exploration.js
@@ -418,7 +418,9 @@ function ExplorationColumn({
) : (
<span className="flex flex-col items-center gap-2">
<FlagIcon className="size-4.5" />
- {"You've reached the end of this journey"}
+ {direction === EXPLORATION_DIRECTIONS.BACKWARD
+ ? "You've reached the beginning of this journey"
+ : "You've reached the end of this journey"}
</span>
)}
</div>
@@ -790,7 +792,15 @@ export function FunnelExploration() {
const initialLoading =
!inViewport || (steps.length === 0 && activeColumnLoading)
- const numColumns = Math.max(steps.length + 1, initialLoading ? 1 : 3)
+ const journeyEnded =
+ !activeColumnLoading &&
+ activeColumnResults.length === 0 &&
+ steps.length >= 1
+ const numColumns = initialLoading
+ ? 1
+ : journeyEnded || (activeColumnLoading && steps.length === 1)
+ ? steps.length + 1
+ : Math.max(steps.length + 1, 3)
const gridColumns = Math.max(numColumns, 3)
const activeColumnIndex = steps.length
const containerRef = useRef(null)
@@ -880,13 +890,6 @@ export function FunnelExploration() {
key={i}
colIndex={i}
header={columnHeader(i, direction)}
- className={
- steps.length === 0 && i === 2
- ? 'sm:hidden'
- : steps.length === 0 && i === 1
- ? 'sm:[grid-column:span_2]'
- : undefined
- }
active={isReachable}
// Active column gets live results; previously-active (now
// selected) columns get the candidate list that was visible at