Repository navigation
Default period to x-axis filtering and add Filter values to period option - #26
Merged
Merged
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
…to period toggle Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
Makes x-axis-only filtering the default behaviour for the
Periodfilter on cumulative and percentage-share graphs (preserving underlying calculations across all history), and adds an opt-in "Filter values to period" toggle (default off) in thePerioddropdown for recalculating using only records within the selected period.Changes
src/lib/state/app.ts,src/lib/hooks.ts)periodFilterValuestoggle inuseApp(defaultfalse,localStoragekeygithub-monitor.periodFilterValues).ScopewithxAxisOnly(!periodFilterValues),dataRange,dataFromDay,dataToDay, anddataKey, plususeDataRangeonuseScopedQueryso x-axis-only period changes reuse cached all-time query results without re-querying SQLite.src/components/FilterBar.tsx)Perioddropdown.(values)on thePeriodbutton and· values filteredon the range summary when enabled (for non-"All time" periods).src/lib/agg/series.ts)bucketNextStartandsliceAxisRowsto filter already-rolled-up / cumulative rows to buckets overlapping[fromMs, toMs]acrossday,week,month, andquartergranularities.src/pages/Contributors.tsx,src/pages/Traffic.tsx)Contributors: computesbuildStacks,rollUp,toCumulative, and contributor card totals/charts across all history by default, then slices the plotted x-axis rows (and respects brush zoom on cards). When Filter values to period is checked, reverts to period-scoped calculations.Traffic: computesReferrer share over timetop-8 series ranking andOtherfold across all history by default, then slices the plotted x-axis days to the selected period.LineOwnershipalready computes history over all time and slices the x-axis.)scripts/test-queries.mjs)sliceAxisRows,bucketNextStart, cumulative preservation, cumulative share preservation, year rollovers, out-of-range windows, and daily boundaries.Verification
npm run check(typecheck, query tests, line-ownership tests, theme tests, workflow lint) — passednpm run build— passed