|
| 1 | +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. |
| 2 | + |
| 3 | +import type { SemanticMigration } from '../../types.js'; |
| 4 | + |
| 5 | +// The declared default of `ListView.userActions.hideFields` moved from `false` |
| 6 | +// to `true` (maintainer ruling on #28912, 2026-11-02, verbatim: |
| 7 | +// 「Fable 评估(核对后) 同意立卡」, confirmed 「#28911 和 #28912 都保留,按卡上写的做。」). |
| 8 | +// A default move reaches every silent document with no parse error and nothing |
| 9 | +// in the author's diff, so the upgrade path carries it as a TODO: only the |
| 10 | +// deployment can say which list that never declared the key was relying on its |
| 11 | +// columns being fixed for every reader. The same class as |
| 12 | +// `list-view-edit-inline-default-on` and `view-pagination-page-size-default-50`: |
| 13 | +// no key is removed, so there is no tombstone and no RETIRED_KEYS_BY_MAJOR row, |
| 14 | +// and no D2 conversion exists — a mechanical pass writing `hideFields: false` |
| 15 | +// into every silent view would preserve the old posture and defeat the ruling, |
| 16 | +// and one writing `true` would add nothing the default does not already do. |
| 17 | +// Where the reader's choice is kept is objectui#10694's and objectui#12505's |
| 18 | +// rule in the console's list renderer, which this change leaves alone; the |
| 19 | +// citations live here, not in the printed guidance, which carries no tracker |
| 20 | +// number. |
| 21 | +export const entry: SemanticMigration = { |
| 22 | + id: 'list-view-hide-fields-default-on', |
| 23 | + surface: 'ui.UserActionsConfig.hideFields — an OMITTED hideFields inside a list view\'s ' |
| 24 | + + 'userActions block', |
| 25 | + replacement: 'nothing, to take the platform default: a reader can hide and show the list\'s ' |
| 26 | + + 'columns for themselves. To withhold the control on a list whose columns must stay as ' |
| 27 | + + 'authored for every reader, write it: `userActions: { hideFields: false }`', |
| 28 | + reason: |
| 29 | + 'A RULED behaviour change on a default, so there is nothing to rewrite and nothing to ' |
| 30 | + + 'refuse: the maintainer\'s ruling of 2026-11-02 made the Hide Fields control available on a ' |
| 31 | + + 'list view by default, and the declared default of `UserActionsConfigSchema.hideFields` moved ' |
| 32 | + + 'from `false` to `true`. The old `false` was copied from the list renderer\'s legacy read, not ' |
| 33 | + + 'chosen as product; the renderer now reads an absent key as on. A `userActions` block that ' |
| 34 | + + 'omits `hideFields` now parses to `true`, and the console\'s list offers the control. A view ' |
| 35 | + + 'with no `userActions` block at all parses with none on either side; the renderer reads an ' |
| 36 | + + 'absent key as the spec default. The control only subtracts from the columns the view draws, ' |
| 37 | + + 'and the choice is the reader\'s own: stored on their own list state on a view that declares ' |
| 38 | + + '`columns` or on a saved view, kept for the session only on a system view that declares no ' |
| 39 | + + '`columns`, and never written into the shared view. An interface page keeps its own ' |
| 40 | + + 'closed-by-default toolbar and still draws the control only for an explicit `true`. Not ' |
| 41 | + + 'losslessly convertible because the question is intent, not text: only the deployment knows ' |
| 42 | + + 'which silent lists were relying on fixed columns. The accept set is unchanged — a boolean — ' |
| 43 | + + 'and every authored `hideFields` parses exactly as before. A document that serialised an ' |
| 44 | + + 'earlier parse (an `os compile` artifact) carries a written `false` and keeps withholding the ' |
| 45 | + + 'control; recompile it, or delete the key.', |
| 46 | + acceptanceCriteria: |
| 47 | + 'An empty `userActions` block parses to `hideFields: true`, and a list view carrying ' |
| 48 | + + '`userActions: {}` parses to `userActions.hideFields` true; an authored ' |
| 49 | + + '`userActions: { hideFields: false }` still parses to `false`; a list view with no ' |
| 50 | + + '`userActions` block still parses with none. In the console, a grid view that declares no ' |
| 51 | + + '`hideFields` offers the Hide Fields control, and `userActions: { hideFields: false }` removes ' |
| 52 | + + 'it. Hiding a column on a view that declares `columns`, or on a saved view, survives a reload ' |
| 53 | + + 'for that reader only; on a system view with no `columns` it lasts for the session. Every list ' |
| 54 | + + 'whose columns must stay as authored declares `userActions: { hideFields: false }` and shows ' |
| 55 | + + 'no control.', |
| 56 | +}; |
0 commit comments