evidence icon indicating copy to clipboard operation
evidence copied to clipboard

Dropdown Fixes + Inputs Overhaul

Open ItsMeBrianD opened this issue 1 year ago • 3 comments

Description

This PR originally started targeting various issues in the dropdown component, it expanded in scope to also fix a number of issues with the way we are handling inputs - as they were responsible for a number of the dropdown bugs.

This PR will:

Inputs / General Changes:

  • Replace the existing input proxy store with setTrackProxy
    • setTrackProxy is more flexible than the existing store, and also has unit testing to ensure it behaves as expected
  • Ensure that noResolve is passed to child queries (fixes some instances of error flickering)
  • Adds Query.createReactive, a canonical way for creating queries with good reactivity
    • A future PR should consider wrapping this in buildQuery for easier consumption in userland components
  • Moves duckdb serialization into a utility function, adds the ability to skip strings (e.g. serialize dates to duckdb syntax, but leave strings untouched)
  • Preprocessor is now using Query.createReactive, which is tested, not a string, and sharable / consistent across all locations to prevent bespoke logic from popping up related to query reactivity

Dropdown specific changes

  • DropdownOption no longer displays anything, and is only responsible for registering / deregistering options
  • DropdownOptionDisplay is responsible for rendering the Dropdown Option that is shown on the page
  • Dropdown has been refactored to simplify the code
    • Context is now a Symbol, prevents tampering
    • There is now only options and selectedOptions
    • selectedOptions reacts based on the global inputs store
    • All code should now function with both sync and async query execution functions
    • Double rendering of slot (1 invisible, 1 visible) is no longer occuring

Checklist

~~- [ ] For UI or styling changes, I have added a screenshot or gif showing before & after~~

  • [ ] I have added a changeset ~~- [ ] I have added to the docs where applicable~~ ~~- [ ] I have added to the VS Code extension where applicable~~

ItsMeBrianD avatar Apr 26 '24 18:04 ItsMeBrianD

🦋 Changeset detected

Latest commit: 35d31826717a19725d80ccf6580b1349f2456a78

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@evidence-dev/component-utilities Patch
@evidence-dev/preprocess Minor
@evidence-dev/sdk Minor
@evidence-dev/core-components Minor
@evidence-dev/components Minor
@evidence-dev/evidence Major
my-evidence-project Patch
evidence-test-environment Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Apr 26 '24 18:04 changeset-bot[bot]

Deploy Preview for next-docs-evidence ready!

Name Link
Latest commit 35d31826717a19725d80ccf6580b1349f2456a78
Latest deploy log https://app.netlify.com/sites/next-docs-evidence/deploys/663546c7f0ce1300089dfe12
Deploy Preview https://deploy-preview-1944--next-docs-evidence.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Apr 26 '24 18:04 netlify[bot]

Deploy Preview for evidence-development-workspace ready!

Name Link
Latest commit 35d31826717a19725d80ccf6580b1349f2456a78
Latest deploy log https://app.netlify.com/sites/evidence-development-workspace/deploys/663546c75c8e81000871b774
Deploy Preview https://deploy-preview-1944--evidence-development-workspace.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Apr 26 '24 18:04 netlify[bot]