JsDbg icon indicating copy to clipboard operation
JsDbg copied to clipboard

Allow truncating path to variables

Open cbiesinger opened this issue 6 years ago • 5 comments

Today I wanted to show a member variable in the tree with a fairly long path: Layer.scrollable_area_.raw_.scrollbar_manager_.v_bar_is_attached_:false

This takes up a lot of horizontal space... can we allow truncating them? Or always truncate in the middle when they get long enough, or something?

cbiesinger avatar May 16 '19 20:05 cbiesinger

Interesting idea!

For long paths, we could do something like: add a "..." in the middle and the show the full path when the user hits alt+click.

The question though is when do we decide to show the "...". After we expand through a certain number of fields? After we cross an arbitrary path size? Or would it have to vary based on window size? I'm not sure what the right answer is here.

sanketj avatar May 16 '19 21:05 sanketj

@petersalas , have you ever thought about this?

sanketj avatar May 16 '19 21:05 sanketj

Yeah, it can definitely be problem, especially when multiple fields are being showed and it's embarrassingly bad when it's a.really.long.sequence.of.objects.ending.in.fieldA and a.really.long.sequence.of.objects.ending.in.fieldB.

The ideas around trimming sound good to me...maybe elide fields between 2 and N-1?

petersalas avatar May 18 '19 03:05 petersalas

@cbiesinger @petersalas , do we still want this now that we have #155 ?

sanketj avatar Jun 24 '19 20:06 sanketj

You could certainly make an argument either way but I'm leaning towards keeping this open because it would be helpful to conserve screen width when showing multiple variables with long paths

cbiesinger avatar Jun 24 '19 20:06 cbiesinger