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

Bindings explorer panel #15403

Merged
merged 27 commits into from
Jan 23, 2025
Merged

Bindings explorer panel #15403

merged 27 commits into from
Jan 23, 2025

Conversation

aptkingston
Copy link
Member

@aptkingston aptkingston commented Jan 20, 2025

Description

This PR adds a new panel to explore available bindings for the selected component.

Also contains typescriptification of a few BBUI components, BBUI utils and builder components.

image
image

Example of the colours of all possible data types:
image

You can dig in to all the available bindings, including going deep into complex structures - letting you see the full extent of the data available to you.

Interactions:

  • You can expand or collapse an object or array by clicking on either the arrow or the name of the value
  • Values are initially only 1 line. You can expand long values to reveal their full extent by clicking:
    image
    image
  • When hovering over any binding, a copy icon will appear on the right side. Clicking this icon will copy the binding to the clipboard (e.g. {{ Data provider.Rows.0.Price }}. This can then be pasted into a binding drawer for example.

Worth noting that this change also removes the title and add component button from the components tab. The only way to add components is now using the add component FAB in the preview (or ctrl/cmd + enter).
image

Addresses

Feature branch env

Feature Branch Link

Copy link

qa-wolf bot commented Jan 20, 2025

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

@@ -80,7 +80,7 @@
"dayjs": "^1.10.8",
"easymde": "^2.16.1",
"svelte-dnd-action": "^0.9.8",
"svelte-portal": "^1.0.0"
"svelte-portal": "^2.2.1"
Copy link
Member Author

Choose a reason for hiding this comment

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

Bumping as the new version contains types which makes life much easier.

Info = "info",
Positive = "positive",
Negative = "negative",
}
Copy link
Member Author

Choose a reason for hiding this comment

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

We need to export enums from .ts file to avoid linting errors. There's a configuration issue with eslint, typescript and svelte right now that will cause linting errors if exporting from a svelte component directly. This is a clean solution.

export let customHeight: string | undefined = undefined
export let animate: boolean = true
export let customZIndex: number | undefined = undefined
export let handlePositionUpdate: Function | undefined = undefined
Copy link
Member Author

Choose a reason for hiding this comment

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

Both customZIndex and handlePositionUpdate are also just casing and typo fixes, which required updating a few files in the builder.

instance = render(AISettings, {})
const modalContainer = document.createElement("div")
modalContainer.classList.add("modal-container")
instance.baseElement.appendChild(modalContainer)
Copy link
Member Author

Choose a reason for hiding this comment

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

We need to create and append the modal container node during testing now, as it looks like the behaviour of svelte-portal as changed in the new verison. Previously I assume it would silently fall back to using the document, but now it throws an error if the configured target does not exist in the DOM.

@aptkingston aptkingston marked this pull request as ready for review January 21, 2025 15:10
Copy link
Collaborator

@PClmnt PClmnt left a comment

Choose a reason for hiding this comment

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

Pulled this down and had a play with it, and it's such an improvement to the app building experience, great stuff! LGTM

@aptkingston aptkingston added the feature-branch Release this PR code into a feature branch label Jan 23, 2025
@aptkingston aptkingston merged commit 5139485 into state-and-bindings-panels Jan 23, 2025
19 checks passed
@aptkingston aptkingston deleted the bindings-panel branch January 23, 2025 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-branch Release this PR code into a feature branch size/l
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants