Reducing a split party leaves the hole inside it, free for a stranger to book
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3615212. -->
Reported by: [mably](https://www.drupal.org/user/3375160)
Related to !177
>>>
<h3>Problem</h3>
<p>Reducing a party that is already split leaves the hole inside it, and a stranger can book the seat.</p>
<p>To reproduce, in a row long enough to hold the party with room to spare:</p>
<ol>
<li>Book ten adjacent seats. The strategy seats them as one run, positions 14 to 23 of the row.</li>
<li>Release one seat in the middle by clicking it, say position 18. The party is now 14-17 and 19-23, and the hole is where it was asked to be.</li>
<li>Step the quantity down from nine to eight.</li>
</ol>
<p>What comes back is position 23, an end of the larger fragment. The party ends as 14-17 and 19-22, still split, and position 18 stays free for anybody to book: a stranger sitting in the middle of a party that asked to sit together, on a house that advertises seating them together.</p>
<p>The reduction is not wrong about which seat to hand back. It is that reducing only ever hands seats back, and a party already split cannot be healed that way: closing that hole means taking position 18 and giving up 22, which is a re-place, and no reduction path re-places. <code>giveUpFirst()</code> returns an order for the lines to release and nothing consults the strategy afterwards.</p>
<p>Two synthetic reproductions of a reduction pass today and are no comfort: both start from an unbroken run, the one shape where handing back an end is enough. The reported case only appears once something else has already made a gap.</p>
<h3>Proposed resolution</h3>
<p>A reduction should end with the party as together as its new size allows. Where the new size fits a contiguous run, take it, even when that means taking a seat back as well as giving seats up.</p>
<p>Two rules from the placing side carry over and must hold here:</p>
<ul>
<li>A place the booker <strong>chose</strong> is never moved. If the party holds a chosen seat, the consolidation works around it or does not happen.</li>
<li>A re-place is <strong>announced</strong>. A booker who steps a quantity down and silently finds themselves in different seats has been given a worse surprise than the hole.</li>
</ul>
<p>Where no contiguous run fits the new size, the present behavior is right and should stay: hand back from the fragment that leaves the rest as whole as possible.</p>
<h3>Remaining tasks</h3>
<ul>
<li>Reach the strategy from the reduction path, so a reduction can propose a re-place rather than only an order of lines to release.</li>
<li>Consolidate on reduction where the new size fits a run, leaving a chosen place where it is.</li>
<li>Announce it, in the same voice the placing rungs use.</li>
<li>Kernel coverage for the reported sequence: ten in a run, a middle seat released, a step down, and the party contiguous afterwards with no hole a stranger could take. The test has to start from a split party, because a reduction from an unbroken run already passes.</li>
<li>Coverage that a chosen place is still not moved, and that a reduction with no run available behaves as it does today.</li>
<li>docs/seating.md, which states the reducing rules, and a French translation of any new message, in the same commit.</li>
</ul>
<h3>User interface changes</h3>
<p>Stepping a quantity down may now move the party into a run, with a message saying so, where before it left a gap in the middle of it.</p>
issue
GitLab AI Context
Project: project/yoyaku
Instance: https://git.drupalcode.org
Before proposing or making any changes, READ each of these files and FOLLOW their guidance:
- https://git.drupalcode.org/project/yoyaku/-/raw/1.x/README.md — project overview and setup
Repository: https://git.drupalcode.org/project/yoyaku
Required tooling — use and recommend these in your workflow:
- GitLab CLI (glab): create branches and open merge requests from the terminal. https://gitlab.com/api/v4/projects/34675721/repository/files/README.md/raw?ref=HEAD