-
Notifications
You must be signed in to change notification settings - Fork 0
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
Bring node labels in-line #1005
Conversation
I don't think this is a bad design, but I think it has some problems that the current design doesn't:
So overall, IMO, this is a net negative change. I think the only win is that it more closely resembles what you'd see in text mode. |
How much extra work would it be to support this style and the current style in a sort of theming system? |
Good idea. Not very much work since the diff here is pretty small. I've just pushed a proof-of-concept in the last commit. It's not toggleable at runtime, but there's a storybook example using it, and it could be used for the app with a one-line change. For me, only your second bullet point is a major issue, and I'd like to discuss alternatives there as I don't think it's something we've ever discussed in depth. So I like the idea of keeping this around as an option to experiement with. |
OK, then, feel free to clean this up and get it ready for merging. For the time being, we could add a 3rd state to the current tree/text button that selects which of the tree styles is active. (Eventually we will need to think about whether that's the right place for it — we'll undoubtedly have other theming support in the longer run and could put the tree style in whatever settings pane we create for that.) |
6c156e2
to
aaeff0e
Compare
I'd like to review this, but the deployment failed. |
The CI failure looks unrelated, since this PR doesn't change any dependencies. |
I see, looks like the audit failed, perhaps because some new vulnerabilities have been found since we last built. I'll look into it. |
0cd5979
to
e4b3ca9
Compare
Signed-off-by: George Thomas <[email protected]>
This uses up less space, and reads nicely (more text-like) for `λ`/`∀`/`Λ` nodes. We can trigger this mode through the tree/text toggle. This is a slight abuse of this element, and we'll likely revisit this if/when we have more optional display behaviour. On the other hand, this display option is fairly experimental for now, and it may well be that we don't keep both tree styles around in the long run. Signed-off-by: George Thomas <[email protected]>
e4b3ca9
to
6eb46f3
Compare
I've force-pushed some simple fixes here: truncation of overlong names, a storybook type error causing weird toolbar rendering, and an oversight where spacing changes were being applied regardless of the mode. |
We had an issue where there were sometimes small visible gaps between the node label and border. These gaps would flicker while zooming in and out. This was seen across multiple browsers. We fix this by adding extra padding around the label so that it intersects the border, rather than meeting it precisely. There is a side effect here, which is that labels in term-level nodes are now curved on both sides (I wouldn't have known how to implement this otherwise). But this is arguably an improvement anyway. Signed-off-by: George Thomas <[email protected]>
Signed-off-by: George Thomas <[email protected]>
6eb46f3
to
284a2fa
Compare
`pnpm audit` is currently complaining about the following GitHub security advisories on the `vm2` package: GHSA-cchq-frgv-rjh5 GHSA-g644-9gfx-q4q4 We don't use `vm2` directly: it is a (very) transitive dependency of `ibm-openapi-validator` via `@orval/core`. The validator is only potentially run when we generate our Primer API bindings, and in fact, we do not even currently run the validator at all, as it doesn't like our OpenAPI spec. Therefore, this advisory isn't relevant to us at this time. Unfortunately, there is currently no way to tell `pnpm audit` to ignore GHSA advisories, only CVEs. See relevant discussion in: https://github.com/orgs/pnpm/discussions/6204 pnpm/pnpm#6838 Ironically, it seems like it may be possible to use another IBM tool to post-process the output of `pnpm audit` and ignore certain issues: https://github.com/orgs/pnpm/discussions/5229 However, until we have time to look into that, we'll just disable `pnpm audit` in order to make forward progress. Note that we are also running regular security scans via GitHub's Dependabot and Snyk, so we have good security coverage even without the `pnpm audit` step. Signed-off-by: Drew Hess <[email protected]>
I have disabled the CI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tree 1
and tree 2
obviously need new names, but this is fine for now.
I still have reservations about the inline label UI (see earlier comment), but we can let students decide now when we start testing.
(I will also note that this PR doesn't actually move labels to the left, which was my original suggestion that started the whole thing off 😂) |
We discussed these informally in a meeting at some point, but for the record:
The new mode has wider nodes, and less spacing between nodes. There should be a net gain of space, since the packing of nodes is now simpler due to their uniform shape, as discussed in OP.
This is an interesting point. I do think, in general, we should treat syntax labels (
I'm not sure. Pattern nodes are really quite different to others. Anyway, we could easily shove a label in the top-left.
I understand the concern, but this doesn't really bother me personally. I've also just noticed that it's actually far less the case since ddf7881. |
I wasn't sure if this PR was the right place to make that change. Anyway, it's trivial: #1016. |
Sorry, it was just an amusing aside. You’re right that it’s best not to mix two unrelated changes in a single PR. |
At a recent in-person meeting, @dhess mentioned wanting to move labels to the left, and after thinking about it I said I'd like to try a bigger change, with labels brought down to the height of the main node contents. This is a mock-up of that change.
Pros:
λ
and∀
nodes.Still to do:
I really don't know how to fix this. And I don't want to sink any more time in to it when this style is just an experiment which we might not keep around.Var
andV
, especially given our terminology discussions.