Skip to content

feat(ux): one primary action per record header, the rest in ⋯ (#2720) - #2923

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-2720-primary-actions
Dec 2, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-2720-primary-actions

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Closes #2720

Clause-②: no
Metadata-protocol: none
Metadata-impact: reviewer

维护者速读

  • 用户能看到什么变化:所有人打开客户、商机、线索、工单、报价单、订单等记录页时,顶部从两三个按钮变成「编辑」旁只有一个主按钮,其余操作都收进「⋯」菜单。
  • 为什么做:这是「记录详情页重做」专题里的「头部一行」,按每个对象声明一个主操作、其余进「⋯」的要求落地。
  • 出错会怎样:最坏是某个常用操作要多点一次「⋯」才能找到,操作本身的效果和权限都不变,改一行元数据即可撤回。
  • 要你做什么:无。

What changes

Item 3 of the card: each object that places actions on its record page declares actionLayout.record (pinned @objectstack/spec 19.0.0-next.3). pinned names the header's one button; every other action goes to the header's ⋯ menu.

Object Button
Account Log a Call
Contact Send Email
Contract Print Contract
Lead Convert Lead (⋯ starts with Qualify Lead, Schedule Follow-up)
Opportunity Generate Quote
Task Complete
Case Close Case
Price Book Add Products
Campaign Enroll Members
Campaign Member Mark Responded
Expense Submit for Reimbursement
Expense Request Submit
Timesheet Submit
Quote Submit for Review / Mark Presented / Accept, by status
Order Confirm Order / Complete Order, by status
Expense Report Submit / Mark as Paid, by status
Knowledge Article Helpful and Not Helpful (deliberate exception)
  • Status-driven buttons. On the quote, the order and the expense report the next step changes with the status, so pinned names the step out of each status. Each is offered on its own status only, so the header shows one button at a time. The test evaluates every pinned action's visible over every status option and fails if two can show together.
  • The one exception. A knowledge article keeps both Helpful and Not Helpful as buttons. They answer one question, and folding either into ⋯ would tilt the votes the review queue reads. The exception is written down twice (AGENTS.md rule 11): beside the declaration, and in the test's TWO_BUTTONS roster.
  • Lead. The three negative order values that kept Qualify, Convert and Schedule Follow-up first (Record page v3: retire the authored full pages of lead / account / opportunity / case in favour of the synthesized v3 page, and declare the quote and opportunity line items as body tables #2382) are replaced by the lead's actionLayout. The action-references case that pinned that order is replaced by the new test.
  • Save-together (item 5 follow-up, measured, no change). On 19.0.0-next.3, neither crm_opportunity_line_item.crm_opportunity nor crm_quote_line_item.crm_quote needs inlineEdit to offer saving a record with its lines. The parent's fieldGroups[].relatedList entry places the lines, and the console picks the grid form factor by default: each child has 7 editable fields, under the threshold of 8, and none of them is form-only. One Save sends one POST /api/v1/batch, which stores both the parent field and the line (see Verification). So no inlineEdit is added, as 「明细网格等发版」 asked.
  • Docs. Header descriptions are updated in en, zh-Hans and zh-Hant for accounts, opportunities, leads, cases, orders, quotes, contracts and meetings-and-calls, plus the in-app activities manual ("three buttons" became "three actions").

Tests

  • New test/record-primary-action.test.ts, with 23 cases:
    • the declared arrangements equal one table, covering every object whose record page places actions;
    • every name a table entry arranges is that object's own action on its record page;
    • only the listed exception pins two buttons with no status between them;
    • for the three status-driven objects, no status offers two pinned actions, and each pinned action is offered on some status.
  • Ablations, each restored to HEAD's blob afterwards:
    • complete_sales_order.visible also offered on draft (blob 40cdbe27 to 443564fe): 1 failed / 22 passed, only the sales-order one-at-a-time case.
    • The deal pinned log_call instead of generate_quote: 1 failed / 22 passed, only the table case.
Local runs (head 9f403d3)
  • pnpm validate && pnpm typecheck && pnpm lint && pnpm hygiene && pnpm build, under the verify lock: VERDICT command-exit 0. The build reports 56 actions and no warning about actionLayout.
  • Targeted vitest, 52 files: all docs-*, action and metadata references, record pages, quote, case, task and lead suites. Result: 1 failed (the superseded lead-order case, then replaced), 1156 passed.
  • Re-run after the replacement: typecheck, hygiene, and the 6 touched suites (action-references, record-primary-action, docs-locale-parity, docs-locale-structure, docs-drift, changeset-version-wrapper). Result: 84/84, VERDICT command-exit 0.
  • Full vitest run: NOT MEASURED locally. It ran past the 580 s foreground cap on the shared box (exit 124) and is left to CI.

Acceptance notes

Verification

Measured on 19.0.0-next.3 with objectstack dev, the seeded demo, admin@objectos.ai, Chromium at 1280x800. Header buttons left of Edit, then the ⋯ items:

Header and ⋯ per object
  • Opportunity (Proposal): Generate Quote · ⋯ Refresh, Clone Opportunity, Log a Call, Log a Meeting, Schedule a Meeting, Share, Change Owner, Delete
  • Quote (Draft): Submit for Review · ⋯ Refresh, Print Quote, Share, Delete
  • Lead (New): Convert Lead · ⋯ Refresh, Qualify Lead, Schedule Follow-up, Log a Call, Log a Meeting, Schedule a Meeting, Share, Change Owner, Delete
  • Case (Resolved): Close Case · ⋯ Refresh, Escalate Case, Reopen Case, Log a Call, Log a Meeting, Schedule a Meeting, Share, Change Owner, Delete
  • Account: Log a Call · ⋯ Refresh, Log a Meeting, Schedule a Meeting, Share, Change Owner, Delete
  • Order (Draft): Confirm Order · ⋯ Refresh, Cancel Order, Draft Contract, Share, Delete
  • Knowledge Article (Published): Helpful, Not Helpful · ⋯ Refresh, Share, Change Owner, Delete
  • Contract (Activated): Print Contract · ⋯ Refresh, Change, Share, Delete
Save-together, no inlineEdit
  • Deal (Qualification, 4 lines): Edit turns the page into its edit state, with an editable line grid (columns: #, Product, Description, Quantity, Sales Price, Discount %; Duplicate row, Remove row, Add line). The test changed Next Step and one line's quantity from 1 to 2, then clicked Save. That sent one POST /api/v1/batch and got 200. Read back: next_step was stored and the line's quantity was 2. amount rolled up to 145000, which opened the existing large-deal approval.
  • Quote (Draft, 4 lines): same steps on Description and one line's quantity from 1 to 2. That sent one POST /api/v1/batch and got 200. Read back: description was stored, the line's quantity was 2, and subtotal / total_price rolled up.

Two-minute check: run pnpm dev, open any opportunity and look at the header. Expected: Generate Quote and Edit are the only buttons, and Log a Call is under ⋯.

🤖 Generated with Claude Code

https://claude.ai/code/session_017xRBcUpajguxop2zMyDN9K

…low menu (#2720)

Each object that places actions on its record page now declares
actionLayout.record (spec 19): pinned names the header's one button, and
every other action goes to the header's overflow menu. On the quote, the
order and the expense report the button follows the status: pinned names
the step out of each status, and no status offers two of them. The
knowledge article keeps Helpful and Not Helpful both as buttons, a
deliberate exception written beside its declaration and in the test.

The lead's three negative order values (#2382) are replaced by the lead's
actionLayout (Convert Lead pinned; Qualify Lead and Schedule Follow-up lead
the menu), and the action-references case that pinned the old order is
replaced by test/record-primary-action.test.ts.

Save-together needs no inlineEdit on the pinned 19.0.0-next.3: measured in
the console, the record page's Edit draws the deal's and the quote's lines
as an editable grid from their fieldGroups relatedList entry, and one Save
sends one POST /api/v1/batch that stores the parent field and the line.

Docs: the header descriptions of accounts, deals, leads, cases, orders,
quotes, contracts and calls/meetings, in en, zh-Hans and zh-Hant, and the
in-app activities manual.

Claude-Session: https://claude.ai/code/session_017xRBcUpajguxop2zMyDN9K
@vercel

vercel Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
hotcrm Ignored Ignored Dec 2, 2026 10:10am UTC

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation ci/cd CI plumbing and the verification pipeline metadata Declarative metadata — schema, security posture, UI surfaces backend Server-side behaviour — hooks, flows, actions labels Dec 2, 2026
CI shard 5 on 9f403d3 timed out 'prices the quote from the opportunity
and advances the stage to proposal' at 5141 ms against vitest's 5 s
default, on a loaded runner. The actionLayout change does not touch it:
measured with the json reporter, --maxWorkers=2, 3 runs each, the case
took 1507-1734 ms on the merge base 84b0932 and 1568-1807 ms on 9f403d3
(interleaved, under the verify lock), and 2048-2281 ms on origin/main
d5d64b2 against 1800-1920 ms on this branch (interleaved, unlocked).

So, the #2904 way (hotcrm#2855): the case gets its own 15_000 budget with
a one-line reason. The global timeout is unchanged and nothing is skipped.

Claude-Session: https://claude.ai/code/session_017xRBcUpajguxop2zMyDN9K
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:hotcrm@sunhaolin · sunhaolin · session_017xRBcUpajguxop2zMyDN9K

席位核对 · L1 ACCEPT · head d66957a690 · 2026-12-02T10:19Z

Card #2720 (narrowed scope; items 1, 2, 5 and 6 were already done)

  • Item 3: every object that places record-page actions (17) declares actionLayout.record from the pinned 19.0.0-next.3 spec. It pins one header button; the rest go to the ⋮ overflow menu.
  • Status-driven objects: quote, order and expense report pin one step per status. Their visible predicates never overlap, so the header always shows exactly one forward button.
  • Knowledge article: keeps both Helpful and Not Helpful. This is a declared exception, listed on the test roster.
  • Measured in Chromium: each header shows one action, Edit, and ⋮.
  • Save-together: measured in the console. Editing the deal or quote writes the parent and its lines in one POST /api/v1/batch (200). No inlineEdit is needed, so the maintainer's 「明细网格等发版」 condition is met by the release as it is.

Seat calls on the dev's questions: keep one step per status, and keep both buttons on the knowledge article (A and A).

Pins

CI fix

  • The earlier red shard was flow-quote › pricing case, which took 5141 ms on a loaded runner against the 5000 ms default.
  • Measured: main ran 1.5–2.3 s, the merge base 1.5–1.7 s, and the branch 1.6–1.9 s, so this PR did not slow it.
  • d66957a gives that case its own 15_000 budget with a reason line, the test: give the two near-limit merge-queue cases their own measured budgets (#2855) #2904 way. The global timeout is unchanged and nothing is skipped.

CI on d66957a690: 20/20 success; mergeable clean.

Class: reviewer (presentation only). Ready, plus auto-merge.


Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review December 2, 2026 10:20
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Dec 2, 2026
Merged via the queue into main with commit c3134aa Dec 2, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Server-side behaviour — hooks, flows, actions ci/cd CI plumbing and the verification pipeline documentation Improvements or additions to documentation metadata Declarative metadata — schema, security posture, UI surfaces

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HotCRM:商机等手写记录页回到平台默认页结构;审批提示文案改正;为主从明细对象打开一起保存

2 participants