Conversation
Keep short tasks visible, add live task summaries, and separate log access from selectable task names.
SbloodyS
left a comment
There was a problem hiding this comment.
Please provide a screenshot before and after optimization in the PR details.
Constrain task scrolling to the remaining content area and skip requests after the route identity becomes invalid.
SbloodyS
left a comment
There was a problem hiding this comment.
Avoid quadratic work on each live Gantt update
buildGanttModel calls gantt?.tasks.find(...) for every task definition (model.ts:117). While a workflow is active, useGantt updates now every second and rebuilds the model, repeating this O(n²) search even when the task data has not changed. Since large task counts are an explicit goal of #18647, please index the Gantt tasks once before building the rows, while preserving the duplicate-name and status checks.
NIT: state(row) also recreates the entire tasksState(t) mapping for each rendered row. Consider caching it per locale.
There was a problem hiding this comment.
Please quote the picture in the document.
|
@SbloodyS, addressed the requested live-update performance changes in
Verification:
Please re-review when convenient. |
1c4eb91 to
0bbeb7a
Compare
0bbeb7a to
6c03c89
Compare
|
Follow-up update pushed in
Validation: Gantt model/layout tests (10/10), Prettier, |
Was this PR generated or assisted by AI?
YES. OpenAI Codex assisted with the Gantt UI implementation, data-normalization tests, navigation regression fixes, and this description. The UI was iterated with the contributor and verified in running DolphinScheduler instances.
Purpose of the pull request
Closes #18647.
Make the workflow-instance Gantt view useful for inspecting workflows with mixed task durations and large task counts. The previous view rounds timestamps to whole seconds, making subsecond tasks appear to have no duration, and does not expose task-count summaries or direct log access.
For example, a workflow containing a long task and an 8 ms task should keep the short task visible, preserve its actual duration, show whether other tasks are still unsubmitted or have failed, and let an operator open the corresponding log while still being able to select and copy task names.
The task list must also remain the only vertical scrolling area when many tasks are present. The earlier fixed viewport calculation could create nested scrolling and move the whole page. In addition, leaving the Gantt route briefly invalidates its route parameters; refresh work must stop before those values can produce requests for
/process-instances/NaN,/NaN/tasks, and/NaN/view-ganttand three error messages.Screenshot
The screenshot below uses a running workflow instance with 32 tasks: 13 running and 19 succeeded. It demonstrates the compact status summary, responsive elapsed-time/percentage axis, mixed task durations, live running bars, separate log actions, and the internally scrolling task viewport.
Brief change log
NaNpath parameters.The change is confined to the UI and uses existing APIs. There are no backend, database-schema, public-API, or dependency changes.
Verify this pull request
This change adds tests and was verified as follows:
cd dolphinscheduler-ui && node --test tests/gantt*.test.cjs: 9 tests passed, covering retry deduplication, unsubmitted nodes, millisecond precision, running/completed durations, missing dates, parallel-task percentages, UTC parsing, subsecond timeline bounds, available viewport height, and invalid route identities.vue-tsc --noEmit: passed.npm run build:prod: passed (existing bundle-size andevalwarnings remain).NaNrequests and shows no error messages, short task bars remain visible, task names remain selectable, and logs open from the separate action.Running-time calculations are covered by tests. A new production workload was not launched for this change.