-
Notifications
You must be signed in to change notification settings - Fork 47
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
Tab swiping #1656
Tab swiping #1656
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.
Looks great. Thanks so much for this.
I assume you'll test on iPhone? If so, I can try to test it out on my Android phone.
Unfortunately I'm on parental leave of sorts at the moment so it might take me a bit longer than usual to be able to test it.
Thanks again.
Yup, that sounds good. I'll drop a comment here when I've had a chance to test on iPhone.
That doesn't sound unfortunate to me 🙂. Enjoy your time with your kid(s), no rush at all on my end. |
Great, thank you.
Thanks! Yeah, you're right. Not unfortunate at all! Thanks for your understanding! |
Hey @birtles, I've gotten around to testing this, but while I can get it to run on the iOS simulator, when I try to run on my actual iPhone (really just wanted to test that the swipe behavior feels right on a touch screen) I get provisioning/signing errors: I'm a bit ignorant of how signing works in the Apple/iOS ecosystem, but I'm guessing the Has the iOS app/extension ever been set up to install from source on any Apple ID except yours? Or, is there a way I can just skip the signing step altogether to run the development version? Again, sorry for my ignorance of Xcode here. |
Thanks @StarScape! I got in to the office for a brief moment last week where I was able to test the PR on my Android phone but unfortunately the swiping didn't work for me then. I haven't had a chance to debug it yet, however. I'm really unfamiliar with XCode but I believe @shirakaba has set it up to work on his phone before? Jamie, do you know how any of this works? |
Heya!
Should be solvable – the Xcode project is not tied to any particular device, but it does default to signing for Brian's team (which is unavoidable – Xcode projects are very clunky for opensource projects), so you'll just need to override the team name to your personal team.
As mentioned, it's correct to change the team to your personal team while working on it. 👍 Do leave the resulting change to the Xcodeproj uncommitted, though. As for the error, could you try the top suggestion here? Happy to help until you're unblocked, so just give me another poke if that doesn't resolve it. |
@shirakaba Thanks for the guidance! That was an easier fix than I thought (though maybe 'uninstall and reinstall it' should have been more obvious 😅). I was able to get it working and tested on my phone.
Yeah, it seemed a bit clunky, that's why I wanted to check here. Wasn't sure if it was an Xcode limitation or if I had misconfigured something on my end. Thanks again. @birtles As for the swiping not working on your Android phone, I think the issue might have been that I had the x-distance that needed to be traveled in order for the swipe to register was rather high. When I tested on my iPhone, I could get it to happen, but only if I did a very long and deliberate swipe. I've knocked the threshold down significantly now. Give it another shot when you get the chance. If it still doesn't work then let me know, we'll need to do some more serious debugging. I don't have a physical Android device handy at the moment, but I should be able to fix any bugs with an emulator. |
@shirakaba Thank you so much!
@StarScape Great, that could well be it. I'll try again on Thursday. |
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 tried this on my Android phone and it works great. Thank you!
Alright @birtles, it should (hopefully) be good to go now. Let me know if you'd prefer me squash these down into one commit. |
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.
Looks great. I left a few nit comments. If you don't mind, I'll just make those tweaks myself then squash merge it.
src/content/popup/popup.ts
Outdated
|
||
const contentContainer = html('div', { class: 'content' }); | ||
console.log('Hello1'); |
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.
Can we drop this? 😅
console.log('Hello1'); |
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.
Lol yeah, sorry that slipped through from some debugging. Thanks for getting this merged, appreciate the patience with the back and forth!
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.
Not at all! Thank you so much for your patience with all my nitpicking!
I'll probably try to get in a few more fixes and then we can release the next version with this included.
src/content/popup/popup.ts
Outdated
const contentContainer = html('div', { class: 'content' }); | ||
console.log('Hello1'); | ||
onHorizontalSwipe(contentContainer, (direction) => { | ||
console.log('Hello?'); |
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.
And this?
console.log('Hello?'); |
src/content/popup/popup.ts
Outdated
if (options.onSwitchDictionary) { | ||
options.onSwitchDictionary(direction === 'left' ? 'prev' : 'next'); | ||
} |
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 think we can just write:
if (options.onSwitchDictionary) { | |
options.onSwitchDictionary(direction === 'left' ? 'prev' : 'next'); | |
} | |
options.onSwitchDictionary?.(direction === 'left' ? 'prev' : 'next'); |
- Change x-threshold for swipe motion from 150 to 50px - Move swipe detection code to its own file - Allow 'prev' parameter for showDictionary function - Add @stylistic/eslint-plugin-js to handle max-len linting for comments
@all-contributors please add @StarScape for code |
I've put up a pull request to add @StarScape! 🎉 |
I haven't actually tested this on a phone yet (just used FF's touch emulation), so I want to make sure and do that before this actually gets merged, but this should be good enough to take a look at.
Couple comments/questions below.
Also, there was a test failing on my machine when I ran
yarn test:firefox
, but looks like that predates my commits.