-
Notifications
You must be signed in to change notification settings - Fork 432
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
Visually truncate long bodies and quotes #2451
Conversation
afda6cc
to
79b6a89
Compare
Needs angular wonk code review. 😉 I'm 👍 on this as it solves the > 2 year old #487 issue. @conordelahunty could you take a look at this also? Cheers! |
content: " "; | ||
margin-left: -3em; | ||
padding-right: 40px; | ||
background: -webkit-gradient(linear, left top, right top, from(rgba(255, 255, 255, 0)), to(white), color-stop(50%, white)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good shout!
79b6a89
to
16bc4b7
Compare
929ce15
to
10152be
Compare
10152be
to
cb032fb
Compare
Ok, after much ado, I'm hoping this is good enough to be merged soon. 🙏 |
@@ -92,6 +92,7 @@ module.exports = angular.module('h', [ | |||
|
|||
.directive('annotation', require('./directive/annotation')) | |||
.directive('deepCount', require('./directive/deep-count')) | |||
.directive('excerpt', require('./directive/excerpt')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Big 👍 to trying to keep this functionality as a separate directive.
The styling/markup parts of this look absolutely fine to me. I'm a bit concerned about the business logic to do with |
Here's an example of what I mean. It's a bit rough around the edges but it shows how you might be able to keep the disable/enable state as a parameter to the Hope that helps! |
👍 @nickstenning, and I would only tweak it to prefer positive rather than negative conditionals as I think they're easier to parse: e.g. |
👍 |
@JakeHartnell If you want to walk through the plunker I linked above at some point just let me know. I'm happy to help in any way I can to get this finished. |
|
@nickstenning this is great, and I understand why you like this approach. I'm having one problem that I had early on when I tried a similar approach that also used transclusion. The markdown converter also transcludes the annotation-body section and throws the following error:
Any thoughts on that? I'll keep working on it, but I think if we can get past that we have a nice modular solution here. Thanks for the awesome comments and the plunker. |
Unfortunately, the way around that is just another wrapping element so that On Mon, Sep 21, 2015, 14:44 Jake Hartnell [email protected] wrote:
|
Cool, thanks. |
cb032fb
to
7fda4f4
Compare
|
||
scope: | ||
enabled: '=excerptIf' | ||
maxheight: '=maxheight' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't need to go here, as far as I can tell. You can add some rules like .annotation-body .excerpt { max-height: 16.2em }
to the CSS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Funny enough, that's what I was going to do, but worried it wouldn't be modular enough.
Ok, looking a lot better. But checking it out there seem to be a few bugs -- excerpt controls seem to be displayed all the time for quotes, regardless of how long they are. I've added a couple of comments inline, and I also would like to see the template moved into |
c19dc19
to
7cf68af
Compare
7cf68af
to
f4414f7
Compare
Okay, I've just force-pushed this branch. I've simplified the @robertknight perhaps you could take a look at the general approach, and if you're happy I'll sort out the tests. |
Oh, and the whole thing is now behind a feature flag. |
f4414f7
to
d15accf
Compare
Cool, I don't know if Jake got around to make the design changes or not yet but maybe Robert can pick this up if not. |
@@ -0,0 +1,31 @@ | |||
@import "compass/css3/images"; | |||
@import "variables"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC this will pull in a second copy of 'variables.scss' rather than require them once. I want to use a system in future where requiring in CSS works the same way as JS modules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing that's not actually a problem because variables.scss
is just variable definitions, but you're absolutely right -- it's not necessary. I'll remove it.
@nickstenning This looks good to me. |
Thanks for the review @robertknight. I'll fix up these things, write some tests, and then I reckon we can probably merge this and fix up the design in a separate PR, now that it's feature-flagged. |
d15accf
to
bf9fbe3
Compare
Introduces auto-truncation of long bodies and quotes which expand when you click on a "More" link. Feature flagged as 'truncate_annotations'.
bf9fbe3
to
4c8f9bf
Compare
@robertknight Right, that's everything except the resize behaviour fixed. I reckon we can fix that another day. Let me know what you think. |
@@ -5,6 +5,7 @@ | |||
@import 'mixins/responsive'; | |||
@import 'grid'; | |||
@import 'annotations'; | |||
@import 'excerpt'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should go under 'components' in app.scss
, assuming it isn't used by the help page.
Visually truncate long bodies and quotes
Thanks @robertknight and @nickstenning! |
This is also not enabled in production, it seems. |
@conordelahunty is still working w/ the team to get his tweaks to the style implemented. |
@conordelahunty sorry I didn't get around to those, but it was good to see it on stage being used. Definitely thing we need to make the annotation bodies a bit bigger, as images are cut off. |
It's also true that for a textual annotation, More may only reveal a few On Thu, Oct 29, 2015 at 6:03 PM, Jake Hartnell [email protected]
|
It looks like this: