Skip to content

fix(plugin-calendar): name the object by its label when a reschedule finds the record gone - #31528

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-0et78n
Nov 8, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-0et78n

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Fixes #31494

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 改了什么: 日历拖拽改期被服务端以 404 RECORD_NOT_FOUND 拒绝时,提示不再显示服务端原句(英文、带记录 id 和对象机器名),改为当前语言的一句话,用对象的显示名称指代对象;卡片照旧弹回原日期。
  • 为什么改: 中文会话下用户看到 Record WB5z1sLAsWgE1tXL not found in showcase_task 这样的英文系统句,违反「显示名称优先于机器名」规范(QA QA run · owed:weekly (73/73) · 0647dabb · 2026-11-08 · 61 PASS / 7 PARTIAL / 4 FAIL / 1 BLOCKED / 0 NOT-RUN #31486)。
  • 风险与回滚: 只在 404/RECORD_NOT_FOUND 分支生效;作者标注的 userMessage、外部数据源只读、权限拒绝三条分支仍排在前面不变。回滚即还原本 PR。
  • 先看: ui/packages/plugin-calendar/src/ObjectCalendar.tsx(新分支与 isRecordNotFound)、ObjectCalendar.markedRefusalToast.test.tsx(新 describe)、ui/packages/i18n/src/locales/zh-Hans.ts(新键译文)。
  • 两分钟验证: cd ui && pnpm exec vitest run packages/plugin-calendar/src/ObjectCalendar.markedRefusalToast.test.tsx,预期 12 个用例全绿,其中 zh 用例读到「这条任务记录已不存在,或者您已无权访问它。」
  • 需要你做的: 无,席位落地。

What changes

  • @object-ui/plugin-calendar: handleEventDropDefault's toast chain gains one branch after the permission branch and before extractWriteErrorMessage: a refusal whose code (on the error or its details) is RECORD_NOT_FOUND, or whose status is 404, toasts calendar.rescheduleNotFound with the object named by its label. The label is the object schema's served label (already translated server-side), else the app's convention-key translation via useSafeFieldLabel().objectLabel, else no name at all: the toast then says the existing form.recordNotFoundOrHidden sentence. The server's sentence, the record id and the machine name never reach the toast. The rollback of the optimistic move is unchanged. The classifier is a small module-local isRecordNotFound built on errorCodeIs from @object-ui/types: is404Error lives in @object-ui/data-objectstack, which this package has only as a devDependency, so reusing it would have meant a new runtime dependency edge.
  • @object-ui/i18n: one new key, calendar.rescheduleNotFound, in all eleven locales/*.ts packs; zh-Hant generated from zh-Hans with gen:zh-hant. The sentence takes one placeholder, the object label.
  • The shared extractWriteErrorMessage is not touched (no caller census needed).

Tests

New top-level describe in the existing harness ObjectCalendar.markedRefusalToast.test.tsx (wire-shaped errors through the real normaliseClientError, real MonthView drag):

  • 404 RECORD_NOT_FOUND with a served label: the toast is the labelled en sentence, contains no id, no machine name, no "not found in"; the event is back on its own day and absent from the target day.
  • The same under a zh I18nProvider with the label 任务: the toast is the zh sentence.
  • No label anywhere: the generic form.recordNotFoundOrHidden sentence, no machine name.
  • A 404 that carries a userMessage still renders the marking.
  • The external-source refusal (EXTERNAL_WRITE_FORBIDDEN) keeps its read-only sentence; an unmarked 403 keeps the permission substitution.

The test's drop-target lookup moved from the spoken cell label to the day number of the current-month cell, so the zh render finds it too; the previous cellLabel helper is removed.

Acceptance notes

  • The same raw-sentence shape likely exists on other write toasts that end in extractWriteErrorMessage (11 non-test files under ui/packages and ui/apps call it, git grep at d15c0ad). Not changed here; the card scoped the fix to the calendar toast.

Verification

Local runs at a934d10 (suites re-run at d15c0ad)
  • vitest run packages/plugin-calendar/src/ObjectCalendar.markedRefusalToast.test.tsx: 12/12 passed.
  • vitest run packages/plugin-calendar/ packages/i18n/: Test Files 167 passed, Tests 2312 passed, 108 skipped.
  • turbo run type-check --filter=@object-ui/plugin-calendar --filter=@object-ui/i18n: 53/53 tasks successful.
  • eslint on the two calendar files: 0 errors (warnings all on untouched lines).
  • Ablation (scripts/ablation-replace.mjs, the isRecordNotFound(err) condition replaced by false): 3 failed, 9 passed; the three new not-found cases received Record v1 not found in visit; restore verified blob == HEAD, git diff HEAD empty.
Derived gates

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 38 families; all 38 ran at a934d10 and exited 0; --ran reconciliation: 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN.

node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-empty-changeset.mjs --base origin/main :: exit 0
node scripts/check-empty-changeset.mjs --self-test :: exit 0
node scripts/check-sdui-manifest.mjs :: exit 0
node scripts/check-sdui-manifest.mjs --self-test :: exit 0
node scripts/ci/snapshot-next.mjs --self-test :: exit 0
node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
node scripts/release-pending-publish.mjs --self-test :: exit 0
pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
pnpm check:changeset-gate-self-tests :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:dispatcher-error-vocabulary :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:engine-double-contract :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:merge-driver :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:published-files :: exit 0
pnpm check:query-options-erasure :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:registry-log-declared :: exit 0
pnpm check:rest-log-spy-declared :: exit 0
pnpm check:role-word :: exit 0
pnpm check:skill-identifier-liveness :: exit 0
pnpm check:test-source-alias :: exit 0
pnpm check:tier-file-adoption :: exit 0
pnpm check:type-check-coverage :: exit 0
pnpm check:type-check-debt :: exit 0
pnpm check:undeclared-dep-imports :: exit 0
pnpm check:watch-hint-literal :: exit 0
pnpm check:where-matcher :: exit 0
pnpm --dir ui exec vitest run scripts/ :: exit 0

After merging main (head d15c0ad, the derived list unchanged), the ratchet and suite families were re-run: all exit 0, and the calendar + i18n suites again passed 167/167 files.

node scripts/check-sdui-manifest.mjs :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:test-source-alias :: exit 0
pnpm check:type-check-coverage :: exit 0
pnpm check:type-check-debt :: exit 0
pnpm check:undeclared-dep-imports :: exit 0
pnpm check:published-files :: exit 0
pnpm check:nul-bytes :: exit 0

Generated by Claude Code

…finds the record gone

A drag-to-reschedule refused with 404 RECORD_NOT_FOUND toasted the server's
own sentence (record id plus the object's machine name, in English). It now
toasts calendar.rescheduleNotFound with the object's served label (else the
app's translation of it, else the generic form.recordNotFoundOrHidden), and
the event still rolls back. Marked, external-source and permission refusals
keep their own messages ahead of it.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jSxTNXbFBqyMe2bkhV
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 8, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#3 · zhuangjianguo · session_01QsR2jVEjiYrK7onirxUGyo

Contract review

Served-tier: TIER_DEFAULT
Head-sha: d15c0ad464f603c558e62fbdb2606d598ac337b3
Local-runs: none

The lane seat's own review of record, owed by the Clause-②: yes declaration alone (face declaration). No path of the diff is a published schema or a governed path (check-governed-merges --pr 31528: NOT governed, 0 of 14 paths).

① Derived judgments

  • @object-ui/i18n is published (no private). The diff adds one key, calendar.rescheduleNotFound, to all eleven locale packs (zh-Hant generated from zh-Hans) and removes or rewords none. Built leaves are readonly literals, so the published TranslationKeys widens: Clause-②: yes (widening) is RIGHT (amendment 6721392279).
  • @object-ui/plugin-calendar (published) changes only which toast a refused reschedule shows; it exports nothing new and removes nothing.
  • Metadata-protocol: none is RIGHT: packages/spec and the server are untouched. The classifier reads the existing RECORD_NOT_FOUND code through errorCodeIs from @object-ui/types, an existing runtime dependency; package.json is unchanged.
  • Accept sets: none change.

② Semver level

  • @object-ui/plugin-calendar and @object-ui/i18n at patch, with both declaration lines on the PR body and the changeset alike: RIGHT (a widening ships patch).

③ Boundary flags

  • A bare 404 status with no code is read as not-found too. On a reschedule PATCH the only 404s are a gone record or a gone object, and both mean the row is not there for this session, so the sentence stays true. Accepted.
  • The object name falls back from the served label to the app's translation (resolve answers an empty string on a miss, never the key) and then to the existing nameless form.recordNotFoundOrHidden sentence, so the machine name cannot show.
  • open_questions: none.

Implemented-by: claude/project-thread-0et78n
Reviewed-by: session_01QsR2jVEjiYrK7onirxUGyo

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#3 · zhuangjianguo · session_01QsR2jVEjiYrK7onirxUGyo

席位核对 · ACCEPT · 2026-11-08T13:34Z · head d15c0ad464f603c558e62fbdb2606d598ac337b3

Seat domain:ui#3 reviewed the diff of its own dispatch (claim 6721374461 on #31494 with amendment 6721392279, card thread session_01QsR2jSxTNXbFBqyMe2bkhV, report 6721981335). Checked against GitHub, not against the report.

  1. Shape: 14 files, +172 / -23, draft on main. ObjectCalendar.tsx adds isRecordNotFound (errorCodeIs on the error and its details for RECORD_NOT_FOUND, else a 404 status) as a branch after the marked-message, external-source and permission branches and before extractWriteErrorMessage; the rollback is untouched. The sentence names the object by the served label, then the app's object-label translation, then falls back to the existing nameless form.recordNotFoundOrHidden. One new key, calendar.rescheduleNotFound, in all eleven locale packs. The shared extractWriteErrorMessage and package.json are untouched. Body: Fixes #31494 only.
  2. Premise: on origin/main the toast chain had no not-found branch, so the server's sentence with the record id and machine name reached the user.
  3. Gates / check-runs: 55 runs on this head, 44 success, 11 skipped, 0 red, including Type Check UI (the i18n parity and en-drift gates). mergeable_state clean. Dev: 38/38 derived gates exit 0, --ran reconciled; en-drift exit 0; 167 calendar and i18n files green at both heads; ablation 3 red / 9 green, restore verified.
  4. Accepted deviations / notes: the classifier is errorCodeIs (approved in the amendment); the harness looks a cell up by day number and drops an unused helper, inside the claim's test surface.
  5. Out of scope / Skills-docs: Metadata-protocol: none; Skills-docs: not owed. The changeset sentences were read against the diff: each describes behaviour the diff ships.
  6. Landing: check-governed-merges --pr 31528: NOT governed, 195 changed lines, so no human approval owed. Clause-②: yes (widening): its TIER_DEFAULT review is PASS on this head (6722000697); no packages/spec/src path. Serial: fix(auth): draw the phone way in on first paint when email+password is off and no single sign-on exists #31533 (this seat) touches no file here; locale packs are shared with no in-flight PR of this seat yet. Landing on the maintainer's standing rule that fleet PRs are reviewed and landed by the pm-dispatch skill (2026-11-03T04:52Z), in this project. Relay pr_ready, then automerge_enable.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 8, 2026 13:37
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 8, 2026 13:37
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 8, 2026
Merged via the queue into main with commit 46ec2ec Nov 8, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-0et78n branch November 8, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

1 participant