Skip to content

Commit 6f2f457

Browse files
committed
Merge origin/main into the #36903 rework (#37168's object designer beside the flow designer; the designer-item history exemption goes with the last pillar type)
Claude-Session: https://claude.ai/code/session_01QSeKYnHH41MS5hWVGPia4F Co-authored-by: Claude <noreply@anthropic.com>
2 parents d3e3057 + 9171bed commit 6f2f457

195 files changed

Lines changed: 4967 additions & 3588 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
---
4+
5+
fix(app-shell): on a phone, a long page on the bottom bar's home or approvals page scrolls its last row out from under the bar
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
While the phone's bottom bar is drawn, the console inset keeps the bar's height as end padding. A scroll container's end padding only follows its in-flow content, and the route slot was a fixed `h-full` box: a page taller than the inset (the phone app home with a long menu, a long approvals inbox) overflowed the slot, the scroll ended at the page's own bottom, and its last rows stayed under the bar. On the bar's home and approvals pages the route slot now grows with its page, never shorter than the inset, so scrolling to the end brings the last row above the bar and the safe area. A short page or an empty state still fills the inset as before. The inbox list, an object list that bounds itself and scrolls its rows in its own box, keeps the fixed slot, and so does every route without the bar and every route from 768 px up.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
---
4+
5+
feat(studio): an object opens its designer full-screen, on its own address
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
Studio redesign (epic #36890), the object designer's card (#36904); it also delivers #36513's tab order.
11+
12+
- **One object, one page.** Opening an object in Studio opens its designer full-screen beside the left menu, with its own address you can bookmark or share. × goes back to the object list with its filter and sort as you left them, ‹ › open the previous and next object in that list, and Esc closes. The designer no longer has its own column of objects or its own 「新建」 button: you pick another object from the list, and you create one with the object list's 「新建」, which keeps the organization-wide default sharing choice, the option to add the object to the app's menu, and, on a read-only package, the save into its customization package. If the identifier you pick is already used by an object in that package, the dialog says so and offers to open it.
13+
- **Tabs in a fixed order.** Records, Field layout, Validations, Actions, Settings, Hooks, API; when the page is narrow, Hooks and API fold into "Advanced" first, then Validations, Actions and Settings. References, History (with the audit log) and Source (with the layer comparison) are now tabs after them, in place of the five header icons. The tab you are on is part of the page's address, so refreshing, sharing the link or moving to the next object keeps it.
14+
- **Old links still work.** A bookmark or link to an object in Studio's old Data screen opens that object's designer; a link to the Data screen itself opens the package's object list, and the review link for unpublished changes still opens that review. The app's 「对象设置」, the record page's 「配置页面」, the command palette, links in AI replies and the link to a switched-off action all open the new page.
15+
- **Fixed on the way:** when discarding the AI's unpublished changes partly fails, the message saying which items could not be discarded now stays on the page instead of disappearing at once. A link to an object that does not exist (a deleted object's bookmark, a mistyped link) now says the object was not found, instead of offering it as a new object to design.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/service-knowledge': patch
4+
'@objectstack/knowledge-memory': patch
5+
---
6+
7+
feat(service-knowledge): adapters list their documents; a complete reindex skips unchanged documents and purges the ones its source no longer has; one adapter contract test suite
8+
9+
Clause-②: yes
10+
Metadata-protocol: added
11+
Skills-docs: none — no skill under `skills/**` teaches `KnowledgeDocument`, the adapter contract or reindex; `skills/objectstack-ai/SKILL.md` teaches `KnowledgeSource` authoring only, which this change does not touch. `content/docs/protocol/knowledge.mdx` gains the members, the skip and the purge in this change.
12+
13+
Knowledge adapters can now list the documents they hold, and a full reindex uses that list to skip unchanged documents and to remove documents whose record is gone.
14+
15+
New, all optional, in `@objectstack/spec`:
16+
17+
- `IKnowledgeAdapter.listDocuments?(ctx, { cursor?, limit })` returns `{ documents, nextCursor? }`, each entry `{ documentId, docHash? }`: the documents the adapter holds for a source, one page at a time. New exported types in `@objectstack/spec/contracts`: `AdapterListDocumentsOptions`, `AdapterListedDocument`, `AdapterListDocumentsPage`.
18+
- `KnowledgeDocument.docHash?`: a hash of the document's content, title and metadata, prefixed `v1:`. The knowledge service sets it on every document it hands an adapter; the adapter stores it and returns it unchanged. `indexDocument` refuses a document that already carries a `docHash` (it throws, naming the field).
19+
- `KnowledgeReindexResult.skipped?` and `purged?`.
20+
21+
`KnowledgeService.reindexSource` for an `object` source, when the source's adapter implements `listDocuments`:
22+
23+
- does not send a document to the adapter again when its hash is unchanged, and counts it in `skipped`;
24+
- after a full run (no `limit`, no `dryRun`, every page read), deletes each listed document whose record no longer exists or no longer matches the source's `where`. Before each deletion it reads the record again; a record that exists at that moment keeps its document. A deletion never overlaps a sync of the same record. `purged` counts the deletions. Known limit: on driver-mongodb and driver-memory, a record stored under a caller-supplied numeric id is not found by that re-read, so if it was restored during the run its document is deleted until the record's next change or the next full reindex.
25+
26+
`purged` is `null` when nothing was deleted because no removal ran: the adapter has no `listDocuments`, the run had a `limit` or `dryRun`, a page failed or answered no list of rows, the source sets `refresh.onRecordChange: false`, or the adapter's listing failed (the `message` says why). If a re-read or a deletion fails, the result is `ok: false` and `purged` counts the deletions made before it.
27+
28+
The record sync (on record create, update and restore) now leaves a document in place and logs a warning when the data engine answers its re-read with something other than a list of rows; it used to delete the document.
29+
30+
`@objectstack/service-knowledge/testing` (new, test-only, ESM only; it imports `vitest`) exports `runKnowledgeAdapterContract({ name, makeAdapter, implements: { listDocuments } })`, a test suite any adapter package runs with its own factory: upsert, search and delete; `listDocuments` paging and `docHash` round-trips; and the skip and the removal through a real `KnowledgeService`. `@objectstack/knowledge-memory` implements `listDocuments` and runs the suite.
31+
32+
What to do: nothing. An adapter without `listDocuments` keeps working; its reindex sends every document, as before, and reports `purged: null`. An adapter package adds `listDocuments` (storing `docHash` as given) to get the skip and the removal, and runs the suite from `@objectstack/service-knowledge/testing` with its own factory. A caller of `indexDocument` stops setting `docHash`.

‎.changeset/37150-docs-pages-in-app-shell.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ From 768 px up every app page lost the top bar and keeps the app menu, search, n
1313

1414
The documentation still has one navigation, its own: the sidebar's body carries the docs column (「← Back to APP」, every book of the app with the current one open, a title filter and 「All documentation」) in place of the app's menu. The reader no longer draws that column inside the page there. The app's other docs pages (its docs index, a book with no articles, a book or doc that is not found) carry the same column in the sidebar instead of a back link above the page.
1515

16-
Unchanged: every docs address resolves to the same page as before, and a phone keeps its app bar, no sidebar and the in-page column. The `/docs` portal is not changed by this release. Nothing to migrate.
16+
Unchanged: every docs address resolves to the same page as before, and a phone keeps its app bar, no sidebar and the in-page column. The `/docs` portal draws in the same frame from 768 px up too, in a variant that belongs to no app (its own entry describes it). Nothing to migrate.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
'@object-ui/console': patch
4+
'@objectstack/console': patch
5+
---
6+
7+
feat(console): the documentation portal draws in the app shell's frame from 768 px up, belonging to no app
8+
9+
Clause-②: no
10+
Metadata-protocol: none
11+
12+
The documentation portal (`/docs`, a book, an article) was the one documentation page that still drew a top bar on a desktop, in a frame of its own, while an app's documentation pages draw in the app shell. From 768 px up the portal now draws in the same frame, in a variant that belongs to no app: no top bar; the sidebar with search (when there is an app to search) and notifications in its head and the account at its foot; standing notices (impersonation, usage, storage, a lost connection) at the top of the page's content, beside the sidebar rather than over it; the page header's assistant and help buttons at the top right. Where an app's name sits in its sidebar, the portal's sidebar shows a neutral 「Documentation」 heading; it opens the list of your apps (none marked current) and 「Add app」, and choosing an app opens it. The sidebar's body is the documentation tree: 「All documentation」 first, a title filter, then every book under the heading of the app that carries it, as the portal's index groups them, with the book being read open. Books are named as the index names them, so a platform app's book reads as the app does (for example 「系统设置」) instead of its package's short name.
13+
14+
Opening the portal does not pick an app: no app's colours are applied, and the app you last used, and the one you had open, stay what they were.
15+
16+
「All documentation」 is now also the first documentation row of an app's documentation sidebar, right under 「← Back to APP」 and above the title filter and the books, so the two documentation sidebars match.
17+
18+
Unchanged: every documentation address resolves to the same page as before, and a phone keeps the portal's documentation bar and the in-page column, with 「All documentation」 at its foot. Nothing to migrate.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
'@objectstack/spec': patch
3+
'@objectstack/metadata-protocol': patch
4+
---
5+
6+
fix(spec)!: a query `where` of the wrong kind is refused with one `fields[]` entry that names the shapes it takes, not one bare "Invalid input" per union member
7+
8+
Clause-②: no (narrowing)
9+
Metadata-protocol: none
10+
Skills-docs: none (no skills/ page names the `query.where` refusal, its `Invalid input` entries, or reads `fields[]` / `issues[]` by position or count)
11+
12+
What narrows: the union-branch selection that every refusal list shares now reads a member that is itself a union, failing only because the value is the wrong kind for every one of its own members, as the kind mismatch it is. Such a member is no longer selected, so it no longer adds its own unexplained `invalid_shape` / `Invalid input` entry. The rule lives in `@objectstack/spec`'s branch-selection policy, so the data API's `fields[]` (`zodIssuesToFields`) and the terminal renderer (`formatZodError`) both take it, and `@objectstack/metadata-protocol`'s copy takes the same rule, pinned equal by the cross-package parity test. That copy (`zodIssuesToMetadataIssues`) feeds four lists: the `issues[]` of a refused metadata save (`422 INVALID_METADATA`), a stored item's `_diagnostics.errors`, the seed-request refusal's `issues`, and the unmanaged-import `400`. A nested union declared with its own `error` sentence is still selected, because that sentence is a prescription.
13+
14+
Such a member was one issue long, so under "fewest issues wins" it could out-rank a sibling member with several located causes. That sibling is now the one selected, so in that case a list gains its located entries where one bare entry stood.
15+
16+
The query door's `where` (and its `$filter` / `filter` / `filters` spellings) is such a union of unions: a filter array or a filter object. A number, a string or a boolean on any of those spellings, and `null` on `where` (the other three accept `null` as no filter), now carries one sentence naming both accepted shapes, a condition object such as `{ "status": "open" }` or a filter array such as `["status", "=", "open"]`. An array or an object still answers its located causes.
17+
18+
<!-- adr-0087: not-required (no-migration-prescription) No schema key, accepted value or metadata type is added, removed or renamed, and nothing stored is rewritten: what moves is which entries a refusal's fields and issues lists carry, and the message of one of them, computed afresh on every refused request and every diagnostics read. The accept set is unchanged. The one reading instruction is in the body: read entries by field (or path) and code, never by index or count. -->
19+
20+
**BREAKING** for a client that counts a refused request's `fields[]` entries, reads them by position, or matches the bare `Invalid input` text on the `query.where` entry; for a reader that counts or reads by position a refused metadata save's `issues[]`, a stored item's `_diagnostics.errors`, the seed-request refusal's `issues` or the unmanaged-import refusal; and for anything that counts the terminal renderer's lines for such a refusal. The dropped entries named only the slot, once per union member, and said nothing about what to send. Read entries by `field` (or `path`) and `code`.
21+
22+
The FROM lines below are what the released packages answer. The data API's explained-head drop (`fields-bare-union-head`, the same producer) ships in the same release, and accounts for part of the difference: it removes the explained union heads, and this change removes the unexplained per-member ones.
23+
24+
For `POST /api/v1/data/:object/query` with `{ "where": 42 }` (a string or a boolean alike, and `null` on `where`):
25+
26+
- FROM: `fields` was three identical entries, each `{ field: 'query.where', code: 'invalid_shape', message: 'Invalid input' }`.
27+
- TO: `fields` is `[{ field: 'query.where', code: 'invalid_shape', message: 'A filter is a condition object, such as { "status": "open" } … or a filter array, such as ["status", "=", "open"] …' }]`.
28+
29+
For `{ "where": [["status", "=", "open"], "and"] }`:
30+
31+
- FROM: `fields` held five entries, four of them a bare `invalid_shape` / `Invalid input`, and the one located cause, `min_items` at `query.where`.
32+
- TO: `fields` holds `min_items` at `query.where` and the bare `invalid_shape` at `query.where.1`, the element that is not a filter.
33+
34+
The fix for a caller that matched the bare text on `query.where`: match `field: 'query.where'` with `code: 'invalid_shape'`, whatever the message.
35+
36+
The four metadata lists move the same way, only where the schema has such a nested union of kinds: one `invalid_union` entry for the slot instead of one per member, or the located causes of the sibling member that now out-ranks it.

‎content/docs/frontend/app-shell.mdx‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,12 @@ of its own to it, in particular **no sidebar toggle**. If you want one, render i
7575
Pass `showHeader={false}` to draw no header at all, for a page that draws its own top bar:
7676
the shell then renders no `<header>` element and does not mount `navbar`. It defaults to
7777
`true`, and leaving `navbar` out alone still draws the (empty) bar. The Console draws the
78-
app bar only on a phone (below 768 px) and on an app's docs pages, which mount no sidebar.
79-
From 768 px up an app page starts at the window's top: the sidebar's head carries the app
80-
menu, search and the notification bell, its foot the account menu, the content area the
81-
standing banners, and the page header its own buttons (objectstack#36112). On a phone a
78+
app bar only on a phone (below 768 px). From 768 px up an app page, its docs pages included,
79+
starts at the window's top: the sidebar's head carries the app menu, search and the
80+
notification bell, its foot the account menu, the content area the standing banners, and
81+
the page header its own buttons (objectstack#36112). The documentation portal (`/docs`),
82+
which belongs to no app, draws the same frame there with a neutral 「Documentation」 head
83+
in place of the app menu and the docs tree as the sidebar's body (objectstack#37197). On a phone a
8284
record page's own top bar, with its back link to the object's list, is the page's only bar,
8385
and every other route keeps the app bar.
8486

0 commit comments

Comments
 (0)