[COMMS-930] "Autocompleter" should not be an option for sorting work package tables - #24459
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes internal/non-user-facing sort options (notably the “Autocomplete”/typeahead sort) from the Work Package table “Sort by” dropdown by exposing a displayable flag through the API and filtering the UI accordingly, while also migrating persisted queries away from the deprecated typeahead sort criterion.
Changes:
- Expose
displayableon the API v3QuerySortByrepresenter (backed bycolumn.displayable?). - Filter automatic sort dropdown options in the WP table configuration modal to only show
displayablecolumns. - Add a migration (and specs) to replace persisted
typeaheadsort criteria withupdated_at desc.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
db/migrate/20260727111530_migrate_typeahead_sort_criteria_to_updated_at.rb |
Migrates persisted typeahead sort criteria to updated_at desc while preserving other criteria. |
lib/api/v3/queries/sort_bys/sort_by_decorator.rb |
Delegates displayable? from sort-by decorator to the underlying column. |
lib/api/v3/queries/sort_bys/query_sort_by_representer.rb |
Adds displayable attribute to the QuerySortBy API payload. |
frontend/src/app/features/hal/resources/query-sort-by-resource.ts |
Extends the HAL resource to include the displayable boolean property. |
frontend/src/app/features/work-packages/components/wp-table/configuration-modal/tabs/sort-by-tab.component.ts |
Uses displayable to filter non-displayable sort columns from the modal’s dropdown options. |
spec/lib/api/v3/queries/sort_bys/query_sort_by_representer_spec.rb |
Adds coverage for the new displayable attribute (true by default, false for typeahead). |
spec/features/work_packages/table/configuration_modal/sort_by_spec.rb |
Feature spec ensuring “Autocomplete” is not offered as a sort option in the modal. |
spec/migrations/migrate_typeahead_sort_criteria_to_updated_at_spec.rb |
Migration spec validating typeahead→updated_at desc behavior and de-duplication. |
…package tables https://community.openproject.org/wp/COMMS-930 This is a bug I found during work on "[COMMS-720] Rank exact identifier matches above fuzzy ones in work package searching and autocompleters" where I probably will add a new sort order which is also `displayable: false` and should not be rendered in the dropdown for sorting work package tables as well.
b8a3509 to
4df2c3b
Compare
|
Warning Flaky specs
🤖 Ask Copilot to investigateCopy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer. |
|
Caution The provided work package version does not match the core version Details:
Please make sure that:
|
This is a bug I found during work on "[COMMS-720] Rank exact identifier matches above fuzzy ones in work package searching and autocompleters" where I probably will add a new sort order which is also
displayable: falseand should not be rendered in the dropdown for sorting work package tables as well.Ticket
https://community.openproject.org/wp/COMMS-930
What are you trying to accomplish?
Remove the "Autocompleter" option from work packages table automated sort dropdowns, because it is just a "updated_at desc" under the hood and all other options in that dropdown refer to columns or attributes.
Screenshots
BEFORE

AFTER

(different query)
What approach did you choose and why?
Remove all that are
displayable: falsefrom the dropdown list (displayablemust therefore be exposed via the API). I decided against removing items withdisplayable: falsefrom the API entirely, since there might be places in the future where we want to include them and also the::Queries::WorkPackages::Selects::ManualSortingSelectwas necessary for that dialog as well even though it isdisplayable: false(it is not used in the dropdown though but for the radio buttons)Merge checklist