Skip to content

Add loading animation to container action buttons - #46

Merged
JonasGao merged 4 commits into
mainfrom
copilot/add-loading-animation-container-actions
Jan 16, 2026
Merged

JonasGao merged 4 commits into
mainfrom
copilot/add-loading-animation-container-actions

Conversation

Copilot AI commented Jan 13, 2026 •

Copy link
Copy Markdown
Contributor

Container start/stop/restart actions lacked visual feedback during execution, causing uncertainty about whether actions were processing.

Changes

  • Loading state tracking: Added Map<containerId, action> to track in-flight operations per container
  • Spinner UI: Replace action button emoji with animated spinner during execution
  • Button disabling: Prevent concurrent actions on same container while operation pending
  • Post-action delay: 200ms stabilization period before auto-refresh to ensure consistent state

Implementation

Standard mode buttons:

<button class="action-btn stop" class:loading={isActionLoading(id, 'stop')} disabled={isContainerLoading(id)}>
  {#if isActionLoading(id, 'stop')}
    <span class="spinner"></span>
  {:else}
    ⏸️
  {/if}
  停止
</button>

Compact mode uses smaller spinner-compact variant. Loading state clears after API response + 200ms delay + list refresh.

Screenshots

Standard mode:
Standard mode with loading animation

Compact mode:
Compact mode with loading animation

Original prompt

add loading animation tocontainer start\stop\restart actions:

  1. when action api calling, show loading animation in the action button
  2. when action api called, still show loading animation, and wait 200ms
  3. after waiting 200ms, auto call container list refresh action

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits January 13, 2026 04:41
Co-authored-by: JonasGao <4549584+JonasGao@users.noreply.github.com>
Co-authored-by: JonasGao <4549584+JonasGao@users.noreply.github.com>
Co-authored-by: JonasGao <4549584+JonasGao@users.noreply.github.com>
Copilot AI changed the title [WIP] Add loading animation to container start, stop, and restart actions Add loading animation to container action buttons Jan 13, 2026
Copilot AI requested a review from JonasGao January 13, 2026 04:48
@JonasGao
JonasGao marked this pull request as ready for review January 16, 2026 06:43
Copilot AI review requested due to automatic review settings January 16, 2026 06:43
@JonasGao
JonasGao merged commit e602032 into main Jan 16, 2026
@JonasGao
JonasGao deleted the copilot/add-loading-animation-container-actions branch January 16, 2026 06:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds visual loading feedback to container action buttons (start/stop/restart) to improve user experience by showing when operations are in progress.

Changes:

  • Added loading state tracking using a Map to track in-flight operations per container
  • Implemented animated spinners that replace button emojis during action execution
  • Added button disabling to prevent concurrent actions on the same container
  • Introduced a 200ms stabilization delay after actions before auto-refreshing the container list

Reviewed changes

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

File Description
webui/src/pages/Home.svelte Added loadingActions Map state, REFRESH_DELAY constant, loading state management in handleAction function, and passed loadingActions to all ContainerList components
webui/src/components/ContainerList.svelte Added loadingActions prop, helper functions for checking loading state, conditional spinner rendering in all action buttons for both compact and standard modes, and CSS for spinner animations

// Track if component has mounted to prevent reload during initial setup
let isMounted = false;
let filterDebounceTimer: number | null = null;
let filterDebounceTimer: number | undefined = undefined;

Copilot AI Jan 16, 2026

Copy link

Choose a reason for hiding this comment

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

The type change from number | null to number | undefined is inconsistent with other timer variables in the codebase. Files like Volumes.svelte and VolumeExplorer.svelte use number | null for their timeout IDs. Consider changing this to number | null = null for consistency across the codebase, or update all timer variables to use the same pattern.

Suggested change
let filterDebounceTimer: number | undefined = undefined;
let filterDebounceTimer: number | null = null;

Copilot uses AI. Check for mistakes.
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.

3 participants