docs(revenue): write the approvals page's navigation section to source (#963) - #969
Merged
Merged
Conversation
#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
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
) 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
marked this pull request as ready for review
August 6, 2026 14:09
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #963
content/docs/revenue/approvals.mdx的《Where to find pending approvals》一节,复刻了revenue/index在 #943 / PR #953 之前那一批假导航。两页同在content/docs/revenue/下、互相有链接,读者从前一页读到"只有 Inbox 一项、Action History 不存在",翻到这一页又被教去点 Approval Requests 和 Action History。本 PR 把这一节按src/apps/crm.app.ts与已安装的@objectstack/plugin-approvals(17.0.0-rc.3)写实,口径沿用 PR #953 在隔壁页刚落地的写法:错名一个不删,逐个说清它到底是什么。三处断言的逐项复核
crm.app.ts:165里group_approvals唯一的 childnav_approval_requestslabel 是Inbox(zh-CN.ts:1219 显示为「待我审批」);而Approval Requests是审批插件给对象起的名字(sys_approval_request的pluralLabel,label为Approval Request)src/与插件均为 0 命中;sys_approval_request.listViews实为My Pending/I Submitted/Completed/All(zh-CN「我的待办」「我提交的」「已完成」「全部」)。nav_approval_requests未声明viewName,所以点开落在对象列表上、四个视图全在sys_approval_action(自带Recent/By Actor/All三个视图,并以request_id指回请求),缺的只是入口第二条是本单最值得说的一处:issue 建议按"全仓不存在"处理,若照办,页面会在反方向变成错的——读者会以为审批收件箱根本没有过滤视图。所以本节点名说清三个假名之后,改列真实的四个视图,给出真实到达路径。第一条同理:若照 issue 写"没有任何元数据叫 Approval Requests",插件的对象复数标签正是这个词,页面又会新造一个不准确的否定句。
守卫
新增
test/docs-revenue-approvals-navigation.test.ts(30 个断言),两个方向都钉: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 validateData: 17 Objects 344 Fields/UI: 1 Apps 14 Viewspnpm typechecktsc --noEmit无输出pnpm lint13 warning(s), 14 suggestion(s)(均为既有项)pnpm hygiene✓ no raw control bytes in first-party files(扫描面含content与.changeset)pnpm build✓ Build complete (1238ms)pnpm test -- --maxWorkers=2Test Files 72 passed (72)/Tests 1661 passed | 1 skipped (1662)push 前另做控制字节自扫:
grep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f]'覆盖本 PR 五个文件,无命中。未起 dev server。顺手记录(不在本 PR 修)
content/docs/guides/search-and-navigation{,.zh-Hans,.zh-Hant}.mdx:56把 All Open Opportunities 与 Pending My Approval(简体「所有未结商机」「待我审批」)举例为"随系统提供的内置视图",两个名字在src/均零命中——已另行开 issue。content/docs/getting-started/quick-tour的导航表同样列着 Approval Requests / Action History,已由getting-started/quick-tour的导航表(:35-:44,三语)整表失实:8 行里 4 个分组不存在、3 个真实分组缺席、条目名多处对不上crm.app.ts#960 覆盖,未重复开单。Generated by Claude Code