You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bloodhound.apache.org by Tom Kitchin <tk...@gmail.com> on 2012/12/19 13:05:15 UTC

Ticket #279 - Images rendered in activity feed

Hi,

I've been reading the dev mailing list for a while, and I thought it might
be a time to try and get involved.  I took a look at ticket #279 (
https://issues.apache.org/bloodhound/ticket/279), in which images in ticket
descriptions turn up in the activity feed as well.

The first solution (not rendering them) is simple enough as far as I can
see - I've attached a very simple patch which just sets them display:none
in CSS.

I've been looking into the second solution (resizing the images to fit
instead of hiding them) as well.  As far as I can tell (prompted by Gary)
the trick would be to do something with the Image() macro in the specific
context of the Activity feed to apply the 'span4' class to the img tag.  I
haven't quite worked out how to do that yet, but thought I'd send a message
here before I persisted.

Which approach is preferred?  As far as I can see, the question comes down
to whether the activity feed could end up misinforming people due to
missing images, and whether it would look jarring if a referenced image
wasn't there.  On the other hand, even resized images might still be very
long, taking up a lot of space in the feed.

Incidentally, nice to meet you all.  I hope I can be of some help with the
project.

Tom

Re: Ticket #279 - Images rendered in activity feed

Posted by Olemis Lang <ol...@gmail.com>.
On 12/19/12, Joachim Dreimann <jo...@wandisco.com> wrote:
>
[...]
>
> I don't believe resizing images is worth the hassle: On pictures for people
> or objects they may still be recognisable in a meaningful way, but I don't
> see that being the case the screenshots or other image types likely to be
> attached to a software product -related ticket.
>
> I like Gary's suggestion of a placeholder better:

fwiw  maybe this is what happens if rendering long texts using
oneliner wiki formatter . Just for activity widget , I mean .

[...]

-- 
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:

Re: Ticket #279 - Images rendered in activity feed

Posted by Olemis Lang <ol...@gmail.com>.
On 12/20/12, Olemis Lang <ol...@gmail.com> wrote:
> On 12/20/12, Gary Martin <ga...@wandisco.com> wrote:
>>
> [...]
>>
>> Olemis: if you think that another solution is to use the oneliner wiki
>> formatter, could you test that assumption?
>
> I'll do , just give me a few minutes please ... ;)
>


My quick research

{{{
#!py

>>> wikitext = r"""Wiki text with ...
...
... [[Image(https://issues.apache.org/bloodhound/raw-attachment/wiki/Proposals/BEP-0003/Product_envs_small.png)]]
...
... ... and more ..."""
>>> from bhdashboard.util import dummy_request
>>> from trac.env import open_environment
>>> env = open_environment('/path/to/trac/env')
>>> env._abs_href = lambda : 'http://example.org/bh/'
>>> req = dummy_request(env)
>>> from trac.web.chrome import web_context
>>> ctx = web_context(req)
>>> from trac.wiki import format_to_oneliner, format_to_html
>>> print format_to_html(env, ctx, wikitext)
<p>
Wiki text with ...
</p>
<p>
<a style="padding:0; border:none"
href="https://issues.apache.org/bloodhound/raw-attachment/wiki/Proposals/BEP-0003/Product_envs_small.png"><img
src="https://issues.apache.org/bloodhound/raw-attachment/wiki/Proposals/BEP-0003/Product_envs_small.png"
alt="https://issues.apache.org/bloodhound/raw-attachment/wiki/Proposals/BEP-0003/Product_envs_small.png"
title="https://issues.apache.org/bloodhound/raw-attachment/wiki/Proposals/BEP-0003/Product_envs_small.png"
/></a>
</p>
<p>
... and more ...
</p>

>>> print format_to_oneliner(env, ctx, wikitext)
Wiki text with ...

<a style="padding:0; border:none"
href="https://issues.apache.org/bloodhound/raw-attachment/wiki/Proposals/BEP-0003/Product_envs_small.png"><img
src="https://issues.apache.org/bloodhound/raw-attachment/wiki/Proposals/BEP-0003/Product_envs_small.png"
alt="https://issues.apache.org/bloodhound/raw-attachment/wiki/Proposals/BEP-0003/Product_envs_small.png"
title="https://issues.apache.org/bloodhound/raw-attachment/wiki/Proposals/BEP-0003/Product_envs_small.png"
/></a>

... and more …
>>> print format_to_oneliner(env, ctx, wikitext, shorten=True)
Wiki text with ...
 …
>>>

}}}

>> If it is not quite right, it
>> sounds like we could create another wiki formatter.
>
> yes it's possible ,

of course , if the previous example is not enough then we can develop
oour own wiki formatter .

> and afaicr wiki style may be specified in the
> rendering context too ...
>

These are the context hints I was talking about ;)

context.get_hint('shorten_lines', False)
context.get_hint('wiki_flavor', 'oneliner')

>> I expect that the
>> oneliner formatter would be in use when abbreviated_messages is
>> specified in the timeline section of the configuration.
>>
>
> I'll try to check that too .
>

timeline.abbreviated_messages works in Trac timeline view like the
last example I pasted above . Not the same in the widget .

IMO we should add a new parameter to the widget and include support
for abbreviated_messages ;)

All this seems to be a matter of setting context hints ;)

-- 
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:

Re: Ticket #279 - Images rendered in activity feed

Posted by Olemis Lang <ol...@gmail.com>.
On 12/20/12, Gary Martin <ga...@wandisco.com> wrote:
>
[...]
>
> Olemis: if you think that another solution is to use the oneliner wiki
> formatter, could you test that assumption?

I'll do , just give me a few minutes please ... ;)

> If it is not quite right, it
> sounds like we could create another wiki formatter.

yes it's possible , and afaicr wiki style may be specified in the
rendering context too ...

> I expect that the
> oneliner formatter would be in use when abbreviated_messages is
> specified in the timeline section of the configuration.
>

I'll try to check that too .

-- 
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:

Re: Ticket #279 - Images rendered in activity feed

Posted by Gary Martin <ga...@wandisco.com>.
OK, configuration is for a different ticket/email thread anyway. 
Lightboxes likewise, although I expect I will have some alternative 
suggestions around that.

Olemis: if you think that another solution is to use the oneliner wiki 
formatter, could you test that assumption? If it is not quite right, it 
sounds like we could create another wiki formatter. I expect that the 
oneliner formatter would be in use when abbreviated_messages is 
specified in the timeline section of the configuration.

Cheers,
     Gary

On 19/12/12 16:21, Joachim Dreimann wrote:
> Welcome Tom!
>
> I don't believe resizing images is worth the hassle: On pictures for people
> or objects they may still be recognisable in a meaningful way, but I don't
> see that being the case the screenshots or other image types likely to be
> attached to a software product -related ticket.
>
> I like Gary's suggestion of a placeholder better: It still gives a clear
> indication that there is an image attached (similar placeholders may be
> used to indicate patches/diffs/documents). It would also provide a clear
> click target from which users could expect a lightbox-style overlay view of
> the actual image. Just displaying a link wouldn't make that as clear. I'd
> also expect placeholders to be faster performance wise (being cacheable for
> example).
>
> As for users being able to modify/change those image settings: I suggest we
> wait until that's requested by users and reassess it then, but don't build
> it in from the beginning. Too many configuration options (even if each
> seems sensible individually) make for a very complicated product.
>
> Cheers,
> Joe
>
>
> On 19 December 2012 13:41, Tom Kitchin <tk...@gmail.com> wrote:
>
>> Whoops, seems email attachments don't get into mailing lists.  I've pasted
>> the simple image hiding fix patch below.  I'll look further into resizing
>> the image when I have time, though.
>>
>> Index: bloodhound_theme/bhtheme/htdocs/bloodhound.css
>> ===================================================================
>> --- bloodhound_theme/bhtheme/htdocs/bloodhound.css      (revision 1423531)
>> +++ bloodhound_theme/bhtheme/htdocs/bloodhound.css      (working copy)
>> @@ -144,6 +144,10 @@
>>
>>   }
>>
>> +#activityfeed img {
>> +  display: none;
>> +}
>> +
>>   #activityfeed dt {
>>     font-weight: normal;
>>   }
>>
>>
>> On 19 December 2012 13:15, Gary Martin <ga...@wandisco.com> wrote:
>>
>>> Great to hear from you Tom!
>>>
>>> I think for a quick solution I could live with not displaying in the
>> short
>>> term. Alternatively, swapping the image for a placeholder image might
>> work.
>>> I could see the visibility of images as being something configurable
>>> though. For tall images, perhaps we could just scale them back to some
>>> maximum height.
>>>
>>> Cheers,
>>> Gary
>>>
>>>
>>> On 19/12/12 12:58, Peter Koželj wrote:
>>>
>>>> I am in favor of keeping images. Normally they should not be to heigh
>> when
>>>> resized to fit activity feed width.
>>>> In the long run I would like if users have an option on activity widget
>> or
>>>> in widget activity setting to show/hide images.
>>>>
>>>> And...
>>>> ... welcome to Bloodhound!
>>>>
>>>> Peter
>>>>
>>>> On 19 December 2012 13:05, Tom Kitchin <tk...@gmail.com> wrote:
>>>>
>>>>   Hi,
>>>>> I've been reading the dev mailing list for a while, and I thought it
>>>>> might
>>>>> be a time to try and get involved.  I took a look at ticket #279 (
>>>>> https://issues.apache.org/**bloodhound/ticket/279<
>> https://issues.apache.org/bloodhound/ticket/279>),
>>>>> in which images in
>>>>> ticket descriptions turn up in the activity feed as well.
>>>>>
>>>>> The first solution (not rendering them) is simple enough as far as I
>> can
>>>>> see - I've attached a very simple patch which just sets them
>> display:none
>>>>> in CSS.
>>>>>
>>>>> I've been looking into the second solution (resizing the images to fit
>>>>> instead of hiding them) as well.  As far as I can tell (prompted by
>> Gary)
>>>>> the trick would be to do something with the Image() macro in the
>> specific
>>>>> context of the Activity feed to apply the 'span4' class to the img tag.
>>>>>   I
>>>>> haven't quite worked out how to do that yet, but thought I'd send a
>>>>> message
>>>>> here before I persisted.
>>>>>
>>>>> Which approach is preferred?  As far as I can see, the question comes
>>>>> down
>>>>> to whether the activity feed could end up misinforming people due to
>>>>> missing images, and whether it would look jarring if a referenced image
>>>>> wasn't there.  On the other hand, even resized images might still be
>> very
>>>>> long, taking up a lot of space in the feed.
>>>>>
>>>>> Incidentally, nice to meet you all.  I hope I can be of some help with
>>>>> the
>>>>> project.
>>>>>
>>>>> Tom
>>>>>
>>>>>
>
>


Re: Ticket #279 - Images rendered in activity feed

Posted by Joachim Dreimann <jo...@wandisco.com>.
Welcome Tom!

I don't believe resizing images is worth the hassle: On pictures for people
or objects they may still be recognisable in a meaningful way, but I don't
see that being the case the screenshots or other image types likely to be
attached to a software product -related ticket.

I like Gary's suggestion of a placeholder better: It still gives a clear
indication that there is an image attached (similar placeholders may be
used to indicate patches/diffs/documents). It would also provide a clear
click target from which users could expect a lightbox-style overlay view of
the actual image. Just displaying a link wouldn't make that as clear. I'd
also expect placeholders to be faster performance wise (being cacheable for
example).

As for users being able to modify/change those image settings: I suggest we
wait until that's requested by users and reassess it then, but don't build
it in from the beginning. Too many configuration options (even if each
seems sensible individually) make for a very complicated product.

Cheers,
Joe


On 19 December 2012 13:41, Tom Kitchin <tk...@gmail.com> wrote:

> Whoops, seems email attachments don't get into mailing lists.  I've pasted
> the simple image hiding fix patch below.  I'll look further into resizing
> the image when I have time, though.
>
> Index: bloodhound_theme/bhtheme/htdocs/bloodhound.css
> ===================================================================
> --- bloodhound_theme/bhtheme/htdocs/bloodhound.css      (revision 1423531)
> +++ bloodhound_theme/bhtheme/htdocs/bloodhound.css      (working copy)
> @@ -144,6 +144,10 @@
>
>  }
>
> +#activityfeed img {
> +  display: none;
> +}
> +
>  #activityfeed dt {
>    font-weight: normal;
>  }
>
>
> On 19 December 2012 13:15, Gary Martin <ga...@wandisco.com> wrote:
>
> > Great to hear from you Tom!
> >
> > I think for a quick solution I could live with not displaying in the
> short
> > term. Alternatively, swapping the image for a placeholder image might
> work.
> >
> > I could see the visibility of images as being something configurable
> > though. For tall images, perhaps we could just scale them back to some
> > maximum height.
> >
> > Cheers,
> > Gary
> >
> >
> > On 19/12/12 12:58, Peter Koželj wrote:
> >
> >> I am in favor of keeping images. Normally they should not be to heigh
> when
> >> resized to fit activity feed width.
> >> In the long run I would like if users have an option on activity widget
> or
> >> in widget activity setting to show/hide images.
> >>
> >> And...
> >> ... welcome to Bloodhound!
> >>
> >> Peter
> >>
> >> On 19 December 2012 13:05, Tom Kitchin <tk...@gmail.com> wrote:
> >>
> >>  Hi,
> >>>
> >>> I've been reading the dev mailing list for a while, and I thought it
> >>> might
> >>> be a time to try and get involved.  I took a look at ticket #279 (
> >>> https://issues.apache.org/**bloodhound/ticket/279<
> https://issues.apache.org/bloodhound/ticket/279>),
> >>> in which images in
> >>> ticket descriptions turn up in the activity feed as well.
> >>>
> >>> The first solution (not rendering them) is simple enough as far as I
> can
> >>> see - I've attached a very simple patch which just sets them
> display:none
> >>> in CSS.
> >>>
> >>> I've been looking into the second solution (resizing the images to fit
> >>> instead of hiding them) as well.  As far as I can tell (prompted by
> Gary)
> >>> the trick would be to do something with the Image() macro in the
> specific
> >>> context of the Activity feed to apply the 'span4' class to the img tag.
> >>>  I
> >>> haven't quite worked out how to do that yet, but thought I'd send a
> >>> message
> >>> here before I persisted.
> >>>
> >>> Which approach is preferred?  As far as I can see, the question comes
> >>> down
> >>> to whether the activity feed could end up misinforming people due to
> >>> missing images, and whether it would look jarring if a referenced image
> >>> wasn't there.  On the other hand, even resized images might still be
> very
> >>> long, taking up a lot of space in the feed.
> >>>
> >>> Incidentally, nice to meet you all.  I hope I can be of some help with
> >>> the
> >>> project.
> >>>
> >>> Tom
> >>>
> >>>
> >
>



-- 
Joe Dreimann
UX Designer | WANdisco <http://www.wandisco.com/>
*
*
*Transform your software development department. Register for a free SVN
HealthCheck <http://go.wandisco.com/HealthCheck-Sig.html> *

Re: Ticket #279 - Images rendered in activity feed

Posted by Tom Kitchin <tk...@gmail.com>.
Whoops, seems email attachments don't get into mailing lists.  I've pasted
the simple image hiding fix patch below.  I'll look further into resizing
the image when I have time, though.

Index: bloodhound_theme/bhtheme/htdocs/bloodhound.css
===================================================================
--- bloodhound_theme/bhtheme/htdocs/bloodhound.css      (revision 1423531)
+++ bloodhound_theme/bhtheme/htdocs/bloodhound.css      (working copy)
@@ -144,6 +144,10 @@

 }

+#activityfeed img {
+  display: none;
+}
+
 #activityfeed dt {
   font-weight: normal;
 }


On 19 December 2012 13:15, Gary Martin <ga...@wandisco.com> wrote:

> Great to hear from you Tom!
>
> I think for a quick solution I could live with not displaying in the short
> term. Alternatively, swapping the image for a placeholder image might work.
>
> I could see the visibility of images as being something configurable
> though. For tall images, perhaps we could just scale them back to some
> maximum height.
>
> Cheers,
> Gary
>
>
> On 19/12/12 12:58, Peter Koželj wrote:
>
>> I am in favor of keeping images. Normally they should not be to heigh when
>> resized to fit activity feed width.
>> In the long run I would like if users have an option on activity widget or
>> in widget activity setting to show/hide images.
>>
>> And...
>> ... welcome to Bloodhound!
>>
>> Peter
>>
>> On 19 December 2012 13:05, Tom Kitchin <tk...@gmail.com> wrote:
>>
>>  Hi,
>>>
>>> I've been reading the dev mailing list for a while, and I thought it
>>> might
>>> be a time to try and get involved.  I took a look at ticket #279 (
>>> https://issues.apache.org/**bloodhound/ticket/279<https://issues.apache.org/bloodhound/ticket/279>),
>>> in which images in
>>> ticket descriptions turn up in the activity feed as well.
>>>
>>> The first solution (not rendering them) is simple enough as far as I can
>>> see - I've attached a very simple patch which just sets them display:none
>>> in CSS.
>>>
>>> I've been looking into the second solution (resizing the images to fit
>>> instead of hiding them) as well.  As far as I can tell (prompted by Gary)
>>> the trick would be to do something with the Image() macro in the specific
>>> context of the Activity feed to apply the 'span4' class to the img tag.
>>>  I
>>> haven't quite worked out how to do that yet, but thought I'd send a
>>> message
>>> here before I persisted.
>>>
>>> Which approach is preferred?  As far as I can see, the question comes
>>> down
>>> to whether the activity feed could end up misinforming people due to
>>> missing images, and whether it would look jarring if a referenced image
>>> wasn't there.  On the other hand, even resized images might still be very
>>> long, taking up a lot of space in the feed.
>>>
>>> Incidentally, nice to meet you all.  I hope I can be of some help with
>>> the
>>> project.
>>>
>>> Tom
>>>
>>>
>

Re: Ticket #279 - Images rendered in activity feed

Posted by Gary Martin <ga...@wandisco.com>.
Great to hear from you Tom!

I think for a quick solution I could live with not displaying in the 
short term. Alternatively, swapping the image for a placeholder image 
might work.

I could see the visibility of images as being something configurable 
though. For tall images, perhaps we could just scale them back to some 
maximum height.

Cheers,
Gary

On 19/12/12 12:58, Peter Koželj wrote:
> I am in favor of keeping images. Normally they should not be to heigh when
> resized to fit activity feed width.
> In the long run I would like if users have an option on activity widget or
> in widget activity setting to show/hide images.
>
> And...
> ... welcome to Bloodhound!
>
> Peter
>
> On 19 December 2012 13:05, Tom Kitchin <tk...@gmail.com> wrote:
>
>> Hi,
>>
>> I've been reading the dev mailing list for a while, and I thought it might
>> be a time to try and get involved.  I took a look at ticket #279 (
>> https://issues.apache.org/bloodhound/ticket/279), in which images in
>> ticket descriptions turn up in the activity feed as well.
>>
>> The first solution (not rendering them) is simple enough as far as I can
>> see - I've attached a very simple patch which just sets them display:none
>> in CSS.
>>
>> I've been looking into the second solution (resizing the images to fit
>> instead of hiding them) as well.  As far as I can tell (prompted by Gary)
>> the trick would be to do something with the Image() macro in the specific
>> context of the Activity feed to apply the 'span4' class to the img tag.  I
>> haven't quite worked out how to do that yet, but thought I'd send a message
>> here before I persisted.
>>
>> Which approach is preferred?  As far as I can see, the question comes down
>> to whether the activity feed could end up misinforming people due to
>> missing images, and whether it would look jarring if a referenced image
>> wasn't there.  On the other hand, even resized images might still be very
>> long, taking up a lot of space in the feed.
>>
>> Incidentally, nice to meet you all.  I hope I can be of some help with the
>> project.
>>
>> Tom
>>


Re: Ticket #279 - Images rendered in activity feed

Posted by Peter Koželj <pe...@digiverse.si>.
I am in favor of keeping images. Normally they should not be to heigh when
resized to fit activity feed width.
In the long run I would like if users have an option on activity widget or
in widget activity setting to show/hide images.

And...
... welcome to Bloodhound!

Peter

On 19 December 2012 13:05, Tom Kitchin <tk...@gmail.com> wrote:

> Hi,
>
> I've been reading the dev mailing list for a while, and I thought it might
> be a time to try and get involved.  I took a look at ticket #279 (
> https://issues.apache.org/bloodhound/ticket/279), in which images in
> ticket descriptions turn up in the activity feed as well.
>
> The first solution (not rendering them) is simple enough as far as I can
> see - I've attached a very simple patch which just sets them display:none
> in CSS.
>
> I've been looking into the second solution (resizing the images to fit
> instead of hiding them) as well.  As far as I can tell (prompted by Gary)
> the trick would be to do something with the Image() macro in the specific
> context of the Activity feed to apply the 'span4' class to the img tag.  I
> haven't quite worked out how to do that yet, but thought I'd send a message
> here before I persisted.
>
> Which approach is preferred?  As far as I can see, the question comes down
> to whether the activity feed could end up misinforming people due to
> missing images, and whether it would look jarring if a referenced image
> wasn't there.  On the other hand, even resized images might still be very
> long, taking up a lot of space in the feed.
>
> Incidentally, nice to meet you all.  I hope I can be of some help with the
> project.
>
> Tom
>