Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .changeset/list-sort-field-fallback-and-reset-4243.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'@object-ui/plugin-list': patch
'@object-ui/i18n': patch
---

List sort: the picker stops borrowing the filter whitelist, and a header click is no longer a one-way door out of the view's declared sort

`filterableFields` was applied to the single field set both toolbar builders read, so a whitelist authored for *filtering* silently became the *sort* whitelist too. A view could declare a two-level default sort — `plan_start_date` then `name` — and get a sort panel that offered neither field and rendered both of its rows blank: the declared sort worked on load and could then be neither reproduced nor modified, and there was no way to express "sortable but not offered as a filter condition" short of widening the filter builder as collateral. The whitelist now narrows the filter builder alone, which is the contract it was written for; the sort picker starts from every field the view can name and applies its own sortability rules.

Those rules are about what the sort can honestly reach, so a second one joins the existing relational exclusion: a `formula` field is withheld. It has no materialised column, so ordering by one is refused by the server outright (objectstack `UNMATERIALIZED_SORT_TYPES`) — and it matters here precisely because the base set widened, since a formula field previously reached the picker only if someone had whitelisted it. The exclusion is `formula` alone and deliberately not the spec's `COMPUTED_VALUE_TYPES`: `summary` and `autonumber` are computed too, each gets a real maintained column, and both order correctly. Either rule keeps its existing escape hatch — a field the current sort already uses stays listed, which for a formula field is the only way to remove the offending row.

One consequence worth naming: the hint explaining the relational omission used to be gated by the same whitelist. A view whitelisting only `status` showed a near-empty sort picker and no word about why; the withheld relational field now reaches the rule that withholds it, so the explanation appears with it.

The second half is the way back. One column-header click replaces the whole sort array, so a view shipping a multi-level default lost it for the rest of the session — the declared `sort` behaved as an initial value only, recoverable just by reloading the page. The sort panel gains a **Reset to view default** control that restores the declared array whole: multi-level, in declared order, not merely cleared. It reads the view's declared sort through the same resolver the initial render already uses, so there is one answer to "what did this view declare". It is disabled while the active sort already matches that default, and absent entirely for a view that declares no sort — there is no default to return to, and clearing the sort under that label would be a second, differently-named way to do what removing the rows already does. The header click's own semantics are unchanged: it still replaces the array, it just no longer does so irreversibly.
1 change: 1 addition & 0 deletions packages/i18n/src/locales/ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ const ar = {
sortByIdSuffix: "(حسب المعرّف)",
sortRelationalHint:
"الأعمدة التي تشير إلى سجل آخر غير مدرجة هنا: يمكن ترتيبها حسب المعرّف المخزَّن فقط، وليس حسب الاسم الظاهر في الخلية. للترتيب حسب ذلك الاسم، أضف حقل صيغة يحتوي عليه.",
resetSortToDefault: "إعادة التعيين إلى الترتيب الافتراضي للعرض",
group: "تجميع",
groupBy: "تجميع حسب",
export: "تصدير",
Expand Down
1 change: 1 addition & 0 deletions packages/i18n/src/locales/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ const de = {
sortByIdSuffix: "(nach ID)",
sortRelationalHint:
"Spalten, die auf einen anderen Datensatz verweisen, werden nicht aufgeführt: Sie lassen sich nur nach der gespeicherten ID sortieren, nicht nach dem in der Zelle angezeigten Namen. Fügen Sie ein Formelfeld mit diesem Namen hinzu, um danach zu sortieren.",
resetSortToDefault: "Auf Standard der Ansicht zurücksetzen",
group: "Gruppieren",
groupBy: "Gruppieren nach",
export: "Exportieren",
Expand Down
1 change: 1 addition & 0 deletions packages/i18n/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@ const en = {
sortByIdSuffix: '(by ID)',
sortRelationalHint:
'Columns that link to another record are not listed: they can only be sorted by the stored ID, not by the name shown in the cell. To sort by that name, add a formula field holding it.',
resetSortToDefault: 'Reset to view default',
group: 'Group',
groupBy: 'Group By',
export: 'Export',
Expand Down
1 change: 1 addition & 0 deletions packages/i18n/src/locales/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ const es = {
sortByIdSuffix: "(por ID)",
sortRelationalHint:
"Las columnas que apuntan a otro registro no aparecen aquí: solo pueden ordenarse por el ID almacenado, no por el nombre que se muestra en la celda. Para ordenar por ese nombre, añada un campo de fórmula que lo contenga.",
resetSortToDefault: "Restablecer al valor predeterminado de la vista",
group: "Agrupar",
groupBy: "Agrupar por",
export: "Exportar",
Expand Down
1 change: 1 addition & 0 deletions packages/i18n/src/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ const fr = {
sortByIdSuffix: "(par ID)",
sortRelationalHint:
"Les colonnes qui pointent vers un autre enregistrement ne sont pas listées : elles ne peuvent être triées que par l'ID stocké, et non par le nom affiché dans la cellule. Pour trier par ce nom, ajoutez un champ de formule qui le contient.",
resetSortToDefault: "Réinitialiser au tri par défaut de la vue",
group: "Grouper",
groupBy: "Grouper par",
export: "Exporter",
Expand Down
1 change: 1 addition & 0 deletions packages/i18n/src/locales/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ const ja = {
sortByIdSuffix: "(ID順)",
sortRelationalHint:
"他のレコードを参照する列は表示されていません。保存されている ID でしか並べ替えられず、セルに表示される名称では並べ替えできません。その名称で並べ替えるには、名称を保持する数式項目を追加してください。",
resetSortToDefault: "ビューの既定の並び順に戻す",
group: "グループ",
groupBy: "グループ化",
export: "エクスポート",
Expand Down
1 change: 1 addition & 0 deletions packages/i18n/src/locales/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ const ko = {
sortByIdSuffix: "(ID 기준)",
sortRelationalHint:
"다른 레코드를 참조하는 열은 목록에 없습니다. 저장된 ID로만 정렬할 수 있고 셀에 표시되는 이름으로는 정렬할 수 없습니다. 그 이름으로 정렬하려면 이름을 담는 수식 필드를 추가하세요.",
resetSortToDefault: "뷰 기본 정렬로 재설정",
group: "그룹",
groupBy: "그룹 기준",
export: "내보내기",
Expand Down
1 change: 1 addition & 0 deletions packages/i18n/src/locales/pt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ const pt = {
sortByIdSuffix: "(por ID)",
sortRelationalHint:
"As colunas que apontam para outro registro não são listadas: elas só podem ser ordenadas pelo ID armazenado, não pelo nome exibido na célula. Para ordenar por esse nome, adicione um campo de fórmula que o contenha.",
resetSortToDefault: "Restaurar o padrão da exibição",
group: "Agrupar",
groupBy: "Agrupar por",
export: "Exportar",
Expand Down
1 change: 1 addition & 0 deletions packages/i18n/src/locales/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,7 @@ const ru = {
sortByIdSuffix: "(по ID)",
sortRelationalHint:
"Столбцы, ссылающиеся на другую запись, здесь не показаны: их можно сортировать только по сохранённому ID, а не по имени, которое видно в ячейке. Чтобы сортировать по этому имени, добавьте поле-формулу с ним.",
resetSortToDefault: "Сбросить к сортировке представления",
group: "Группировка",
groupBy: "Группировать по",
export: "Экспорт",
Expand Down
1 change: 1 addition & 0 deletions packages/i18n/src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ const zh = {
sortByIdSuffix: '(按 ID)',
sortRelationalHint:
'指向其他记录的列未列出:它们只能按存储的 ID 排序,而不是单元格中显示的名称。若要按该名称排序,请添加一个存放该名称的公式字段。',
resetSortToDefault: '恢复视图默认排序',
group: '分组',
groupBy: '分组依据',
export: '导出',
Expand Down
Loading
Loading