-
Notifications
You must be signed in to change notification settings - Fork 27
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
GScan improvements, propagate state #736
Conversation
While working on #733 for #721, I noticed the In this pull request I will move the GScan data out of the component, into Vuex, and update it incrementally based on deltas. The goal is to have the least amount of elements being updated as possible. Here's a screenshot from this morning where I hacked the code to print whenever a Even though |
import Alert from '@/model/Alert.model' | ||
import applyDeltasTree from '@/components/cylc/tree/deltas' | ||
|
||
const state = { |
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've split the workflows.module
since it had data used by GScan, and also by the Tree view. The tree view data is relatively more complex at this point, so moving it out simplifies the workflows.module
.
* @param {Object.<String, Object>} lookup | ||
* @return {Result} | ||
*/ | ||
function applyDeltasAdded (added, lookup) { |
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 code added here was in workflows/deltas.js
, but was used only by the Tree view. Instead of moving to the tree view, I've moved it here to common since if we ever need to use a delta that creates a lookup, anyone can simply call this function ☝️
I think I won't need a lookup for GScan, at least for now. Or at least I am avoiding adding one unless really needed. But if I need to add one, then I'll use this function.
I've implemented most of what I had in mind for GScan. But this afternoon just before a meeting I decided to look if the I created a smaller test scenario, with I'm investigating now why that's happening, and so far these are the two best leads: vuejs/vue#7257 & vuejs/vue#10115 (comment) since they match what |
951c0e1
to
ee607a7
Compare
All right, coming back to this one after lunch, and strong ☕ to help me |
17dd08d
to
aa8843e
Compare
Hmm, I think I figured how to store the data in each node in a way that I can update with added/updated/pruned deltas. The leaf nodes in the GScan tree are workflows. They will keep the same structure (latestStates + stateTotals). The intermediary nodes (workflow-name-part nodes, as I called them 🧐 ) will have a computed variable with same name. This way the component's templates won't need to be changed. However, the real data will hold:
Then the computed variables will display the summarized numbers of latestStates and stateTotals for all entries in the maps/dictionaries. This is necessary so that we can:
The approach of keeping a pointer to the leaf-node stateTotals/latestStates is necessary so that when a leaf-node is pruned, we can safely delete it from the map/dictionary, causing the computed variables to be calculated again. An alternative would be to store the ID's only. And then use the lookup to locate the node, and finally retrieve its latestStates and stateTotals. Will think on the pros & cons of each alternative, and try to come up with some code. At the moment, the code in this pull request correctly produces a GScan tree with added nodes, with no stateTotals/latestStates. It's pending:
|
cf0c1b5
to
f3a81df
Compare
Done for the day, next week will start sorting the Previously, we were always re-generating the whole tree 😨 so it looked like the tree element was correctly re-positioned… but it was actually due to the new three being created from scratch. |
c2c4972
to
de31daa
Compare
Think I found how to improve GScan a bit more, preventing it from re-rendering all the nodes in the GScan tree, refs: |
1d19a63
to
d552e90
Compare
230bc61
to
fc4c584
Compare
… common module (so GScan can re-use it too)
…ted, use more props
This PR can probably be closed. I started working on the GScan here to propagate states. Then realized we had some improvements that could be applied to GScan, and started changing that here. Then another PR came that changed the callbacks and deltas in GScan 😬 I moved the improvements to #802 , mimicking with we have in the Tree view. There's one commit in this PR that tries to propagate the states in GScan. I think someone could either drop the other commits and fix conflicts after #802 has been merged, and then finish the current work. Or just close this and use as reference for future implementations. 🖖 |
Thanks for the advice @kinow, good to know 👍 |
Stale. |
These changes close #721 and supersede #733 (not yet, but will in a few more commits 🤞 )
Requirements check-list
CONTRIBUTING.md
and added my name as a Code Contributor.