Commit Graph
2413 Commits
Author SHA1 Message Date
Mike Cao 0fff8fbb86 Merge branch 'fix-4123' of https://github.com/ElfenB/umami into ElfenB-fix-4123 2026-05-17 21:04:17 -07:00
Mike Cao bd7b794307 Merge branch 'dev' into master 2026-05-15 02:18:29 -04:00
Mike Cao c99ab3102d Fix DataGrid JSX nesting 2026-05-14 23:00:49 -07:00
Mike Cao be1161b32e Merge branch 'dev' into feat/datagrid-view-toggle 2026-05-15 00:28:51 -04:00
Mike Cao caa200db29 Merge pull request #4259 from yancat160/feat/persist-hidden-events-across-range
fix: keep hidden events hidden across date-range changes
2026-05-15 00:15:40 -04:00
Mike Cao 1dda7bddcd Merge pull request #4142 from nielskaspers/fix/issue-3981-case-insensitive-login
fix: make username login case-insensitive
2026-05-14 23:49:04 -04:00
Mike Cao a48f5aad5f Merge pull request #4140 from seojcarlos/fix/firefox-events-nan
fix: prevent NaN timestamps from breaking event charts in Firefox
2026-05-14 23:28:51 -04:00
Mike Cao 5e39485313 Merge pull request #4236 from SAYOUNCDR/fix/firefox-autofill-login-fields
fix: normalize autofill styles across browsers
2026-05-14 23:23:53 -04:00
Mike Cao bbe105524d Merge pull request #4257 from yancat160/fix/stable-event-chart-colors
fix: stabilize event chart colors per label
2026-05-14 23:18:07 -04:00
Mike Cao c7515ff230 fix: merge DataGrid layout + add min width to sessions location column 2026-05-14 20:10:10 -07:00
Mike Cao a1c73fc959 Merge branch 'dev' of https://github.com/umami-software/umami into dev 2026-05-14 20:05:29 -07:00
Mike Cao 06caccbadb Merge branch 'dev' into fix/datatable-horizontal-scroll-on-overflow 2026-05-14 22:59:03 -04:00
Mike Cao 24d05f9329 Merge branch 'master' into dev 2026-05-14 19:44:00 -07:00
Mike Cao cbe4d79b3c Merge pull request #4260 from yancat160/fix/chart-canvas-overflow-on-resize
fix: keep charts responsive when the viewport resizes
2026-05-14 22:43:38 -04:00
Mike Cao c20aede586 Merge pull request #4248 from anvme/fix/tracker-bugs
fix(tracker): track clicks on annotated containers + handle invalid pushState URLs
2026-05-14 22:26:34 -04:00
Francis Cao aa9b6c0ca3 heatmaps UI polish, finish feature gate + messaging, overlay bug fixes 2026-05-14 15:18:29 -07:00
Francis Cao cd20b3aafd Heatmaps bug fixes, update schema to match overlay, use react-zen component to match ui/ux, polish 2026-05-14 14:23:41 -07:00
Francis Cao 483b0619d2 Merge branch 'dev' of https://github.com/umami-software/umami into dev 2026-05-14 09:51:30 -07:00
Francis Cao 3f3000c2fd Fix LinksTable merge 2026-05-14 09:51:28 -07:00
Mike Cao a9a4ad0f68 Reset event property state when event changes 2026-05-14 09:45:34 -07:00
Mike Cao c6733897b4 Fetch recorder settings from website config endpoint 2026-05-14 03:26:24 -07:00
Mike Cao c724f42daf Merge branch 'dev' of https://github.com/umami-software/umami into dev 2026-05-14 03:02:48 -07:00
Mike Cao a47b32718d Merge branch 'dev' into fix/links-table-truncate-urls 2026-05-14 06:02:14 -04:00
Mike Cao 0157c23922 Merge branch 'master' into dev 2026-05-14 02:56:13 -07:00
Mike Cao 9c1db27218 Merge pull request #4099 from sputnik-mac/fix/redirect-logged-in-user-from-login-4094
fix: redirect logged-in users from login page to dashboard
2026-05-14 05:55:33 -04:00
Mike Cao 985aa285b2 Merge pull request #4039 from God-2077/umami-v3-dev-2
fix: Optimize IP detection logic and add error handling
2026-05-14 05:53:05 -04:00
Mike Cao 0be5b5aa26 Route /auth and /config to local API; everything else uses API_URL 2026-05-13 00:07:30 -07:00
Francis Cao b7e1d902f4 seperate revenue queries for better api/performance. Fix realtime css/ui issues. 2026-05-12 16:44:12 -07:00
Francis Cao c6ec8385c9 Add revenue chart cumulative mode. 2026-05-12 10:32:43 -07:00
Francis Cao 21b56d2922 add LLM channel logic 2026-05-11 10:31:04 -07:00
Mike Cao 216cf6c448 Migrate test suite from Cypress and Jest to Playwright and Vitest 2026-05-09 01:23:20 -07:00
Mike Cao 2fd319f910 Add configurable internal API URL 2026-05-09 01:06:52 -07:00
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
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 Cao 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
Francis Cao 73c045118b Merge branch 'dev' into fix/pages-url-query 2026-05-07 16:15:46 -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