jbenet / depviz

dependency visualizer for the web
https://jbenet.github.io/depviz
MIT License
49 stars 10 forks source link

DepCard: Expanded cards #35

Closed wking closed 7 years ago

wking commented 7 years ago

There's currently no way to toggle between collapsed/expanded, or label buttons, comment counts, task counts, or assignee icons. But this is where I am at the moment ;). I thought I'd push it to avoid duplicating effort.

Fixes #8.

jbenet commented 7 years ago

i think travis wants more coverage

wking commented 7 years ago

Yeah, this is very work-in-progress. I'll remove the WIP prefix when I think it ready.

jbenet commented 7 years ago

Ah-- got it.

wking commented 7 years ago

Still a few cases that aren't handled well (long titles, multiple assignees, adjusting the graph layout depending on node size, a UI for toggling expanded-ness), but the commit I just pushed to this PR handles the core expanded-node features:

expanded

I put the person icon in the upper right since the host icon is in the top line, and having both icons in the same line makes line spacing more consistent when the image height is different from the usual line spacing.

The comment, task, and default-avatar icons use Unicode, so you'll need a font that supports the code points I'm using. Details on that in the commit message.

wking commented 7 years ago

I've added e and c hotkeys to toggle expanded/collapsed. There are some caveats to this approach (details in the commit message, especially the fact that you need to focus on the SVG-wrapping div before we notice your keypresses), but I think it's good enough for this to be merge-able.

wking commented 7 years ago

Fixed a GitHub-mock default with 8680c8a → 7f5536d to get tests passing again.

jbenet commented 7 years ago

Great! looking good-- let's merge this

wking commented 7 years ago

For some reason, expand/collapse replace calls don't seem to be triggering a re-render, although that had been working in my local testing earlier. I'll go through my reflog and see where that broke…

wking commented 7 years ago

On Thu, Dec 01, 2016 at 05:50:39PM -0800, W. Trevor King wrote:

For some reason, expand/collapse replace calls don't seem to be triggering a re-render…

They seem to be working now. Maybe I'd just forgotten to focus on the graph first 1.