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

It isn't clear that you can open results in the inspector #2620

Open
guyguy2001 opened this issue Sep 12, 2024 · 3 comments
Open

It isn't clear that you can open results in the inspector #2620

guyguy2001 opened this issue Sep 12, 2024 · 3 comments

Comments

@guyguy2001
Copy link

(Alt title: Make items in the inspector have the > expanding arrow by default)

The problem

When running a couple of expressions in the repl, the inspector first looks like this:
image

Which seemed to me like it's just a weird way to show the repl results history in a textual way, and nothing more.

I think I had to see in the docs / tutorial that you can expand items.

It isn't unreasonable or anything, but for someone who comes to Calva from other programming languages, and not other clojure editors, and isn't used to REPL programming or paredit, everything is already so overwhelming, that simple things like this can be missed.

(A small related "nitpick" - there isn't any space for the > at the start, and once I do inspect an item, all of the items move right to add place for the > - which is a tad bit disorienting (as all items move both down and right at the same time), and misses the opportunity to have the negative space where the > will be, before inspecting the first item)
image

Proposed Solution

Make the > appear from the get-go, and lazily inspect the element once we click it.
This is what pylance do for their call / type hierarchies:
https://github.com/user-attachments/assets/9370e230-0b11-4d55-9df6-cf92ccb880b3
(I'm sure the delay is for the analysis and not the rendering since on big projects it's really slow for like 3 items).

I don't see a reason not to do this, or if there is a reason for users to want to know what was already inspected (e.g. a huge object that takes 10 seconds to expand on the first time, and the user wants to know they're clicking the immidiate one), there could be a UI representing whether it's cached or not (maybe the > could be greyed a bit, or an underline or something), and there could be a setting to control this.

If it isn't possible / in the meantime, shifting the text a bit to the right to leave space for the > would also be nice.

@PEZ
Copy link
Collaborator

PEZ commented Sep 12, 2024

Hi! Thanks for the detailed report. I think the suggestion makes sense. When I first created the inspector I wasn't too familiar with its API, but now I do think we can lazily unpack the items like you suggest.

Do you want to have a look at implementing it? Otherwise I will do it pretty soon. Seems important for the reasons you give.

@guyguy2001
Copy link
Author

guyguy2001 commented Sep 13, 2024

I won't be able to get to it for now; I hope I'll be able to take a stab on this (or other stuff I encounter) once the Jewish holidays come around next month.

@PEZ
Copy link
Collaborator

PEZ commented Sep 13, 2024

Right. Let's see if I get at it before those holidays. 😄 Please don't hesitate to holler my way when you have some time for hacking on Calva. I'm easiest to find at the Clojurian slack.

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

No branches or pull requests

2 participants