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

Collapsing nodes #8686

Merged
merged 17 commits into from
Jan 12, 2024
Merged

Collapsing nodes #8686

merged 17 commits into from
Jan 12, 2024

Conversation

vitvakatu
Copy link
Contributor

Pull Request Description

Closes #8067

Also fixes nodeRects map, as it no longer stores invlisible nodes.

collapsing.nodes.mp4

Important Notes

Positioning of newly created nodes is not handled yet, as it requires fixes in the Ast editing API.

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,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed, the GUI was tested when built using ./run ide build.

@vitvakatu vitvakatu added CI: No changelog needed Do not require a changelog entry for this PR. -gui labels Jan 5, 2024
@vitvakatu vitvakatu self-assigned this Jan 5, 2024
@vitvakatu vitvakatu marked this pull request as ready for review January 5, 2024 10:42
@farmaazon farmaazon requested review from farmaazon and removed request for MichaelMauderer January 8, 2024 10:58
Copy link
Contributor

@farmaazon farmaazon left a comment

Choose a reason for hiding this comment

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

Nothing really serious found by me.

app/gui2/src/components/ComponentBrowser/placement.ts Outdated Show resolved Hide resolved
app/gui2/src/stores/graph/graphDatabase.ts Outdated Show resolved Hide resolved
app/gui2/src/stores/graph/graphDatabase.ts Outdated Show resolved Hide resolved
app/gui2/src/components/GraphEditor/collapsing.ts Outdated Show resolved Hide resolved
app/gui2/src/components/GraphEditor.vue Outdated Show resolved Hide resolved
app/gui2/src/stores/graph/graphDatabase.ts Outdated Show resolved Hide resolved
app/gui2/src/stores/graph/graphDatabase.ts Outdated Show resolved Hide resolved
app/gui2/src/util/ast/abstract.ts Outdated Show resolved Hide resolved
app/gui2/src/util/ast/abstract.ts Outdated Show resolved Hide resolved
app/gui2/src/util/ast/abstract.ts Outdated Show resolved Hide resolved
exprs_.push({ newline: { node: Token.new('\n') }, expression: null })
}
const body = BodyBlock.new(exprs_, module)
const args_ = args.map((arg) => [{ node: arg.exprId }])
Copy link
Contributor

Choose a reason for hiding this comment

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

When constructing an Ast object it's important to ensure any children are accessible in the object's module. After #8711 the makeChild helper takes care of this; it can be used like: node: makeChild(module, arg, id). id should be the ID of the object currently being constructed; it can be generated with newAstId() and used here and as the ID argument to the Function constructor call below.

@vitvakatu vitvakatu added the CI: Ready to merge This PR is eligible for automatic merge label Jan 12, 2024
@mergify mergify bot merged commit 58cf4e5 into develop Jan 12, 2024
27 checks passed
@mergify mergify bot deleted the wip/vitvakatu/collapsing-nodes-2 branch January 12, 2024 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-gui CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Collapsing nodes
4 participants