New Action List Sort
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3352398. -->
Reported by: [danielspeicher](https://www.drupal.org/user/3621778)
Related to !484
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>Users can currently add, remove, count, and compare lists, however they cannot sort them.</p>
<h3>Proposed resolution</h3>
<p>As a first, simple approach, there are a number of common use cases for sorting:</p>
<ul>
<li>Ascending by value</li>
<li>Descending by value</li>
<li>Ascending by key</li>
<li>Descending by key</li>
<li>"Natural" order</li>
<li>"Natural" order (case insensitive)</li>
</ul>
<p>While ascending and descending order are highly desirable for performance purposes, natural orders may be more appropriate for end-user facing lists. I believe that this approach and new issue summary reflects the original intent of this feature request.</p>
<h3>API changes</h3>
<p>A new Action plugin is required. This action plugin should have a couple of configuration options:</p>
<ol>
<li>Sort method - this determines how the list will be sorted (see proposed resolution).</li>
<li>Name of token - if provided, the list will be sorted and saved in the provided token. If not provided, the list will be sorted "in place" (that is, within the input token).</li>
</ol>
issue