Sort current-workflow activities by execution order#15
Open
nomis52 wants to merge 2 commits into
Open
Conversation
The current workflow tab rendered activities in whatever order buildActivityExecutions produced, which was alphabetical by activity type name (the results come from a Go map, then were sorted by Type). That bears no relation to the order activities actually ran, so the list looked arbitrary to users. Sort by StartTime instead so the list reflects execution order. Activities that never started (pending/not-started/skipped) have a zero StartTime and sort last, ordered by type for stable output; ties from parallel activities with identical start times also fall back to type. Extract the comparator into sortByExecutionOrder and unit-test it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Revert the server-side sort change: the API now leaves activity ordering to the client (it keeps its existing stable alphabetical-by-type output), and the web UI sorts by execution order at render time using the start_time already present on each activity. Applied in both the current-workflow tab and the history detail view via a shared sortByExecutionOrder helper. Started activities sort by start_time; not-yet-started/skipped activities (no or zero start time) sort last, by type. Uses Date.parse rather than lexicographic string comparison so mixed fractional-second timestamps order correctly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
nomis52
marked this pull request as ready for review
July 7, 2026 12:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On the web UI's Current Workflow tab, activities appeared in a seemingly random order — they were actually sorted alphabetically by activity type name, which bears no relation to the order activities ran.
Fix
Sort by execution order (
start_time) client-side, since the browser already hasstart_timeon every activity. The API keeps its existing stable output; ordering is a display concern handled at render time.sortByExecutionOrder(executions)helper inserver/static/index.html, applied in both the current-workflow tab and the history detail view.start_time; not-yet-started / skipped activities (no or zero start time) sort last, by type.Date.parserather than lexicographic string comparison so mixed fractional-second timestamps order correctly.Testing
go build ./...andgo test ./server/runner/pass (Go code unchanged).🤖 Generated with Claude Code