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

Explore adding defaults to forms for starting queries #42

Open
eriktaubeneck opened this issue Jun 10, 2024 · 1 comment
Open

Explore adding defaults to forms for starting queries #42

eriktaubeneck opened this issue Jun 10, 2024 · 1 comment

Comments

@eriktaubeneck
Copy link
Member

A few notes from #41:

  1. It seems that the default in browsers is to not include unchecked checkboxes at all (and the Switch is acting like a checkbox), but that link suggests this approach as an alternative if you'd like to include it.
  2. It seems cleaner to capture the full state of the form (e.g. include disable_metric: false, multithreading: true, ... instead of just multithreading: on. This allows us to capture it, store it, display it, etc without assumptions about the state of the form in the past.
  3. We could also add defaults on the server, however at this point I'm assuming tight coupling between the client (frontend) and server (sidecar/controller). Maintaining backwards compatibility is simply out of scope at this point, as the whole thing is not at all mature enough.
  4. This flow will soon change, as the queries will be started from a queue, and not directly from a form. There is an opportunity to change this (e.g., we read the params from the DB, populate defaults, submit to controllers), if we have a strong opinion.

Originally posted by @eriktaubeneck in #41 (comment)

@akoshelev
Copy link
Collaborator

Maybe my understanding of how UI works is obsolete, I was imagining before rendering we sent a JS object that represents the defaults for query parameters. Then, when form_data comes back, we merge them, overriding the values set in UI and ignoring the ones that didn't come. This can be done in one place without requiring patching each individual checkbox.

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

No branches or pull requests

2 participants