-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
State explorer panel #15365
State explorer panel #15365
Conversation
QA Wolf here! As you write new code it's important that your test coverage is keeping up. |
…panels' into budi-8980-create-state-panel
…panels' into budi-8980-create-state-panel
…panels' into budi-8980-create-state-panel
…panels' into budi-8980-create-state-panel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work Pete! The "updates" and "controlled by" jumping to the correct setting and selecting the component feels great 👌
Also love how the values update in real time per key stroke - super responsive.
Code review in progress, but a few usability things I ran in to:
- The placeholder for the state variable select needs set to something - it defaults to "Type here..." at the moment which is probably the default of one of the underlying components
- With no state variable selected you can still see the input for setting a value. Touching this throws an error (
Uncaught Error: No state key selected
). Maybe we should hide the value input if no variable is selected? - There's a bit too much padding - the tab content div already provides the right padding, so we can remove the padding around the state panel div.
- State values don't appear until you leave the tab and go back into it. I think we probably should support this if possible, since you might well have the state panel open while working with state variables, and expect to be able to see them.
- When a state value is selected, you can still select the placeholder "Type here..." which crashes things. We should remove the placeholder option if there are any valid state variables, to fix this.
- If I try to use the binding drawer to enter a value, my tab freezes and dies, so I can't test this scenario any further
- The state variable dropdown seems to search all screens for state variables. This means it will list variables that aren't actually used on the current page, so the usage information is blank. We either need to only list state variables on the current screen, or show usages across all screens.
- I think it would be a nice UX improvement to automatically select the first available state variable if any exist. Just saves the user a click and prevents seeing an empty state if you don't need to
@@ -32,7 +31,7 @@ | |||
$: safeValue = getSafeValue(value, defaultValue, allBindings) | |||
$: replaceBindings = val => readableToRuntimeBinding(allBindings, val) | |||
|
|||
$: if (!Array.isArray(value)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This basically disallowed us from highlighting array values, say like an onClick handler. I changed it to this and haven't been able to find any issues arising.
…panels' into budi-8980-create-state-panel
…ase into budi-8980-create-state-panel
…ase into budi-8980-create-state-panel
…panels' into budi-8980-create-state-panel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…to budi-8980-create-state-panel
Description
This PR adds the ability to:
Screenshots
Clicking one of the above links will highlight the setting that was selected.
If the state variable is in use in the Styles or Conditions tabs, those will automatically switch and highlight the setting there
You can set a default value in the panel to be shown or used in the design preview
Addresses
https://linear.app/budibase/issue/BUDI-8980/create-state-panel
Feature branch env
Feature Branch Link