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

feat: Readable metrics view url params #5675

Merged
merged 72 commits into from
Dec 5, 2024

Conversation

AdityaHegde
Copy link
Collaborator

@AdityaHegde AdityaHegde commented Sep 12, 2024

Move our dashboard url state from base64 encoded protobuf to human readable urls params.

  • Updated V1ExplorePreset to include all fields.
  • Replace protobuf with a url params translator.
  • Handle non-standard filters in all network calls.
  • Show a free-form editor for non-standard filters.
  • Show a readonly pill when non-standard filter is selected.
  • Add all fields to url state.
  • Do not add pivot fields when it is not active.
  • Fix unit tests
  • Fix e2e tests
  • Add docs (https://www.notion.so/rilldata/Human-readable-state-docs-for-SewerAI-145ba33c8f57805f8d15c85141e545ac)
  • Figure out expected behaviour around visual explore editor. (Follow up PR)
  • Add more exhaustive tests. (Follow up PR)

@AdityaHegde AdityaHegde force-pushed the adityahegde/human-readable-url branch from fd6f6c1 to af1a029 Compare October 22, 2024 08:09
web-admin/src/features/dashboards/query-mappers/utils.ts Outdated Show resolved Hide resolved
Comment on lines 16 to 19
export function getBasePreset(
explore: V1ExploreSpec,
preferences: LocalUserPreferences,
) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It feels like this function is doing two things: 1. defining the "base" ("default"?) state for all Explores and 2. merging the generic default state with the given Explore's default state and the user preferences.

Could we define a DEFAULT_EXPLORE_STATE in a constant outside this function? And maybe the function name should be reconsidered.

Comment on lines +57 to +59
return {
timeZone: getLocalIANA(),
};
Copy link
Contributor

Choose a reason for hiding this comment

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

I wouldn't expect this default/fallback to be included in this function. I'd expect timeZone: getLocalIANA() to be included in the default generic Explore state, which would later be merged with user preferences.

@@ -16,20 +15,21 @@
const queryClient = useQueryClient();

export let data: PageData;
$: ({ metricsView, explore, basePreset, partialMetrics } = data);
Copy link
Contributor

Choose a reason for hiding this comment

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

It's confusing seeing both basePreset and partialMetrics. Could we merge the two of them further upstream?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

They are not used together. If basePreset is used to keep the url clean and not add defaults. partialMetrics is the metrics from url. basePreset will not be needed in the future when we directly update the url in actions.

Comment on lines 39 to 42
const basePreset = getBasePreset(
exploreResource.explore.state?.validSpec ?? {},
getLocalUserPreferencesState(exploreName),
);
Copy link
Contributor

Choose a reason for hiding this comment

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

It feels like this doesn't belong in this function. Maybe it could be pushed down to a central place where we synthesize the initial state.

Copy link
Contributor

@ericpgreen2 ericpgreen2 left a comment

Choose a reason for hiding this comment

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

I kicked off a UXQA doc here

@AdityaHegde AdityaHegde force-pushed the adityahegde/human-readable-url branch from 1a4350f to 0f5f94f Compare December 4, 2024 10:37
@AdityaHegde AdityaHegde force-pushed the adityahegde/human-readable-url branch from 720bca1 to 7b88d3b Compare December 4, 2024 16:21
@AdityaHegde AdityaHegde marked this pull request as ready for review December 5, 2024 06:09
@AdityaHegde AdityaHegde force-pushed the adityahegde/human-readable-url branch from 5e662a4 to 9b10c0d Compare December 5, 2024 06:25
@AdityaHegde AdityaHegde force-pushed the adityahegde/human-readable-url branch from aed2a91 to e7b9d37 Compare December 5, 2024 07:26
@AdityaHegde AdityaHegde force-pushed the adityahegde/human-readable-url branch from fe3291e to b8fb2cb Compare December 5, 2024 14:48
@ericpgreen2 ericpgreen2 merged commit 258151c into main Dec 5, 2024
10 checks passed
@ericpgreen2 ericpgreen2 deleted the adityahegde/human-readable-url branch December 5, 2024 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker A release blocker issue that should be resolved before a new release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants