Repository navigation
fix(core): resolve {next_week_end} and {next_year_end} in the client date-macro resolver - #30364
Merged
Merged
Conversation
…date-macro resolver Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXcHcEtzn8WgUC46Xj
Closed
2 tasks
Contributor
Author
|
domain:ui#3 · os-bill · session_01Utp6CbPN5UYMnBaNJPJWfG Known red, not this PR's · Lint UI (job 127126632397). Same signature as main-red anchor #30367: |
Contributor
Author
|
domain:ui#3 · os-bill · session_01Utp6CbPN5UYMnBaNJPJWfG 维护者速读
席位核对 — ACCEPT · head f235369
|
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 Bill · project thread
Fixes #30134
domain:ui#3 · os-bill · session_01Utp6CbPN5UYMnBaNJPJWfG
Clause-②: no — the client resolver catches up with tokens the spec already declares
Metadata-protocol: none
维护者速读
{next_week_end}(下周日)与{next_year_end}(明年 12 月 31 日),并加一条测试逐个核对 spec 声明的全部固定占位符都能在客户端解析。{next_week_end}文本,比较区间与趋势标签随之出错。ui/packages/core/src/utils/date-macros.ts(两行新映射)、date-macros.specTokens-30134.test.ts(防漂移钉)。pnpm --dir ui exec vitest run packages/core/src/utils/__tests__/date-macros.specTokens-30134.test.ts,预期 38 条全绿。What changes
resolveDateMacros(@object-ui/core) resolves{next_week_end}as the Sunday of next week (Monday-start weeks, the same week{next_week_start}opens, per the spec'sDATE_MACRO_DESCRIPTIONSentry "Sunday of next week") and{next_year_end}as Dec 31 of next year ("Dec 31 of next year").date-macros.specTokens-30134.test.ts: iterates the spec's exportedDATE_MACRO_TOKENS(imported from@objectstack/spec/data, not copied) and fails on any token the client leaves unresolved; pinsnext_week_endfrom a Monday, a Sunday and across the 2026→2027 year boundary (Wed 2026-12-30 →2027-01-04..2027-01-10), andnext_year_endon Dec 31 and Jan 1.@object-ui/corealready depends on@objectstack/specat runtime.@object-ui/core: patch.Tests
Changed tests plus every test file importing the changed module or its importers (head 8dec3da, re-run after the main merge)
pnpm --dir ui exec vitest runover the 5date-macros/dashboard-filters/filter-tokenstest files: Test Files 5 passed, Tests 114 passed.compare-to/dashboard-filters/filter-tokens: Test Files 13 passed, Tests 250 passed.origin/main: the twodate-macrosfiles, Tests 46 passed.pnpm exec turbo run type-check --filter=@object-ui/core --concurrency=2(runstsconfig.test.jsontoo): 4 tasks successful.scripts/ablation-replace.mjs --deleteof thenext_week_endentry, source import, no dist on the path): the new file went red, 2 failed ({next_week_end} resolves to a day or an instant,{next_week_end} is the Sunday of next week);git diff HEADempty after the restore leg.Acceptance notes
ui/packages/types/src/data-protocol.ts(FilterBuilderDateRangePreset) is not changed here. The union is a deliberately separate vocabulary (renamed fromDateRangePresetin objectui#4167 because it adds future windows the dashboard schema refuses), so deriving it fromDATE_RANGE_PRESETSwould droptomorrow,next_week,next_year,next_7_daysandnext_90_daysthat its filter-builder surface uses. Its doc comment's counts ("thirteen", "eight") no longer match the spec table, which now holds sixteen. Reported to the seat; not filed.Verification
dispatch-gates on 8dec3da
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 35 derived families, each run with its exit code recorded before any pipe, all exit 0 (includingnode scripts/check-sdui-manifest.mjs).--ranreconciliation: 35 derived, 35 run, 0 NOT-MEASURED, 0 UNRUN.Generated by Claude Code