Homec4science

Fix the attempt of graceful alignment for Hovercards

Authored by Anh Nhan Nguyen <anhnhan@outlook.com> on Apr 8 2013, 03:10.

Description

Fix the attempt of graceful alignment for Hovercards

Summary:
Refs T1048; Fixes T2902 - (Probably) fixes @vrana's issue. I managed
to repro it on Ubuntu FF (though on Windows with 1.0GHz/512MB it's
really worse...).

This revises the approach to the graceful degradation for
too-far-to-the-screen-edge-edge-case.

I noticed that x could become very negative, up to about ~-170px.
This is due to the "already-on-the-left-side" nature of object tags.
50 - 200 - 20 = negative. Adding 100px (node.dimension.x / 4) to
that won't really help, as the hovercard would still be offscreen.

Instead, display them left-aligned with the object tags on the left edge
per default, and offer centerization in center cases. This is also better
for Pholio, Phriction, which have a way lower min-x than Maniphest,
Differential.

I also disabled placing the hovercard below the tag in case there's not
enough space on the north side. The hovercard would not display 99.99% of
the times after being hidden (and it retains the flickering behaviour).
Another reason is also our current hide-behaviour, which only assumes
north-side alignment. Adding south-side didn't really work (I'm bad with
JS), so I didn't bother with it. Disabling this is acceptable, since
it only really affects Pholio, Phriction. And nobody places object tags
in the first line, anyway. Except for my test pages, of course :/

Btw, this also removes the weird jaggy horizontal shifts for object of
various lengths (e.g. {D4356}, {rP32ofhw0842obw} etc.). I think
that's only good.

Test Plan:
Hovered in Pholio, Phriction in Chrome, FF. Did not touch
left screen border.

Hovered in Maniphest, Differential. Tags farther to the left were
aligned left, tags more in the center were pretty centered.

Reviewers: epriestley, vrana

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1048, T2902

Differential Revision: https://secure.phabricator.com/D5612

Details

Committed
epriestley <git@epriestley.com>Apr 8 2013, 03:10
Pushed
aubortJan 31 2017, 17:16
Parents
rPH3c1a0b76fac8: Add a custom "Header" Maniphest field type
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHdbcd38aa881b: Fix the attempt of graceful alignment for Hovercards (authored by Anh Nhan Nguyen <anhnhan@outlook.com>).Apr 8 2013, 03:10