Skip to content

i15-1: display the queue from the daq-queue-service#45

Merged
DominicOram merged 51 commits into
mainfrom
1625-display-queue
Jun 12, 2026
Merged

i15-1: display the queue from the daq-queue-service#45
DominicOram merged 51 commits into
mainfrom
1625-display-queue

Conversation

@noemifrisina

@noemifrisina noemifrisina commented May 27, 2026

Copy link
Copy Markdown
Collaborator

@DominicOram DominicOram left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like a great start, thank you. I think we should probably see if @zoharma and @douglaswinter have opinions too. Some comments in code. Additionally, my initial thoughts on the look/feel, feel free to spin into new issues/PR given the size of this PR already:

  • Should: There's no feedback when we can't connect to the queue, it just says it's running
  • Should: I don't really think ID is useful to be user facing
  • Should: The pause will pause after the next task in the queue is finished, I think it would be good to rename it to make that more obvious
  • Should: This PR includes stuff for the abort button, we should probably have the same button on the queue page (in fact maybe everywhere)
  • Could: It would be nicer if the drag and drop was entirely disabled for the current/past tasks so its more obvious you can't do it
  • Could: If there's nothing in the queue then having it saying it's running is a bit odd, maybe "Queue finished"?
  • Could: I think some tooltips on the column headers would be good
  • Nit: You can filter by the action column, this doesn't really make much sense
  • Nit: Status is an enum but when you filter by it you put in a string, might be nicer if the filter was an enum

Comment thread apps/i15-1/src/queue/tasks.ts Outdated

export type TaskStatus =
| "Waiting"
| "Claimed"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How do I trigger a claimed state in the queue?

@jacob720 jacob720 Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is leftover from before the queue refactor, I need to remove that type now as the correct one exists in generated/. Tasks can now only have the following status:

class Status(StrEnum):
    QUEUED = "Queued"
    IN_PROGRESS = "In progress"
    COMPLETE = "Complete"
    CANCELLED = "Cancelled"

Blueapi calls can be claimed though. This represents the time when the worker has popped the call from the queue but blueapi hasn't started running it yet. A task's status is derived from the status of the blueapi calls it has produced, so both a claimed and in_progress blueapi call make its parent task in_progress.

class CallStatus(StrEnum):
    WAITING = "Waiting"  # Waiting in the queue
    CLAIMED = "Claimed"  # Claimed by the worker
    IN_PROGRESS = "In progress"  # In progress inside BlueAPI
    SUCCESS = "Success"  # Completed successfully
    ERROR = "Error"  # Error while trying to run

Comment thread apps/i15-1/src/routes/QueueView.tsx Outdated
Comment thread apps/i15-1/src/routes/QueueView.tsx Outdated
Comment thread apps/i15-1/src/queue/tableData.ts Outdated
sampleId: string;
planRunning: string;
parameters: string;
// parameters: PlanParameters;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should: Remove commented out code

Comment thread apps/i15-1/src/queue/queueService.ts Outdated
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";

// const QUEUE_SOCKET: string = "/api/daq-queue";
const QUEUE_SOCKET: string = "http://127.0.0.1:8001";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Must: Can we have some way of generically configuring this so that it works for testing and prod

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Have added an env variable to toggle between these, which also turns mock service worker on/off.

Comment thread apps/i15-1/src/queue/queueService.ts Outdated
Comment thread apps/i15-1/src/routes/QueueView.tsx Outdated
enableRowDragging: true,
enableSorting: false,
muiRowDragHandleProps: ({ table }) => ({
onDragEnd: () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should: I think some tests on the logic here would be good.

@douglaswinter

Copy link
Copy Markdown
Collaborator

Two top-level comments/questions: 1) How does this view relate to the design in Figma? 2) Echoing Dom's comment, we need tests for this, both plain unit tests for your queries and logic, and RTL tests for the rendering.

@jacob720
jacob720 force-pushed the 1625-display-queue branch 2 times, most recently from 6a0c321 to a839a06 Compare June 2, 2026 12:16
@jacob720

jacob720 commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

It's getting iteratively closer to the figma design, but still some differences:

  • Task params are all listed as a string rather than in individual columns as per the design i15-1: Investigate best way to display task params in queue  #52
  • Currently can't get estimated run time from blueapi so run time, progress columns don't yet exist
  • Currently have a toggle to show historic tasks instead of having tabs for future, historic, all, tasks
  • Currently tasks can always be re-ordered, there's a toggle in the design
  • Can't select tasks to perform actions on them - there's just a cancel button
  • The pause/resume queue button and queue status text look a bit different to the design

In the interest of getting this merged + deployed asap, so the scientists can have a play around with it, I can spin these into separate issues to fix in future?

@jacob720
jacob720 force-pushed the 1625-display-queue branch from 0b3f29c to 468ae62 Compare June 4, 2026 16:47
@jacob720
jacob720 requested a review from DominicOram June 8, 2026 10:16
@jacob720

jacob720 commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

I've now added some tests. I've put the remaining comments from @DominicOram in a new issue: #56

@jacob720
jacob720 marked this pull request as ready for review June 8, 2026 10:21
@zoharma

zoharma commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

I'm adding all my comments, although some may be split to further issues and PRs:

  • Statuses should be small, and use outline by default (unless specifically needed to be filled - TBD).
  • Hide "Density" and "Full screen" buttons.
  • Hide "Actions" header actions and action-menu (no need to hide or filter for it).

Questions:

  • Can we show plan parameters as [Label: Value] list or expanded list in a different way? not showing the curly brackets?
  • Do we need "Sort order" on this? Or is it always to be shown by position order?
  • What does "Cancel" do? Can we rename to more explicit?

For later:

  • Sort should be hidden and activated on mode "Sort table" button, saved automatically, with an Exit button (this is so we don't have accidental ordering).
  • Spacing needs to be looked at. The default density to too big, and the small one is too tight. Need to tighten it slightly. I need to understand how the spacing works in MRT, not sure if this is done by changibg padding or the line size of object within. Also, action columns have smaller padding by default.

@jacob720
jacob720 force-pushed the 1625-display-queue branch from c0c0253 to a9b726e Compare June 10, 2026 10:33
@jacob720

jacob720 commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Can we show plan parameters as [Label: Value] list or expanded list in a different way? not showing the curly brackets?

Yeah I'll look into displaying this more nicely, see #52

Do we need "Sort order" on this? Or is it always to be shown by position order?

I think not, as I can't think of a case where you wouldn't want it to display in position order

What does "Cancel" do? Can we rename to more explicit?

This removes the task from the queue. Happy to rename it to something else, maybe Remove?

@DominicOram DominicOram left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, good work! I'm still trying to get my head around react but this looks good. Couple of comments in code, additionally when I try and display historic tasks when running in mock mode I get an error

Comment thread .devcontainer/devcontainer-lock.json Outdated
@@ -0,0 +1,9 @@
{
"features": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should: Can you remove this and add to the .gitignore?

import type { QueuedTasks } from "./tasks";

const QUEUE_MODE = import.meta.env.VITE_QUEUE_MODE;
const QUEUE_SOCKET: string =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should: Can you add a link into #59 to tidy this up

Comment thread apps/i15-1/src/queue/tasks.ts Outdated
@@ -0,0 +1,30 @@
import type { TaskWithPosition } from "./generated";

// Temporary parameters to see if things work in the first instance

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should: Can you link to an issue describing what we need to do to make this less temporary?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think we need this now that I've generated typed from the queue API. I've deleted this

enableSorting: false,
enableDensityToggle: false,
enableFullScreenToggle: false,
muiRowDragHandleProps: ({ row, table }) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could: Would be nice to test some of this dragging but I suspect that's a PITA

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There's a test for calculateNewPosition

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sure but it would be nicer to have one on the control itself that we can move things around. It's no big deal though

@jacob720
jacob720 requested a review from DominicOram June 11, 2026 13:56

@DominicOram DominicOram left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, I tidied up the mocks a bit more. Just the one comment now

Comment thread apps/i15-1/helm/values.yaml Outdated

- id: daq-queue
path: /api/daq-queue/
path: /api/blueapi/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Must: Is this right? I think we want the queue on different endpoints to blueapi? If not then we will need to change the endpoints in the code?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Discussed in person, this was just a typo, I will correct

@DominicOram DominicOram left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me. I think there's a few niggles but we should get this in now and iterate

@DominicOram
DominicOram merged commit acb50b2 into main Jun 12, 2026
2 checks passed
@DominicOram
DominicOram deleted the 1625-display-queue branch June 12, 2026 09:38
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.

Add vitest capability and tests to i15-1

5 participants