Skip to content

feat: add visual distinction for workspaces with running startup scripts #18984

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

blink-so[bot]
Copy link
Contributor

@blink-so blink-so bot commented Jul 22, 2025

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:

  • The workspace is fully ready with all startup scripts completed
  • The workspace is running but startup scripts are still executing

This lack of distinction can lead to confusion, especially for users who:

  • Connect to workspaces expecting them to be fully initialized
  • Wonder why certain services or configurations aren't available yet
  • Need to troubleshoot startup script issues

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

  1. Enhanced Status Display: Workspaces now show "Running (Starting...)" when:

    • The workspace build is complete and running
    • One or more agents have lifecycle_state of "starting" or "created"
    • Startup scripts are still being executed
  2. Informative Tooltips: Added helpful tooltips that explain:

    • "Your workspace is running but startup scripts are still executing" for starting workspaces
    • Maintains existing "Your workspace is running but some agents are unhealthy" for unhealthy workspaces
  3. Consistent Visual Feedback:

    • Uses the existing spinner animation for "starting" state
    • Transitions to the play icon once all agents reach "ready" state
    • Maintains the same color scheme and styling for consistency

Technical Implementation

  • Added hasStartingAgents() helper function to check agent lifecycle states
  • Extended getDisplayWorkspaceStatus() to accept an optional workspace parameter
  • Updated WorkspaceStatusIndicator component to leverage agent state information
  • Backward compatible - works with existing code that doesn't pass workspace data

Benefits

  1. Improved User Experience: Users can immediately see when their workspace is still initializing
  2. Better Debugging: Easier to identify if issues are related to ongoing startup processes
  3. Clearer Expectations: Users know to wait when they see "Starting..." status
  4. No Breaking Changes: Fully backward compatible with existing implementations

Testing

Added comprehensive unit tests covering:

  • hasStartingAgents() function with various agent states
  • getDisplayWorkspaceStatus() with and without workspace data
  • Different combinations of agent lifecycle states

Visual Changes

  • Before: Workspace shows "Running" immediately after build completes with no indication that startup scripts are still executing
  • After: Workspace shows "Running (Starting...)" while scripts execute with clear visual feedback using spinner animation and helpful tooltip on hover

Future Enhancements

This foundation enables future improvements such as:

  • Progress indicators showing script completion percentage
  • Detailed startup script status in the workspace details view
  • Notifications when startup scripts complete or fail

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.

- Add helper function hasStartingAgents to check agent lifecycle states
- Update getDisplayWorkspaceStatus to show 'Running (Starting...)' when agents are still starting
- Enhance WorkspaceStatusIndicator with tooltips for starting workspaces
- Add comprehensive tests for the new functionality
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.

0 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy