Skip to content

Add gantt chart for task visibility#108

Merged
ethanrous merged 10 commits into
mainfrom
gantt-task-chart
Jun 22, 2026
Merged

Add gantt chart for task visibility#108
ethanrous merged 10 commits into
mainfrom
gantt-task-chart

Conversation

@ethanrous

Copy link
Copy Markdown
Owner

Added gantt chart for task history observability on the dev page in the settings

image

Copilot AI review requested due to automatic review settings June 22, 2026 02:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a task-history Gantt chart to the Settings → Dev page for improved task observability, backed by expanded task API data (timing/metadata/error) and incremental polling support.

Changes:

  • Introduces a new Gantt chart UI (chart, axis, bars, tooltip) and a useTaskHistory composable to accumulate polled task history.
  • Extends /tower/tasks to optionally include exited tasks and filter exited results by a since epoch-ms cursor.
  • Expands TaskInfo across backend + generated clients/docs to include queue/finish timestamps, metadata, and error text.

Reviewed changes

Copilot reviewed 29 out of 37 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
weblens-vue/weblens-nuxt/util/gantt.ts Gantt model building + time parsing/helpers for rendering.
weblens-vue/weblens-nuxt/types/portablePath.ts Adds relative-path helper for display logic.
weblens-vue/weblens-nuxt/stores/location.ts Minor comment punctuation change.
weblens-vue/weblens-nuxt/pages/settings/dev.vue Adds Gantt/Table toggle and integrates useTaskHistory.
weblens-vue/weblens-nuxt/pages/settings.vue Layout tweaks (min-w-0, flex-1) for better sizing/overflow.
weblens-vue/weblens-nuxt/e2e/dev-actions.spec.ts E2E coverage for Gantt visibility + toggle behavior.
weblens-vue/weblens-nuxt/composables/useTaskHistory.ts Polling + session history accumulation with incremental cursor.
weblens-vue/weblens-nuxt/components/molecule/TaskGanttTooltip.vue Tooltip UI for task bar hover details.
weblens-vue/weblens-nuxt/components/molecule/TaskGanttChart.vue Main Gantt chart component (zoom, pin-right scrolling, virtualization).
weblens-vue/weblens-nuxt/components/molecule/FileSquare.vue Supports displayName as string or PortablePath and renders paths.
weblens-vue/weblens-nuxt/components/molecule/FileCard.vue Computes relative display name during search and passes to file component.
weblens-vue/weblens-nuxt/components/atom/GanttTimeAxis.vue Tick rendering for the Gantt time axis.
weblens-vue/weblens-nuxt/components/atom/GanttBar.vue Individual bar rendering + hover event emission.
weblens-vue/weblens-nuxt/components/atom/FilePath.vue Updates path rendering with icons and truncation behavior.
services/reshape/task.go Adds metadata/error and queue/finish timing to reshaped TaskInfo.
services/reshape/task_test.go Unit tests for new TaskInfo timing + error propagation.
routers/api/v1/tower/rest_admin.go Adds includeExited + since handling and task filtering helper.
routers/api/v1/tower/rest_admin_test.go Unit tests for FilterTasks behavior.
modules/wlstructs/task.go Expands TaskInfo struct with queue/finish/metadata/error.
models/task/worker_pool.go Changes task retention behavior and sets finish time on panic recovery.
models/task/task.go Adds GetQueueTime() accessor.
models/task/task_test.go Test asserting finished tasks remain queryable.
models/history/file_action.go Moves warning about empty content ID from creation to save time.
e2e/rest_tower_test.go E2E validation that includeExited=true works and returns a list.
docs/swagger.yaml Updates swagger artifacts for new fields/params.
docs/swagger.json Updates swagger artifacts for new fields/params.
docs/docs.go Updates embedded swagger doc template.
api/ts/generated/docs/TowersApi.md TS client docs updated for new query params.
api/ts/generated/docs/TaskInfo.md TS client docs updated for new TaskInfo fields.
api/ts/generated/api.ts TS generated types + API signature updates.
api/ts/dist/AllApi.js Built JS client updated for new signature/params.
api/ts/dist/AllApi.d.ts Built TS declarations updated for new signature/params.
api/model_task_info.go Generated Go model updated for new fields.
api/docs/TowersAPI.md Generated Go client docs updated for new query params.
api/docs/TaskInfo.md Generated Go client docs updated for new TaskInfo fields.
api/api/openapi.yaml OpenAPI spec updated for new fields/params.
api/api_towers.go Generated Go client updated for new query params.
Files not reviewed (3)
  • api/api_towers.go: Generated file
  • api/model_task_info.go: Generated file
  • docs/docs.go: Generated file
Comments suppressed due to low confidence (1)

models/task/worker_pool.go:555

  • Finished non-persistent tasks are now retained indefinitely in WorkerPool.taskMap. This changes the documented semantics of Options.Persistent (which says non-persistent tasks are removed) and can lead to unbounded memory growth and slower scans over GetTasks() (e.g., services/embed/embed_service.go iterates all tasks). Consider adding a bounded retention policy (TTL / max count) for exited tasks, or restoring eviction for non-persistent tasks while separately tracking recent history for observability.
					// Update parent task pools about completed task
					directParent := t.GetTaskPool()
					directParent.IncCompletedTasks(1)

					// Run cleanup routines for the task

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread weblens-vue/weblens-nuxt/types/portablePath.ts Outdated
Comment thread weblens-vue/weblens-nuxt/types/portablePath.ts Outdated
Comment thread weblens-vue/weblens-nuxt/components/molecule/FileSquare.vue Outdated
Comment thread weblens-vue/weblens-nuxt/components/molecule/FileCard.vue
Comment thread weblens-vue/weblens-nuxt/components/atom/FilePath.vue
Comment thread modules/wlstructs/task.go
Comment thread weblens-vue/weblens-nuxt/util/gantt.ts Outdated
Comment thread weblens-vue/weblens-nuxt/util/gantt.ts
Comment thread weblens-vue/weblens-nuxt/composables/useTaskHistory.ts
Comment thread models/task/task_test.go
Copilot AI review requested due to automatic review settings June 22, 2026 04:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 34 out of 42 changed files in this pull request and generated 8 comments.

Files not reviewed (3)
  • api/api_towers.go: Generated file
  • api/model_task_info.go: Generated file
  • docs/docs.go: Generated file
Comments suppressed due to low confidence (1)

models/task/worker_pool.go:556

  • Finished tasks are no longer removed from wp.taskMap, so the worker pool will retain every task ever dispatched for the lifetime of the process. Without a retention policy (max age / max count / explicit cleanup) this can grow unbounded and increase memory usage and response sizes over time (even with the new since cursor, the server still stores everything).
					// Update parent task pools about completed task
					directParent := t.GetTaskPool()
					directParent.IncCompletedTasks(1)

					// Run cleanup routines for the task
					wp.cleanupTask(t, workerID)

Comment thread weblens-vue/weblens-nuxt/types/portablePath.ts Outdated
Comment thread models/task/task.go Outdated
Comment thread weblens-vue/weblens-nuxt/components/molecule/TaskGanttTooltip.vue
Comment thread weblens-vue/weblens-nuxt/components/molecule/FileSquare.vue Outdated
Comment thread weblens-vue/weblens-nuxt/util/gantt.ts Outdated
Comment thread weblens-vue/weblens-nuxt/util/gantt.ts Outdated
Comment thread weblens-vue/weblens-nuxt/composables/useTaskHistory.ts Outdated
Comment thread weblens-vue/weblens-nuxt/types/portablePath.ts Outdated
Copilot AI review requested due to automatic review settings June 22, 2026 04:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 34 out of 42 changed files in this pull request and generated 3 comments.

Files not reviewed (3)
  • api/api_towers.go: Generated file
  • api/model_task_info.go: Generated file
  • docs/docs.go: Generated file
Comments suppressed due to low confidence (1)

models/task/worker_pool.go:556

  • Finished tasks are no longer removed from the worker pool’s taskMap (the previous cleanup path was removed), so taskMap will grow unbounded over the server lifetime. This has clear memory/operational risk, and also makes the initial includeExited=true&since=0 poll potentially huge.
					// Wake any waiters on this task
					close(t.waitChan)

					// Potentially find the task pool that houses this task pool. All child
					// task pools report their status to the root task pool as well.
					// Do not use any global pool as the root
					rootTaskPool := t.taskPool.GetRootPool()

					if t.exitStatus.Load() == TaskError && !rootTaskPool.IsGlobal() {
						rootTaskPool.AddError(t)
					}

					// Update parent task pools about completed task
					directParent := t.GetTaskPool()
					directParent.IncCompletedTasks(1)

					// Run cleanup routines for the task
					wp.cleanupTask(t, workerID)

Comment thread models/task/task.go
Comment thread weblens-vue/weblens-nuxt/components/molecule/TaskGanttTooltip.vue
Comment thread models/history/file_action.go
The empty-content-ID warning was moved from NewCreateAction into
SaveAction, but its text still read "Creating FileAction...". Update it
to "Saving FileAction..." so the log message reflects the actual call
site and stays searchable.
Copilot AI review requested due to automatic review settings June 22, 2026 04:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 34 out of 42 changed files in this pull request and generated 1 comment.

Files not reviewed (3)
  • api/api_towers.go: Generated file
  • api/model_task_info.go: Generated file
  • docs/docs.go: Generated file

Comment thread models/task/worker_pool.go
The gantt chart is now the default task view on the dev settings page,
so the "No running tasks" empty state only renders after toggling to the
table view. Switch to the Table view before asserting the empty state.
getByText('upload-seq-N.txt') matched both the upload progress indicator
and the file-grid entry, causing a strict-mode violation under CI timing.
Scope to [id^="file-card-"] like the other upload-flow assertions.
Copilot AI review requested due to automatic review settings June 22, 2026 05:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 56 out of 64 changed files in this pull request and generated 2 comments.

Files not reviewed (3)
  • api/api_towers.go: Generated file
  • api/model_task_info.go: Generated file
  • docs/docs.go: Generated file

Comment thread models/task/worker_pool.go
Comment thread weblens-vue/weblens-nuxt/composables/useTaskHistory.ts
@ethanrous ethanrous merged commit 04adaa4 into main Jun 22, 2026
5 checks passed
@ethanrous ethanrous deleted the gantt-task-chart branch June 22, 2026 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants