### Apache Airflow version

main (development)

### What happened

Currently when a new task is added to a dag and in the grid view, a user selects the top level of a dag run and then clicks on "Queue up new tasks", the list returned by the confirmation box is always empty. 

It appears that where the list of tasks is expected to be set, [here](https://github.com/apache/airflow/blob/ada91b686508218752fee176d29d63334364a7f2/airflow/api/common/mark_tasks.py#L516), `res` will always be an empty list. 


### What you think should happen instead

The UI should return a list of tasks that will be queued up once the confirmation button is pressed. 

### How to reproduce

Create a dag, trigger the dag, allow it to complete. 

Add a new task to the dag, click on "Queue up new tasks", the list will be empty.

### Operating System

n/a

### Versions of Apache Airflow Providers

2.3.3 and upwards including main. I've not looked at earlier releases. 

### Deployment

Other 3rd-party Helm chart

### Deployment details

_No response_

### Anything else

I have a PR prepared for this issue. 

### Are you willing to submit PR?

- [X] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)

"""
    Return a dict of the task quantity, grouped by dag id and task status.
    :param qry: The data in the format (<dag id>, <task state>, <is dag running>, <task count>),
        ordered by <dag id> and <is dag running>
    """
    data = {}
    last_dag_id = None
    has_running_dags = False
    for dag_id, state, is_dag_running, count in qry:
        if last_dag_id != dag_id:
            last_dag_id = dag_id
            has_running_dags = False
        elif not is_dag_running and has_running_dags:
            continue
        if is_dag_running:
            has_running_dags = True
        if dag_id not in data:
            data[dag_id] = {}
        data[dag_id][state] = count
    return data
def redirect_or_json(origin, msg, status="", status_code=200):