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

Improve tree view #87

Closed
wants to merge 33 commits into from
Closed

Conversation

lapo-luchini
Copy link
Owner

I'm creating this PR myself for ease of tracking olibu's branch as quoted in #81.

I have concept draft for a new interactive tree view based on the latest esm branch in my repository. https://github.com/olibu/asn1js/tree/treeview
What do you think about it.

@lapo-luchini
Copy link
Owner Author

I really like the "real tree" look, I'm not very fond of the ⊕⊖ icons, seems a bit too cumbersone (I mean too "noticeable" in regards of the actual text), but that's a minor issue (I think it can be improved easily with smaller size or with less contrast).

Something funny happened with distances between elements (my 2.0.1 vs your treeview):
image
image

@lapo-luchini
Copy link
Owner Author

I'm not very fond of the ⊕⊖ icons, seems a bit too cumbersome

Might also be the reason the new view occupies more vertical space.

Was it intended change (i.e. for visual clarity?) or a unintended side-effect?

@olibu
Copy link
Contributor

olibu commented Apr 20, 2024

Thank you for your feedback!
I'm not really happy with the icons, too. They have larger and black and white. I'll reduce them a little bit more to reduce the distraction.
I have not changed any vertical spacing explicitly. I can hardly see the differences. I expect that this is an side effect of the icons and the <li> elements.
Shall I add more space between the lines again?

@olibu
Copy link
Contributor

olibu commented Apr 20, 2024

I've update the feature branch with less distracting tree icons.
As part of the tree stylesheet I had removed too many spacing styles. After recovering, the UI now looks much more like the original one.

I've deployed that version at https://olibu.github.io/asn1js/

Waiting for your feedback.

@lapo-luchini
Copy link
Owner Author

Much better!
image
About vertical space… it does use a bit more space, but watching it again maybe it was a bit "too packed" before, rather than "too spacey" in the new one. 🤔

@lapo-luchini
Copy link
Owner Author

There are a few "weird spots" where the tree lines have double width, can you check that?
PS: I can't see any new commit with these fixes on the feature branch… did you forget to push?

@olibu
Copy link
Contributor

olibu commented Apr 21, 2024

I do not see any of this "weird spots". Maybe it's dependent on the resolution? I'm using Chrome and Safari on a Mac.
image

All changes are now available at https://github.com/olibu/asn1js/tree/feature/treeview
There have been some push issues as you already found out ;)

@olibu
Copy link
Contributor

olibu commented Apr 21, 2024

I can reproduce the "weired spots" when zomming the page. Some zoom levels show the lines in different sizes. I will try to find a fix for this.

@lapo-luchini
Copy link
Owner Author

@olibu I'm going to fix this squashed in a single commit, it would be too difficult to re-build all changes in single commits, I hope you don't mind. (I usually prefer 1:1 commits myself…)

index.js Outdated
@@ -231,3 +237,19 @@ selectTag.onchange = function (ev) {
let tag = ev.target.selectedOptions[0].value;
window.location.href = 'https://rawcdn.githack.com/lapo-luchini/asn1js/' + tag + '/index.html';
};

// zoom fix to have straight lines in treeview
Copy link
Owner Author

Choose a reason for hiding this comment

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

Is it possible to do this using CSS rules instead of custom JS?
Because I fear that direct style rules such as this would be stopped by CSP on official website.

Copy link
Contributor

Choose a reason for hiding this comment

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

I added a version without JS. Looks fine on my screen.

lapo-luchini pushed a commit that referenced this pull request May 12, 2024
From 64546e4
Date: Sun, 28 Jan 2024 18:17:45 +0100
Subject: [PATCH 01/25] hex copy on click

From 151289b
Date: Sun, 28 Jan 2024 22:08:09 +0100
Subject: [PATCH 02/25] Context menu and copyAsString added

From 5efe7f7
Date: Mon, 29 Jan 2024 08:26:40 +0100
Subject: [PATCH 03/25] Context menu initially hidden

From 36dd239
Date: Mon, 29 Jan 2024 13:28:54 +0100
Subject: [PATCH 04/25] Fix: Copy the string to clipboard

From 01b1525
Date: Mon, 29 Jan 2024 13:31:51 +0100
Subject: [PATCH 05/25] New: Copy as pretty

From 4978b90
Date: Mon, 29 Jan 2024 13:33:13 +0100
Subject: [PATCH 06/25] New: Align context menu to left

From c7cc3ba
Date: Mon, 29 Jan 2024 18:48:31 +0100
Subject: [PATCH 07/25] Negative list for set and sequence

From c69ed8d
Date: Mon, 29 Jan 2024 18:52:28 +0100
Subject: [PATCH 08/25] Fix: Show context menu at correct position

From 0b9b3f3
Date: Mon, 29 Jan 2024 19:22:45 +0100
Subject: [PATCH 09/25] Simple marker with toggle method

From 8eb7457
Date: Wed, 31 Jan 2024 19:50:58 +0100
Subject: [PATCH 10/25] Indention fixed

From 80e7a8b
Date: Sun, 31 Mar 2024 19:35:37 +0200
Subject: [PATCH 11/25] Menu added to tree view

From 6dcb057
Date: Sun, 31 Mar 2024 22:09:03 +0200
Subject: [PATCH 12/25] Pretty text from innerText

From 88d7afd
Date: Wed, 10 Apr 2024 21:01:10 +0200
Subject: [PATCH 13/25] new: tree view

From 59d44dc
Date: Fri, 19 Apr 2024 15:42:51 +0200
Subject: [PATCH 14/25] Only highlight the current selected node

From 1dc1323
Date: Fri, 19 Apr 2024 15:48:44 +0200
Subject: [PATCH 15/25] smaller padding as of tree layout

From 60383f9
Date: Fri, 19 Apr 2024 16:17:50 +0200
Subject: [PATCH 16/25] Smaller borders and icon

From a6cf850
Date: Fri, 19 Apr 2024 16:31:23 +0200
Subject: [PATCH 17/25] do not show the menu in case of clicking the icon

From 174df2c
Date: Fri, 19 Apr 2024 16:38:45 +0200
Subject: [PATCH 18/25] Installation of node to execute lint correctly

From 48fbe0b
Date: Fri, 19 Apr 2024 16:38:54 +0200
Subject: [PATCH 19/25] Singlequotes

From fbd2b26
Date: Sat, 20 Apr 2024 13:33:30 +0200
Subject: [PATCH 20/25] Only show context menu on highlighted element

From ea3c28f
Date: Sat, 20 Apr 2024 14:09:29 +0200
Subject: [PATCH 21/25] Less offensive tree icons

From 1f9913c
Date: Sat, 20 Apr 2024 14:28:33 +0200
Subject: [PATCH 22/25] Original layout recovered

From 0d84f33
Date: Sat, 20 Apr 2024 15:02:26 +0200
Subject: [PATCH 23/25] Layout issue fixed

From ba21d40
Date: Mon, 22 Apr 2024 19:46:31 +0200
Subject: [PATCH 24/25] Fix: Zoom issues of the border line in treeview

From d303e65
Date: Tue, 23 Apr 2024 09:35:51 +0200
Subject: [PATCH 25/25] Indentation fixed
@lapo-luchini
Copy link
Owner Author

lapo-luchini commented May 12, 2024

BTW: I squashed your branch in 76b5048 (and partially merged to current trunk).

@lapo-luchini
Copy link
Owner Author

I merged this PR in branch github-87, which can be tested online on githack.

@olibu
Copy link
Contributor

olibu commented May 12, 2024

The branch looks fine to me. The githack link however has some CSS issues. Maybe the cache has to be reloaded.

@lapo-luchini
Copy link
Owner Author

Maybe the cache has to be reloaded.

Probably; that happened to me as well, but after a reload with F12+disable cache it looked fine.

@lapo-luchini
Copy link
Owner Author

Merged in 88cb856.

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

Successfully merging this pull request may close these issues.

None yet

2 participants