Skip to content

Layout change #70

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

Closed
wants to merge 27 commits into from
Closed

Layout change #70

wants to merge 27 commits into from

Conversation

pietrop
Copy link
Contributor

@pietrop pietrop commented Jan 4, 2019

Is your Pull Request request related to another issue in this repository ?

Suggested Layout change #50

TL;DR:

  • Increasing the height of the space for text
  • allowing to have video preview both resizable and toggle show/hide option.

Describe what the PR does

  • changed layout
  • moved VideoPlayer preview into TranscriptEditor next to TimedTextEditor
  • added optional transcript title (non editable) with css logic to truncate if text is too long
  • added options in settings to hide preview
  • added option in settings to make video preview larger or smaller within custom range

State whether the PR is ready for review or whether it needs extra work

Still doing some tweaks, and cleaning up, should be ready for review soon.

Outstanding

  • Some of the logic across components might need refactoring and cleaning up - simplifying
  • The controls with all the playerControls btns could do with some spacing, to group by logic eg adding a space after fast forward, and after playback speed, before volume, and before title. (?)
  • Update QA doc with new functionalities (QA PR needs to merged into master before this one)
  • check that analytics events are still triggered (from QA doc list) - there might be one or two that are broken

Additional context

screen shot 2019-01-04 at 12 00 04

@pietrop pietrop added CSS Something to do with styling Design Something to do with Design labels Jan 4, 2019
@pietrop
Copy link
Contributor Author

pietrop commented Feb 2, 2019

Outstanding:

  • rebase with current master
  • Needs adjusting spacing of elements in player controls (perhaps even order, to be more aesthetically pleasing)
  • consider moving How does this work? next to settings and keyboard shortcuts for space efficiency, see this previous PR help-box-spike: moved ToolTip next to settings icon #66
  • Would need QA on final version
  • in Select.modules.css - selectPlayerControl had to put width: 60px!important; to get the number in playback rate selection to show, there might be a better way to fix that css (?)
  • Tooltip says save with icon 💾 and it mentions export - to be addressed perhaps as separate PR

@pietrop pietrop mentioned this pull request Feb 2, 2019
@pietrop
Copy link
Contributor Author

pietrop commented Feb 19, 2019

First pass at making it gracefully adapt for mobile view. #49
screen shot 2019-02-19 at 17 59 37

  • "How does it work" - mobile view
  • "settings" tooltip/modal - mobile view
  • "Keyboard shortcuts" tooltip/modal - mobile view
  • Timed text editor content is responsive: speakers, time-codes and text,

@pietrop
Copy link
Contributor Author

pietrop commented Feb 20, 2019

Added an extra break point for ipad in portrait mode

screen shot 2019-02-20 at 13 33 43

It keeps the two columns for video and timed text editor, but inside the timed text editor rearranges speaker names and time-codes to be slightly more compact (same as in mobile view)

there's room for improvement

@pietrop
Copy link
Contributor Author

pietrop commented Feb 20, 2019

  • needs removing hr tag that used to be under title and player controls, I think it go misplaced somewhere else but can be seen before loading the component (load demo in localhost)

Copy link
Contributor

@jamesdools jamesdools left a comment

Choose a reason for hiding this comment

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

I'm going to reject this for now - the styling is not quite there. Probably will have time to help out after the project cycle!

Might need a bit more UX input, especially while the rest of the project is changing too. I suggest we park this or tidy this up completely before it gets into master.


<div className={ style.btnsGroup }>
<button
title="seek backward by a set interval"
Copy link
Contributor

Choose a reason for hiding this comment

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

Good to have these titles I think - but some uniformity would be good (text-wise)

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, fair, we had some feedback from UX about research they have been done on naming, I think this should be noted down for our next batch of user testing follow up questions, to ask how they would refer to the various functionalities, for naming.

title="Picture-in-picture"
className={ style.playerButton }
onClick={ this.props.pictureInPicture }
>
Copy link
Contributor

Choose a reason for hiding this comment

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

The formatting for closing elements > on the last line of a property / new line seems to change a lot

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, preference? should it just be up on the previous line?

@@ -1,8 +1,12 @@
@value color-darkest-grey, color-light-grey, color-labs-red from '../colours.module.css';

.playerControls {
margin: 1em;
display: flex;
/* margin: 1em; */
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets get rid of as much CSS half-fixes and comments as possible - it gets confusing if you're not the one who wrote it!

@@ -2,7 +2,23 @@ import React from 'react';
import PropTypes from 'prop-types';

class VideoPlayer extends React.Component {
constructor(props) {
Copy link
Contributor

Choose a reason for hiding this comment

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

useless constructor

}

handlePlayMedia = () => {
console.log('handle media', this.props.videoRef.current, this.props.videoRef);
Copy link
Contributor

Choose a reason for hiding this comment

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

tidy up logs

.speaker {
display: inline-block;
width: 50%;
padding-right: 2em;
Copy link
Contributor

Choose a reason for hiding this comment

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

This offsets everything onto a new line:
screen shot 2019-02-21 at 14 27 45

Copy link
Contributor

Choose a reason for hiding this comment

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

This was quite tricky to get right the first time (even though it wasn't perfect), and so i'm reluctant to merge in these changes. In addition to the iphone / ipad view, the middle-sizes on desktop should be checked too.

There's a lot of space around the video player, where it could either take up the aside width or give more room to the editor

screen shot 2019-02-21 at 14 29 30

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, I think these needs to be addressed when we look at the media query breakpoints for the responsive design. So that as you said we can tweak for each size the various un-utilised spaces etc..

text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
/* Mobile devices */
Copy link
Contributor

Choose a reason for hiding this comment

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

The WrapperBlock part looks good for the mobile widths 👌
I would maybe give the html/body a min-width of 320px so it doesn't squash down anymore.

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 follow?

/* Mobile devices */
@media (max-width: 768px) {

.markers {
Copy link
Contributor

Choose a reason for hiding this comment

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

In mobile view, the speaker labels and timecodes are just a bit too close to the text. adding a margin-bottom would help

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok changed to be

.markers {
...
    margin-bottom: 0.5em;

and

.WrapperBlock {
...
    margin-bottom: 1em;

screen shot 2019-02-28 at 19 45 01

see what you think, we can tweak this

@@ -1,8 +1,12 @@
@value color-darkest-grey, color-light-grey, color-labs-red from '../colours.module.css';

.playerControls {
Copy link
Contributor

Choose a reason for hiding this comment

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

This section needs rethinking. The player controls and the grouped buttons within could probably be centred and responsive to narrow screens with flexbox and + wrap? Not sure how fiddly that'll be.

I find here the Timebox is too far away from the player + progress bar. Also the huge grid of buttons is overwhelming. An alternative for mobile could be player controls + timebox stuck to the bottom of the screen?

Probably needs more UX input rather than winging it. We're undoing a lot of stuff from the first round of UX in this PR so let's not get carried away 😛

screen shot 2019-02-21 at 14 36 16

Also, any idea why the MediaPlayer size doesn't update properly a lot of the time?

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, we can rethink it, I reckon we can just do a first pass in this PR and then optimise later. Not good to try and do everything at once.

<section className={ style.settingElement }>
<div className={ style.label }>Display Preview</div>
<Toggle
defaultValue={ this.props.previewIsDisplayed }
Copy link
Contributor

Choose a reason for hiding this comment

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

PropTypes missing for a lot of things on this branch. About 30+ things to tidy up on npm run lint too

Copy link
Contributor Author

@pietrop pietrop Mar 1, 2019

Choose a reason for hiding this comment

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

ok fixed them all.

/src/lib/TranscriptEditor/index.js
  284:18  warning  Arrow function should not return assignment  no-return-assign
  285:23  warning  Arrow function should not return assignment  no-return-assign
  286:23  warning  Arrow function should not return assignment  no-return-assign

these refer to this:

<MediaPlayer
...
      hookSeek={ foo => this.setCurrentTime = foo }
      hookPlayMedia={ foo => this.playMedia = foo }
      hookIsPlaying={ foo => this.isPlaying = foo }

I have to admit I don't fully understand how this works, and what could be an alternative way to do it (from a syntax point of view) I think this patter was originally introduced by @Laurian (?)

Pietro Passarelli - News Labs added 3 commits February 22, 2019 13:32
@ivanji
Copy link

ivanji commented Mar 13, 2019

Could I contribute my changes? Please see attached. I'm using CSS grid instead and responsiveness it's pretty much taken care of. I still want to take care of some alignment issues, but happy to take on this issue instead and let @pietrop attend to more critical ones.

editor-desktop-size

editor-mobile-size

@pietrop
Copy link
Contributor Author

pietrop commented Mar 13, 2019

Hi @ivanji , That's awesome, thanks!
Feel free to do a PR, it be great to see an alternative approach and a simpler way to tackle this.

One of the things to keep in mind is making sure the component can still work when used into a parent component that might have a different CSS setup (still using css modules tho - for now) if that makes sense? But we can always test that later.

@pietrop
Copy link
Contributor Author

pietrop commented Mar 15, 2019

closing in favour of #111

@pietrop pietrop closed this Mar 15, 2019
@pietrop pietrop deleted the layout-change branch March 15, 2019 14:41
@pietrop pietrop restored the layout-change branch March 18, 2019 15:39
@pietrop pietrop deleted the layout-change branch March 18, 2019 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS Something to do with styling Design Something to do with Design
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants