Adjust Workflow Graph styling#37497
Conversation
|
Also this one? The workflow summary is not intuitive. #37395 |
yes on it |
|
this might extend into a larger refactor - found some other problems |
|
@wxiaoguang what do you think? |
UI looks clearer than before. |
if you can help simplifying or improving code structure would be great :) |
Let's make sure (almost) everyone likes the new UI first |
how to reproduce? |
Use the workflows from #36248 (comment) |
Make the workflow dependency graph container scrollable so wide DAGs aren’t clipped. Improve the jobs list layout by keeping durations fixed-width/right-aligned so long times don’t squeeze job names. Add a devtest WideDAG run to reproduce overflow and long-duration cases.
@lunny fixed
|
Read the issues again |
|
Actually, I don't think we should re-invent the wheel here. The best and simplest approach should be just using some well-known algorithms. For example: just use the ElkJS from mermaid. |
|
Not sure whether mermaid would be flexible enough to support the deep customization that's needed here. Might be worth a try though. |
For example: just use the ElkJS from mermaid. #37497 (comment) |
|
I'm still not concinved whether it's worth to diverge from GitHub-like rendering too much. ELK renderer would give a different layout for sure. GitHub layout works reasonably well by overlaying paths onto vertical tracks, it's bascially I actually wonder how this cross looks on GitHub renderer: |
If you could provide a task dependency relationship, I would be willing to help with testing |
|
@wxiaoguang can you provide the workflow file of the screenshot from #37497 (comment)? |
|
|
GitHub also renders ambiguous layout for that case. I don't think GitHub is right, blindly following GitHub is also not right. I believe something like ElkJS is the right answer, we don't need to write our home-made layout algorithm, and I don't think there will be people interested in maintaining it. |
|
From the perspective of someone who has used workflow orchestration tools like Dagster and Airflow, as well as data lineage tools like OpenMetadata, I find GitHub’s flow graph to be really clean and excellent. When dealing with many tasks, a unified vertical line experience is far better than multiple branching lines, because with branching you also need hover highlighting to understand the relationships (trust me, the human eye really dislikes too many lines and isn’t great at parsing them). A unified vertical line also makes the layout more compact. My observation is that, except for tasks in the first row, as long as downstream tasks are placed in different rows, you can avoid subsequent straight lines. If a downstream task ends up in the same row as its upstream, moving it down to the next row keeps the top-to-bottom data flow direction more natural and curvy. If a downstream task is in a vertical column one row apart, you can just insert a straight line directly. Compared to GitHub's hover-highlight design for related tasks, most workflow orchestration tools highlight related tasks when you click a card. I think this mainly comes down to the use case — since the actions in GitHub workflows are relatively few and simple, hover works more conveniently. Of course, if implementing and maintaining something like that turns out to be too difficult, then going with an existing solution like ElkJS is probably the best approach — the GitHub-inspired tweaks are really just a small UX enhancement. |
|
Since hovering with the mouse isn’t a difficult interaction, it can quickly strip away the noise. But maybe it’s just me — when facing many tasks, I’ve personally gotten used to clicking a single task to inspect its dependencies rather than relying on first-glance clarity. That might not reflect what most people prefer, just my own two cents. |
How to "hover" when there is no pointer device (mouse)? For example: view the page on a pad? |
|
Maybe clicking on a task could toggle the highlight — one click to keep it on, another to turn it off — just like how other workflow orchestration tools handle it. |
Other workflow orchestration tools also generate such ambiguous layout? Don't they have better layout algorithms? |
|
They’re using existing solutions like React Flow 🤣 |
Do other workflow orchestration tools also generate such ambiguous layout? |
I haven’t come across that behavior in my own use cases. |
|
The ambiguity resolves when you hover/click one of the boxes, then it highlights the full dependency chain. I think that is clear enough. GitHub sacrifices a bit of clarity with the rendering, but I think it's acceptable. ELK renderer would surely be worse. |
Then, since you used "other workflow orchestration tools" as example, if they don't generate ambiguous layouts: why Gitea should learn from GitHub's flawed design.
I don't understand why it "would surely be worse". Is it your guess? Have you tested it and got proofs? If the ELK layout algorithm is bad, why mermaid uses it. |
@lutinglt That's what you are referring:
Why not just use elkjs here just like your "workflow orchestration tools"? |
Maybe you should learn how to use elkjs first. The box width/height are provided by callers. You tell elkjs to use the same width, then it will use the same width. |
|
The difference mainly comes from the intuitive experience when dealing with multiple tasks: ElkJS (branching lines): GitHub (unified vertical line): I think this is the core difference, and it’s why I still prefer GitHub’s design after using many workflow orchestration tools. With many tasks, ElkJS’s lines, while accurate, become noise that my brain and eyes can’t process—at a glance it’s nearly unusable for understanding dependencies. GitHub’s approach may be less precise, but I can still roughly see task dependencies, and it’s correct most of the time. For me, GitHub’s design remains usable at a larger scale with multiple tasks, whereas ElkJS becomes ineffective despite being accurate. I personally believe the reason you can quickly pick up those rough dependency relationships on GitHub is exactly because of its clean line design. With ElkJS you probably would have already resorted to highlights to find them. |















Screenshot
Fixes #37493
Fixes #37395