Tables: a slow sort answer can land over a newer filter's, and Companies rows name a form that may not be on the page #648

Closed
opened 2026-10-01 20:05:17 +00:00 by tiagoagueda · 0 comments
Owner

Found on 2026-10-01 while reviewing #314, by holding one answer on the server and sending another from a second control. Both faults reproduce on b1dceaf79, before #314, so they are not caused by it.

1. A slow sort answer lands after a newer filter answer

Since #313 every live control of a table takes turns on the filter form (hx-sync), so a newer request replaces the one in flight. The sort links and the page links were left out on purpose: their address was written with the last answer, and letting one replace a newer request would put an old question back.

Left out, they can still arrive late:

  1. Click a sort arrow while its answer is slow.
  2. Type in a header filter before the answer comes back.
  3. The filter's answer is drawn first. The sort's answer then lands in the table that the first swap already replaced.

Seen: the address becomes ?sort=company, the table still shows the filtered rows, the Role, Company and Location boxes vanish from the headers, and focus falls to the body.

Where: the sort link at cotton/table/head.html:183-186; the page links have the same shape.

What a fix has to settle: a sort or a page link clicked first must give way to a later filter (it is the older question), and one clicked after a filter is in flight must not put the old address back. Two candidates are a drop or abort turn on the same form for these links, or building their request from the form's current state rather than from an address written earlier.

2. Companies with no industries: the rows name a form that is not on the page

On Companies, the rows' controls carry form="companies-bulk". When the account has no industries, no form with that id is drawn, so those controls belong to nothing.

Done when

  • A browser test holds a sort's answer, sends a filter, releases both, and finds the address, the table, the headers and the focus agreeing, on the three tables.
  • A test renders Companies with no industries and finds no control whose form attribute names a missing form.
Found on 2026-10-01 while reviewing #314, by holding one answer on the server and sending another from a second control. Both faults reproduce on `b1dceaf79`, before #314, so they are not caused by it. ## 1. A slow sort answer lands after a newer filter answer Since #313 every live control of a table takes turns on the filter form (`hx-sync`), so a newer request replaces the one in flight. The sort links and the page links were left out on purpose: their address was written with the last answer, and letting one replace a newer request would put an old question back. Left out, they can still arrive late: 1. Click a sort arrow while its answer is slow. 2. Type in a header filter before the answer comes back. 3. The filter's answer is drawn first. The sort's answer then lands in the table that the first swap already replaced. **Seen:** the address becomes `?sort=company`, the table still shows the filtered rows, the *Role*, *Company* and *Location* boxes vanish from the headers, and focus falls to the body. **Where:** the sort link at `cotton/table/head.html:183-186`; the page links have the same shape. **What a fix has to settle:** a sort or a page link clicked first must give way to a later filter (it is the older question), and one clicked after a filter is in flight must not put the old address back. Two candidates are a `drop` or `abort` turn on the same form for these links, or building their request from the form's current state rather than from an address written earlier. ## 2. Companies with no industries: the rows name a form that is not on the page On *Companies*, the rows' controls carry `form="companies-bulk"`. When the account has no industries, no form with that id is drawn, so those controls belong to nothing. ## Done when - A browser test holds a sort's answer, sends a filter, releases both, and finds the address, the table, the headers and the focus agreeing, on the three tables. - A test renders *Companies* with no industries and finds no control whose `form` attribute names a missing form.
tiagoagueda added this to the 0.5.0 milestone 2026-10-01 20:05:17 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Postulo/postulo#648
No description provided.