Skip to content

Fixes #2104 Add Simulation Queue Position Display to Simulations Page #2624

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 2 commits into
base: master
Choose a base branch
from

Conversation

nadamakram
Copy link

Description

This PR Fixes #2104 by adding a queued label and queue position display to the Simulations page, addressing issue #2104. The motivation is to provide users with clear feedback on their simulation's status in the processing queue, rather than showing all queued jobs as "computing." This improves transparency and user experience by indicating both the queue position and when a simulation is actively calculating.

Changes

Updated the Simulations page to display:

  • An orange "POSITION IN QUEUE: X" label for simulations with queue_position > 0
  • A blue "CALCULATING" label for simulations with queue_position === 0 or missing
  • The "Queue Position" column now always shows the queue position value or a dash if not present
  • Ensured the frontend expects and handles the queue_position field from the backend /simulations API
  • Added test data to the frontend to visually verify all queue/calculate display cases

Tests

Manually verified the following cases in the UI:
Simulations with queue_position > 0 display "POSITION IN QUEUE: X" (orange tag) in the status column and the correct number in the Queue Position column.
Simulations with queue_position === 0 display "CALCULATING" (blue tag) in the status column and 0 in the Queue Position column.
Simulations with no queue_position display "CALCULATING" (blue tag) in the status column and a dash ("—") in the Queue Position column.
Completed and errored simulations display the correct status and a dash in the Queue Position column.

Screenshots

image

Note: I am not aware of what data values to enter into the simulation, so I test all possibilities in the UI, not hardcoded, so if you can guide me through this to make sure it is working properly.

Copy link

vercel bot commented Jun 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
policyengine-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 24, 2025 8:06pm

@nadamakram
Copy link
Author

@anth-volk can you take a look at this pls?

@anth-volk
Copy link
Collaborator

Hi @nadamakram, my apologies for the delay. I'll be working through some PR backlog over the next couple days and will address then. Thanks for your patience.

@anth-volk
Copy link
Collaborator

@nadamakram could you run make format as described in our README? Also, if you check out my update to the original issue, I'm not 100% sure how to proceed with this, as we don't have the same queue logic that we used to now that we're using a new API for computations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

Add queued label and queue position to Simulations page
2 participants