New file tree#46602
Conversation
Bundle size report 📦
Look at the Statoscope report for a full comparison between the commits 90c163b and 83270f4 or learn more. Open explanation
|
|
This is awesome! Could we introduce a |
I think this would be AWESOME and we should do that but I’m a bit hesitant to do this just yet because I don't fully understand the different needs of these views yet. What about we add this as a one-off for now, iron out the edge cases, maybe start thinking about what symbols and the references panel would need, and then onboard it to Wildcard? |
…t Taras stood by and did not hold me back so he's also to blame
| // on the folder name as well and thus the jumping is unexpected. To fix this, | ||
| // we have to patch `.focus()` and handle the case ourselves. | ||
| // | ||
| // TODO: This should be fixed upstream in react-accessible-treeview. |
There was a problem hiding this comment.
I'd suggest making a PR there, maybe it'll get merged quickly. Monkey-patching HTMLElement.prototype.focus() seems really hacky
There was a problem hiding this comment.
@felixfbecker Yeah I can look into it. We could also vendor the library, it's just two files. But I'll try to come up with a reasonable API (Maybe providing a custom focus helper? Maybe just a callback + a way to set the preventScroll option?)
There was a problem hiding this comment.
Maybe I’m overthinking it, I'll just post the same fix that I did, since this is also a weird experience in the examples of this library if you start to constrain the size:
Screen.Recording.2023-01-18.at.19.11.58.mov
There was a problem hiding this comment.
either upstream fix or vendoring sounds both reasonable to me :)
There was a problem hiding this comment.
If you can extend it to the additional use cases as a direct follow-up that makes sense. I think the explicit goal here should be to find something that is generically reusable for other areas, so you're right that we don't really know until we use it in at least two places, which only means we should do that rather sooner than later. I could also see an argument for already reusing it in this PR for the symbols sidebar to figure out if we can make it work like that (because maybe the library is actually not well generalizable, who knows). But that's up to you, certainly good to ship improvements faster too. |
Yeah that's what I want to figure out. I had to build a bit of book-keeping to make it work well for the files use case, and I think that's fine to be kept file-tree-specific. Maybe what's reusable is the the general layout and UI (so everything beside the icons and the text that is rendered) |
mrnugget
left a comment
There was a problem hiding this comment.
Only looked at *.go and left some comments that should be addressed, after that, as long as you tested this, I'm good withit
| // on the folder name as well and thus the jumping is unexpected. To fix this, | ||
| // we have to patch `.focus()` and handle the case ourselves. | ||
| // | ||
| // TODO: This should be fixed upstream in react-accessible-treeview. |
There was a problem hiding this comment.
either upstream fix or vendoring sounds both reasonable to me :)
|
This looks great btw :) |
|
Codenotify: Notifying subscribers in OWNERS files for diff a528304...90c163b.
|
|
It's unclear when the upstream fix will be merged (dgreene1/react-accessible-treeview#81) and I don't want to be blocked by it, so I went ahead and vendored the library for now to avoid the controversial hack. Let me know if you can think of any issues with this approach (as a nice upside we can also remove the PropTypes usage, yay!). Included the LICENSE file as well. |
9017181 to
1978fa5
Compare
taras-yemets
left a comment
There was a problem hiding this comment.
Great work, Philipp!
valerybugakov
left a comment
There was a problem hiding this comment.
Awesome work! Excited to start using it on S2 as soon as it becomes available 🔥
| } | ||
|
|
||
| return ( | ||
| <Tree<TreeNode> |
Part of #46602 This adds single-child folder expansion to the new tree view based on how VS Code does it 🎉 Since the implementation of the tree is append-only, only a bit of bookkeeping is needed to detect single-child expansion scenarios and change the tree entries accordingly. I've left various comments in the code which should explain the implementation for the curious.
Part of #12916
Todo
Todo for later
➡️ moved to #12916
Test plan
mainso we can test it properly on S2