fix(events): keep the selected property when switching events - #4419
Open
JeremieSamson wants to merge 1 commit into
Open
JeremieSamson wants to merge 1 commit into
JeremieSamson wants to merge 1 commit into
Conversation
Selecting a different event in the Properties tab always cleared the selected property, even when the new event exposes that same property. Comparing one property across events is a common task (page, url, source are often shared by several events), and it currently requires selecting the property again after every switch. Keep the current property when the newly selected event also exposes it, and fall back to the previous behaviour otherwise. Property filters are still cleared, since their values are event-specific. The effect that reset the property on every eventName change is removed: setEventName is only ever called from handleEventChange, so the effect was redundant and would have overwritten the value being kept.
|
Someone is attempting to deploy a commit to the Umami Software Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Greptile SummaryUpdates event-property selection so switching events preserves the selected property when the destination event exposes a property with the same name.
Confidence Score: 5/5The PR appears safe to merge, with the selected property retained only when it exists on the newly selected event. The event selector is available only after event-property data has loaded, all current event-name changes pass through the updated handler, and property filters remain cleared at the event boundary.
|
| Filename | Overview |
|---|---|
| src/app/(main)/websites/[websiteId]/events/EventProperties.tsx | Event switching now conditionally retains a shared property while reliably clearing event-specific filters; no changed-code defect was identified. |
Reviews (1): Last reviewed commit: "fix(events): keep the selected property ..." | Re-trigger Greptile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In a website's Properties tab, picking a different event always clears the
selected property, even when the newly selected event exposes that very same
property.
Properties such as
page,urlorsourceare commonly attached to severalevents, so comparing one property across events is a routine task. Today it
means re-selecting the property after every single switch, and the chart area
goes empty in between.
Change
handleEventChangenow keeps the current property when the newly selectedevent also exposes it, and clears it otherwise, which is the current behaviour.
Property filters are still cleared unconditionally: their values are tied to a
specific event, so carrying them over would filter on values that may not exist
for the new event.
The
useEffectthat reset the property on everyeventNamechange is removed.setEventNameis only ever called fromhandleEventChange, so the effect wasredundant, and it would have immediately overwritten the property being kept.
How to test
two events both carrying
page).property. The chart renders.
cleared, as before.
Checks
biome lintandbiome formatreport no changes on the modified file.tsc --noEmiton the full project: 0 errors.vitest run: 685 tests pass. The 2 failures inAttributionPage.test.tsxarepre-existing on
devand unrelated to this change: the@umami/react-zenmock in that file does not define
ZenProvider, whichsrc/test/render.tsxrequires. Verified by running that test file on a clean
devcheckout, whereit fails identically.
EventPropertieshas no test file yet, and covering itwould mean mocking the whole chart/pivot-table tree. Happy to add one if you
would like it in this PR.
Targeting
dev, perCONTRIBUTING.md.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.