Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor Leaderboard/DimensionTable queries #5942

Merged
merged 13 commits into from
Nov 7, 2024

Conversation

briangregoryholmes
Copy link
Contributor

@briangregoryholmes briangregoryholmes commented Oct 19, 2024

This PR refactors the way queries are handled within the Leaderboard and DimensionTable components. Namely, the reliance on externally derived readables that are accessible only within the StateManger context has been removed. Instead, they accept state-agnostic props and it is the responsibility of the parent component to pass them down accordingly. The logic for building out the queries/options objects is now collocated with the relevant component. In the future, Leaderboard and DimensionTable will be consolidated into a single component (along with LeaderboardDisplay and DimensionTableDisplay).

As part of this work, the Leaderboard now properly displays data for items "below the fold", as seen below.

Screenshot 2024-10-18 at 9 16 10 PM

Closes #5753

@briangregoryholmes briangregoryholmes self-assigned this Oct 19, 2024
@briangregoryholmes briangregoryholmes marked this pull request as ready for review October 19, 2024 04:21
@briangregoryholmes briangregoryholmes changed the title fetch below the fold leaderboard data feat: fetch below the fold leaderboard data Oct 19, 2024
@ericpgreen2
Copy link
Contributor

Is this one ready for review again? IMO this is an important one to get in the next release

Copy link
Collaborator

@AdityaHegde AdityaHegde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeing some weird behaviour still,

  1. Selecting below fold values, refreshing, expanding the dimension and coming back removes the values.
    https://www.loom.com/share/41ba9ec4e6b84956859aabcc4d4b5ca1?sid=267e6432-8c69-49eb-bc76-2b94aa3a343d
  2. I feel like there is some reactivity missing somewhere. Values do not update when I select filters for other dimensions. Also when values go above the fold they are duplicated.
    https://www.loom.com/share/d1d8311b050145089c3a9592598b339d?sid=089fc062-7494-4f5d-b421-c1bd15c983e8

@briangregoryholmes briangregoryholmes changed the title feat: fetch below the fold leaderboard data refactor Leaderboard/DimensionTable queries Oct 30, 2024
@briangregoryholmes
Copy link
Contributor Author

I've decided to just make this PR the full refactor. These changes have resolved your two notes, but I recommend taking another look now that the scope has changed.

Copy link
Collaborator

@AdityaHegde AdityaHegde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! One thing that is different from production is that below the fold values that get filtered out are not shown anymore. Not sure what the UX would be for those.

@@ -1,181 +1,17 @@
import { mergeMeasureFilters } from "@rilldata/web-common/features/dashboards/filters/measure-filters/measure-filter-utils";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice seeing this massive removal! This was needed when we had different APIs used. Now with a single AggregationRequest I was thinking of writing up a wrapper around it using builder pattern. Might decrease the code a lot more.

@briangregoryholmes
Copy link
Contributor Author

Added a catch for that situation. Those values are now displayed below the fold with no data.

let selectedBelowTheFold: LeaderboardItemData[] = [];
let showExpandTable = false;
let noAvailableValues = true;
$: console.log(sortedData?.data);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leftover console

@briangregoryholmes briangregoryholmes merged commit d515610 into main Nov 7, 2024
7 checks passed
@briangregoryholmes briangregoryholmes deleted the bgh/leaderboard-fold-data branch November 7, 2024 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Leaderboards: Missing data after selecting 9th+ dimension member in Dimension Table
3 participants