Skip to content
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

Feature: swipe ui #110

Closed
wants to merge 4 commits into from
Closed

Feature: swipe ui #110

wants to merge 4 commits into from

Conversation

jossmac
Copy link
Owner

@jossmac jossmac commented Dec 15, 2016

Description of changes:
Attempt to integrate feature/swipe-support into new fullscreen layout

Related issues (if any):

  1. Consider adding touch support (Consider adding touch support #15)
  2. Swipe with transition (Swipe with transition #99)

Checks:

  • Please confirm npm run lint ran successfully
  • Please confirm that only /src and /examples/src are committed
  • [if new feature] Please confirm that documentation was added to the README.md

jossmac and others added 3 commits December 15, 2016 13:27
Initialise with `fullscreen-ui`:
* first pass at fullscreen UI
* implement HTML5 fullscreen support
* cleanup examples app.js - abstract moving parts
@jossmac
Copy link
Owner Author

jossmac commented Dec 15, 2016

Hi @jkettmann,

We've both made pretty dramatic changes to the codebase. This branch feature/swipe-ui is my attempt to merge swipe-support and fullscreen-ui unsuccessfully.

Is there any chance you could help?

@jkettmann
Copy link

jkettmann commented Dec 15, 2016

Hi @jossmac, of course. I'll have some time the next days. I'll keep you posted. Any particular area you need help with?

@jossmac
Copy link
Owner Author

jossmac commented Dec 15, 2016

@jkettmann that's terrific, thank you!

I'm struggling a bit with the new <SwipeContainer /> component - I haven't implemented anything using react-motion, so it's unfamiliar territory. There's also some decisions that I don't understand, like providing the source 'data:' when an image is not visible?

Basically if you could just take a look I suspect you'll notice something obvious that I've missed whilst integrating your changes.

@jkettmann
Copy link

jkettmann commented Dec 17, 2016

I made my changes now and pushed to my forked feature/swipe-ui branch. I'm not sure how the workflow is continuing now. Should I just create a pull request from my forked branch to feature/swipe-ui?

Anyways:
LightBox now only uses SwipeContainer, so we also have horizontal animation on non-mobile devices. The name SwipeContainer seems a bit confusing in this way.

I'm not totally sure why setting source to something for non-visible images was important, but data: seems to be wrong. As far as I remember I did that because of performance issues: SwipeContainer is a wrapper around all images, so it's windowWidth * imageCount wide. If all image sources would be set, this would cause memory problems when there are many and/or large images. So we need to unset sources of non-visible images. One way of doing that is like in this answer.

On mobile devices there is a small issue now, because the user cannot close the LightBox if he is not active anymore.

@jossmac
Copy link
Owner Author

jossmac commented Dec 19, 2016

Thank you @jkettmann, I appreciate you diving back into this

  1. Yes, please create a new pull request from your branch to feature/swipe-ui
  2. In my manual merge attempt I had intentionally forked the behaviour of touch vs desktop devices. I feel that having the image replaced in situ (with the loading indicator when applicable) feels more responsive on desktop. Are you cool with that?
  3. The solution on StackOverflow seems fine, though perhaps I'm missing the problem. Can't we request the image (or two) ahead of the direction the user is headed rather than load them all at once? If so, there's already a method on Lightbox in the fullscreen branch.
  4. I'll look into the userIsActive issue when this is merged; should be fine with the forked behaviour mentioned above

@jkettmann jkettmann mentioned this pull request Dec 20, 2016
@jkettmann
Copy link

Hi @jossmac

  1. done
  2. that's fine by me. I just like to have an animation on desktop too. Otherwise it looks kind of static to me. I removed Desktop behaviour in the second commit I guess
  3. Yes, actually I remember seeing that. I'm not sure, if there is any reason to use my implementation as well. I'll look into that.

* Fixed SwipeContainer by setting initial transformX
* Only use SwipeContainer in Lightbox for animation
* Added propTypes for Swipe- and ImageContainer
* Extracted image component
* Adjusted hidden images src to be single pixel gif
@stefano-DM
Copy link

when will this be added to master? thanks

@neptunian
Copy link
Collaborator

if @jkettmann could fix the conflicts i can look at merging it, otherwise i'll look at it when i can.

@jkettmann
Copy link

@neptunian I'll probably have some time at the weekend

@jkettmann
Copy link

Hi, just a small update: I didn't find enough time on the weekend. I'll let you know soon

@neptunian
Copy link
Collaborator

neptunian commented Jul 25, 2017

@jkettmann is this merge for two different features? full screen and swipe or does full screen already exist? i don't see anything about that in the docs.

@jkettmann
Copy link

@neptunian It's been quite some time, but as far as I remember it was something @jossmac was working on and we merged the two behaviors into this branch. But I'm not really sure

@neptunian
Copy link
Collaborator

@jkettmann do you recall the reason for that? otherwise it seems like it'd be easier to separate these features out for simplicity's sake.

@jkettmann
Copy link

@neptunian No I don't remember a reason. You're right, it would be easier to separate them.

@jkettmann
Copy link

@neptunian I resolved the conflicts. Should I create a pull request to feature/swipe-ui or somewhere else?

@neptunian
Copy link
Collaborator

@jkettmann i think we should probably keep it on this branch instead of starting over and separating things. perhaps @jossmac will be able to pick up where he left off again. Did you ever look into #3 that you mentioned above with loading of the images one or two ahead instead of loading them all?

@jkettmann jkettmann mentioned this pull request Aug 9, 2017
@jkettmann
Copy link

jkettmann commented Aug 9, 2017

@neptunian Sorry it took me so long. I created a new pull request, because this branch is already quite messed up. You would have to resolve the conflicts yourself. If you would like me to change something just tell me.

@ooloth
Copy link

ooloth commented Oct 26, 2017

Would love to use this component as soon as touch support is added!

@michalica
Copy link

I would like to use swipe function in current version ... is it gonna be possible?

@neptunian
Copy link
Collaborator

addressed in #199

@neptunian neptunian closed this Jul 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants