[PATCH RFC] hgweb: improve annotate flow

Laurens Holst laurens.nospam at grauw.nl
Fri Nov 18 23:56:06 UTC 2011


Op 18-11-2011 21:15, Patrick Mézard schreef:
> Le 18/11/11 19:55, Laurens Holst a écrit :
>> Op 18-11-2011 19:37, Patrick Mézard schreef:
>>> It actually exists but there is nothing to scroll so it gives the impression the anchor is not there. Just look for 'id="t1.372"' in the page source. That said, the anchor generation is a little ad-hoc and I would not be surprised to find bugs in this area with complicated patches mixing binaries and renames.
>>>
>>> Also, Javascript could be used here to highlight the target line or the target hunk and avoid this no-scroll issue (or even CSS if the id passed as a parameter as well).
>> Actually there’s an easier way to do this, without scripting; If you move the ID from the<a>  tag to the<td>  tag, you can use the CSS :target pseudo-class to highlight the line, something like:
>>
>> td:target { background-color: yellow }
> Thanks, I have updated the demo server. And mpm link now looks like:
>
>    http://mezard.eu/hg/hg-does-it-look-good-for-you/rev/5868dd69fb03/#t1.372

Hey,

Looks good!

However it could still use some improvement though: Because you have two 
separate IDs now, if you click on a line number to make a link now, it 
doesn’t get highlighted. Also if you click on ‘ann’ the line in the 
annotate view doesn’t get highlighted.

You should remove the ID from the <a> tag entirely, and just have the ID 
on the <td> (annotate view) or <div> (rev view). Then consistently any 
link pointing to a line number will highlight the target. So as to not 
break existing links you should use the original ID scheme for this (l1.20).

Also the style should be moved into the style-paper.css stylesheet.

~Laurens

-- 
~~ Ushiko-san! Kimi wa doushite, Ushiko-san nan da!! ~~
Laurens Holst, developer, Utrecht, the Netherlands
Website: www.grauw.nl. Working @ www.roughcookie.com


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4332 bytes
Desc: S/MIME cryptografische ondertekening
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-devel/attachments/20111119/41a2e8be/attachment.p7s>


More information about the Mercurial-devel mailing list