Skip to content

Migrate the Select tool to the document graph #1433

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

Merged
merged 16 commits into from
Oct 17, 2023

Conversation

0HyperCube
Copy link
Member

@0HyperCube 0HyperCube commented Oct 8, 2023

TODO:

  • Fix with multiple transform nodes
  • Fix deep select (new implementation ~10 lines - although it probably doesn't match the previous behaviour as I haven't really tested it)
  • Don't select artboards with select tool.

@Keavon
Copy link
Member

Keavon commented Oct 8, 2023

!build

@github-actions
Copy link

github-actions bot commented Oct 8, 2023

📦 Build Complete for 7daee21

@Keavon
Copy link
Member

Keavon commented Oct 8, 2023

!build

@github-actions
Copy link

github-actions bot commented Oct 8, 2023

📦 Build Complete for 7daee21

@Keavon
Copy link
Member

Keavon commented Oct 9, 2023

!build

@github-actions
Copy link

github-actions bot commented Oct 9, 2023

📦 Build Complete for 7daee21

@Keavon Keavon changed the title Select tool port Migrate the Select tool to the document graph Oct 9, 2023
@Keavon
Copy link
Member

Keavon commented Oct 9, 2023

!build

@github-actions
Copy link

github-actions bot commented Oct 9, 2023

📦 Build Complete for 7daee21

@Keavon
Copy link
Member

Keavon commented Oct 9, 2023

!build

@github-actions
Copy link

github-actions bot commented Oct 9, 2023

📦 Build Complete for 7daee21
https://ec60da70.graphite.pages.dev

@0HyperCube
Copy link
Member Author

!build

@GraphiteEditor GraphiteEditor deleted a comment from github-actions bot Oct 11, 2023
@github-actions
Copy link

📦 Build Complete for 4be5ccf
https://c049f077.graphite.pages.dev

@Keavon
Copy link
Member

Keavon commented Oct 11, 2023

How easy would it be to make the Select tool not select the artboard? As soon as I click the artboard, it breaks the rendering of the artwork (but the shape-hover overlays show the current positions after navigating).

I also notice the "Empty Stack" node is appearing as a layer in the (still-to-be-rewritten) layer panel, but if it's a real quick change, it'd be nice to temporarily remedy that until I rewrite the layer panel in the next few weeks.

@0HyperCube
Copy link
Member Author

I see, yes that makes sense. Do you agree that preventing the Select tool from interacting with artboards would be the right solution here? (And then only the Artboard tool can do that.)

Fixed @Keavon

@0HyperCube 0HyperCube requested a review from Keavon October 11, 2023 22:38
@Keavon
Copy link
Member

Keavon commented Oct 11, 2023

!build

@github-actions
Copy link

📦 Build Complete for a39f29f
https://2f9a71ab.graphite.pages.dev

@Keavon
Copy link
Member

Keavon commented Oct 11, 2023

This looks great! Only a few little things I'm noticing:

  • I can't reproduce it reliably, but thrice I've noticed that as I multi-select (shift-clicking one shape then another in the viewport), it ends up making both shapes disappear permanently from the render until I Ctrl+Z it. We'll have to keep watching this one since I have no idea how to make it happen and it's sort of rare.
  • The pivot widget should also be grayed out, not hidden, just like the alignment and flip widgets.

I think that's all that I directly notice pertaining to the Select tool, so this should be ready to merge pretty soon then! In fact, I'll just push the pivot widget change now so it's in good shape for a review also by @TrueDoctor and then we'll be good to merge.

After this, I think the most obvious problems users will encounter in this branch is that artboards should be fed into from a layer stack, rather than living at the base of a layer stack; and that selecting a layer in the node graph doesn't show the upstream nodes in the Properties panel. But those are both fine to fix in a separate PR and are probably somewhat approachable by new contributors. Thank you so much for this!

@Keavon
Copy link
Member

Keavon commented Oct 12, 2023

!build

1 similar comment
@Keavon
Copy link
Member

Keavon commented Oct 12, 2023

!build

@github-actions
Copy link

📦 Build Complete for a68263b
https://88f27cf3.graphite.pages.dev

@TrueDoctor
Copy link
Member

I'm not quite happy with the overall approach of relying on node names for special behaviour. We could potentially add a dedicated node tag (or just in general some sort of tagging system) to make the system a bit more robust.
Another issue with the current approach is that we still don't support Flip nodes or other user-custom transform nodes right? But I can address that in a followup pr.

Copy link
Member

@TrueDoctor TrueDoctor left a comment

Choose a reason for hiding this comment

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

21 files left to review, will continue asap

@0HyperCube
Copy link
Member Author

0HyperCube commented Oct 12, 2023

I'm not quite happy with the overall approach of relying on node names for special behaviour. We could potentially add a dedicated node tag (or just in general some sort of tagging system) to make the system a bit more robust.

I have previously mentioned that the approach of relying on node names and input indices is not robust.

Another issue with the current approach is that we still don't support Flip nodes or other user-custom transform nodes right? But I can address that in a followup pr.

This approach should work fine if there are any sort of transform nodes downstream. I forgot about other nodes being downstream, so we probably need some slight code changes to handle this. Also we may potentially need to fix the code for adjusting the translation (so that the shape appears to stay still as the bounding box is changed in the path tool) to work with custom transform nodes.

I can't reproduce it reliably, but thrice I've noticed that as I multi-select (shift-clicking one shape then another in the viewport), it ends up making both shapes disappear permanently from the render until I Ctrl+Z it. We'll have to keep watching this one since I have no idea how to make it happen and it's sort of rare.

Is there any error logs? Does it still happen when you save and then reload? Do the layers still appear in the layer tree? If you drag a connection between two nodes in the graph UI then does anything change (this causes the layer tree to be recomputed)?

@Keavon
Copy link
Member

Keavon commented Oct 16, 2023

!build

@github-actions
Copy link

📦 Build Complete for 37b8225
https://c5b8c1c5.graphite.pages.dev

@Keavon
Copy link
Member

Keavon commented Oct 17, 2023

!build

@github-actions
Copy link

📦 Build Complete for 549d523
https://48ba8420.graphite.pages.dev

@0HyperCube 0HyperCube force-pushed the select-tool-port-rebase branch from 41063eb to b727536 Compare October 17, 2023 17:03
@Keavon
Copy link
Member

Keavon commented Oct 17, 2023

!build

@github-actions
Copy link

📦 Build Complete for b727536
https://d5c61a09.graphite.pages.dev

@Keavon Keavon requested a review from TrueDoctor October 17, 2023 17:55
Copy link
Member

@Keavon Keavon left a comment

Choose a reason for hiding this comment

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

QA looks great!

@Keavon Keavon merged commit 8daf183 into full-document-graph Oct 17, 2023
@Keavon Keavon deleted the select-tool-port-rebase branch October 17, 2023 17:59
Keavon added a commit that referenced this pull request Oct 17, 2023
* function for accessing document metadata

* Better select tool

* Fix render

* Fix transforms

* Fix loading saved documents

* Populate graph UI when loading autosave

* Multiple transform nodes

* Fix deep select

* Graph tooltips

* Fix flip axis icon

* Show disabled widgets

* Stop select tool from selecting artboards

* Disable (not hide) the pivot widget; remove Deep/Shallow select for now

* Code review changes

* Fix pivot position with select tool

* Fix incorrectly selected layers when shift clicking

---------

Co-authored-by: Dennis Kobert <[email protected]>
Co-authored-by: Keavon Chambers <[email protected]>
Keavon added a commit that referenced this pull request Oct 17, 2023
* function for accessing document metadata

* Better select tool

* Fix render

* Fix transforms

* Fix loading saved documents

* Populate graph UI when loading autosave

* Multiple transform nodes

* Fix deep select

* Graph tooltips

* Fix flip axis icon

* Show disabled widgets

* Stop select tool from selecting artboards

* Disable (not hide) the pivot widget; remove Deep/Shallow select for now

* Code review changes

* Fix pivot position with select tool

* Fix incorrectly selected layers when shift clicking

---------

Co-authored-by: Dennis Kobert <[email protected]>
Co-authored-by: Keavon Chambers <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants