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

Replace the switch button by a radio button with three states off/solo/on #123

Open
wants to merge 5 commits into
base: preview-management-url
Choose a base branch
from

Conversation

etienneCharignon
Copy link
Collaborator

@etienneCharignon etienneCharignon commented Oct 5, 2018

This PR is dependent on the preview-management-url PR.

It replace the following switch button:
capture d ecran 2018-10-05 a 14 51 08

by a three states button preview Off/my code in solo/preview on with all codes:
capture d ecran 2018-10-05 a 14 50 52

This is demonstrating how we could take profit of the preview management URL to control what can be displayed in the programmer preview.

I like this new widget with three icons representing the three states. This is a full and only CSS+Html solution, based on a input of type radio.

I like the symmetry of off/on icons with the headphone in the middle.

I'm not sure about the heavy usage of flex layout.

…t submission.

Keep the list of selected code object ids so that, for example, new code
objects would not appear when the preview is off.
@jonathanperret jonathanperret temporarily deployed to paysage-test-pr-123 October 5, 2018 13:02 Inactive
@etienneCharignon etienneCharignon changed the title Replace the switch button by a radio button with tree states off/solo/on Replace the switch button by a radio button with three states off/solo/on Oct 5, 2018
@jonathanperret jonathanperret temporarily deployed to paysage-test-pr-123 October 5, 2018 15:16 Inactive
Triggering the action on click makes it possible to re-click on the solo icon.
This is usefull when you open a new code and want to see the new code in solo
in place of the previous one.
@jonathanperret jonathanperret temporarily deployed to paysage-test-pr-123 October 5, 2018 21:08 Inactive
@juliendorra
Copy link
Collaborator

This is a necessary evolution, and a feature that will greatly benefit beginners and other users during big collective sessions (15+ people coding)

Here are my issues at the moment:

UX-wise, the icons are not standards: X is for closing a window, headphone are… :-) ?? and a checkmark is for selection or checking a list item.

We need icons that say Hide / Show / Solo.

Hide and Show are easy and quite standard, widely accepted:
hide: https://thenounproject.com/search/?q=hide
show: https://thenounproject.com/search/?q=show

Solo is harder, we have various choices:
https://thenounproject.com/search/?q=front
https://thenounproject.com/search/?q=me&i=1408780
https://thenounproject.com/search/?q=unique&i=967840
https://thenounproject.com/search/?q=unique&i=385004
https://thenounproject.com/search/?q=stand%20out

An option would also be to create the 3rd icon by combining the show icon with one of the icons to reinforce the meaning: "Show + Me", "Show + Unique"… Not sure if it is worth the effort, though.

(I have an account on Noun Project and will happily pay for the no-credit license if you find great icons there. I love to credit people but on Paysage it may be impractical to credit)

UI-wise, the icons are too close, the on/off state is not distinct enough. Usability would be better by using a style more like Google Maps iOS
image

@etienneCharignon
Copy link
Collaborator Author

Thank you very much for your comment. I agree that the icons I chose are note very expressive. The headphone was following the analogie with the Audio mixers, when you are only listening on yourself… ok, not very easy to catch.

Actually, I've been doing this development as an experiment, to feel the three states button for real and the result is that I'm not really convinced. Also, I'm sad to loose the former switch button that I liked.

I did not manage to make tree states switch button in html and CSS (I did not try very hard), but I did one in paysage.xyz for the simulation purpose. Give it a try if you like. You will see that it is not very easy to use :

var r = 30;
var x = 100;
var y = 100;
  
var de = 0;
var a = 1;
var alpha = -PI/2;
var bgcolor = 0;

function drawSwitch(x, y, positionInitiale, positionCible) {
  strokeWeight(6);
  stroke(bgcolor, bgcolor, bgcolor);
  fill(bgcolor, bgcolor, bgcolor);
  rect(x, y, 6*r, 2*r, 2*r);

  strokeWeight(1);
  fill(255, 255, 255);
  var distance = positionCible - positionInitiale;
  if(alpha < PI/2) {
    alpha += 0.05;
  }
  bgcolor = 100 * positionInitiale + 100 * distance * (sin(alpha)+1)/2;
  var position = positionInitiale + distance * (sin(alpha)+1)/2;
  ellipse(x+r+(position) * 2*r, y+r, 2*r, 2*r)
}

void mousePressed() {
  alpha = -PI/2;
  de = a;
  if(mouseX < x + r) {
    a = 0;
  }
  if(mouseX >= x + r && mouseX < x + 3*r) {
    a = 1;
  }
  if(mouseX >= x + 3 * r) {
    a = 2;
  }
}

void draw() {
  background(0);
  drawSwitch(x, y, de, a);
}

Therefor, I'm thinking of stepping back to the original switch button (switching the preview on and off) and adding beside it a toggle [solo] button.

Well, all this is still maturing for now. And, I might also give a try with the icons you pointed.

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.

3 participants