📈 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!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
Minor fixes
Blue Moused3244d97d8c4
diff --git a/web/app/modals/AnnotationModal.tsx b/web/app/modals/AnnotationModal.tsxindex 06b11c31d..d2b3341d6 100644--- a/web/app/modals/AnnotationModal.tsx+++ b/web/app/modals/AnnotationModal.tsx@@ -1,4 +1,4 @@-import { useState, useEffect, useMemo } from 'react'+import { useState, useEffect, useMemo, useId } from 'react'import { useTranslation } from 'react-i18next'import { Annotation } from '~/lib/models/Project'@@ -47,6 +47,8 @@ const AnnotationModal = ({const [date, setDate] = useState(initialDate)const [text, setText] = useState(initialText)+ const dateInputId = useId()+useEffect(() => {// eslint-disable-next-line react-hooks/set-state-in-effect -- Syncing initial state with UIsetDate(initialDate)@@ -124,6 +126,7 @@ const AnnotationModal = ({<div><Textas='label'+ htmlFor={dateInputId}size='sm'weight='medium'colour='secondary'@@ -134,6 +137,7 @@ const AnnotationModal = ({</Text><Datepickermode='single'+ inputId={dateInputId}value={date ? [new Date(date + 'T00:00:00')] : []}onChange={(dates) => {if (dates.length > 0 && allowedToManage) {diff --git a/web/app/pages/ErrorTracking/index.tsx b/web/app/pages/ErrorTracking/index.tsxindex 1b3dc56a1..027309a8c 100644--- a/web/app/pages/ErrorTracking/index.tsx+++ b/web/app/pages/ErrorTracking/index.tsx@@ -154,11 +154,19 @@ const ErrorTracking = () => {/></Text><ul className='mt-2 list-inside list-disc'>- {_map(t('errors.fast.list', { returnObjects: true }), (item) => (- <Text as='li' size='lg' key={item} className='mb-2'>- {item}- </Text>- ))}+ {_map(+ t('errors.fast.list', { returnObjects: true }),+ (item, idx) => (+ <Text+ as='li'+ size='lg'+ key={`error-fast-${idx}`}+ className='mb-2'+ >+ {item}+ </Text>+ ),+ )}</ul><Textdiff --git a/web/app/pages/Organisations/Settings/People.tsx b/web/app/pages/Organisations/Settings/People.tsxindex 540d31c5b..95ebd4421 100644--- a/web/app/pages/Organisations/Settings/People.tsx+++ b/web/app/pages/Organisations/Settings/People.tsx@@ -175,8 +175,11 @@ const UsersList = ({ members, onRemove, fetcher }: UsersListProps) => {size='xs'type='button'onClick={() => onRemove(member)}+ aria-label={t('project.settings.removeUser', {+ user: member.user.email,+ })}>- <TrashIcon className='h-4 w-4' />+ <TrashIcon className='h-4 w-4' aria-hidden='true' /></Button></div>)}diff --git a/web/app/pages/Project/View/components/RefreshStatsButton.tsx b/web/app/pages/Project/View/components/RefreshStatsButton.tsxindex e89386818..10ebcc2c2 100644--- a/web/app/pages/Project/View/components/RefreshStatsButton.tsx+++ b/web/app/pages/Project/View/components/RefreshStatsButton.tsx@@ -54,12 +54,16 @@ export const RefreshStatsButton = ({ onRefresh }: RefreshStatsButtonProps) => {hasTriggeredRefresh.current = true;(async () => {setIsRefreshing(true)- await onRefresh(false)- setIsRefreshing(false)- // Reset timer after refresh completes- startTimeRef.current = Date.now()- hasTriggeredRefresh.current = false- setProgress(0)+ try {+ await onRefresh(false)+ } catch (error) {+ console.error('Auto refresh failed', error)+ } finally {+ setIsRefreshing(false)+ startTimeRef.current = Date.now()+ hasTriggeredRefresh.current = false+ setProgress(0)+ }})()}@@ -77,8 +81,11 @@ export const RefreshStatsButton = ({ onRefresh }: RefreshStatsButtonProps) => {startTimeRef.current = Date.now()hasTriggeredRefresh.current = falsesetProgress(0)- await onRefresh(true)- setIsRefreshing(false)+ try {+ await onRefresh(true)+ } finally {+ setIsRefreshing(false)+ }}const remainingSeconds = Math.max(diff --git a/web/app/root.tsx b/web/app/root.tsxindex 10e4b2f9b..2f352e7ba 100644--- a/web/app/root.tsx+++ b/web/app/root.tsx@@ -255,6 +255,8 @@ export function ErrorBoundary() {<buttontype='button'onClick={() => setCrashStackShown((prev) => !prev)}+ aria-expanded={crashStackShown}+ aria-controls='crash-stack'className='flex cursor-pointer items-center justify-center text-base text-gray-800 hover:underline dark:text-gray-300'>{crashStackShown ? (@@ -270,7 +272,11 @@ export function ErrorBoundary() {)}</button>{crashStackShown ? (- <span className='text-sm whitespace-pre-line text-gray-600 dark:text-gray-400'>+ <span+ id='crash-stack'+ role='region'+ className='text-sm whitespace-pre-line text-gray-600 dark:text-gray-400'+ >{error.stack}</span>) : null}diff --git a/web/app/routes/_index.tsx b/web/app/routes/_index.tsxindex 0a4064dea..da1a1b6aa 100644--- a/web/app/routes/_index.tsx+++ b/web/app/routes/_index.tsx@@ -332,7 +332,7 @@ const LiveDemoPreview = () => {style={{ pointerEvents: 'none' }}tabIndex={-1}/>- <div className='pointer-events-none absolute inset-0 flex items-center justify-center rounded-2xl bg-slate-900/40 opacity-0 backdrop-blur-[2px] transition-opacity duration-200 group-hover:pointer-events-auto group-hover:opacity-100'>+ <div className='pointer-events-none absolute inset-0 flex items-center justify-center rounded-2xl bg-slate-900/40 opacity-0 backdrop-blur-[2px] transition-opacity duration-200 group-focus-within:pointer-events-auto group-focus-within:opacity-100 group-hover:pointer-events-auto group-hover:opacity-100'><ahref={LIVE_DEMO_URL}target='_blank'diff --git a/web/app/routes/tools.meta-tags-generator.tsx b/web/app/routes/tools.meta-tags-generator.tsxindex 6cc513f1a..0b37731a2 100644--- a/web/app/routes/tools.meta-tags-generator.tsx+++ b/web/app/routes/tools.meta-tags-generator.tsx@@ -71,6 +71,15 @@ interface MetaData {twitterHandle: string}+const getHostnameFromUrl = (url: string): string => {+ if (!url) return 'example.com'+ try {+ return new URL(url.startsWith('http') ? url : `https://${url}`).hostname+ } catch {+ return 'example.com'+ }+}+export default function MetaTagsGenerator() {const [data, setData] = useState<MetaData>({title: 'Swetrix - Privacy-focused web analytics',@@ -274,13 +283,7 @@ ${imageUrl ? `<meta property="twitter:image" content="${imageUrl}" />\n` : ''}${)}<div className='border-t border-gray-200 p-3 dark:border-slate-800'><Text as='p' size='sm' colour='muted' className='truncate'>- {data.url- ? new URL(- data.url.startsWith('http')- ? data.url- : `https://${data.url}`,- ).hostname- : 'example.com'}+ {getHostnameFromUrl(data.url)}</Text><Text as='p' weight='semibold' className='mt-0.5 truncate'>{data.title || 'Page Title'}diff --git a/web/app/ui/Datepicker.tsx b/web/app/ui/Datepicker.tsxindex f39206d91..21134bc22 100644--- a/web/app/ui/Datepicker.tsx+++ b/web/app/ui/Datepicker.tsx@@ -25,6 +25,8 @@ interface DatePickerProps {maxRange?: numberclassName?: stringmode?: 'single' | 'range'+ inputId?: string+ ariaLabelledBy?: string}type DatePickerHandle = {@@ -109,6 +111,8 @@ const DatePicker = forwardRef<DatePickerHandle, DatePickerProps>(maxRange = 0,className,mode = 'range',+ inputId,+ ariaLabelledBy,},ref,) {@@ -340,6 +344,8 @@ const DatePicker = forwardRef<DatePickerHandle, DatePickerProps>({options ? (<inputreadOnly+ id={inputId}+ aria-labelledby={ariaLabelledBy}onClick={() => setOpen(true)}value={label || ''}placeholder={diff --git a/web/app/ui/MultiSelect.tsx b/web/app/ui/MultiSelect.tsxindex 814e9cf93..4822d554e 100644--- a/web/app/ui/MultiSelect.tsx+++ b/web/app/ui/MultiSelect.tsx@@ -138,7 +138,7 @@ const MultiSelect = ({const activeOptionId =activeIndex >= 0 && items[activeIndex]- ? `${optionIdPrefix}-${itemKey(items[activeIndex])}`+ ? `${optionIdPrefix}-${activeIndex}`: undefinedreturn (@@ -189,7 +189,7 @@ const MultiSelect = ({_map(items, (item, index) => {const isSelected = _includes(label, item)const isActive = index === activeIndex- const optionId = `${optionIdPrefix}-${itemKey(item)}`+ const optionId = `${optionIdPrefix}-${index}`return (<buttontype='button'diff --git a/web/app/ui/ProgressRing.tsx b/web/app/ui/ProgressRing.tsxindex f7077fb5a..0cec40e24 100644--- a/web/app/ui/ProgressRing.tsx+++ b/web/app/ui/ProgressRing.tsx@@ -83,7 +83,8 @@ const ProgressRing = ({)const center = size / 2- const displayValue = Math.floor(normalizedValue)+ const isFinite = Number.isFinite(normalizedValue)+ const displayValue = isFinite ? Math.floor(normalizedValue) : 0return (<div@@ -94,7 +95,7 @@ const ProgressRing = ({role='progressbar'aria-valuemin={0}aria-valuemax={100}- aria-valuenow={displayValue}+ aria-valuenow={isFinite ? displayValue : undefined}aria-label={ariaLabel ?? `Progress: ${displayValue}%`}><svg width={size} height={size} className='-rotate-90' aria-hidden='true'>