Repository navigation
feat(docs): in-app Help group with three manuals and nine bilingual package docs - #2355
Merged
Merged
Conversation
… three books Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAn2ZxhfvpehmexXYC6
…arget the docs tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAn2ZxhfvpehmexXYC6
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAn2ZxhfvpehmexXYC6
Keeps main's Lead Engagement rename in the quick-tour Reports row beside the new Help row, and carries the Forecasts sharing rule main added to the old crm_admin.md into crm_admin_access.md and its Chinese sibling. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAn2ZxhfvpehmexXYC6
…nes (#2327) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAn2ZxhfvpehmexXYC6
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
…ch package ships (#2327) Package docs link to each other by name (ADR-0046 §3.3), and the console resolves ./NAME.md across packages. On disk the service and revenue pages live in their own module's docs directory, so a by-name link between packages read as dead to markdown-link-check. The replacement patterns map each bare ./crm_PREFIX_NAME.md link to the directory that package's docs live in; any other link shape is judged as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAn2ZxhfvpehmexXYC6
Contributor
Author
席位核对Verdict: ACCEPT ·
Generated by Claude Code |
This was referenced Oct 28, 2026
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.
Requested by Irene · project thread
Fixes #2327
Clause-②: no
Metadata-protocol: none
维护者速读
crm_sales、crm_admin、crm_service被删除,指向它们的链接会显示「未找到」。回滚即还原本 PR。src/sales/books/crm-admin-manual.book.ts与objectstack.composition.ts里 saas 下把受众换成 tenant_admin 的那段;src/sales/apps/crm.app.ts的group_help;test/docs-books.test.ts。pnpm vitest run test/docs-books.test.ts test/docs-lifecycle-diagrams.test.ts,预期 19 个用例通过;或以 na.rep 登录,展开「帮助」只见使用手册和收入手册,管理员登录多一本管理员手册。What changes
A Help group, last and collapsed.
crm.app.tsgainsgroup_helpafter Reports,expanded: false, with twotype: 'doc'entries: User Manual (crm_manual) and Admin Manual (crm_admin_manual). The revenue module adds Revenue Manual (crm_revenue_manual) into the same group through anavigationContributionsrow insrc/revenue/index.ts, so the entry leaves with the module. Labels are translated in the zh-CN, es-ES and ja-JP packs (帮助 / 使用手册 / 管理员手册 / 收入手册 …);enadds the group label only, as it lists groups only.Three books (ADR-0046 §6).
src/sales/books/crm-manual.book.ts: Getting Started (pages: ['crm_overview']), Sales (include: 'crm_sales_*'), Service (include: 'crm_service_*',package: 'app.objectstack.hotcrm.service').src/sales/books/crm-admin-manual.book.ts: one group,include: 'crm_admin_*',audience: { permissionSet: 'system_admin' }.src/revenue/books/crm-revenue-manual.book.ts: one group,include: 'crm_revenue_*'.The app-package books are registered through
appBooksinobjectstack.composition.ts. UnderHOTCRM_COMPOSITION=saasthe composition swaps the Admin Manual's audience totenant_admin, the admin set that shape registers in place ofsystem_admin(measured below: a book gated on a set the stack does not declare is readable by nobody).Nine pages, each with a
.zh.mdsibling.crm_sales.md,crm_admin.mdandcrm_service.mdare split by topic:crm_overview,crm_sales_leads,crm_sales_opportunities,crm_sales_contracts,src/service/docs/crm_service_cases,src/service/docs/crm_service_knowledgecrm_admin_access,crm_admin_automationsrc/revenue/docs/crm_revenue_quotesEach page carries
order:for its place in its group. The overview has a mermaid lifecycle flowchart and a "which guide to read" table, and links only to sales, service and admin pages, never to revenue (the module can be uninstalled). The lead, opportunity, contract, case and quote pages each draw their object's lifecycle as a mermaidstateDiagram-v2with the option labels of the locale. The opportunity page keeps the #2342 approval wording. The Forecasts sharing rule that #2338 added tocrm_admin.mdon main is carried intocrm_admin_access.mdand its Chinese sibling.Code comments that pointed at the removed pages now name the new ones (
opportunity.actions.ts,opportunity.hook.ts,opportunity-stagnation.flow.ts,_thresholds.ts, one test).Changeset.
.changeset/2327-in-app-help-manuals.md(minor), naming the removed doc names.Tests
test/docs-books.test.ts(8 cases), computed with the platform's own resolvers (resolveBookClaimedDocs,resolveDocAudiencesfrom@objectstack/spec/system): every page is claimed by a group of some book and has a zh sibling; every book is opened by exactly onedocentry and everydocentry opens a registered book; the admin pages' audience is exactly[{ permissionSet: 'system_admin' }]and every other page includes'org'; that set is registered; no app-package page links to a revenue or marketing page.test/docs-lifecycle-diagrams.test.ts(11 cases): for each of the five diagrams in en and zh, the drawn states equal the field's options, each label equals the pack label, and every arrow is a transition thestate_machinerule allows; no other page draws a state diagram.docs-drift(retargeted to the new pages, zh siblings included; cron and day displays in Chinese),docs-runnable-samples(module doc dirs),app-navigation-shape(docis a known kind; destination key includesbook/doc),docs-quick-tour-navigation(eight groups; Reports and Help collapsed),saas-composition(the Admin Manual's audience per composition).Reverse checks: six one-shot mutations, each red, each restored
Each mutation was made on disk after the commit, the targeted file run, and the file restored with
git checkout HEAD -- PATH;git status --shortandgit diff HEAD --statread empty after the set.Acceptance notes
Mermaid, not live embeds. The card asked for
```metadatastate-machine embeds with mermaid as the fallback. On 18.2.0objectstack buildrefuses every such embed in this artifact (reading below), so the diagrams are hand-written anddocs-lifecycle-diagramsholds them to the compiled machines. Filed as objectstack#27090. Swap them for embeds once the platform builds them, and retire that test with the last one.Book and group titles stay English in Chinese. Page titles and bodies switch to Chinese, but the book title ("HotCRM User Manual") and group headings ("Getting Started", "Sales", "Service") show in English to a zh-CN user: 18.2.0 has no
bookstranslation namespace (objectstack#26819 is not in this pin). The sidebar entries are translated.Uncategorized sweep, admin only. The console's per-book Uncategorized group lists docs of the same package that the book does not claim, even when a sibling book claims them. An administrator sees the two admin pages under the User Manual's Uncategorized, and the app-package user pages under the Admin Manual's. Members without the admin set see neither (the REST tree prunes by audience); the pages themselves are gated correctly. Filed as objectstack#27091.
Cross-package doc links (review round 2, seat ruling: keep the by-name form, teach link-check). Eight links name a page in another package's docs directory:
crm_revenue_quotes(en, zh) →crm_sales_opportunities;crm_overview(en, zh) →crm_service_casesandcrm_service_knowledge;crm_admin_automation(en, zh) →crm_service_cases. CI link-check ond23812dread them dead, because on disk the target sits in another directory. Measured on the dev server, starting on the quotes page as admin:./crm_sales_opportunities.md(ADR-0046 §3.3: resolved by name, across packages). The console rewrites it to/_console/docs/crm_sales_opportunities, which lands on that page in the User Manual../crm_service_cases.mdopens the service page the same way.../../docs/crm_sales_opportunities.md(valid on disk). The console's rewrite takes a bare name only, so it is left alone and the browser goes to/docs/crm_sales_opportunities.md, which answersENDPOINT_NOT_FOUND. The build'sdocs/broken-linklint skips path-shaped links too.So form A stays.
.github/markdown-link-check-config.jsongainsreplacementPatterns, each anchored to the bare./NAME.mdform (^\./(crm_service_[a-z_]+\.md)$→{{BASEURL}}/src/service/docs/$1), module prefixes (crm_service_,crm_revenue_) before thesrc/docsones (crm_overview,crm_sales_,crm_admin_). Every other link shape is judged as before. Measured locally withmarkdown-link-check@3.13.7, the version the action installs:Surface beyond the claim, declared.
.github/markdown-link-check-config.json(above, accepted by the seat in round 2);objectstack.composition.ts(book registration and the saas audience swap); the comment-pointer fixes in foursrc/files and one test; thesaas-composition,app-navigation-shapeanddocs-quick-tour-navigationtest edits; andcontent/docs/getting-started/quick-tour(en, zh-Hans, zh-Hant), whose Help row the quick-tour navigation test requires (accepted by the seat as a surface extension).Verification
At
d9b47b3(after mergingorigin/main3801c17):pnpm verify, exit 0.d23812dadds only the claim'sClause-②andMetadata-protocollines to the changeset;test/changeset-version-wrapper.test.ts4/4 at that head.At
5b07331(round 2, config only):markdown-link-check@3.13.7with the repo config over the 19 changed.mdfiles, 0 dead links;docs-books,docs-lifecycle-diagrams,docs-drift,docs-runnable-samples,docs-quick-tour-navigation,app-navigation-shape: Test Files 6 passed (6), Tests 102 passed (102).mainhas since moved to08bbdd5(#2354, refusal labels for converted leads and closed-deal line items; no file in common with this diff), so CI's merge ref is the reading for that tip.Platform readings on 18.2.0 (probe artifact, then this branch)
1. Metadata embeds refused at build. A probe doc in the app package and one in the service package, each with a
```metadatastate-machine embed,npx objectstack build:The service package's own page naming its own
crm_caseis refused too: the lint looks the object up on the artifact's top level, which a multi-package artifact leaves empty.2. An audience set the stack does not declare locks everyone out. A probe book gated on
tenant_adminunder the community composition: the build warnssecurity-book-audience-unknown-set("The runtime fails closed — no holder means NO reader can open the book") andGET /api/v1/meta/book/NAME/treeanswers 403 to the admin too. Gated onsystem_admin: admin 200, rep and service agent 403 on the tree and on the doc, and the nav entry is pruned server-side. Hence the composition swap.3. A group's
package:claims another package's docs. The User Manual's Service group (package: 'app.objectstack.hotcrm.service') lists both service pages; holds.4. This branch, dev server, demo staff seeded.
GET /api/v1/meta/book/BOOK/treeandGET /api/v1/meta/doc/DOCper persona:The rep's
crm_manualtree has Getting Started, Sales, Service; the admin's adds Uncategorized with the two admin pages (acceptance note above).Browser pass (branch head, dev server, en and zh-CN)
Playwright, one run per persona and locale, signed in through
/api/v1/auth/sign-in/email:/docs/crm_manual/crm_overview,/docs/crm_admin_manual/crm_admin_access,/docs/crm_revenue_manual/crm_revenue_quotes).svg[aria-roledescription=stateDiagram]per diagram page, no raw fence text. Nodes read: opportunities (en) Prospecting … Closed Won, Closed Lost; contracts (en) Draft, In Approval, Activated, Expired, Terminated; cases (zh) 新建, 处理中, 等待客户回复, 等待支持回复, 已升级, 已解决, 已关闭; quotes (zh) 草稿, 审核中, 已提交, 已接受, 已拒绝, 已过期./docs/crm_admin_manual/crm_admin_accessdirectly: "You do not have access to this documentation".Screenshots: project files
issue-2327/(*-1-help,*-2-book1..3,*-3-diagram,rep-en-4-admin-direct).Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01J8VVAn2ZxhfvpehmexXYC6