Repository navigation
Fix TypeScript build error for blog frontmatter fields - #37
Merged
huangyiirene merged 2 commits intoJan 20, 2026
Merged
huangyiirene merged 2 commits into
huangyiirene merged 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Remove `as any` type casts from source.config.ts and source.ts - Properly configure fumadocs-mdx blog schema with extended frontmatter fields - Use z.coerce.string() for date field to handle YAML Date objects - Add BlogPostData interface and type assertions in blog page component - Build now passes successfully Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix error in workflow step execution
Fix TypeScript build error for blog frontmatter fields
Jan 20, 2026
huangyiirene
marked this pull request as ready for review
January 20, 2026 07:54
This was referenced May 25, 2026
xuyushun441-sys
pushed a commit
that referenced
this pull request
May 25, 2026
Adds entries 26-40 covering the gaps that make the helpdesk template 'pretty but not daily-usable' from an end-user perspective: P0 additions: - #26 No inline message composer on detail pages - #27 No external-user portal mechanism - #28 Attachment/file-list field UI not E2E P1 additions: - #29 No 'changed since last visit' indicator - #30 Bulk operations UI unverified (escalates #17) - #31 Rich-text editor scoped to comments only - #32 No first-class canned response / macro - #33 No collaboration presence indicators - #34 No keyboard-shortcut API - #35 No conditional SLA timer (pause on waiting_customer) - #36 Formula fields can't reference foreign object fields P2 additions: - #37 No chart drill-down - #38 No period-over-period analytics primitive - #39 No inbound-channel abstraction (email-to-ticket etc.) - #40 i18n translation namespace validation weak Includes 'user-pain → platform-gap' mapping table tracing each end-user complaint to a specific issue number. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Sep 4, 2026
os-warren
added a commit
that referenced
this pull request
Sep 4, 2026
…cision/runId/repairable beside its 500 Maintainer ruling 2026-09-04, decision batch #37, option B. One `POST /api/v1/approvals/requests/{id}/reject` produced three coexisting outcomes: the caller read HTTP 500, the request row WAS terminal and had left the pending inbox, and the run was stranded. 500 alone reads as "the rejection did not happen", so callers retried against a durable decision. The status code does not move — the effect landing while the run strands is still a failure — and the door does not become atomic: the #13937 shape-4 ruling binds this door's own writes too, so no decision is ever rolled back. What changed is that the door stops discarding what the engine said. - `serviceResume` carries `AutomationResult.status` through. It read only success/code/error, and the stranded exit reports a status and NO code, so the repairability signal died one line before the envelope was built — a member with a producer and, until now, zero consumers. - `resumeRecordedOutcome` throws a carrier with `finalized` (the decision stands), `decision`, `runId`, and `repairable` derived from the engine's `'stranded'` discriminator. Absence of that stamp is `false`, never a default: a repair verb that would refuse is worse than no promise. - The REST approvals door forwards those four fields on `RESUME_FAILED` only, presence-gated — an error with no carrier answers exactly the body it always did. - `@objectstack/types` hosts the constructor and its recogniser in one module (the producer is a plugin; rest cannot import one), the same Home rule as the validation-failure pair beside it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XpTx2tbq3pZRYAdoGt6E6Y
This was referenced Sep 4, 2026
This was referenced Oct 14, 2026
Merged
This was referenced Nov 17, 2026
Nenzyz
pushed a commit
to Nenzyz/objectstack
that referenced
this pull request
Dec 1, 2026
…t submitter notice read in the reader's language (objectstack-ai#36846) <!-- claude-projects-attribution: {"github_login":"os-support-ai"} --> _Requested by **Yibo Wang** · [project thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwB9Gqqp1VYZwEqbXEm1YsTjU)_ Fixes objectstack-ai#36463 Clause-②: yes (widening) Metadata-protocol: none repo:objectstack#3 · os-support-ai · session_01WGufziH9MVhWYLVCiw5eXB ## 维护者速读 - 用户能看到什么变化:提交人自己点「批准」被拒时,审批详情页和审批中心弹出的提示改用用户自己的语言(中文用户整句都是中文);没人能审批时发给提交人的通知,即使列了好几个岗位,也整句按收件人的语言显示。 - 为什么做:属于「审批收尾」这一组工作,补上上一轮留下的两处英文残留。 - 出错会怎样:只影响这两句提示的文字,审批是否被拒、拒绝的规则和已保存的审计记录都不变,可以直接撤回。 - 要你做的:无。 ## Widened door response (Clause-②) The approvals routes (`packages/rest/src/approvals-routes.ts`, all nine that share `handleApprovalError`) now carry a marked `userMessage` at the top level of their flat `{ code, error }` refusal body on any mapped row whose thrown error is marked, the same member objectstack-ai#34619 added for `RESUME_FAILED` on this door and that `ApiErrorSchema` already declares and `@objectstack/client` already lifts. Producers today: the two self-approve decide refusals, both on the `403 FORBIDDEN` row (`excludeSubmitter`, and the override self-approve kept under maintainer ruling 2026-11-17 option B). The member is absent when no producer marked one, so every other refusal body is byte-identical. Additive, so `yes (widening)`, patch, `Metadata-protocol: none` (precedents objectstack-ai#34619, objectstack-ai#35811; L1 S1 7122520696). ## Census - **The console reader that shows a decide refusal.** Two places: - The request page's Approve button is the declared `type: 'api'` action `approval_approve`. Its failure text is read by `refusalEnvelopeMessage` in `ui/packages/app-shell/src/utils/flowResponse.ts`, through `apiActionRefusalResult`. Both callers use it: the `apiHandler` in `useConsoleActionRuntime` and the one in `RecordDetailView`. Before this PR it read only `error.userMessage` of the ADR-0112 envelope. The approvals door answers the flat `{ code, error }` body, so the toast showed the English `error`. - The Approval Center's inline Approve: `humanizeError` in `ui/apps/console/src/pages/system/ApprovalsInboxPage.tsx`, called by `inlineApprove`. It answered every `FORBIDDEN` with the generic "You are not allowed to perform this action.", so the remedy was lost. - **Which channel was reused.** A producer marks `userMessage` on the thrown error. The plugin already does this in `lockedError` (`lifecycle-hooks.ts`) and `snapshotQueryRefusal` (`payload-predicate-guard.ts`). The approvals mapper carries it at the top level of its flat body, the member its `RESUME_FAILED` stranded envelope already uses for `userMessage`. `@objectstack/client` lifts `userMessage` from that member too (`errorBody?.userMessage ?? errorBody?.error?.userMessage`). Where this differs from the dispatch: the `declaredUserMessage` block around `recognisedRefusal` relays an engine resume refusal. It is not a producer of approvals' own refusal text, so it was not the pattern used here. - **The two refusals.** Both `excludeSubmitter` and the override self-approve now throw through one local helper, `refuseOwnApproval`. It keeps the `message` byte for byte (the existing English pins are unchanged and green) and sets `userMessage` from `submitterRefusalUserMessage` (`no-approver-note.ts`). That text uses the decider's `readerLabels(context).sentence`, with the position labels from the same `notePositionLabels` read. If the decider asked in no language, or the pack lacks one of the sentences, the whole text is English and names no user id. It is never half one language and half the other. - **The submitter notice.** The messaging layer renders at delivery, per recipient (`NotificationTextRenderer.render`). It resolves a keyed param with `t(key, locale)` and no params, so a hole holds one text or one hole-free key. One list param cannot carry translated clauses, and the plugin cannot compose a list per reader, because the emit does not know the recipient's locale. This falsifies the dispatch's flatten-into-one-param route as stated. The route taken flattens the list into the **sentence** instead. `approvalNoApproverHoldingSlots2` to `…Slots8` are derived in every pack from that pack's own `approvalNoApproverHolding`, `approvalNoApproverSlot` and `approvalNoApproverSlotSeparator`. Each slot is a keyed `typeN` / `valueN` pair, the single-slot shape repeated. Nothing is translated twice, the messaging contract does not move, and the notice reads exactly what the timeline reads for the same slate (pinned for every pack and every size 2 to 8). - **The timeline overlay** (`localizeRoutingNotes`) uses the same `noApproverWho` composition, through `noApproverNoteText(note, labels.sentence, …)`. It already renders any number of slots in the reader's language and is not touched. ## What changes - `packages/plugins/plugin-approvals/src/translations/messages.ts`: - five authored sentences, `approvalDecideRefusedSubmitterExcluded`, `…OverrideOwnRequest`, `…AnotherApprover`, `…OverrideAnotherApprover` and `…OverrideWithdraw`, in all eleven packs; - the derived `approvalNoApproverHoldingSlotsN` sentences, built in `slotListSentences` and added to every shipped locale by `withSlotLists`; - `NO_APPROVER_NOTICE_MAX_SLOTS = 8`. - `no-approver-note.ts`: `noApproverNotice` spells 2 to 8 slots inline (shared `slotParams`). It adds `submitterRefusalUserMessage`. - `approval-service.ts`: the two decide refusals go through `refuseOwnApproval`. Behaviour is unchanged: both still refuse, with the same English `message`. - `packages/rest/src/approvals-routes.ts`: `handleApprovalError` adds `userMessage` (read once through `declaredUserMessage`) to every mapped row when the producer marked one. An unmarked refusal gets exactly the body it had before. - `ui/packages/app-shell/src/utils/flowResponse.ts`: `refusalBodyUserMessage` reads the envelope's `error.userMessage`, else a flat body's top-level `userMessage`. These are the two members the client lifts, through one predicate. - `ui/apps/console/src/pages/system/ApprovalsInboxPage.tsx`: `humanizeError` shows a marked refusal first. - Changeset `.changeset/36463-no-approver-text-in-reader-language.md`, patch for `@objectstack/plugin-approvals`, `@objectstack/rest`, `@object-ui/console` and `@object-ui/app-shell` (private, inert). Prior rulings that govern the edited lines (check-prior-rulings over the touched files; quoted as they stand in the tree): - `[Maintainer ruling 2026-11-17, option B]` on the override refusal: "The objectstack-ai#3424 override never approves a request its actor submitted, whatever `excludeSubmitter` says." Kept exactly. Only the language of its text changes. - `ApiErrorSchema.userMessage` (`packages/spec/src/api/contract.zod.ts`), "ruling record 6819749037, option C: text addressed to the end user comes back in the request's language, composed where it is produced". The `userMessage` is composed in the service, in the decider's language, with `en` as the last rung. - The mapper's `[objectstack-ai#13807, maintainer ruling 2026-09-04 batch objectstack-ai#37]` stranded envelope and the code-anchored prefix strip ("converged here by the 2026-08-31 ruling") are not changed. The stranded spread still comes last. ## First reads (by risk) 1. `packages/plugins/plugin-approvals/src/no-approver-note.ts`: `submitterRefusalUserMessage` (the all-or-nothing English fallback) and the multi-slot arm of `noApproverNotice`. 2. `packages/plugins/plugin-approvals/src/translations/messages.ts`: `slotListSentences`, and the change of `enMessages` into the authored set plus the derived set. 3. `ui/packages/app-shell/src/utils/flowResponse.ts`: `refusalBodyUserMessage`. It is shared by every `type: 'api'` action, so the top-level read is gated by the same `declaredUserMessage` predicate. ## Tests - `no-approver-note.test.ts`: - the two-slot keyed shape; - zh-CN delivery is entirely Chinese, with each position by its pack label or else as stored; - every pack and every size 2 to 8 equals the timeline's sentence; - 9 slots keep one English `who`; - both refusals are entirely Chinese in zh-CN; - every pack composes every refusal with no hole left; - English when there is no reader language, and the whole text is English when a pack lacks any one sentence. - `exclude-submitter.integration.test.ts`: each refusal carries the zh-CN `userMessage` while its `message` keeps the English byte for byte; a decider with no locale gets English that names no id; the control (another approver on the slate) gets the English "another approver" text. - `admin-rescue-named-slate.integration.test.ts`: a two-slot submitter notice goes through the real `NotificationTextRenderer`, entirely Chinese in zh-CN, in Japanese for ja-JP, and with the English literal body unchanged. - `rest-approvals-wire-codes.test.ts`: `403 FORBIDDEN` with `userMessage` at the top level, `ApiErrorSchema` parse green; control: unmarked and blank markings add no member. - `flowLaunch.preDispatchRefusal-36390.test.tsx`: a flat approvals refusal's top-level `userMessage` is the toast, through a real `ActionRunner`; control: an unmarked or blank one shows the `error`. - `ApprovalsInboxPage.inlineActionsVisible-34587.test.tsx`: the inline Approve's failure toast is the marked text; control: the generic line. ## Acceptance notes - **Slates of more than 8 slots.** The notice still names their slots in English inside the recipient's sentence, as every multi-slot notice did before this PR. Naming any number of slots would need a list-shaped keyed param in `@objectstack/service-messaging`, which is outside this card's surface. 8 is a declared constant, and the derived sentences cost one bundle entry per size per pack. - **A deployment override** of `messages.approvalNoApproverHolding` does not reach the derived `…SlotsN` sentences. Those are their own catalog keys and can be overridden the same way. - **The Approval Center's bulk approve** still reports failures by record title only. It shows no reason for any refusal, as before. ## Verification Two-minute check: `pnpm --filter @objectstack/plugin-approvals exec vitest run --maxWorkers=2 src/no-approver-note.test.ts`. Expect every test to pass, including "a zh-CN decider reads each refusal entirely in Chinese, the position by its label". <details><summary>Local readings at 869d5de</summary> - Dependency closure build (`@objectstack/plugin-approvals^...`, `@objectstack/rest^...`): lock VERDICT command-exit 0. - `pnpm --filter @objectstack/plugin-approvals --filter @objectstack/rest typecheck`: VERDICT command-exit 0 (both include `check:test-typecheck`). - Full `@objectstack/plugin-approvals` vitest: Test Files 127 passed (127), Tests 1899 passed (1899). - Full `@objectstack/rest` vitest: Test Files 433 passed (433), Tests 9114 passed, 376 skipped (9490). - UI: `pnpm --dir ui exec vitest run` on the two touched UI test files: Test Files 2 passed, Tests 17 passed. `pnpm --dir ui exec vitest run scripts/`: Test Files 172 passed, 2 skipped (174). `pnpm check:new-line-citations` (ui): 0 new, exit 0. - `pnpm check:i18n`: OK, 10 packages, all bundles in sync, exit 0 (after its declared prerequisite build). - Derived gate list (`dispatch-gates.mjs --commands`, 78 commands): 76 exit 0, 2 exit 3 (PREREQUISITE NOT MET, so NOT MEASURED): `check-plugin-teardown-shape --self-test` (shallow checkout) and `check:dual-build-cjs-loads` (needs a full workspace build). `--ran` with exit codes: "78 derived famil(ies) accounted for — 76 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3)". - NOT MEASURED: `type-check` of `@object-ui/app-shell` and `@object-ui/console`. Locally every error is TS2307 module-not-found for unbuilt `@object-ui/*` declarations, with none in the touched files. CI `Type Check UI` is the reading. - Ablations, each through `scripts/ablation-replace.mjs` with the restore proven by `git diff HEAD` empty and blob equal to HEAD: - the mapper's `userMessage` spread deleted: `rest-approvals-wire-codes` 1 failed / 15 passed; - the service's `err.userMessage` assignment voided: `exclude-submitter` 2 failed / 23 passed. - `overlap-check --branch=HEAD`: VERDICT clean exit 0. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01WGufziH9MVhWYLVCiw5eXB)_ <!-- signed: repo:objectstack#3 · os-support-ai · session_01WGufziH9MVhWYLVCiw5eXB --> --------- Co-authored-by: Claude <noreply@anthropic.com>
This branch was successfully deployed
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.
The CI build was failing because blog posts used custom frontmatter fields (
date,author,tags) that weren't typed in the fumadocs-mdx schema. Type casts (as any) masked this until TypeScript compilation.Changes
source.config.tsdocs.schemaproperty with extended frontmatterz.coerce.string()for date field to handle YAML's auto-parsing to Date objectssource.tsas anycasts to enable type inferencepage.tsxBlogPostDatainterface and type assertions for custom fieldspage.data.bodyaccess for MDX componentOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.