Skip to content

Commit cbdcaaf

Browse files
committed
Clarify cross_list wait flag documentation
Updates the drag helper comments to cover the truncated-list case, where a same-list drag also takes the frame-reload response path because the client omits the optimistic param.
1 parent 1f451cf commit cbdcaaf

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

modules/backlogs/spec/support/pages/backlog.rb

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,10 @@ def expect_no_filter_count(type)
560560
# A drag within one list is optimistic: the server answers 204 and no frame
561561
# reload happens, so the settle signal is the sortable-lists:moved event. A
562562
# cross-list drag still reloads the backlogs_container frame. Callers of
563-
# drag_work_package(before:) crossing lists must pass cross_list: true.
563+
# drag_work_package(before:) must pass cross_list: true whenever the move
564+
# takes the frame-reload response path: crossing lists, or staying within a
565+
# truncated list (the client omits the optimistic param there, so the
566+
# server streams a reload).
564567
def drag_work_package(moved, before: nil, into: nil, cross_list: into.present?)
565568
raise ArgumentError, "You must specify either before or into" unless before.present? ^ into.present?
566569

@@ -840,9 +843,11 @@ def wait_for_backlogs_turbo_stream(wait: Capybara.default_max_wait_time, frame_r
840843
end
841844
end
842845

843-
# A cross-list drag_work_package still reloads the backlogs_container frame;
844-
# a same-list one is optimistic (204, no reload) and only ever settles via
845-
# the sortable-lists:moved event.
846+
# cross_list: true waits for the backlogs_container frame reload — used for
847+
# genuine cross-list drags and for same-list drags in truncated lists, both
848+
# of which take the stream-reload response. A plain same-list drag is
849+
# optimistic (204, no reload) and only ever settles via the
850+
# sortable-lists:moved event.
846851
def wait_for_drag_work_package(cross_list:, &)
847852
if cross_list
848853
wait_for_backlogs_turbo_stream(frame_reload: true, &)

0 commit comments

Comments
 (0)