Skip to content

Commit f3214b2

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/issue-33581-console-eager-closure
# Conflicts: # ui/packages/app-shell/src/views/RecordDetailView.tsx
2 parents 10d582f + 337f435 commit f3214b2

68 files changed

Lines changed: 3167 additions & 225 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: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
Clause-②: no
6+
Metadata-protocol: none
7+
8+
The record-page skills teach the parent-declared record page:
9+
10+
- `objectstack-ui` record-page rule: the parent's `relatedLists` is the tab list. Without it nothing changes; declared, only the named lists show, in order, with the attachments, approvals and activity tabs named by object (`sys_attachment`, `sys_approval_request`, `sys_activity`), and an entry `{ list, label, columns }` titles one list. "Put the tasks tab first" lists every tab to keep, tasks first, because a list naming only the task hides the rest. A child list another package adds is hidden by a `relatedLists` that does not name it.
11+
- The same rule's step 1 no longer teaches a stage bar or a key-field strip: the stage is the status tag beside the title, whose menu moves it, and `highlightFields` feed hover cards, pickers and related-list columns. A field group lists its own members in `fields`. The wide full page pins the details left beside the tabs, unless the details hold a child table or there is no other tab; the right summary rail and its switch are gone from the text, and the details column's dragged width joins the reader's own choices.
12+
- A `master_detail` child is a tab by default (`objectstack-data` relationships rule, the record-page rule and an eval); a parent field group naming the child list places its table among the fields, written only when asked, and the list keeps its tab too unless a declared `relatedLists` leaves it out.
13+
- `objectstack-data` field-groups example lists each group's members in `fields`; `objectstack-ui` navigation names `fieldGroups` alone.
14+
- Evals: the tasks-first case now writes the full tab list; new cases remove the attachments tab, place a Tax ID field after Industry in its group's list, and put a quote's line items above its amount section.
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/plugin-detail': patch
4+
'@object-ui/i18n': patch
5+
---
6+
7+
feat(record-page): on a phone, the record's comments open as a page of their own: the threads first, a thread's replies inside it, the comment box docked at the foot, and a long press for a comment's actions
8+
9+
Clause-②: yes (widening) — `@object-ui/plugin-detail` adds the export `CommentsPage` and its type `CommentsPageProps`; `CommentThread` takes a third `mode`, `'page'`, and optional `itemInteraction`, `heldId` and `onHeldActions`; `CommentItem` an optional `interactionProps`; `CommentComposer` and `RichTextCommentInput` (exported) an optional `layout` (`'default' | 'phone'`). `@object-ui/app-shell` reserves the console URL parameter `comments` (`RECORD_COMMENTS_PARAM`, in `RESERVED_URL_PARAMS`). `@object-ui/i18n` adds four keys to every pack: `detail.addReactionEmoji`, `detail.commentThread`, `detail.formatBold`, `detail.formatItalic` (the toolbar's names without their shortcut). Nothing existing is removed or re-typed; the desktop's panel, toolbar and labels are unchanged.
10+
Metadata-protocol: none
11+
Skills-docs: none — no skill under `skills/**` teaches where the console draws a record's comments; `content/docs/frontend/plugins/plugin-detail.mdx` and the plugin-detail README gain the phone's page in this change.
12+
13+
On a phone the record page's top bar gains the comments icon, with the number of unresolved threads. A press opens the record's comments as a page over the record, which stays where it was under it; 「‹」 and the browser's Back return to it.
14+
15+
- The page lists each thread's first comment with 「N 条回复」 under it; a tap opens the thread, the comment first and its replies after it. 「‹ 评论」 returns to the list.
16+
- The comment box is docked at the foot of the screen and stands on the keyboard while it is up. One line until tapped; then a row under the text holds mention, bold, italic, list and code, and send at the right end. In the list it writes a comment, in a thread a reply. No 「Ctrl+Enter」 hint.
17+
- A long press on a comment (or its context menu) raises a sheet from the bottom: six reactions, 「标记已解决」 on a thread's first comment, 「编辑」 and 「删除」 (red, confirmed first), each offered exactly where the desktop's hover row offers it.
18+
- The filter at the top right is the desktop's: 「显示已解决」 and 「只看我参与的」.
19+
- The 动态 tab holds the system entries alone, as on the desktop. On a phone the comments live on this page: this replaces the lines of the two objectstack#36075 entries (the record comment panel, and resolved threads) that said the phone keeps the comments in its 动态 tab, or keeps its feed as before.
20+
- The page is in the URL (`?comments=` for the list, `?comments=<id>` for a thread), so a link or a reload opens it where it was.
21+
22+
Unchanged: the desktop; who may write, resolve, edit or delete a comment (the phone offers each exactly where the desktop does); a record page authored in full and an object with `enable.feeds: false` show no icon.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
'@objectstack/formula': minor
3+
'@objectstack/lint': minor
4+
'@objectstack/mcp': minor
5+
'@objectstack/service-automation': minor
6+
'@objectstack/spec': minor
7+
'@objectstack/scenarios': minor
8+
'@object-ui/app-shell': minor
9+
---
10+
11+
fix(formula)!: `validateExpression` refuses `==` / `!=` between a list-valued field and a scalar, which answers a constant on every row
12+
13+
Clause-②: no (narrowing)
14+
Metadata-protocol: narrowed
15+
Skills-docs: follow-up #36217
16+
17+
<!-- adr-0087: registered cel-list-equality-refused -->
18+
19+
**BREAKING** accept-set narrowing, shipped as `minor`. CEL compares the whole list with the scalar, so `record.labels == 'frontend'` is `false` for `['frontend', 'qa']` and for `null` alike, and `record.labels != 'frontend'` is always `true`: a condition written that way never fires (or always does), with no fault and no log line. The shared validator accepted it.
20+
21+
- **The refusal.** `validateExpression` refuses a `==` / `!=` between a read of a list-valued field on `record` / `previous` (`record.f`, `record['f']`, either operand order) — or, at a flattened (flow) condition, its bare name `f`, which the run binds to the trigger record's field, unless a flow variable holds the name or a node can bind names no reader sees — and a non-null string, number or boolean literal, as the new `list-equality` code (params `reference`, `operator`, `operand`, `answer`, `rewrite`), prescribing the null-guarded membership test.
22+
- **Which fields are lists.** A `fieldTypes` entry of an inherently multi-value type (`multiselect`, `checkboxes`, `tags`), or a field named in the new optional `ExprSchemaHint.multiValueFields` — the fields a caller reads as multi-valued through `isMultiValueField` (`@objectstack/spec/data`), which is how a `select` / `radio` / `lookup` / `user` / `file` / `image` field declared `multiple: true` becomes a list here. Absent, such a field is not judged, as before.
23+
- **Who fills it.** The publish lint (`os validate` / `os build`, every CEL site that types the object's fields), the MCP `validate_expression` tool (read off the served definition, `McpDataBridge.servedObjectDefinitionOf`, at the validation / formula / flow-condition sites; a bridge without it answers as before), `registerFlow`'s schema pass (`parseObjectFieldSchema` returns `multiValueFields`; logged, never thrown, like every finding of that pass), the scenario scorer, and Studio's object draft check (field rules, formulas, validation rules; `CelSchemaHint.multiValueFields`).
24+
- **Still accepted.** `S == null` / `S != null` (either side), `'a' in S`, a list compared with a list literal or with another list field, and a comparison whose other operand is not a literal.
25+
26+
FROM → TO:
27+
28+
- `record.labels == 'frontend'` → `record.labels != null && 'frontend' in record.labels`
29+
- `record.labels != 'frontend'` → `record.labels == null || !('frontend' in record.labels)`
30+
- at a flow condition, `labels == 'frontend'` → `labels != null && 'frontend' in labels`
31+
32+
One-line fix: test membership with `in`, null-guarded (`'a' in null` faults); compare the list with `null` to test whether it is set.

‎content/docs/frontend/plugins/plugin-detail.mdx‎

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,38 @@ the record drawer), and no longer inside the 动态 (Activity) tab
239239
The panel and the icon come with the default record page and with a page that
240240
only fills its slots. A record page you author in full keeps the feed blocks it
241241
places (`record:discussion`, `record:activity`) exactly as before, and an object
242-
with `enable.feeds: false` shows no icon. On a phone the comments stay in the
243-
动态 tab.
242+
with `enable.feeds: false` shows no icon.
243+
244+
### On a phone
245+
246+
On a phone the same icon sits at the right of the record page's top bar, with
247+
the same number, and opens the record's comments as a page of their own over
248+
the record (objectstack#36076). The record stays where it was under it: 「‹」
249+
and the browser's Back return to it as it was scrolled.
250+
251+
- **Two levels.** The page lists each thread's first comment, with the faces of
252+
the latest repliers and 「N 条回复」 under it; replies are not on the list. A
253+
tap on a comment opens its thread: the comment first, then the replies,
254+
oldest first. 「‹ 评论」 goes back to the list.
255+
- **The comment box** stays at the foot of the screen, and above the keyboard
256+
while it is up. One line until you tap it; then a row under the text holds
257+
mention, bold, italic, list and code, with send at the right end. In the list
258+
it writes a new comment; in a thread, a reply. It names no keyboard shortcut.
259+
- **A long press** on a comment raises its actions from the bottom: six
260+
reactions on one row, then 「标记已解决」 (on a thread's first comment), 「编辑」
261+
and 「删除」, red, which asks before deleting. Each appears exactly where the
262+
desktop's hover row would offer it. The comment's reactions show under its
263+
text with their counts, yours marked; a tap on one adds yours or takes it back.
264+
- **The filter** at the list's top right is the desktop's: 「显示已解决」 and
265+
「只看我参与的」.
266+
- **The 动态 tab** holds the system entries only, as on the desktop.
267+
268+
The page is addressed by the URL (`?comments=` for the list, `?comments=<id>`
269+
for a thread), so a link or a reload opens it where it was.
244270

245271
The components are exported from `@object-ui/plugin-detail` (`CommentsPanel`,
246-
`CommentsButton`, `CommentThread`, `CommentItem`, `CommentComposer`,
247-
`useRecordComments`); each reads the discussion off the host's
272+
`CommentsPage`, `CommentsButton`, `CommentThread`, `CommentItem`,
273+
`CommentComposer`, `useRecordComments`); each reads the discussion off the host's
248274
`DiscussionContext`, as the feed blocks do.
249275

250276
## The `record:activity` block

‎content/docs/ui/pages.mdx‎

Lines changed: 70 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,13 @@ replacement.
182182
A record page needs no authoring. With no page assigned, the Console synthesizes one from
183183
the object: a header, the record's **details** (the **Details** tab), and one tab per related
184184
list, then **Attachments** for an object with `enable: { files: true }`, **Approvals** when the
185-
record has approval requests, and **动态** (Activity) last, each with its count. A relationship
186-
whose child field declares `relatedList: 'primary'` is part of the record's body: its list is a
187-
full-width table in the details, after the first field section, with no tab of its own. **动态**
185+
record has approval requests, and **动态** (Activity) last, each with its count. Every related
186+
list is a tab by default, a `master_detail` child's too. The header carries the title
187+
(`nameField`) and, for an object with a `stageField`, a status tag whose menu moves the stage;
188+
the page draws no stage bar and no key-field strip (`highlightFields` feed hover cards, pickers
189+
and related-list columns). A relationship whose child field declares `relatedList: 'primary'`
190+
is part of the record's body: its list is a full-width table in the details, after the field
191+
sections drawn open, with no tab of its own. **动态**
188192
(`?related=timeline`) holds the record's system entries: its activity and, with
189193
`enable: { trackHistory: true }`, its field changes; there is no separate History tab. On the
190194
desktop the record's comments are not in it but in the comment panel, opened from the
@@ -194,9 +198,69 @@ whole table (`?related=<object>.<field>`). The tab row shows as many tabs as its
194198
rest into a **+N** menu; the open tab is always on the row. The related tabs are the reader's
195199
to arrange: move one before or after its neighbour, hide one, and bring hidden ones back. The
196200
arrangement is kept per user and object, never in the object's declaration.
197-
Moving a child table into the record's body is therefore a one-word change on the
198-
relationship field, not a page-authoring task, and `relatedList: false` leaves a child off the
199-
page.
201+
Moving a child table into the record's body is therefore a declaration on the parent (a field
202+
group naming the list, below), not a page-authoring task, and `relatedList: false` leaves a
203+
child off the page.
204+
205+
### Declaring the tabs and the field groups
206+
207+
The parent object declares its record page's tabs and sections in one place. Without these
208+
keys nothing changes.
209+
210+
- **`relatedLists` is the tab list.** Declared, only the related lists it names show, in its
211+
order; leaving one out hides its tab. The three built-in tabs are named by object:
212+
`sys_attachment` (attachments: shown only when listed, and only with files enabled),
213+
`sys_approval_request` (approvals: when unlisted, after the listed tabs) and `sys_activity`
214+
(the activity stream: when unlisted, last). An entry `{ list, label, columns }` gives one list
215+
its own title and child-field columns, winning over the child field's `relatedListTitle` /
216+
`relatedListColumns`; a built-in is written only as its bare name. To put one tab first, list
217+
every tab the page keeps with that one first. A child list another package adds is hidden by a
218+
`relatedLists` that does not name it (letting a package place its own list is a later change),
219+
and `relatedList: false` on the child's reference field still hides a list.
220+
- **A field group lists its fields.** `fieldGroups` are the Details sections, in array order.
221+
A group lists its members, in order, in `fields`; without `fields`, its members are the fields
222+
whose `group` names it, the older spelling, still read.
223+
- **A group can place a child table among the fields.** A group that names a child list
224+
(`relatedList: 'quote_line'`, with no `fields`) draws that list's table at its position in the
225+
details, and the record's create and edit forms enter the child rows with the record. The
226+
list keeps its tab as well unless a declared `relatedLists` leaves it out. Write such a group
227+
only where the table belongs among the fields; without one the list is only a tab.
228+
229+
{/* os:check */}
230+
```typescript
231+
import { ObjectSchema, Field } from '@objectstack/spec/data';
232+
233+
export const Quote = ObjectSchema.create({
234+
name: 'quote',
235+
label: 'Quote',
236+
sharingModel: 'private',
237+
fields: {
238+
name: Field.text({ label: 'Quote Name', required: true }),
239+
account: Field.lookup('account', { label: 'Account' }),
240+
valid_until: Field.date({ label: 'Valid Until' }),
241+
discount: Field.percent({ label: 'Discount' }),
242+
total: Field.currency({ label: 'Total' }),
243+
terms: Field.textarea({ label: 'Terms' }),
244+
},
245+
fieldGroups: [
246+
{ key: 'basic', label: 'Basic Information', fields: ['name', 'account', 'valid_until'] },
247+
// Only where the line items belong among the fields; without it they are a tab.
248+
{ key: 'lines', label: 'Line Items', relatedList: 'quote_line' },
249+
{ key: 'amount', label: 'Amount', fields: ['discount', 'total'] },
250+
{ key: 'terms', label: 'Terms', fields: ['terms'] },
251+
],
252+
relatedLists: [
253+
// Named here as well, so the line items also keep a tab, with these columns.
254+
{ list: 'quote_line', label: 'Line Items', columns: ['product', 'quantity', 'unit_price', 'amount'] },
255+
'task',
256+
'sys_attachment',
257+
'sys_approval_request',
258+
'sys_activity',
259+
],
260+
});
261+
```
262+
263+
### How the page is laid out
200264

201265
The Console lays the page out by the width of the surface it occupies, never by the viewport.
202266
On a full page wide enough for a 320 px details column beside 400 px of tabs, the details are

0 commit comments

Comments
 (0)