-
Notifications
You must be signed in to change notification settings - Fork 284
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
Keymapper documentation (and tests troubleshoot) #212
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.
This is great!! Everything is really well-explained. @jywarren so I think we are starting with merging this one? Also noting status of my toolbar positioning PR does not matter here
The only changes I made are to use the Leaflet class factories syntax where available (I have been making a project out of updating the whole repo of these through FTOs so I am invested in it.
Also any ideas how we can avoid this testingIntent
variable? Would you say that tests are not meant to create this kind of interdependency?. If I understand it correctly, it's allowing you to call _toggleRotateDistort
without failing if the image editing class has not initialized yet? And doesn't have to do with your new code? If this is the case, you can initialize the editing in the beforeEach
and then the below line shouldn't return undefined (see DistortableCollection
test file for an ex.)
@sashadev-sky Can you detail a bit on what exactly do I define, since the undefined object here isn't used anywhere in the spec but the src file, and still gives undefined if I try to explicitly declare it in the |
Ohh ok I am going to clone your fork and try it out, I don't want to lead you down a path that doesn't work out |
Co-Authored-By: rexagod <rexagod@gmail.com>
Co-Authored-By: rexagod <rexagod@gmail.com>
Co-Authored-By: rexagod <rexagod@gmail.com>
Co-Authored-By: rexagod <rexagod@gmail.com>
5220095
to
6ba2ed1
Compare
@rexagod I pulled your fork and you had a big problem ... you were were tracking the I don't really understand how you saw, then, that my Anyway this rebase took me a full hour so I did not push the spec update I said I would. Will get back to that tomorrow. But now, if you look at |
@sashadev-sky So sorry for all this confusion, and also for taking up your time like this! I'm aware of the fact that much of PL's libs were shifted from I'll get to fixing this, as this is my top priority now, and I'll see that everything's in place and working as you recommended above. Many apologies! |
@sashadev-sky I just checked out my |
@rexagod If I rebased on But I am pretty sure it was on This is what my terminal output looks like: You can see here that the only difference between public lab's Sorry if I changed anything that caused confusion!! I will fix it just not understanding the problem |
@rexagod I looked again and 2 things:
|
Nonetheless, I'm trying to fix this. |
6d35c18
to
50ec5d6
Compare
@rexagod I had to do a big rebase again to remove the I recommend before you start working to do a git pull of this branch |
@rexagod UI is perfect for both some quick things:
|
@rexagod Ok good job! I standardized even further on top of your updates: do you like this UI change as well: (I'll revert those easily if you dont dw). Note I will probably make one hotkey to toggle send up / down instead of having two in my PR on normalizing hotkeys: #229. But for now doesn't matter |
@rexagod ok so functionality is great! The next step is the placement of the code doesn't make sense in the |
@rexagod get on gitter! |
Ok so from our discussion: this is basically ready we just need to add an option for the user to pass The next step will be to open a new PR and make it so that the keymapper is not hardcoded, but dynamic based on each tool added to the toolbar |
@rexagod Ok I added the documentation let me know what you think. Obviously you can always revert my commit but I also saved it for you here just in case so you can see it easily already in md format: https://github.com/sashadev-sky/PL-notes/blob/master/save-notes.md |
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.
@rexagod Ok this is great!! Some things that could be improved, whether here or in a new PR:
-
Is it better if we make the
keymapper
andkeymapper_position
options all under one option by just making the possible valueskeymapper
:topright
(default)bottomleft
,bottomright
,bottomleft
,hide
(instead of false, for consistency, but would mean suppress it)? I actually don't know the answer to this myself. -
ALTERNATIVE: Should we expose the
keymapper
initialization code in the example files to allow the user to passposition
if they would like there? andkeymapper: false
would still be the ultimate overriding factor and this would be passed to the image? -
Either way, we do need to break this connection of
keymapper
anddistortableImageOverlay
eventually because it doesn't make complete sense. Eventually when thefeatureGroup
is for single and multiple images, we can make these options passed there instead of to individual images? And we move the keymapper initialization code in the featureGroup class, or don't have it in either by just using an "add hook", like after something else is done initializing, create the keymapper.- This will also fix problems like: For
select.html
, if the user wants to turn off the keymapper for multiple image select interface, they would have to manually passkeymapper: false
to each image.
- This will also fix problems like: For
@jywarren what are your thoughts? But issues like point 3 are why I would recommend introducing a breaking version that requires the featureGroup
sooner than later.
Note this is merge-able - it works well! But we do need to address how important these points on the implementation are right now as opposed to opening a PR to fix it later.
Okay so the docs look good for now. Also, regarding the above review points, @sashadev-sky, would it be okay if I pushed those in another PR, since I think we can work with what's in this PR for now while continuing on the next one, and maybe we can take this discussion over there? |
I think this is the most important point -- for this reason it makes sense for the keymapper code to be outside the distortableImage code -- a kind of "add-on" interface you initialize in It's a really great UI to have. But it's more a feature of a map, than of an image. Perhaps we should merge this now, then in a follow-up, let's break it out so that we don't have to set it on a per-image basis, but rather for the whole map. Could it live in a submodules like this:
So, like, |
@rexagod @jywarren yes perfect. Ok I just want to add to documentation about positioning. then I will do another lookover and merge. @rexagod maybe let's not have it in the tools folder, that will be for toolbar tools? In the meantime should we move it out to just the edit folder? @jywarren I think it is time to make breaking change with featureGroup after this. There will be so many things to rewrite at this point and it is going to save a lot of time for everyone. Making a feature work both in |
In response to @sashadev-sky's suggestion here.