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

Collab: Add presence avatars #44

Merged
merged 10 commits into from
Sep 7, 2021
Merged

Collab: Add presence avatars #44

merged 10 commits into from
Sep 7, 2021

Conversation

mirka
Copy link
Member

@mirka mirka commented Sep 1, 2021

Based on #43

Changes proposed

Adds presence avatars to the editor toolbar to show peers who are present.

It displays up to three images, and the rest is overflow. (We can revisit this number once we gather some usage stats.)

Presence avatars in toolbar

Testing instructions

  1. yarn install && yarn storybook
  2. Open this URL in a bunch of tabs in the same browser: http://localhost:6006/?path=/story/collaboration--default

@mirka mirka self-assigned this Sep 1, 2021
@mirka mirka requested review from a team and johngodley September 2, 2021 10:01
@annemirasol
Copy link

Code and styles look good!

Not sure if there's anything to fix here, but from the Storybook page, I noticed a few things:

  • On narrower screens, the avatars overflow from the toolbar.

Screen Shot 2021-09-02 at 8 45 57 PM

Other than that, 👍 🚢

Copy link

@lezama lezama left a comment

Choose a reason for hiding this comment

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

Great work Lena

@mirka
Copy link
Member Author

mirka commented Sep 3, 2021

Thanks for testing!

  • On narrower screens, the avatars overflow from the toolbar.

Good one, I've been wondering about this too. @johngodley Do you think we should backport some of the responsive styles we have in p2-editor for the stacked toolbar?

Yeah, this Storybook maneuver (and also how Storybook handles hot reloading) doesn't properly unmount the React component, so we accumulate "ghosts" like this. Fortunately it's just a Storybook dev thing.

@johngodley
Copy link
Member

Do you think we should backport some of the responsive styles we have in p2-editor for the stacked toolbar

It's part of a bigger, more complicated, issue that I've been carefully trying to avoid!

The core editor now only uses a two row toolbar, there is no single row option:

image

This is fine for the core editor, but can look very bulky in an isolated editor (comments, for example). The rows are also in very different places in the DOM and don't merge well with CSS modification.

There's an open issue here (#19) to improve the toolbar in general, and the two row issue is now a blocker to remove this (#25) deprecated warning.

In the short term I think whatever is the easiest way to get things 'acceptable' is ok. For example, maybe the avatars can squish together a bit more on a smaller screen. I also note that in Anne's screenshot the block mover arrows are incorrectly displayed, using up additional width.

In the longer term we need a better plan for handling toolbars, maybe just accepting the two row situation and adjusting around it, or maybe forcing an inline popup toolbar for smaller widths and situations that need less UI.

Base automatically changed from refactor/collab to trunk September 7, 2021 12:27
@mirka
Copy link
Member Author

mirka commented Sep 7, 2021

In the short term I think whatever is the easiest way to get things 'acceptable' is ok.

That makes sense. Thanks for the explanation!

@mirka mirka merged commit 6311f85 into trunk Sep 7, 2021
@mirka mirka deleted the collab/avatars branch September 7, 2021 16:00
@pablohoneyhoney
Copy link

A different signal for smaller ports (like a dot or icon) that opens a panel on hover to show the avatars could work.

This can also be true to see all the avatars, hovering the +, instead of the tooltip?

@pablohoneyhoney
Copy link

@evilluendas maybe you all discussed colors, but would they align with the P2 brand colors, the specific-P2 configuration, or the Workspace's?

@mirka
Copy link
Member Author

mirka commented Sep 10, 2021

In terms of priority, a narrow-viewport-specific design is not particularly necessary right now because in a properly styled use case (like in P2), the toolbars will be stacked and have enough space.

I was wondering about colors, too. We did not discuss, but I picked out several legible colors that were somewhat distinct and matched the muted palette of the wp-admin colors.

export const defaultColors = [ '#4676C0', '#6F6EBE', '#9063B6', '#C3498D', '#9E6D14', '#3B4856', '#4A807A' ];

For downstream P2 usage, we can override these as we want, perhaps less muted.

@evilluendas
Copy link

We don't have an extended color palette defined yet, but this could be a good opportunity to generate it. I'll open an issue with specific colors so we can try them 👍

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.

6 participants