Skip to content

Comments

Display scan state in visr#11

Merged
EmsArnold merged 6 commits intomainfrom
ea/display_scan_state_in_visr
Feb 17, 2026
Merged

Display scan state in visr#11
EmsArnold merged 6 commits intomainfrom
ea/display_scan_state_in_visr

Conversation

@EmsArnold
Copy link
Contributor

Displays response from startTask, as a visual change in the RunPlanButton. Button will be displayed as 'loading' until a response is received, and then either green ('success') or red ('error') for 4 seconds after response is received.

Mocking a 'success' response is default, but either a 'success' or an 'error' can be mocked by adding ?scenario=success or ?scenario=error respectively to the spectroscopy page url (i.e. http://localhost:5174/spectroscopy?scenario=error). These mocked responses include realistic delay to the http response, to test the button 'loading' state.

Copy link
Collaborator

@douglaswinter douglaswinter left a comment

Choose a reason for hiding this comment

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

This looks good so far but it's an incomplete story. I think there are two bits of state that should be tracked.

  1. Scan success/failure, but that's more than the initial post/put response, because a scan can fail halfway through. So that should use the events endpoint (or the upcoming glazed subscription), as well as the initial return code. This state would be better tracked as a label ('scan running', 'scan complete' etc) and maybe a green/red light.
  2. Depending on whether a scan is currently running, we should be disabling one of Submit or Abort buttons.

@EmsArnold
Copy link
Contributor Author

This looks good so far but it's an incomplete story. I think there are two bits of state that should be tracked.

RunPlanButton now shows as loading while the request is taking place

1. Scan success/failure, but that's more than the initial post/put response, because a scan can fail halfway through. So that should use the events endpoint (or the upcoming glazed subscription), as well as the initial return code. This state would be better tracked as a label ('scan running', 'scan complete' etc) and maybe a green/red light.

2. Depending on whether a scan is currently running, we should be disabling one of Submit or Abort buttons.

While a scan is running, the RunPlanButton is disabled, and while there is no scan running the AbortButton is disabled.

@EmsArnold EmsArnold merged commit ba7fa7b into main Feb 17, 2026
1 check passed
@EmsArnold EmsArnold deleted the ea/display_scan_state_in_visr branch February 17, 2026 08:41
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