UI issue: "Stop pipeline" dynamically targeting the newest pipeline

Summary

The "Stop pipeline" dialog will always target the newest pipeline, disregarding which pipeline it was invoked on.
That defeats the purpose of having a "cancel" button next to the pipeline.

Steps to reproduce

  1. Start a pipeline
  2. In the projects pipelines view, click the "Cancel the running pipeline" button, keep the dialog open
  3. Start a new pipeline

Example Project

In my example I used the /projects/:id/pipeline API endpoint to create pipelines.

https://gitlab.com/customer-issue-reproduction/zd-542590

What is the current bug behavior?

The "Stop pipeline?" will change the target to the newest pipeline.

What is the expected correct behavior?

The "Stop pipeline?" should target the pipeline on which the "Cancel the running pipeline" button was clicked.

Relevant logs and/or screenshots

Screen_Recording_2024-08-08_at_21.03.35

Output of checks

This bug happens on GitLab.com