Skip to content

docs(revenue): write the approvals page's navigation section to source (#963) - #969

Merged
yinlianghui merged 2 commits into
mainfrom
claude/issue-963-approvals-where-to-find
Aug 6, 2026
Merged

docs(revenue): write the approvals page's navigation section to source (#963)#969
yinlianghui merged 2 commits into
mainfrom
claude/issue-963-approvals-where-to-find

Conversation

@yinlianghui

Copy link
Copy Markdown
Collaborator

Fixes #963

content/docs/revenue/approvals.mdx 的《Where to find pending approvals》一节,复刻了 revenue/index#943 / PR #953 之前那一批假导航。两页同在 content/docs/revenue/ 下、互相有链接,读者从前一页读到"只有 Inbox 一项、Action History 不存在",翻到这一页又被教去点 Approval RequestsAction History。本 PR 把这一节按 src/apps/crm.app.ts 与已安装的 @objectstack/plugin-approvals(17.0.0-rc.3)写实,口径沿用 PR #953 在隔壁页刚落地的写法:错名一个不删,逐个说清它到底是什么

三处断言的逐项复核

原文断言 复核结论 证据
Approvals 分组含 Approval Requests 部分成立:它确实不是导航条目,但这个名字并非"全仓不存在" crm.app.ts:165group_approvals 唯一的 child nav_approval_requests label 是 Inbox(zh-CN.ts:1219 显示为「待我审批」);而 Approval Requests 是审批插件给对象起的名字(sys_approval_requestpluralLabellabelApproval Request
该条目带视图 Pending My Approval / Submitted by Me / Recently Approved 成立,但只讲了一半:三个名字双面零命中,可插件确实内置了视图——只是叫别的名字 三名在 src/ 与插件均为 0 命中;sys_approval_request.listViews 实为 My Pending / I Submitted / Completed / All(zh-CN「我的待办」「我提交的」「已完成」「全部」)。nav_approval_requests 未声明 viewName,所以点开落在对象列表上、四个视图全在
Approvals 分组含 Action History 成立 全仓无此 label;审计数据真实存在于 sys_approval_action(自带 Recent / By Actor / All 三个视图,并以 request_id 指回请求),缺的只是入口

第二条是本单最值得说的一处:issue 建议按"全仓不存在"处理,若照办,页面会在反方向变成错的——读者会以为审批收件箱根本没有过滤视图。所以本节点名说清三个假名之后,改列真实的四个视图,给出真实到达路径。第一条同理:若照 issue 写"没有任何元数据叫 Approval Requests",插件的对象复数标签正是这个词,页面又会新造一个不准确的否定句。

守卫

新增 test/docs-revenue-approvals-navigation.test.ts(30 个断言),两个方向都钉:

  • 文档侧:本节必须列出插件在两个对象上内置的每一个视图 label(插件新增视图而文案不跟 → 红),必须保留全部五个错名(静默删名 → 红),且每个错名都要带上对应的否定句。
  • 源码侧group_approvals 恰好一个 child、label 为 Inbox、无 viewName、分组默认折叠;zh-CN 标签为「待我审批」;全仓无 label 叫 Approval Requests / Action History;插件的对象复数标签确为 Approval Requests;三个假视图名在 src/ 与插件 listViews 中均零命中;无任何导航条目指向 sys_approval_action

任何一条源码事实变了(插件改名、补了导航入口、上了一个真叫 Pending My Approval 的视图),测试先红,而不是文档默默变对或变错。

反向验证(方向为事前预测的 RED):把 en 页这一节回退成原文后重跑,6 条红全部落在 en 页的文档侧规则上(缺四个视图 label、缺审计视图、三条否定句缺失、名字归属句缺失、三段旧文案复活),源码侧一组与两个中文页保持绿——与预测一致。

边界

src/ 零改动;本页其余各节未动;content/docs/releases/ 未动;@objectstack/* 版本未动;#595 / #596 的产品判断不预判(本节只记录当前形状)。

六道门(flock 内串行,NODE_OPTIONS=--max-old-space-size=4096

退出码 关键行
pnpm validate 0 Data: 17 Objects 344 Fields / UI: 1 Apps 14 Views
pnpm typecheck 0 tsc --noEmit 无输出
pnpm lint 0 13 warning(s), 14 suggestion(s)(均为既有项)
pnpm hygiene 0 ✓ no raw control bytes in first-party files(扫描面含 content.changeset
pnpm build 0 ✓ Build complete (1238ms)
pnpm test -- --maxWorkers=2 0 Test Files 72 passed (72) / Tests 1661 passed | 1 skipped (1662)

push 前另做控制字节自扫:grep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f]' 覆盖本 PR 五个文件,无命中。未起 dev server。

顺手记录(不在本 PR 修)


Generated by Claude Code

#963)

The `Where to find pending approvals` section carried the same phantom sidebar
`revenue/index` carried until #943/PR #953, so two pages in one directory gave
readers two different answers.

Measured against `src/apps/crm.app.ts` and the installed
`@objectstack/plugin-approvals` (17.0.0-rc.3):

- `group_approvals` holds exactly one child, labelled `Inbox` (zh-CN 待我审批),
  and the group is collapsed by default. `Approval Requests` is no navigation
  entry -- but the name is the plugin's own label for the OBJECT, so the section
  says where it really lives instead of claiming nothing carries it.
- `Pending My Approval` / `Submitted by Me` / `Recently Approved` hit nothing in
  `src/` and nothing in the plugin. The four views that do exist -- `My Pending`,
  `I Submitted`, `Completed`, `All` -- are what the nav item opens, since it pins
  no `viewName`, so the section names those.
- `Action History` labels no item anywhere. The trail is real data
  (`sys_approval_action`, its own three views, a `request_id` back-link); only
  the entry point is missing.

All three locales updated; `src/` untouched.
`test/docs-revenue-approvals-navigation.test.ts` pins both directions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHrPAGEgFDoHjphqYG4BMa
@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hotcrm Ignored Ignored Aug 6, 2026 2:06pm

Request Review

Comment thread test/docs-revenue-approvals-navigation.test.ts Fixed
)

CodeQL flagged the `src/` walk in the new approvals-navigation guard as a
potential file-system race: it called `statSync(full).isDirectory()` and then
re-opened the same path with `readFileSync`, the check-then-use pair.

`readdirSync(dir, { withFileTypes: true })` carries each entry's type from the
directory read itself, so there is no second syscall to race against, and a
`readFileSync` that throws on a file removed mid-walk is what this guard wants
anyway. No assertion or branch changed — 30/30 still pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHrPAGEgFDoHjphqYG4BMa
@yinlianghui
yinlianghui marked this pull request as ready for review August 6, 2026 14:09
@yinlianghui
yinlianghui added this pull request to the merge queue Aug 6, 2026
Merged via the queue into main with commit 9db63a3 Aug 6, 2026
10 checks passed
yinlianghui added a commit to yinlianghui/hotcrm that referenced this pull request Aug 10, 2026
…ctstack-ai#973) (objectstack-ai#979)

The *Built-in vs personal vs shared* bullet taught the concept with two
examples and neither was a view. *All Open Opportunities* splices the two
real opportunity views — Open Deals (`open_opportunities`, default + pinned)
and All Opportunities (`all_opportunities`, unfiltered). *Pending My Approval*
is the phantom PR objectstack-ai#969 removed from `revenue/approvals` and objectstack-ai#960 from
`quick-tour`; this page was its last landing place, and the approvals plugin
ships My Pending / I Submitted / Completed / All on `sys_approval_request`.

The zh pages were wrong in their own ways: zh-Hans quoted 待我审批, the
navigation label of `nav_approval_requests` rather than a view; zh-Hant quoted
待我審核, which no locale pack carries at all (this app ships en / zh-CN /
ja-JP / es-ES and no Traditional Chinese pack). Both now name the real views
and quote the zh-CN labels the console resolves.

Names swapped without a denial: this bullet is an example, not a navigation
roster. `src/` untouched. `test/docs-search-navigation-views.test.ts` pins the
bullet's names and glosses against the shipped metadata and the two retired
spellings.

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd CI plumbing and the verification pipeline

Projects

None yet

3 participants