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

Improved mobile layout for smaller devices #76

Merged
merged 2 commits into from Dec 23, 2016

Conversation

yurm04
Copy link
Contributor

@yurm04 yurm04 commented Dec 21, 2016

This pull request addresses Issue #31 and includes:

  • Additional media queries for better support of smaller mobile devices.
  • Rearranged message name, time, text order in individual messages.

Small Device
mobile-small

Medium Device
mobile-med

- Rearranged message name, time, text order in individual messages.
@codecov-io
Copy link

codecov-io commented Dec 21, 2016

Current coverage is 100% (diff: 100%)

Merging #76 into master will not change coverage

@@           master   #76   diff @@
===================================
  Files           3     3          
  Lines          52    52          
  Methods         0     0          
  Messages        0     0          
  Branches        0     0          
===================================
  Hits           52    52          
  Misses          0     0          
  Partials        0     0          

Powered by Codecov. Last update da1ba39...9d0f2e7

html += '<small class=\'time\'>' + getTime(msg.t) + ' </small>';
html += '<span class=\'name\'>' + msg.n + ': </span>';
html += '<span class=\'msg\'>' + msg.m + '</span>';
html += '<p class=\'msg\'>' + msg.m + '</p>';
Copy link
Member

Choose a reason for hiding this comment

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

I actually like having the date/time first on the line (before) the name because it's a fixed width whereas the name won't be ... so the UI ends up looking more aligned ... @yurm04 what were your thoughts on this?
is this the UI other chat apps are implementing?
(genuine question ... I'm in a "Gitter" bubble so I don't know ...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nelsonic swapping the order of the time and name was mostly to mirror other chat apps i've used (Slack, HipChat). I was also toying with the idea of right aligning the timestamp on tablet and desktop (would have required a float if I left the name and timestamp as they were), but decided against it until I got some feedback 😅

I can change the order back before the PR gets merged if that's the preferred layout.

width: 100%;
display: flex;
Copy link
Member

Choose a reason for hiding this comment

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

display: flex; is "Flexbox", right...?
https://css-tricks.com/snippets/css/a-guide-to-flexbox/
(I'm a complete noob at CSS ... so zero XP on this...)
It appears to be available in "All Modern Browsers" ... http://caniuse.com/#feat=flexbox
Given that this app uses WebSockets which is also not "progressive enhancement" http://caniuse.com/#search=websockets
I don't have an issue with using Flexbox for this demo app.
@iteles thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, I changed the message input form to flexbox because it was the quickest and easiest way to fix the mobile layout. However, flexbox doesn't play nice with older IE browsers (below IE 11), so if a more universal solution is necessary I'd be happy to make that change.

While on the subject, are there any thoughts on which browsers should be supported by this project?

Copy link
Member

Choose a reason for hiding this comment

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

My thoughts here is that what we're aiming to teach/help with in this project is the combination of hapi/socket.io/redis that brought you to it in the first place @yurm04!

Whilst we want to make all of our code and examples as accessible as possible, I think that it's not the main aim of this repo, so it shouldn't be a blocker for merging these excellent changes in. There are lots of improvements to the CSS that could be done if we were being picky (e.g. over-usage of ID selectors and descendent selectors)!

Suggested next steps (happy for this to be in a different PR):

  • Add a line to the readme explaining that we're using flexbox for simplicity given the focus of this repo is on the hapi/socket.io/redis combination, but raising a warning this will not play well with anything under IE11 (sadly still under heavy use)
  • Add an issue to the backlog for the more universal solution you've suggested @yurm04 so that it's captured as something to be dealt with when you or anyone else has a little time 😊

#messages li:nth-child(odd) { background: #eee; }


/* == Individual messages == */
.time { color: #2c3e50; }
.time { color: #9c9c9c; }
Copy link
Member

Choose a reason for hiding this comment

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

This color is good (more subtle): http://www.colorhexa.com/9c9c9c
color-9c9c9c

the old one was a bit "heavy": http://www.colorhexa.com/2c3e50
color-2c3e50

Copy link
Member

@nelsonic nelsonic left a comment

Choose a reason for hiding this comment

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

@yurm04 thank you so much for digging out this issue and fixing it!! 😮 😍
I'm happy with this code. (LGTM) 👍
The only thing I would change would be to leave the time at the start of the line. But I'm happy to merge just so we can #fix the <button>! 👍

@iteles over-to-you. ❤️ ✅

P.S. @yurm04 how did you discover @dwyl ...? (thanks!)

@iteles
Copy link
Member

iteles commented Dec 22, 2016

Will review at lunch 👍 Thanks for the PR @yurm04 , would also be great to know how you found dwyl! 😊

@yurm04
Copy link
Contributor Author

yurm04 commented Dec 22, 2016

@iteles @nelsonic thank you both 😄 I found the project while searching for a Hapi.js/socket.io implementation as research for a similar project I'm working on. I'm new to Hapi, so this was perfect to get me started in the right direction. The inclusion of Redis was a plus since I was kicking around different ideas for storage, but now I'm sold on this particular setup.

Would love to keep contributing to the project so if there are any other issues/requests I can help with, please shoot them my way!

width: 100%;
display: flex;
Copy link
Member

Choose a reason for hiding this comment

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

My thoughts here is that what we're aiming to teach/help with in this project is the combination of hapi/socket.io/redis that brought you to it in the first place @yurm04!

Whilst we want to make all of our code and examples as accessible as possible, I think that it's not the main aim of this repo, so it shouldn't be a blocker for merging these excellent changes in. There are lots of improvements to the CSS that could be done if we were being picky (e.g. over-usage of ID selectors and descendent selectors)!

Suggested next steps (happy for this to be in a different PR):

  • Add a line to the readme explaining that we're using flexbox for simplicity given the focus of this repo is on the hapi/socket.io/redis combination, but raising a warning this will not play well with anything under IE11 (sadly still under heavy use)
  • Add an issue to the backlog for the more universal solution you've suggested @yurm04 so that it's captured as something to be dealt with when you or anyone else has a little time 😊

margin-right: 0.8em;
}

.name,
Copy link
Member

Choose a reason for hiding this comment

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

Hooray for the fact that you're using classes and not ID selectors! 🎉 ❤️
https://github.com/dwyl/style-guide#general-points


/*==============================
MEDIA QUERIES
================================*/
Copy link
Member

Choose a reason for hiding this comment

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

Great to have a separate section for these in this simple case 👍

@iteles
Copy link
Member

iteles commented Dec 23, 2016

@yurm04 This is fantastic, thank you! ❤️
Super impressed with the organisation and quality of your code, clear commit and PR messages.

I've only suggested one action in the comments above which is not a blocker for merging this in 🎉

Welcome to dwyl!

@iteles iteles merged commit ec7377d into dwyl:master Dec 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants