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
fix(blocks): prevent indent
when already a leaf block, prevent indent
and unindent
when already a top-level child
#228
fix(blocks): prevent indent
when already a leaf block, prevent indent
and unindent
when already a top-level child
#228
Conversation
…nt context (athensresearch#209) If the node being unindented is the top-level node in the current context, prevent unindent by checking if parent node id is equal to id present in :current-route object. Co-authored-by: Adrien Lacquemant <github@alaq.io> Co-authored-by: nthd3gr33 <codinginenglish@gmail.com>
…#209) A leaf block is a block with block order 0. If the block order is 0, do not indent and return a no-op in the indent event handler Co-authored-by: Adrien Lacquemant <github@alaq.io> Co-authored-by: nthd3gr33 <codinginenglish@gmail.com>
…e is no indent or unindent happening (athensresearch#209) Co-authored-by: Adrien Lacquemant <github@alaq.io> Co-authored-by: nthd3gr33 <codinginenglish@gmail.com>
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.
Small adjustments. Great job team!
* Move the block zero check in indent event handler to the on-key-down handler since it doesn't require any re-frame or datascript subscriptions * Rename context-root to context-root-uid and remove unnecessary comment in unindent event handler * Use the stricter parent ID to context-root uid check instead of (and parent grandpa) in unindent event handler Co-authored-by: Adrien Lacquemant <github@alaq.io> Co-authored-by: nthd3gr33 <codinginenglish@gmail.com>
Just did a big refactor of blocks, can you resolve conflicts @itsrainingmani ? |
Yeah no problem |
…decompose monolith block-el (athensresearch#232) * line 524 of blocks. if I use a dispatch, on-drag-end doesn't get called * feat(blocks): drag and drop PoC for local event handlers. refactor block-el
@tangjeff0 Should be able to merge now. |
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.
Great job!!!!!!!!!
Thanks !! |
…ent` and `unindent` when already a top-level child (athensresearch#228) * fix(blocks): prevent unindent when already a top-level child in current context (athensresearch#209) If the node being unindented is the top-level node in the current context, prevent unindent by checking if parent node id is equal to id present in :current-route object. Co-authored-by: Adrien Lacquemant <github@alaq.io> Co-authored-by: nthd3gr33 <codinginenglish@gmail.com> * fix(blocks): prevent indent when already a leaf block (athensresearch#209) A leaf block is a block with block order 0. If the block order is 0, do not indent and return a no-op in the indent event handler Co-authored-by: Adrien Lacquemant <github@alaq.io> Co-authored-by: nthd3gr33 <codinginenglish@gmail.com> * fix: prevent default browser behavior for tab and shift+tab when there is no indent or unindent happening (athensresearch#209) Co-authored-by: Adrien Lacquemant <github@alaq.io> Co-authored-by: nthd3gr33 <codinginenglish@gmail.com> * fix(blocks) - Refactor indent and unindent event handlers * Move the block zero check in indent event handler to the on-key-down handler since it doesn't require any re-frame or datascript subscriptions * Rename context-root to context-root-uid and remove unnecessary comment in unindent event handler * Use the stricter parent ID to context-root uid check instead of (and parent grandpa) in unindent event handler Co-authored-by: Adrien Lacquemant <github@alaq.io> Co-authored-by: nthd3gr33 <codinginenglish@gmail.com> * Add missing devtool devcard deps (athensresearch#229) * feat(blocks): Drag n drop v2. use local listeners instead of global. decompose monolith block-el (athensresearch#232) * line 524 of blocks. if I use a dispatch, on-drag-end doesn't get called * feat(blocks): drag and drop PoC for local event handlers. refactor block-el Co-authored-by: Adrien Lacquemant <github@alaq.io> Co-authored-by: nthd3gr33 <codinginenglish@gmail.com> Co-authored-by: Tom H <git@tomisme.com> Co-authored-by: jeff <tangj1122@gmail.com>
This PR fixes Issue #209 .
There are 3 parts to this fix -
indent
event handler to only perform an indent if the block order for the current block is not 0unindent
event handler to extract theid
of the current page from the:current-route
object ofrfdb
. If theid
of the current page is equal to the parent ID of the node being unindented, prevent the unindent to keep the node within the current context.Potential Performance Optimization
We wanted to point out that there is some potential performance gain to be had by performing the
if
check at the earliest possible moment in the re-frame event handlers and thereby skipping the evaluation of possibly complexlet
bindings.