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

feat: show type of selection #966

Merged
merged 5 commits into from
Jun 9, 2023
Merged

feat: show type of selection #966

merged 5 commits into from
Jun 9, 2023

Conversation

dhess
Copy link
Member

@dhess dhess commented Jun 8, 2023

Note that in this PR, we've lost the ability to drag the PIP around the canvas, not because it's broken, but just because there's now no good handle for starting the drag. The @neodrag/react functionality we're using passes the mousedown event to the component underneath, so if we make the new tab bar the drag handle, it could end up switching tabs, which is really annoying.

I played around for an hour or two with some ideas for a handle, but didn't come up with anything great. At this point I'm just going to merge this so that we can lock in the ability to see selection types (modulo the issues with the backend not properly identifying the type for holes, see hackworthltd/primer#1062 (comment) for details).

I'll revisit the drag control later today, if I have a chance.

@dhess dhess marked this pull request as draft June 8, 2023 03:16
@dhess dhess added the Deploy service Deploy the backend service for this PR label Jun 8, 2023
@dhess dhess added Deploy service Deploy the backend service for this PR and removed Deploy service Deploy the backend service for this PR labels Jun 8, 2023
Base automatically changed from dhess/fitViewOptions to main June 8, 2023 12:05
@dhess dhess added Deploy service Deploy the backend service for this PR and removed Deploy service Deploy the backend service for this PR labels Jun 8, 2023
Copy link
Contributor

@georgefst georgefst left a comment

Choose a reason for hiding this comment

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

Looks good, modulo styling.

This upstream version has support for displaying the selection's type
or kind. This commit includes the required changes to node flavors,
but the new API method isn't hooked up yet.

Signed-off-by: Drew Hess <src@drewhess.com>
In subsequent commits, the info that was meant to be displayed in this
panel will move to a tab in the PIP. (Note that no such info was
actually ever displayed in this panel, because it was never
implemented.)

The `Sidebar` now only displays types & definitions.

Signed-off-by: Drew Hess <src@drewhess.com>
@dhess dhess removed the Deploy service Deploy the backend service for this PR label Jun 8, 2023
@dhess dhess added the Deploy service Deploy the backend service for this PR label Jun 8, 2023
dhess added 3 commits June 8, 2023 19:26
We add tabs to the PIP, and add the new type info panel as a new tab
in addition to the existing eval view.

The styling here needs a lot of work, but this is mostly functional,
except for 2 known issues:

* Upon initial load, even if there's a selection, it doesn't show up
in the info panel for some reason.

* The types of holes are shown as a hole themselves. This is due to a
backend bug that we haven't figured out yet. All other types I've
tried seem to be correct.

Signed-off-by: Drew Hess <src@drewhess.com>
Signed-off-by: Drew Hess <src@drewhess.com>
Now that the `EvalFull` component isn't always rendered (i.e., if the
selection info tab is selected in the PIP), it can't persist the
currently selected definition. However, the `Edit` component knows it,
so we pass it down to `EvalFull` via a new property.

(The whole eval roundtrip from `EvalFull` back up to `Edit` is pretty
convoluted, and we should figure out a better way to do this.)

Signed-off-by: Drew Hess <src@drewhess.com>
Merged via the queue into main with commit 8853a97 Jun 9, 2023
26 checks passed
@dhess dhess deleted the dhess/show-type branch June 9, 2023 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deploy service Deploy the backend service for this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants