Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Fixes

Blue Mouse032d5ec559dd
diff --git a/web/app/pages/Dashboard/Dashboard.tsx b/web/app/pages/Dashboard/Dashboard.tsx
index 91bfd6acb..0d58c60f4 100644
--- a/web/app/pages/Dashboard/Dashboard.tsx
+++ b/web/app/pages/Dashboard/Dashboard.tsx
@@ -553,7 +553,7 @@ const Dashboard = () => {
<AnimatePresence mode='popLayout' initial={false}>
{_map(projects, (project) => (
<motion.div
- key={`${project.id}-${project.name}`}
+ key={project.id}
layout
initial={{ opacity: 0, scale: 0.97 }}
animate={{ opacity: 1, scale: 1 }}
diff --git a/web/app/pages/Project/View/Panels.tsx b/web/app/pages/Project/View/Panels.tsx
index 0036e1718..881fb737d 100644
--- a/web/app/pages/Project/View/Panels.tsx
+++ b/web/app/pages/Project/View/Panels.tsx
@@ -270,34 +270,34 @@ const PanelContainer = ({
: dropdownPlaceholder || t('project.campaigns')
return (
- <Dropdown
+ <div
key={`dropdown-${index}`}
- title={
- <>
- {dropdownTitle}
- {activeDropdownTab ? (
- <PanelTabUnderline layoutId={underlineId} />
- ) : null}
- </>
- }
- items={dropdownTabs}
- labelExtractor={(item) => item.label}
- keyExtractor={(item) => item.id}
- onSelect={(item) => {
- onTabChange(item.id)
- }}
- buttonClassName={cx(
- 'relative border-b-2 border-transparent px-0 py-1 text-sm font-bold whitespace-nowrap transition-colors duration-200 md:px-0',
- {
- 'text-slate-900 dark:text-gray-50':
- !!activeDropdownTab,
- 'text-gray-500 hover:border-gray-200 hover:text-gray-700 dark:text-gray-400 dark:hover:border-gray-200 dark:hover:text-gray-300':
- !activeDropdownTab,
- },
- )}
- headless
- chevron='mini'
- />
+ className='relative inline-flex'
+ >
+ <Dropdown
+ title={dropdownTitle}
+ items={dropdownTabs}
+ labelExtractor={(item) => item.label}
+ keyExtractor={(item) => item.id}
+ onSelect={(item) => {
+ onTabChange(item.id)
+ }}
+ buttonClassName={cx(
+ 'relative border-b-2 border-transparent px-0 py-1 text-sm font-bold whitespace-nowrap transition-colors duration-200 md:px-0',
+ {
+ 'text-slate-900 dark:text-gray-50':
+ !!activeDropdownTab,
+ 'text-gray-500 hover:border-gray-200 hover:text-gray-700 dark:text-gray-400 dark:hover:border-gray-200 dark:hover:text-gray-300':
+ !activeDropdownTab,
+ },
+ )}
+ headless
+ chevron='mini'
+ />
+ {activeDropdownTab ? (
+ <PanelTabUnderline layoutId={underlineId} />
+ ) : null}
+ </div>
)
}
diff --git a/web/app/pages/Project/tabs/Traffic/MetricCards.tsx b/web/app/pages/Project/tabs/Traffic/MetricCards.tsx
index db108a9c4..5e0d13622 100644
--- a/web/app/pages/Project/tabs/Traffic/MetricCards.tsx
+++ b/web/app/pages/Project/tabs/Traffic/MetricCards.tsx
@@ -5,7 +5,7 @@ import _isNumber from 'lodash/isNumber'
import _map from 'lodash/map'
import _round from 'lodash/round'
import { motion, type Variants } from 'motion/react'
-import React, { memo } from 'react'
+import React, { memo, useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'
import {
@@ -23,9 +23,28 @@ import {
getTimeFromSeconds,
} from '~/utils/generic'
-// Animated counterparts of nFormatter / percent / getStringFromTime, so the
-// main metric values roll smoothly on load and when the period changes.
-const CompactNumberFlow = ({ value }: { value: number }) => {
+const useIsHydrated = () => {
+ const [isHydrated, setIsHydrated] = useState(false)
+
+ useEffect(() => {
+ setIsHydrated(true)
+ }, [])
+
+ return isHydrated
+}
+
+const StaticCompactNumber = ({ value }: { value: number }) => {
+ const [num, symbol] = nFormatterSeparated(value, 1) as [number, string | null]
+
+ return (
+ <>
+ {num}
+ {symbol}
+ </>
+ )
+}
+
+const AnimatedCompactNumber = ({ value }: { value: number }) => {
const flowValue = useFlowValue(value)
const [num, symbol] = nFormatterSeparated(flowValue, 1) as [
number,
@@ -44,7 +63,17 @@ const CompactNumberFlow = ({ value }: { value: number }) => {
)
}
-const PercentFlow = ({ value }: { value: number }) => {
+const CompactNumberFlow = ({ value }: { value: number }) => {
+ const isHydrated = useIsHydrated()
+
+ return isHydrated ? (
+ <AnimatedCompactNumber value={value} />
+ ) : (
+ <StaticCompactNumber value={value} />
+ )
+}
+
+const AnimatedPercent = ({ value }: { value: number }) => {
const flowValue = useFlowValue(value)
return (
@@ -59,7 +88,32 @@ const PercentFlow = ({ value }: { value: number }) => {
)
}
-const DurationFlow = ({
+const PercentFlow = ({ value }: { value: number }) => {
+ const isHydrated = useIsHydrated()
+
+ return isHydrated ? (
+ <AnimatedPercent value={value} />
+ ) : (
+ <>{_round(value, 1)}%</>
+ )
+}
+
+const StaticDuration = ({
+ value,
+ showMs,
+}: {
+ value?: number
+ showMs?: boolean
+}) => (
+ <>
+ {getStringFromTime(
+ getTimeFromSeconds(Number.isFinite(value) ? value : 0),
+ showMs,
+ )}
+ </>
+)
+
+const AnimatedDuration = ({
value,
showMs,
}: {
@@ -117,6 +171,22 @@ const DurationFlow = ({
)
}
+const DurationFlow = ({
+ value,
+ showMs,
+}: {
+ value?: number
+ showMs?: boolean
+}) => {
+ const isHydrated = useIsHydrated()
+
+ return isHydrated ? (
+ <AnimatedDuration value={value} showMs={showMs} />
+ ) : (
+ <StaticDuration value={value} showMs={showMs} />
+ )
+}
+
// Entrance animation: parent containers set initial='hidden' animate='visible'
// to stagger the cards in. Standalone usage (no motion parent) stays static.
export const metricCardsContainerVariants: Variants = {
diff --git a/web/app/pages/UserSettings/UserSettings.tsx b/web/app/pages/UserSettings/UserSettings.tsx
index 18db21f46..2666be900 100644
--- a/web/app/pages/UserSettings/UserSettings.tsx
+++ b/web/app/pages/UserSettings/UserSettings.tsx
@@ -571,6 +571,7 @@ const UserSettings = () => {
useState(false)
const [showModal, setShowModal] = useState(false)
const [showAPIDeleteModal, setShowAPIDeleteModal] = useState(false)
+ const [isDeleting, setIsDeleting] = useState(false)
const translatedFrequencies = useMemo(
() => _map(reportFrequencies, (key) => t(`profileSettings.${key}`)),
[t],
@@ -971,6 +972,9 @@ const UserSettings = () => {
setCookie(CONFIRMATION_TIMEOUT, true, 600)
toast.success(t('profileSettings.confSent'))
} else if (intent === 'delete-account') {
+ setIsDeleting(false)
+ setShowModal(false)
+ setDeletionPassword('')
logout()
toast.success(t('apiNotifications.accountDeleted'))
navigate(routes.main)
@@ -983,6 +987,9 @@ const UserSettings = () => {
}
} else if (fetcher.data?.error || fetcher.data?.fieldErrors) {
setIsCancellingSubscription(false)
+ if (fetcher.data.intent === 'delete-account') {
+ setIsDeleting(false)
+ }
if (pendingToggles.current.has('live-visitors')) {
mergeUser({
showLiveVisitorsInTitle: pendingToggles.current.get('live-visitors'),
@@ -1414,14 +1421,14 @@ const UserSettings = () => {
}
const onAccountDelete = () => {
+ if (isDeleting || !deletionPassword) return
+
+ setIsDeleting(true)
const formData = new FormData()
formData.set('intent', 'delete-account')
formData.set('password', deletionPassword)
formData.set('feedback', deletionFeedback)
fetcher.submit(formData, { method: 'post' })
- setTimeout(() => {
- setDeletionPassword('')
- }, 300)
}
const onEmailConfirm = () => {
@@ -2804,10 +2811,9 @@ const UserSettings = () => {
customButtons={
<HoldToConfirmButton
onConfirm={() => {
- setShowModal(false)
onAccountDelete()
}}
- disabled={!deletionPassword}
+ disabled={!deletionPassword || isDeleting}
className='w-full justify-center sm:w-auto'
>
{t('common.holdToDelete')}
diff --git a/web/app/routes/_index.tsx b/web/app/routes/_index.tsx
index 3c4496c4e..5a0973704 100644
--- a/web/app/routes/_index.tsx
+++ b/web/app/routes/_index.tsx
@@ -287,7 +287,7 @@ const TrialsHighlight = ({
return (
<span className='font-semibold text-gray-900 dark:text-gray-50'>
- {mounted && value ? (
+ {mounted && value != null ? (
<TrialsFlow value={value} locale={locale} />
) : (
children
@@ -344,17 +344,15 @@ const Testimonials = ({
<div className='text-base text-gray-900/70 dark:text-gray-200'>
<Trans
values={{
- amount: stats?.trials
- ? stats.trials.toLocaleString(language)
- : '> 1000',
+ amount:
+ stats?.trials != null
+ ? stats.trials.toLocaleString(language)
+ : '> 1000',
}}
t={t}
i18nKey='main.understandTheirUsers'
>
- <TrialsHighlight
- value={stats?.trials || undefined}
- locale={language}
- />
+ <TrialsHighlight value={stats?.trials} locale={language} />
</Trans>
</div>
</div>
diff --git a/web/app/ui/FeedbackButton.tsx b/web/app/ui/FeedbackButton.tsx
index 03c271158..14c236c15 100644
--- a/web/app/ui/FeedbackButton.tsx
+++ b/web/app/ui/FeedbackButton.tsx
@@ -65,6 +65,7 @@ const FeedbackButton = ({
className={cn('grid', className)}
>
<span
+ aria-hidden={phase !== 'idle'}
className={cn(
MORPH_LAYER_CLASSES,
phase !== 'idle' && MORPH_HIDDEN_CLASSES,