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

Improve inline previews for links and images #524

Merged
merged 3 commits into from
Apr 6, 2017
Merged

Conversation

maxpoulin64
Copy link
Member

This is a CSS mod I have had for a little while that improves the readability and space efficiency of the link and image previews, so I thought it would be time to finally share it.

capture d ecran_2016-07-22_23-03-24
capture d ecran_2016-07-22_23-01-43

For me, this makes it viable to have them all expand by default and you don't get extra huge images in your face all the time. You can see on the first screenshot I have hidden the toggle button entirely, as I don't feel like I need it anymore.

@maxpoulin64 maxpoulin64 added Type: Feature Tickets that describe a desired feature or PRs that add them to the project. second review needed labels Jul 23, 2016
@astorije astorije self-assigned this Jul 23, 2016
@maxpoulin64
Copy link
Member Author

@astorije: you asked how they looked before, there:

capture d ecran_2016-07-24_02-25-47

}

#chat .toggle-content.show {
display: inline-block !important;
display: block !important;
Copy link
Member

Choose a reason for hiding this comment

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

While we're at it, did you look if it was possible/a good idea to get rid of the !important here?

Copy link
Member

@astorije astorije Aug 31, 2016

Choose a reason for hiding this comment

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

So I tested this and it works just with without the !important.
However, this rule is redundant with this Bootstrap one anyway so I think we should remove it.

@xPaw
Copy link
Member

xPaw commented Aug 20, 2016

👍

@astorije
Copy link
Member

astorije commented Aug 31, 2016

Alright, finally found some time to review this!

It looks really nice, but I found out a few issues we'll want to fix before merging:

  • On non-image links (tested with GitHub URLs), picture goes out of the box.
    screen shot 2016-08-31 at 00 29 41
  • On desktop, for non-image links, box width is fixed and does not shrink when window size gets smaller.
    screen shot 2016-08-31 at 00 30 37
  • On mobile, for image links, box takes all width (I believe this issue is already present on master, but since you are improving the whole thing...).
    screen shot 2016-08-31 at 00 37 23

@maxpoulin64
Copy link
Member Author

@astorije: just fixed the images. As for the links overflowing, this is unfortunately not possible because of the table layout (which is why I didn't notice it at first, it works beautifully with my non-broken chat layout. Table cells aren't supposed to contain block elements in them)

@astorije
Copy link
Member

just fixed the images

Huh, really? I still have this after pulling your branch and rebasing with master (and also when pulling your branch as is with ./scripts/run_pr.sh 524):
screen shot 2016-09-12 at 01 02 44

As for the links overflowing, this is unfortunately not possible because of the table layout (which is why I didn't notice it at first, it works beautifully with my non-broken chat layout. Table cells aren't supposed to contain block elements in them)

The second issue is pretty bad as content is missing, and does not exist in master. Maybe we should get #523 reviewed and merged first then? Too bad, this current PR seemed like a no-brainer at first 😞 (#523 is a bit harder to jump in).

@astorije astorije added the Meta: Do Not Merge This PR should not be merged. label Sep 18, 2016
@xPaw xPaw removed the Meta: Do Not Merge This PR should not be merged. label Oct 1, 2016
@astorije
Copy link
Member

Marking this as do not merge until issue(s) above is fixed and #523 is merged.

@astorije astorije added the Meta: Do Not Merge This PR should not be merged. label Oct 11, 2016
@astorije
Copy link
Member

astorije commented Dec 5, 2016

@maxpoulin64, do you think we should close this in favor of #701?

@AlMcKinlay
Copy link
Member

@astorije I think that would be a sensible decision if we think #701 is likely to get merged (I think it is), then this should probably be closed.

@astorije
Copy link
Member

Okay, closing this for now since @MaxLeiter wants to work on #701 that supersedes it. If for some reason #701 cannot make it (but I hope it will!) then we can re-open this.

@astorije astorije closed this Dec 19, 2016
@astorije astorije deleted the PR/inline-preview branch February 14, 2017 04:44
@astorije
Copy link
Member

astorije commented Apr 3, 2017

I suggest reopening this since #701 isn't gonna happen anytime soon. I can try to revive it tomorrow

@astorije astorije restored the PR/inline-preview branch April 4, 2017 05:39
@astorije astorije reopened this Apr 4, 2017
@astorije astorije force-pushed the PR/inline-preview branch from e4ddc1b to 6a273d8 Compare April 4, 2017 05:41
@astorije
Copy link
Member

astorije commented Apr 4, 2017

So, I have revived this and while the first issue I mentioned in my earlier comment was fixed, the other 2 were not:

screen shot 2017-04-04 at 01 52 37

It's not obvious but the first preview does not show ellipsis and goes behind the user list. You can tell with the lack of margin on the right.

@maxpoulin64, I know you have been out of the game for a bit now, but since your flexbox layout got merged, I'm hoping you could help us with this pleeeease? It would be super sweet to merge this! :)
I have just checked and these 2 issues are absent from master.

astorije added 2 commits April 4, 2017 02:09
Bootstrap was taking over these declarations because they use `!important`.
Also fix the preview description not respecting the ellipsis, and update the image size and margin to nicely align with text.
@astorije astorije force-pushed the PR/inline-preview branch from 649c34e to dce42df Compare April 4, 2017 06:31
@astorije
Copy link
Member

astorije commented Apr 4, 2017

Alriiiight thanks to some efforts and help from @maxpoulin64, all issues are fixed, including 2 I discovered along the way, yay! 🎉

Who wants to test this? :)

screen shot 2017-04-04 at 02 32 34

@astorije astorije removed the Meta: Do Not Merge This PR should not be merged. label Apr 4, 2017
@astorije astorije added this to the 2.3.0 milestone Apr 4, 2017
@astorije astorije removed their assignment Apr 4, 2017
@@ -1,5 +1,5 @@
{{#toggle}}
<div class="toggle-content">
<div class="toggle-content toggle-type-{{type}}">
Copy link
Member

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 is necessary anymore @maxpoulin64, what do you think?

Copy link
Member

Choose a reason for hiding this comment

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

Can be useful for themes.

Copy link
Member

Choose a reason for hiding this comment

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

Sure

@@ -1,5 +1,5 @@
{{#toggle}}
<div class="toggle-content">
<div class="toggle-content toggle-type-{{type}}">
Copy link
Member

Choose a reason for hiding this comment

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

Can be useful for themes.

}

#chat .toggle-content .thumb {
max-height: 110px;
max-width: 210px;
float: left;
Copy link
Member

Choose a reason for hiding this comment

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

Tried flex instead of float?

Copy link
Member

Choose a reason for hiding this comment

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

I have not. Floats are very much designed for this kind of usage, and it works just fine like this sooo I'm tempted to call it good enough and go on with my life :) (also it was like this initially, I did not try to be creative)
All I missing a clear issue that flexbox addresses here?

@astorije astorije merged commit b8c4946 into master Apr 6, 2017
@astorije astorije deleted the PR/inline-preview branch April 6, 2017 07:01
@bews
Copy link
Contributor

bews commented Apr 20, 2017

Site preview images are too small now, I don't even see the content now. This is how it looks:

lounge_sm2 vs. before:
shout_big

Now prefetch is pointless for me, because I still need to click on every link.

@astorije
Copy link
Member

Site preview images are too small now, I don't even see the content now.

There are 2 types of previews: images & documents.
What you are showing here are documents, and we are displaying one image as part of the link preview (I forgot how that image gets picked over another on a page).
That means you can share a link to a GitHub repo and the picture would be the user's avatar. You certainly don't want that avatar to take that much real estate on the chat.
Images on the other hand are very focused, so when you share a link to a picture, it's with more confidence that we can display a bigger one.

Now prefetch is pointless for me, because I still need to click on every link.

I am sure you mean well, but don't forget that this is an open source project: no one is working for money (it's 2:30am here as I type, and I spend time most nights on this), nor for you specifically. Also, don't forget that the coldness of the screen vs. live discussion can make it look like you feel entitled to a service and requests, and I have noticed people are less inclined to help in these situations.

What you expose here is a personal opinion and as such unlikely to reflect in code changes. That PR was approved and desired by multiple people, and deemed the best approach UX-wise for a largest audience.
That being said, it doesn't mean there are no solutions:

  • If an opinion materializes in something actually better for the user regardless of preferences (or personal abilities, i.e. accessibility concerns), then a PR is almost always welcome. Make sure to expose your thought process in an issue first if you want to make sure the team is on board with it. For example, Better embedding using embed.js #701 is severely looking for help and I'm sure @MaxLeiter would be happy to guide you.
  • People have opinions, especially in the IRC world, and that's why we introduced the custom CSS stylesheet in the settings. With a bit of tweaking, it is possible to make this preview bigger again.

Makes sense? 😃

@bews
Copy link
Contributor

bews commented Apr 22, 2017

That means you can share a link to a GitHub repo and the picture would be the user's avatar. You certainly don't want that avatar to take that much real estate on the chat.

Definitely, but there are also other sites on the internet aside for GitHub.
This preview picture is extremly useful when target site specialize in graphic content - I deside to open link or not judging what it look like. For example, today only preview motivated me to read a few articles and news.

deemed the best approach UX-wise for a largest audience

By ruining a nice functionality? It's really simple: before this change I could use this preview to save time, now I can't.

(it's 2:30am here as I type, and I spend time most nights on this), nor for you specifically

Alright, it's 5:20 am here (don't break this combo now 😄), and it's the second night I spent improving this project. I'm not doing this just for you too 😸.
I do all improvements primarily for myself, because I really need an irc client like this. But at the same time I want to provide a better experience for everyone else. This is exactly why I'm writing this now, while my local copy is already fixed.

If an opinion materializes in something actually better for the user regardless of preferences

And how do we decide is it better or not? By making a poll?

Anyway I plan to redesign this previews (a bit more in irccloud style) and I almost sure it will work well with #701 in future (no, I have no intention to help with it, sorry).
I'll upload it to my fork in case there will be people who don't like this change too (ATM most of them believe it's just a bug, since it's not in the release yet).

@MaxLeiter
Copy link
Member

MaxLeiter commented Apr 22, 2017

@bews if you have a fix (or when you do), feel free to open a PR for discussion from other maintainers and users. @astorije meant this PR was merged with a fair amount of support, but that doesn't mean it's perfect. IIRC from IRC you have a large screen - maybe no one's tested on that yet and that's where all this confusion is coming from.

And I disagree that most people believe it's a bug - otherwise there would be an open issue for it.

@astorije astorije mentioned this pull request May 3, 2017
3 tasks
matburnham pushed a commit to matburnham/lounge that referenced this pull request Sep 6, 2017
Improve inline previews for links and images
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Tickets that describe a desired feature or PRs that add them to the project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants