-
Notifications
You must be signed in to change notification settings - Fork 126
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
Flat render #503
Flat render #503
Conversation
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.
How much overlap is there between getFlatArray
and expandThoughts
? Do you plan on consolidating those functions?
14579de
to
3470495
Compare
@raineorshine I tried your suggested solution of passing |
3470495 is doing the same thing it was doing before; subthoughts fade out and overlap distant cousins.
In what way? Was it targeting the wrong thoughts, or was the technique not working? |
@raineorshine Your observation is absolutely correct. The logic to differentiate unmounting nodes which should animate is still in progress. The issues I wanted to address was that the nodes which directly unmounts without animation still had some delay and lagged. You can see in the above gif that when cursor is set from thought k to thought a , all the subthoughts of k directly unmounts without any animation. That is the correct behavior but the issue is that they have certain delay before unmount. It is causing visual choppiness as you can see in the gif. But the problem seems to be solved if we set display to none when node starts exiting. |
3470495
to
dd4b96d
Compare
@raineorshine I have pushed latest changes. I have have refactored There are several cases to achieve unmount animation perfectly. I implemented all of them except case 3. Please read the implementation detail. #188 (comment)
The issue you mentioned above is exactly the third case. With this PR I used very hacky solution to solve it. But I need you to take a look and tell me what you think about it. Please review it thanks! |
Ah, that it explains it. I tried the one case that you hadn't implemented yet! I now am trying a different case and it is working.
I'm not sure it solved it. Here's a case that does not work:
Activate
Will do! |
Ah, I forgot to consider that we can set cursor to thoughts that are not visible too. I will look at it. |
e56379b
to
d23b965
Compare
@raineorshine With this latest change you can now test the flat rendered tree with cursor action. I have recreated UI to match current implementation to make comparison easier. There are still many challenges to overcome before we reach our goal. I want you to review this to be sure that we are moving ahead in the right direction. |
61dc9e6
to
b1a9f73
Compare
Updates
|
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.
Very pleased with the result so far! The animation looks quite good. It's a little choppy on mobile Safari, but we can address that separately, or worst case disable the height animation on mobile. I don't see any of the major rendering issues we were having earlier. Thank you.
I took a more in-depth look at the code this time. It's looking very good. The component is quite small, and getFlatArray
mostly consists of expansion logic, which is expected. I didn't go over the expansion logic in detail, but focused on the recursion and overall architecture. Questions are below.
I renamed some variables and made a couple small refactors. Make sure to pull my changes into your branch.
Thank you!
src/util/flatRender.js
Outdated
}) | ||
} | ||
|
||
export const treeToFlatArray = (cursor, showHiddenThoughts) => { |
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.
We have a convention to name the file the same as the function when there is a single export.
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.
@raineorshine Sure I will change the name.
1c2b807
to
6db25a1
Compare
Table View Update@raineorshine This is the first iteration of table view with flat renderer. Following goals have been achieved:
Here are some clips showcasing the update Table view togglehttps://drive.google.com/file/d/1LQCcGARD1WH9Ov3mQOiolOm0D8BrqDcl/view?usp=sharing Table view toggle with meta
|
Awesome!!! That is fantastic. Excellent work!
Nice! This looks great. There is a slight modification needed for information design reasons. Take a look at this screenshot of the middle of the animation: The way column 2 animates in results in a misalignment between thoughts and subthoughts. It may be trickier to maintain the row when there are multiple subthoughts in column 2. In this case, the vertical height will be animating to fit the subthoughts. During that time, we have to make sure the subthoughts are animated in at a similar pace so that they do not overlap the row of their uncle in column 1. Not sure how much this requirement will be met by default, or if it will require a lot of custom logic.
WOW. I am stunned by this animation. It looks SO GOOD!!! I am so excited. I'm praying we can get it to run smoothly on all platforms, because this is exactly what we want.
Again this looks absolutely amazing.
I haven't looked at the code yet since you're still working on it, but let me know whenever it's ready for a code review, or if you want my advice on any architectural decisions! Keep up the great work! |
4e36f83
to
193dc50
Compare
TABLE VIEW SECOND UPDATE@raineorshine With this update the table view is now functional to be tested. We have achieved following goals:
Table view toggle with left to right xOffset transform and opacity transition.Table view toggle with one of the children pinned open.Multiple table views openMultiple table views with hidden thoughts onPlease review the code and let me know about your thoughts on the progress. |
TO DO
|
The screenshots really speak for themselves. Wow. I think this is going to blow people away. I mean, is there any outliner out there with animations like this?!? It's just incredible. The table view is looking great and there are more cases than I can name in which animations are working perfectly. We may want to tweak the animations for certain actions, like The only issue I'm noticing is when the cursor moves to column 2 of a table, it reverts to normal view. Instead, it should continue to render column 1 and column 2 as a table, just translated to the left (as in Unrelated to tables, there's a couple core pieces of functionality that need to be restored, as you may be aware of:
Do you have steps to reproduce? I'm not seeing the issue.
Yes, the cells should also be vertically aligned top: |
Separate component for drop end convert treeToFlatArray and FlatTreeRenderer to tsx
fix DND root context drop bug
change showContexts to showContextsParent add id to ranked root fix glitch related to no children context component
remove layout animation due to width change issue bind height change to the wrapper div to allow drop end height to cause height animation remove homelink from thought annotation
It has not been working for me in |
Yes. It was working. It didn't work well when changing width of the thought for first column width in table view. I have disabled it for now. I will be working on solving that issue. |
rebase to dev split and merge content editable behavior fixed
15eaaa1
to
11158d9
Compare
Sounds good. |
Fixing the unit tests should probably be the top priority. |
use react-use-measure instead of custom hook cancel debounced height callback function on unmount set cursor offset
55661f3
to
91197e8
Compare
add id to the cursor on new thought add id to cursor on exisitingThoughtChange find editable using key of the node
add blue overlay on bullet when drag is active update ContentEditable for proper split behavior
@raineorshine I have fixed all the tests. But I ran into problems with drag and drop tests. Turns out testing DND with |
There is a extra white space after em/src/util/getElementPaddings.ts Lines 1 to 6 in 9c2bf2c
|
That's a bummer. Does their latest version support HOC, or would we have to decrease the version we are using? I think HOC with tests is probably better than hooks without tests if we had to choose.
Assuming the padding value is |
Sometimes padding value can return just |
update drag and drop tests update component tests fix move thought up add id to the cursor
03e5365
to
f69d008
Compare
@shresthabijay Should we close this and reconstruct it at a later point? It seems too far behind to use this PR. |
Yes. This PR is too far behind. We can use it as a reference later if we need it. |
Issue: #188
@raineorshine This is a draft PR for the first iteration of flat rendering implementation. There are many challenges as we move forward to create recreate smooth animations and styles. We may need to create custom HOC to tackle some of the animation challenges. Please test the current implementation. It is far from being complete and lacks many details rn but still we are making good progress.
I have used right split pane to render the
FlatTreeRenderer
. You can open the split view and see the renderer in action while playing around with current recursive implementation on the left side of the split view.