Skip to content

Commit bb6ae86

Browse files
committed
wip: list layout tests rewritten; os migrate list-preferences boots identity objects
Claude-Session: https://claude.ai/code/session_01L6bhgUkr3W7rNEqPk3J858 Co-authored-by: Claude <noreply@anthropic.com>
1 parent e347607 commit bb6ae86

27 files changed

Lines changed: 705 additions & 821 deletions
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
'@object-ui/data-objectstack': patch
4+
'@object-ui/react': patch
5+
'@objectstack/platform-objects': patch
6+
---
7+
8+
feat(console): a list's column widths, row height and tab order are kept in this browser only
9+
10+
Clause-②: no
11+
Metadata-protocol: none
12+
13+
On a Console object list, the column widths a reader drags, the row height they pick and the order they give the view tabs are now kept in their own browser only, per signed-in user and object (localStorage `list-layout:<user id>:<object>`). Nothing is sent to the server: the Console no longer reads or writes the per-user list preference row `sys_user_preference` `ui.list.<object>`, and its boot read of the reader's preferences no longer asks for that key family. A list opens at once, without waiting for that read.
14+
15+
- Another browser or device opens the list on its view's own widths, row height and tab order until the reader changes them there.
16+
- Signing out clears these entries with the rest of this browser's Console state, as before.
17+
- With nobody signed in, nothing is kept.
18+
- The record page's "show empty fields" choice (`ui.record.<object>`) is unchanged and still follows the reader.
19+
20+
Upgrade note: what an earlier Console kept for a reader's lists is not carried over. The `ui.list.<object>` rows are no longer read, so every reader's lists open on their views' own widths, row height and tab order until they change them again. This browser's old copies (`list-state:*`, `list-filters:*` and `viewOrder:*` in localStorage) are removed on the first list the Console opens. The server rows stay where they are, unread; leaving them does no harm.
21+
22+
`@object-ui/data-objectstack`, `@object-ui/react` and `@objectstack/platform-objects` change only comments and a README example that named the retired key. No metadata key, value or default changes.

‎content/docs/deployment/cli.mdx‎

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1541,6 +1541,7 @@ where the data lives.
15411541
| `os migrate record-currency-codes` | Write the currency code you give into the rows of a record-mode currency field that hold an amount and no code, the rows stored before the field was switched to `currencyMode: 'record'`. The code is never derived. No flag; idempotent. See [below](#os-migrate-record-currency-codes) |
15421542
| `os migrate recompute-home-amounts` | Recompute the home-currency amounts a record-mode currency field stores, at the exchange rates in force now, after a rate is corrected or added. Reports the rows that change and lists, without writing, the rows it cannot convert. No flag; idempotent. See [below](#os-migrate-recompute-home-amounts) |
15431543
| `os migrate comment-reactions` | Carry the emoji reactions a 17.x deployment stored in the retired `sys_comment.reactions` column into `sys_comment_reaction` records, list every stored value that does not read, and record the verified run that lets `os migrate apply --allow-destructive` drop the column |
1544+
| `os migrate list-preferences` | Remove the per-user list preference rows (`sys_user_preference` keys starting with `ui.list.`) that the Console no longer reads. Dry run by default; `--apply` deletes only with `--export`, which writes every row it deletes to a file first. No flag. See [below](#os-migrate-list-preferences) |
15441545
| `os migrate organization-ownership` | The v18 ownership ceremony (ADR-0131 D10): write a plan of what each table's rows will become, then `--apply` that reviewed plan. It upgrades a database 17.x or an 18.0 pre-release (`18.0.0-next.*`) created; a v18 server refuses to start on one until it has run. See [below](#os-migrate-organization-ownership) |
15451546
| `os migrate activity-changed-fields` | Stamp the two read-rule columns (`changed_fields`, `milestone_key`) on the `sys_activity` rows written before they existed. Until it runs, those rows are withheld from every reader but the system, so run it at once after upgrading. No flag; idempotent |
15461547
| `os migrate audit-mail-bodies` | Mask the mail bodies (`body_text`, `body_html`) that `sys_audit_log` and `sys_activity` copies of `sys_email` / `sys_identity_email` rows still hold in clear, written before the audit writer masked them. Covers the `archive` datasource `sys_audit_log` archives to as well. Reports counts only. No flag; idempotent. See [below](#os-migrate-audit-mail-bodies) |
@@ -1565,7 +1566,7 @@ A read-only data command does not read a table it found missing, since that tabl
15651566
holds nothing, and answers with empty work and exit 0. `os migrate value-shapes` is
15661567
clean over zero records and names the objects it did not read. `os migrate
15671568
recorded-by` has nothing to convert and `os migrate resume` no interrupted runs.
1568-
`os migrate meta --stored` has no stored metadata to examine, `os migrate
1569+
`os migrate meta --stored` has no stored metadata to examine, `os migrate list-preferences` no preference row to report, `os migrate
15691570
audit-metadata-bodies`, `os migrate audit-mail-bodies`, `os migrate audit-key-material` and `os migrate audit-side-copies` no audit copy to rewrite, and
15701571
`os migrate account-issuer` no account to collide. `os secret orphans`, `os secret rewrap` and `os storage orphans`
15711572
report no secret and no file. A read the command cannot avoid and that fails for any
@@ -2063,6 +2064,41 @@ A run that lists an unreadable value or fails a write exits `1`, and so does an
20632064
A database created on v18 never had the column: the run finds nothing, and
20642065
there is no drop to wait for.
20652066
2067+
#### `os migrate list-preferences`
2068+
2069+
The Console used to keep one `sys_user_preference` row per user and object, keyed
2070+
`ui.list.<object>`, holding that user's state for the object's lists: the order of
2071+
the view tabs and, per view, a sort, filters, a column layout, a row height and
2072+
hidden or added columns. It keeps none of that on the server any more. A change a
2073+
reader makes on a list is a draft that they save into a view or discard, and the
2074+
column widths, the row height and the tab order are kept in the reader's own
2075+
browser. Nothing reads the old rows, so leaving them does no harm. This command
2076+
removes them. What they held is not carried over: every list opens on its view's
2077+
own layout until the reader changes it again.
2078+
2079+
```bash
2080+
os migrate list-preferences # Dry run: how many rows, for how many users and which objects
2081+
os migrate list-preferences --apply --export ./list-preferences-backup.json
2082+
os migrate list-preferences --apply --export ./list-preferences-backup.json --yes --json # CI / scripts
2083+
```
2084+
2085+
**Options:**
2086+
- `--apply` — delete the listed rows (default off: a read-only dry run that writes nothing)
2087+
- `--export <path>` — **mandatory with `--apply`**: every row the run deletes, as stored, written
2088+
owner-only and read back before the first delete; refuses to overwrite an existing file
2089+
- `-y, --yes` — skip the confirmation prompt
2090+
- `--force` — apply even when another process is using the SQLite file
2091+
- `--database-url <url>`, `--json`
2092+
2093+
Only keys that start with `ui.list.` are touched. Every other preference row,
2094+
`ui.record.<object>` included, stays as it is. The rows are deleted by id, the ones
2095+
the export holds and no others, and none of them enters the recycle bin. The run then
2096+
reads the prefix again. If a row remains, or was written since by a Console that has
2097+
not been upgraded, it is reported and the run exits `1`; run it again once every
2098+
Console is upgraded. A run that finds nothing writes no export and exits `0`. It is
2099+
never run for you: nothing on any boot, upgrade, migrate or lifecycle path invokes it,
2100+
and it records no `sys_migration` verdict, because nothing waits for one.
2101+
20662102
#### `os migrate activity-changed-fields`
20672103
20682104
An activity row is served to a reader only when the platform can judge it for

‎content/docs/ui/views.mdx‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -634,12 +634,11 @@ whose menu also holds Discard on a narrow list or a phone).
634634
- The draft survives opening a record and coming back. Opening another view or object,
635635
or reloading the list's page, drops it, so that reload opens the view as it is declared.
636636
- Column widths, the row height (density) and the views' order are not a draft: they are
637-
remembered in this browser only, per user and object (localStorage
638-
`list-layout:<user>:<object>`). Nothing is sent to the server, another browser or device
637+
remembered in this browser only, per signed-in user and object (localStorage
638+
`list-layout:<user id>:<object>`). Nothing is sent to the server, another browser or device
639639
opens the view's own layout, and signing out clears them with the rest of this browser's
640640
Console state. Earlier Consoles kept them, with a stored sort and filters, in the user's
641-
`sys_user_preference` row `ui.list.<object>`; nothing reads that row now, and
642-
`os migrate list-preferences` removes such rows.
641+
`sys_user_preference` row `ui.list.<object>`; nothing reads that row now.
643642
- A link carrying list state (`uf_*` parameters) applies it as a draft, whether it opens in a
644643
new tab or in-app (an AI answer's list link, after a reload of the chat page too).
645644
- When a session ends, the sign-in page's return link keeps the list's path but never its

‎content/docs/upgrading.mdx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,8 @@ the protocol-18 step, which `os migrate meta --from 17` lists for your sources
493493

494494
**Upgrading from 18.5.0 or earlier:** the first [`os migrate plan`](/docs/deployment/cli#schema-migrations) after the move lists a safe `create_index` for each `(created_at, id)` and `(owner_id)` index schema sync now builds without a declaration, and on SQLite a `normalize_boolean_storage` step for boolean cells stored as text; the next sync or `os migrate apply` builds them, and neither is destructive. Where an app declares `lifecycle.seal`, an `os migrate audit-* --apply` run on SQLite or Turso now needs every sealing server stopped and `--sealer-stopped` ([18.6.0 checklist](/docs/releases/v18/18-6#upgrade-checklist)).
495495

496+
**Upgrading from 18.6.0 or earlier:** the Console no longer reads the per-user list preference rows (`sys_user_preference` keys `ui.list.<object>`). A reader's column widths, row height and view tab order are kept in their own browser from now on, so each list opens on its view's own layout until the reader changes it again. To clear the old rows, run [`os migrate list-preferences`](/docs/deployment/cli#os-migrate-list-preferences) once all your Consoles are upgraded, a dry run first and then `--apply --export <file>`. Leaving them does no harm: nothing reads them.
497+
496498
The v17 and v18 lines are broken out per release. Each v17 minor shipped
497499
breaking changes under the repo's launch-window convention — which ships a
498500
breaking change as `minor` rather than `major`, so the version number is not the

0 commit comments

Comments
 (0)