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
Svelte: First run on file tree visual update #62585
Conversation
@vovakulikov I see you requested review, but this is still in draft state. What kind of review are ya looking for? |
@camdencheek you can ignore it for now. For some reason I thought that since this is in draft mode you won't be notified |
@taiyab I fixed the file icon color for selected states, I haven't added vertical lines (I tried and it looked a bit crowded with additional elements) but I think our paddings for nesting levers were off, I think I fixed them now, (basically I did repeat nesting from JetBrains IDEs) |
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.
This looks great! I've added some comments on the Loom for feedback.
(The drag to collapse menu is genius).
@taiyab echo your comments here, just to keep it in one place
This actually was intentional, because on the big screens, there will be enough space for these controls, we could either
I remember we had a big conversation that having non-jumping controls for show/hide actions is very vital. If @fkling is happy here I can live with not having this but I would prefer to still have it |
On a bit of technical note (echo it from Slack to keep convos in one place) Before this PR, I thought that file tree providers knew about each other as we go from folder to folder, but it seems they don't, and the only way it works smoothly at the moment is because of our cache on the rural level. This doesn't cause any big problems at the moment, but I think if we need to have more interaction about which folder we want to open and when we probably should have something like a graph rather than a plain list of data sources. I've seen parents linking in the codebase (I think these arguments are not used and are obsolete at the moment), so @fkling probably has already thought about this, but I am curious what problem you had with this. |
This please.
I was proposing this as a temporary solution, as I was intending to actually have the button to the left of the file header so it always maintained its position. However, after some experimenting, we can slightly adjust what you've done instead:
Thanks! |
|
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.
lgtm 👍🏻
li[data-treeitem][aria-selected='true'] > & { | ||
color: var(--tree-node-lable-color, var(--body-bg)); | ||
} |
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.
Not sure if that's better, but we could also set the color/variable in [role="treeitem"]
(and &[aria-selected="true"]
) and just use color: var(...)
here, and avoid using this selector.
No preferences though.
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.
The problem with setting variables or color on [role="treeitem"]
level is that all children levels also get these variable or color values, which isn't correct when these styles are used for selected/hover states.
I did this at the very beginning too
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.
I though "resetting" it to the default color by a treeitem descendant would override that setting but maybe not.
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.
No, CSS cascade doesn't work with recursive like this (if I understood your comment correctly), an interesting thing is that I wanted to have left padding for nesting also based on CSS variables but it turned out this expression doesn't work
:root {
--nesting-level: 0;
}
.item-children {
--nesting-level: calc(var(--nesting-level) + 1);
}
:global([data-tree-view-flat-list='true']) & { | ||
width: 0; | ||
margin-left: 0.5rem; | ||
} |
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.
I didn't quite understand why this is necessary until I opened the page and changed the styles dynamically.
I agree that not using as much horizontal space when it's not needed looks good, but I also noticed that the whole tree "shifts" when going up to a non-flat parent, which feels a bit weird. Overall I wonder if this edge case is worth having the extra rules.
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.
but I also noticed that the whole tree "shifts" when going up to a non-flat parent, which feels a bit weird
I have no preferences here, but I think the tree jumps regardless of the padding here; the current level gets additional paddings anyway as we open the parent level, no?
client/web-sveltekit/src/lib/fuzzyfinder/FuzzyFinderContainer.svelte
Outdated
Show resolved
Hide resolved
client/web-sveltekit/src/lib/fuzzyfinder/FuzzyFinderContainer.svelte
Outdated
Show resolved
Hide resolved
client/web-sveltekit/src/routes/[...repo=reporev]/(validrev)/(code)/+layout.svelte
Show resolved
Hide resolved
|
||
/** | ||
* Resets file tree top level path, in some cases like jump to scope | ||
* we have to invalidate cache since top level path has been changed | ||
* to a lower level. | ||
*/ | ||
resetTopPathCache(repoName: string, revision: string): void |
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.
This feels very "manual". Maybe there is a better way to do this at some point, but I can't think of anything else atm either.
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.
This PR seems to sometimes introduce a horizontally scrolling container, which is confusing because the content isn't actually horizontally scrollable except for a pixels in either direction
screenshot-2024-05-14_15-11-41.mp4
Not quite sure what's going on, but when I run this branch locally, the fuzzy finder activates on every page load. This does not happen for me on |
@camdencheek, this is my bad. One commit slipped when I was fixing it by Felix's comments. I just pushed it, it should be working now. |
I'll take a look; it's actually an interesting question: should this block be scrollable by a horizontal axis? It probably should (the proper scroll, not just a few pixels) if the tree has that nested structure like this. Otherwise it won't be possible to work with this tree only if they jump the scope with new control that this PR adds but this thing should be optional I guess |
4006abf
to
7ffcc31
Compare
Excited for this to be merged in! Great work @vovakulikov. |
@camdencheek I fixed the problem with width and undesirable small scroll, thanks for spotting this. For now I just hide overthing that falls outside of the sidebar width. This is somehting we have at the moment on the main so no regressions here, the problem would partially solved by new "move scope to dir" button but it's still possible to open some really nested strucuter and see no title of the selected item. For example on our test wierd repo @taiyab Curios what you think about making the sidebar scrollable by X axis and maybe make file items titles sticky by X axis as well. Making it scrollable would solve problem with overflowed nested items, making them (file items title) sticky by X axis would solve the problem when you will scroll to the right to see nested items, you also will still be able to see file items from the top level since they're sticky but this also would me that if you make panel small enough we just cut file item titles (now they are truncated and you can see ... at the end) |
I'm going to merge this one since this doesn't introduce any regressions in the current layout behavior but again I think the problem still remains |
Part of #62001
This PR mostly updates the visual representation of the file tree side panel. It also adds a few action buttons to the file tree header.
Loom Demo https://www.loom.com/share/0e72844210934a86868dd722e9c2b3e9
Todo
Test plan