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

Send to device follow-ups #393

Merged
merged 12 commits into from
May 21, 2018
Merged

Send to device follow-ups #393

merged 12 commits into from
May 21, 2018

Conversation

gfodor
Copy link
Contributor

@gfodor gfodor commented May 16, 2018

This PR:

  • Fixes layout for the code entry screen on iOS.
  • Properly disables (via a hack) pinch-to-zoom and double-tap-to-zoom on iOS devices for the link page and the hub page. (Apple no longer supports the viewport method in iOS 10+ apparently :P)
  • Adds a "Have a link code?" link to the homepage. (Note: the reason it's a "link code" and not an "entry code" or a "room code" is because it is unique per "device linking", and shouldn't be considered a code for the room itself or for the ability to enter the room, since that would result in a bad mental model and might imply that users should share the code, even though they are one-time-use and meant for the same user.)
  • Changes code input type from number to tel because it can have leading zeros.
  • Adds better error handling for code entry failures.
  • Fixes up entry flow for Oculus Browser, so that the user is only prompted to "Enter in VR" or "Send to Device"

@gfodor gfodor requested a review from brianpeiris May 16, 2018 21:25
@gfodor gfodor requested a review from cvan May 16, 2018 21:45
Copy link
Contributor

@cvan cvan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good! nice adjustments 👍

@@ -57,16 +57,20 @@ body {
min-height: 90px;
height: 90px;
display: flex;
border-bottom: 2px solid #242424;
border-bottom: 1px solid #242424;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this is rgb(36, 36, 36), which is slightly darker than $darker-grey is. do you want to make a $darkest-grey, heh?

display: flex;
width: 350px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you want to make this a variable?

color: $grey-text;
font-size: 1.0em;
font-weight: lighter;
white-space: nowrap;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit; want to do text-overflow: ellipsis;? (I've been meaning to file an issue for this anyway; ellided text that looks truncated tends to look better/natural with IMO)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think this will ever overflow because once the width is reduced we just stop showing it altogether

display: none;
}

padding: 0.5em;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: intentional usage of em instead of rem or px?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah px seems better

}

padding: 0.5em;
background-color: rgba(0, 0, 0, 0.85);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you use $darkest-transparent?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, refactored and flipped everything to 0.9 alpha

@@ -132,6 +139,13 @@ class HomeRoot extends Component {
</div>
</div>
</div>
<div className="header-subtitle">
<div>
<a className="header-subtitle__link" href="/link">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rel="nofollow"?

@@ -106,7 +111,8 @@ class LinkRoot extends Component {
<div className={styles.enteredDigits}>
<input
className={styles.digitInput}
type="number"
type="tel"
pattern="[0-9]*"
Copy link
Contributor

@cvan cvan May 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feels awkward to use type="tel", but then, given the bug in Firefox, and seeing how input[type="tel"]'s mobile entry flow is more PIN-code-like, this is probably sufficient.

do you know how this works with internationalisation (i.e., non-Arabic numerals)?

is Firefox the only browser affected in your experience? Chrome, Safari seemed fine in my testing.

can you add a comment somewhere linking to this relevant Firefox bug?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah interesting, i didn't realize this was considered a bug. it seemed logical that a "0001" entry for a number seems wrong. i'll add a comment. not sure about internationalisation. even previously it was just a rendering issue, if they just punch the value in the keypad as you'd expect i think it will work no matter what.

let lastTouchAtMs = 0;

document.addEventListener("touchmove", ev => {
if (ev.scale === 1) return;
Copy link
Contributor

@cvan cvan May 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scale seems to be a WebKit-specific property, not a standardised property of TouchEvent. is this correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this is an iOS specific hack since iOS 11 disabled recognizing user-scalable=no

ev.preventDefault();
});

document.addEventListener("touchend", ev => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you want to handle the touchforcechange event?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure, I don't have a device to test :/ I'll do a fast-follow if this doesn't resolve the issue we were seeing (mis-zooming on the keypad page)


document.addEventListener("touchend", ev => {
const now = new Date().getTime();
const isDoubleTouch = now - lastTouchAtMs <= 300;
Copy link
Contributor

@cvan cvan May 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure, but not certain, you could use iOS' gesturestart/gesturechange/gestureend events.

from Safari's Handling Events docs:

To disable pinch open and pinch close gestures in iOS 2.0, implement the gesturestart and gesturechange event handlers as follows:

function gestureChange(event) {
  // Disable browser zoom
  event.preventDefault();
}

(there's also dblclick but that may fire too late.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah the double tapping is the main issue for the link page, and the zooming is the main issue for the hub page. this implementation "cleanly" fixes both (I don't like it either) :/

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.

2 participants