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

Component catalogue in Design Mode includes component under preview, resulting in compilation errors on drop #5125

Open
tronical opened this issue Apr 24, 2024 · 2 comments
Labels
a:live preview The Live preview of slintpad or the LSP (mT,bO) bug Something isn't working priority:low Lowest priority. The issue is kept open for tracking purpose, but noone is actively working on this

Comments

@tronical
Copy link
Member

To reproduce:

  1. Open https://slintpad.com/
  2. Click "Design Mode" in the preview toolbar
  3. Observe "Demo" as entry in the component catalogue under "User Defined"
  4. Dragging "Demo" into the preview results in compilation failure.

Expected Result:

It should not be possible to drag "Demo" into the demo UI under preview. Either by it not being listed there, or being visually disabled for drag and drop.

@tronical tronical added bug Something isn't working a:slintpad SlintPad web frontend implementation (mT,bS) labels Apr 24, 2024
@ogoffart ogoffart added a:live preview The Live preview of slintpad or the LSP (mT,bO) priority:low Lowest priority. The issue is kept open for tracking purpose, but noone is actively working on this and removed a:slintpad SlintPad web frontend implementation (mT,bS) labels Apr 24, 2024
@ogoffart
Copy link
Member

ogoffart commented Apr 24, 2024

I'm not sure whether the component catalog should depends on the component under preview or not. But yes, we shouldn't allow dropping it.

We need to do some graph analysis of each component to know whether they contain the component under review or not or if it is allowed to import that file from the current file without causing recursion.

Considering this is not a simple task, I think we can live with this bug for the MVP though.

Edit: Although if it is in the same file, it should be easy to disallow dropping on component declared before the component we want to drop.

@tronical
Copy link
Member Author

Considering this is not a simple task, I think we can live with this bug for the MVP though.

I agree. I mean, I think for the MVP it would still be very beneficial to cover at least the most obvious cases that user will run into, such as the scenario you described with the declaration order. Just wanted to make sure we're tracking this issue.

I ran into this by accident as I ended up dragging the wrong thing while trying to see if I can use this already for a demo. It took just a few seconds, and once in this state it's very hard to get back (clicking into the text editor and pressing the undo shortcut being hard).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:live preview The Live preview of slintpad or the LSP (mT,bO) bug Something isn't working priority:low Lowest priority. The issue is kept open for tracking purpose, but noone is actively working on this
Projects
None yet
Development

No branches or pull requests

2 participants