benvinegar / counterscale

Scalable web analytics you run yourself on Cloudflare
https://counterscale.dev
MIT License
1.3k stars 52 forks source link

Feature: Drill-down filters when clicking table rows [draft] #87

Closed benvinegar closed 1 month ago

benvinegar commented 1 month ago

Note this targets the v2 branch

Now if users click a row within a table card, the full data set will be filtered by that selection.

For example, if in the "Paths" card, you click a given path (e.g. "/dashboard"), the dataset will reload filering on path"=/dashboard". This means every figure – the top-level numbers, the chart, and all the table cards – will respect that filter.

You can also combine multiple filters (e.g. by referrer and device).


Still left to do:

https://github.com/user-attachments/assets/e50a3abf-0673-4f47-ac49-3d70f328f8ce

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 80.80229% with 67 lines in your changes missing coverage. Please review.

Project coverage is 72.66%. Comparing base (4f21e5e) to head (215f4f4).

Files Patch % Lines
app/routes/dashboard.tsx 68.18% 21 Missing :warning:
app/analytics/query.ts 81.48% 10 Missing :warning:
app/components/TableCard.tsx 82.97% 8 Missing :warning:
app/routes/resources.country.tsx 57.14% 6 Missing :warning:
app/routes/resources.browser.tsx 64.28% 5 Missing :warning:
app/routes/resources.device.tsx 64.28% 5 Missing :warning:
app/routes/resources.paths.tsx 73.33% 4 Missing :warning:
app/routes/resources.referrer.tsx 69.23% 4 Missing :warning:
app/components/PaginatedTableCard.tsx 89.28% 3 Missing :warning:
app/components/SearchFilterBadges.tsx 98.11% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## v2 #87 +/- ## ========================================== + Coverage 68.83% 72.66% +3.83% ========================================== Files 28 29 +1 Lines 2644 2905 +261 Branches 150 178 +28 ========================================== + Hits 1820 2111 +291 + Misses 816 786 -30 Partials 8 8 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

benvinegar commented 1 month ago

I think this is a good to go, just needs automated tests first.