Commit Graph
6486 Commits
Author SHA1 Message Date
Yan 54e038f423 clip the canvas wrapper to suppress first-paint overflow
Address Greptile P2 review on PR #4260. Before Chart.js' first
ResizeObserver callback fires the canvas keeps its HTML5 default
size of 300x150. With position: absolute that no longer pushes any
ancestor's intrinsic size, but on a wrapper narrower than 300px the
canvas can still poke past the wrapper for one frame before Chart.js
catches up. Adding overflow: hidden to the relative wrapper clips
that transient overflow and is the pattern Chart.js' own docs
recommend for responsive charts inside flex / grid layouts. No
steady-state behaviour change because the canvas is already sized to
the wrapper once Chart.js takes over; the React tooltip lives
outside this wrapper so it remains visible.
2026-05-08 15:25:14 -04:00
Yan e63a2aec44 guard the localStorage read and drop the empty span placeholder
Address Greptile review on PR #4262.

P2 (line 62): the value read back from localStorage was typed as
any and trusted blindly, so a value written by an extension or a
manual edit could end up as the chart's displayMode. Read it once,
keep only 'table' or 'cards', otherwise fall back to null and let
the existing useMobile-driven default decide. Self-correcting on the
next click is no longer necessary because the next render is already
clean.

P2 (line 114): the empty <span /> was a flex placeholder that
existed only to make justify-content: space-between push the toggle
button to the right when allowSearch was false. Drop the span, drop
space-between, and put marginLeft: auto on the inner Row holding the
actions and the toggle. The toggle now hugs the right edge whether
search is rendered or not, with no extra DOM node. style={{}} is
used because the react-zen Row marginLeft prop only accepts spacing
tokens, not auto.

Verified in Playwright at 1400 viewport: the toggle is now flush
with the right edge of the action row, the toggle still flips
between table and cards on click, and a deliberately invalid
localStorage value ({"malicious":true}) is rejected on reload so
the page falls back to the table default.
2026-05-08 13:16:06 -04:00
Yan 62b1b9e758 let overflowing tables scroll horizontally instead of stretching the card
The react-zen DataTable lays its columns out on a CSS Grid with
fixed pixel widths, so the sum of column widths becomes the table's
max-content. Without an overflow boundary that width propagates up
through the surrounding flex chain into the Tabs panel grid track,
forcing every ancestor wider than the viewport. Dropping in
overflow-x: auto alone is not enough because the wrapper still
stretches to its parent's width, and the parent's width is still
driven by max-content from the table.

Wrap the rendered DataTable in DataGrid in a single-column CSS Grid
sized as minmax(0, 1fr) with overflow-x: auto. The minmax explicitly
caps the wrapper's track at the available 1fr space (instead of
following content's max-content), so the wrapper takes its size from
the layout and overflow-x: auto produces a horizontal scrollbar when
the table is wider than the viewport. No prop changes; every
DataGrid consumer (sessions, websites, links, pixels, boards, team
admin, etc.) gets the behaviour without any caller-side change.

Verified in playwright on the sessions table at 1024 viewport: the
table stays inside the card and exposes a horizontal scrollbar so
all 9 columns are reachable. At 1600 viewport the table fits
naturally and no scrollbar appears.
2026-05-08 11:28:48 -04:00
Yan 6ff13544ce let users toggle DataGrid between table and card view
DataGrid was already injecting displayMode='cards' on small viewports
via useMobile() and leaving it undefined (default 'table') everywhere
else. The user had no way to override either side: someone on a wide
screen who preferred a denser card list could not get there, and
someone on a tablet with a tall narrow window could not force the
table view to keep their layout consistent.

Add a small icon toggle in the DataGrid header row that flips between
table and cards, and persist the choice in localStorage under
umami.datagrid.displayMode. The user choice wins; if there is none,
the existing useMobile-driven default applies. Every DataGrid
consumer (sessions, websites, links, pixels, boards, team admin,
etc.) gets the toggle automatically with no caller-side change.

Verified in playwright on the sessions page: at 1400 viewport the
default is table; clicking the toggle switches to cards and a reload
keeps cards. At 800 viewport the default is cards; clicking the
toggle switches to table even though useMobile would otherwise force
cards. Round trip in both directions works and the choice survives
navigation away and back.
2026-05-08 11:04:04 -04:00
Yan cdc29a812f keep charts responsive when the viewport resizes
The chart canvas in src/components/charts/Chart.tsx was rendered
directly inside the Box wrapper. Chart.js writes inline pixel sizes
onto the canvas, and while the canvas lives in the normal flow that
pixel width propagates up as min and max content through every flex
parent and into the surrounding CSS Grid track on the Tabs panel.
The track therefore stayed at whatever width the canvas had when the
page first loaded, and the chart could only grow on resize, never
shrink, until the user reloaded.

Wrap the canvas in a position-relative div and position the canvas
absolutely. Out-of-flow elements do not contribute to ancestor
intrinsic sizing, so the wrapper now takes its size purely from the
parent layout. Chart.js' ResizeObserver picks up the wrapper size and
resizes the canvas to fit, in both directions, without a reload.

Verified in playwright with resize 1280 to 800 (canvas 925 to 699)
and 800 to 1400 (canvas 699 to 1117), both without reload, and that
the click-to-toggle legend, the focusLabel hover behaviour, and the
website overview / revenue charts that share this component all
still render and update normally.
2026-05-08 10:16:58 -04:00
Yan 84fe25af92 read willBeHidden from hiddenLabels in handleLegendClick
Address Greptile P2 review on PR #4259. willBeHidden was derived from
!ds.hidden, but ds.hidden can be set by the focusLabel pass too, so
the dataset flag is not a faithful read of the controlled hidden
state. In a chart that uses both focusLabel and hiddenLabels at once,
the callback could fire with a misleading toggle direction.

Read directly from hiddenLabels instead, with optional chaining so
the new path is a no-op when hiddenLabels is not provided. Behavior
is unchanged for EventsChart (which does not use focusLabel today)
but the controlled state is now the single source of truth.
2026-05-08 09:35:43 -04:00
Yan d0049e70b5 explicitly reset ds.hidden in the hiddenLabels block
Address Greptile P1 review on PR #4259. The hiddenLabels loop only
wrote ds.hidden = true and never reset to false when a label was
removed from the set. Toggle-off worked today only because the
focusLabel block above ran first and unconditionally cleared all
ds.hidden when focusLabel was falsy. That block is guarded by
chartData.focusLabel !== null, so any caller passing focusLabel={null}
would skip the reset and leave a stale true on reused dataset objects
across effect re-runs, making un-hide silently fail.

Add an else-if branch to the hiddenLabels loop that resets ds.hidden
to false when the label is not in the set and no focusLabel is
active. Behavior is unchanged for EventsChart (which never passes a
null focusLabel) and the contract of the new props is now independent
of execution order.
2026-05-08 09:35:09 -04:00
Yan 46e1351aed cache hex6 hash per label in color mapping
Address Greptile review on PR #4257: hex6(key) was parsed twice per
label, once in the sort comparator and once when deriving the
preferred palette slot. Cache the parsed integer in a local hashOf
map so the sort comparator and the slot lookup share one computation
per label, no behaviour change.
2026-05-08 09:17:07 -04:00
Yan 4f72d17faf keep hidden events hidden across date-range changes
Clicking a legend item on the events chart toggled hidden via
chart.current.getDatasetMeta(idx).hidden, which lives on Chart.js's
per-dataset meta object. Each time chartData changed (date-range
switch, refetch, focusLabel update) the second useEffect in Chart.tsx
replaces datasets wholesale, Chart.js regenerates the meta, and the
hidden flags vanish, so previously-toggled-off events came back on
their own.

Lift the hidden state into React. EventsChart owns a Set<string> of
hidden labels and passes it down via a new optional hiddenLabels prop
on Chart, plus an onLegendClick callback for controlled toggling.
Chart re-applies hidden after the existing focusLabel pass so the set
survives every data refresh, and falls back to the original
meta-based behaviour when no callback is provided so other charts
(website overview, revenue) keep their existing semantics.

Verified with the seeded Demo SaaS data: hide signup_started in the
Last 24 hours view, switch to Last 7 days then Last 30 days, the
label stays greyed in the legend and absent from the bars; clicking
again restores it. State is component-scoped, so it intentionally
resets on reload or navigation away from the events page.
2026-05-08 08:38:15 -04:00
dependabot[bot]andGitHub aee0ec6614 Bump hono from 4.12.9 to 4.12.18
Bumps [hono](https://github.com/honojs/hono) from 4.12.9 to 4.12.18.
- [Release notes](https://github.com/honojs/hono/releases)
- [Commits](https://github.com/honojs/hono/compare/v4.12.9...v4.12.18)

---
updated-dependencies:
- dependency-name: hono
  dependency-version: 4.12.18
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-08 12:31:22 +00:00
Yan edcf5bd407 stabilize event chart colors per label
Colors in the events-tab chart were assigned by the dataset index from
Object.keys(map), so changing the date range or reloading the page
reshuffled keys and produced a different color for the same event each
time.

Pick the palette slot deterministically from a hash of the label
(hex6 / FNV-1a), and walk the palette greedily in hash-sorted order so
the assignment is independent of the API response order. When two
labels prefer the same slot, the later one steps to the next free
slot, so the visible set of up to 12 events all get distinct colors.
The right shift on the hash sidesteps the FNV-1a low-bit bias mod 12
(FNV prime is close to 2^24).
2026-05-08 08:00:11 -04:00
Francis Cao fa182d0947 implement URL pageview metric/expanded metric 2026-05-07 16:59:30 -07:00
Francis CaoandGitHub 1b61ee4692 Merge pull request #4247 from anvme/perf/tracker-inp-defer-sort
perf(tracker): defer INP percentile computation to flush time
2026-05-07 16:57:04 -07:00
dependabot[bot]andGitHub 767bdcc43e Bump icu-minify from 4.8.4 to 4.11.0
Bumps [icu-minify](https://github.com/amannn/next-intl) from 4.8.4 to 4.11.0.
- [Release notes](https://github.com/amannn/next-intl/releases)
- [Changelog](https://github.com/amannn/next-intl/blob/main/CHANGELOG.md)
- [Commits](https://github.com/amannn/next-intl/compare/v4.8.4...v4.11.0)

---
updated-dependencies:
- dependency-name: icu-minify
  dependency-version: 4.11.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-07 23:53:36 +00:00
Francis CaoandGitHub e2fcea65c0 Merge pull request #4139 from seojcarlos/fix/pages-url-query
fix: include url_query in pages report display
2026-05-07 16:16:21 -07:00
Francis CaoandGitHub 73c045118b Merge branch 'dev' into fix/pages-url-query 2026-05-07 16:15:46 -07:00
Francis CaoandGitHub 7fea01ecac Merge pull request #4250 from yancat160/fix/missing-peer-deps
fix: declare prop-types and react-aria-components as direct dependencies
2026-05-07 16:06:18 -07:00
Francis Cao 67f7ecf2a6 combine heatmap prisma migration 2026-05-07 15:47:42 -07:00
Mike Cao 6c2155d496 Merge branch 'dev' of https://github.com/umami-software/umami into dev 2026-05-07 14:54:25 -07:00
Mike Cao 9b18511af0 Merge branch 'heatmaps' into dev
# Conflicts:
#	db/clickhouse/schema.sql
2026-05-07 14:49:21 -07:00
Mike Cao eef10dd897 Use unknown icon for generic browser 2026-05-07 14:34:10 -07:00
Mike Cao 6672ea04f0 Label generic browser as unknown 2026-05-07 14:30:43 -07:00
Mike Cao 3d9e116424 Guard recorder custom events until ready 2026-05-07 14:28:14 -07:00
Francis Cao 17e7a4a63a exclude performance events from non-performance metrics/lists 2026-05-07 14:17:03 -07:00
Mike Cao 6be5b61442 Wait for heatmap snapshot before overlay 2026-05-07 14:06:49 -07:00
Mike Cao abac89b57f Fix heatmap snapshot timestamp query 2026-05-07 14:01:45 -07:00
Mike Cao 923b94ae8e Render heatmaps from replay snapshots 2026-05-07 13:59:30 -07:00
Francis CaoandGitHub 88ccf5348e Merge pull request #4243 from anvme/fix/delete-cascade
fix: clean up link, pixel, board rows on user/team deletion
2026-05-07 13:59:08 -07:00
Francis CaoandGitHub b7084bb90a Merge branch 'dev' into fix/delete-cascade 2026-05-07 13:58:29 -07:00
Mike Cao 9c31e7b601 Fix heatmap iframe sizing 2026-05-07 13:52:41 -07:00
Francis Cao b0799fe5da Merge branch 'dev' of https://github.com/umami-software/umami into analytics 2026-05-07 13:31:01 -07:00
Francis Cao 9b099408c2 add share page options enable filtering and enforce theme 2026-05-07 13:24:45 -07:00
Yan 74e8b12e39 declare prop-types and react-aria-components as direct dependencies
Both packages are required at runtime but were not declared in package.json:

- react-simple-maps imports prop-types but does not list it as a peer or
  direct dependency, so prop-types must be provided by the host project.
- @umami/react-zen lists react-aria-components in peerDependencies, so
  the host project must provide it.

These are auto-installed by pnpm 8+ when auto-install-peers is true (the
project default), which masks the issue. They are not auto-installed by
npm or by pnpm with auto-install-peers disabled, causing build failures
on a fresh checkout.
2026-05-07 15:22:17 -04:00
Francis Cao 4b6cfe8a91 Merge branch 'dev' of https://github.com/umami-software/umami into analytics 2026-05-07 10:50:17 -07:00
Francis Cao 5ccfb6d0a5 implement datatable sorting on non-analytics tables. (website/board/link/pixel/team/admin) 2026-05-07 10:46:03 -07:00
Stanislaw dcf1b8b8b5 fix(tracker): track clicks on annotated containers and gracefully handle invalid pushState URLs
Three bugs in src/tracker/index.js, all empirically reproduced.

1. handleClicks() missed clicks on container elements: closest('a,button')
   could not find a non-anchor ancestor with data-umami-event, so a click on
   any descendant of <div data-umami-event=...> went untracked. Reworked to
   closest([data-umami-event]) so any annotated ancestor matches.

2. handlePush() called new URL(url, location.href) outside normalize()'s
   try/catch, so a host page calling history.pushState({}, '', invalidUrl)
   would have umami's wrapper throw a TypeError into the host's router.
   normalize(url) already handles base resolution and catches parse errors.

3. The history hook ran the umami callback BEFORE native pushState, so a
   failed native call (SecurityError on invalid URL, etc.) would still mutate
   currentUrl/currentRef and schedule a phantom pageview. Run native first;
   if it throws, the callback never fires and tracker state stays consistent.

Bug 2 verified: 4/10 representative click scenarios missed before
(span inside div, deep span inside div, a with no href, button inside a),
all 10/10 tracked after.

Bug 1+3 verified: pushState({}, '', invalidUrl) now leaves tracker state
unchanged (currentUrl unchanged, no phantom pageview).
2026-05-07 16:04:16 +02:00
Stanislaw 3f9de35907 perf(tracker): defer INP percentile computation to flush time
The INP observer sorted Object.values(interactions) on every event entry,
even though metrics.inp is only read when sendPerformance() flushes.
Defer the sort + p98 computation to flush, and drain queued observer
entries via observer.takeRecords() to capture the most recent
interactions on pagehide/visibilitychange.

Output is identical (same INP value computed). Savings are largest on
interaction-heavy pages and low-end devices where the per-event sort
compounds.
2026-05-07 15:31:49 +02:00
Stanislaw 71ee000f21 fix: avoid restamping deletedAt + skip Redis DEL for already-soft-deleted slugs
Address Greptile review feedback on #4243.

- Cloud-mode link.updateMany / pixel.updateMany now filter where: { ..., deletedAt: null } so a previously soft-deleted row keeps its original deletion timestamp instead of being restamped with the current time.
- Pre-transaction findMany now selects deletedAt; the Redis invalidation list filters to only live slugs, avoiding harmless but wasted DEL calls for already-soft-deleted entries.

Note: the share.deleteMany cleanup still uses the broad entityId list (not filtered by deletedAt) so that orphan share rows of already-soft-deleted links/pixels are still cleaned up. Filtering the prefetch itself, as Greptile's exact suggestion proposed, would skip those shares while link.deleteMany still hard-deletes the rows, leaving orphan share rows behind. Verified empirically with a 3-scenario reproduction.
2026-05-07 04:14:38 +02:00
Stanislaw a57abbe039 fix: clean up link, pixel, board rows on user/team deletion
deleteUser and deleteTeam left link/pixel/board rows (and their share rows)
in the database after the owner was removed. /q/<slug> and /p/<slug>
also kept serving deleted entries because the routes did not filter
deletedAt and Redis cached lookups for 24h.

- deleteUser: clean up link/pixel/board + shares for the deleted user.
  Cloud mode: soft-delete link/pixel, hard-delete board, only userId-owned.
  Non-cloud: hard-delete everything matching userId or owned teamIds.
- deleteTeam: same cleanup, scoped to teamId.
- /q and /p route handlers: filter deletedAt: null at the call sites
  (not in findLink/findPixel helpers, which would null-deref the
  permission checks at src/permissions/link.ts and pixel.ts).
- Post-transaction Redis invalidation mirrors deleteWebsite.
2026-05-07 03:37:22 +02:00
Francis CaoandGitHub b5c4dbfa56 Merge pull request #4207 from c0ball/fix/i18n-missing-saved-labels
🌐 fix(i18n): add missing 'saved' labels for german and swiss locales
2026-05-06 09:57:03 -07:00
Francis CaoandGitHub af68bcc12c Merge branch 'dev' into fix/i18n-missing-saved-labels 2026-05-06 09:56:18 -07:00
Francis Cao 71893e4f89 fix maxheight on DialogButton 2026-05-06 09:51:28 -07:00
dependabot[bot]andGitHub 2e9aaf3ae7 Bump uuid from 13.0.0 to 14.0.0
Bumps [uuid](https://github.com/uuidjs/uuid) from 13.0.0 to 14.0.0.
- [Release notes](https://github.com/uuidjs/uuid/releases)
- [Changelog](https://github.com/uuidjs/uuid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/uuidjs/uuid/compare/v13.0.0...v14.0.0)

---
updated-dependencies:
- dependency-name: uuid
  dependency-version: 14.0.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-06 00:44:55 +00:00
0xSYN.dev 5e6b7d1d21 fix: normalize autofill styles across browsers 2026-05-06 00:39:26 +05:30
Francis Cao da5654a9ef rename propertyName parameter 2026-05-05 10:49:13 -07:00
Francis Cao f463a4ce3f rename propertyName parameter 2026-05-05 10:48:56 -07:00
Mike Cao 1b69ce6e90 Add scroll heatmaps. 2026-05-05 10:43:39 -07:00
Mike Cao c7f71e5758 Make heatmaps report always available. 2026-05-05 10:43:39 -07:00
Mike CaoandGitHub b062484798 Merge pull request #4192 from tairosonloa/patch-1
fix: fixes #4186
2026-05-04 19:42:54 -04:00
Mike CaoandGitHub a9508e7aae Merge pull request #4200 from yhyasyrian/syrian-flag
The Syrian flag has changed
2026-05-04 19:40:36 -04:00