feat: add visual distinction for workspaces with running startup scripts #18984
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.
Add Visual Distinction for Workspaces with Running Startup Scripts
Problem Statement
Currently, when a prebuilt workspace is marked as "Running" in the Coder interface, there's no visual indication whether:
This lack of distinction can lead to confusion, especially for users who:
Solution
This PR introduces a visual distinction in the workspace status indicator to show when a workspace is running but startup scripts are still executing.
Key Changes
Enhanced Status Display: Workspaces now show "Running (Starting...)" when:
lifecycle_state
of "starting" or "created"Informative Tooltips: Added helpful tooltips that explain:
Consistent Visual Feedback:
Technical Implementation
hasStartingAgents()
helper function to check agent lifecycle statesgetDisplayWorkspaceStatus()
to accept an optional workspace parameterWorkspaceStatusIndicator
component to leverage agent state informationBenefits
Testing
Added comprehensive unit tests covering:
hasStartingAgents()
function with various agent statesgetDisplayWorkspaceStatus()
with and without workspace dataVisual Changes
Future Enhancements
This foundation enables future improvements such as:
Why This Matters
For teams using prebuilt workspaces with complex initialization scripts, this feature provides crucial visibility into workspace readiness. It reduces support tickets, improves developer experience, and makes the platform more intuitive for new users.
The implementation is minimal, focused, and leverages existing infrastructure - making it a low-risk, high-value addition to Coder.