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

New design of CB: two modes #10814

Merged
merged 11 commits into from
Aug 19, 2024
Merged

New design of CB: two modes #10814

merged 11 commits into from
Aug 19, 2024

Conversation

farmaazon
Copy link
Contributor

@farmaazon farmaazon commented Aug 14, 2024

Pull Request Description

Fixes #10603

Screencast.from.2024-08-14.12-10-51.webm

What is not yet implemented: the filtering. That means that spaces keep their special meaning, and we still display modules and types.

The component list itself was refactored to a separate vue component.

The logic of default visualization type in preview changed a bit: as now there is no selected component, we remember with what suggestion have we switched to code edit mode.

Important Notes

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.

@farmaazon farmaazon added x-new-feature Type: new feature request -gui labels Aug 14, 2024
@farmaazon farmaazon self-assigned this Aug 14, 2024
@farmaazon farmaazon marked this pull request as ready for review August 14, 2024 10:34
Copy link
Contributor

@kazcw kazcw left a comment

Choose a reason for hiding this comment

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

Since we are no longer identifying a suggestion match for the component as it is edited, when editing an existing component we won't have up-to-date information about what icon or visualization type are appropriate. This PR falls back to the generic values in that case, but IMO it would be better to use the node's initial values:

  • I would expect edits that change the component type would be less common than smaller edits
  • When we have already selected e.g. the table visualization for a node, switching to JSON when editing feels odd

app/gui2/src/components/ComponentBrowser.vue Show resolved Hide resolved
Comment on lines 129 to +133
// Top (and left) margins are more important than bottom (and right) margins because the screen has controls across
// the top and on the left.
{ x: inputArea.left - margins.left, y: panelsArea.top - margins.top },
{ x: area.left - margins.left, y: area.top - margins.top },
// If the screen is very spacious, even the bottom right gets some breathing room.
{ x: inputArea.right + margins.right, y: inputArea.bottom + vizHeight + margins.bottom },
{ x: area.right + margins.right, y: area.bottom + margins.bottom },
Copy link
Contributor

Choose a reason for hiding this comment

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

While we're modifying this: When this logic was written, the big plus button was in the bottom left; it's in the bottom right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is, indeed, a higher margin on the left, but this is still useful to make space for component name (and circular menu),.


const previewedSuggestionReturnType = computed(() => {
const id = previewed.value.suggestionId
const id = appliedSuggestion.value
Copy link
Contributor

Choose a reason for hiding this comment

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

Because appliedSuggestion is only set in component-browsing mode, when editing an existing component we will lack information to select the correct visualization type

v-model="input.content.value"
class="component-editor"
:navigator="props.navigator"
:icon="selectedSuggestionIcon"
Copy link
Contributor

Choose a reason for hiding this comment

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

Generic icon when editing existing component?

@farmaazon farmaazon added the CI: Ready to merge This PR is eligible for automatic merge label Aug 19, 2024
@mergify mergify bot merged commit 921632e into develop Aug 19, 2024
35 checks passed
@mergify mergify bot deleted the wip/farmaazon/cb-modes branch August 19, 2024 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-gui CI: Ready to merge This PR is eligible for automatic merge x-new-feature Type: new feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Component Browser Modes
2 participants