Repository navigation
fix(plugin-calendar): no resize-end handle without an end field; a drop that changes no date writes nothing - #29146
Merged
Conversation
…op that changes no date writes nothing Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTP5DLZwaztvKMgUJf
…angeset Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTP5DLZwaztvKMgUJf
…the event is drawn timed Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTP5DLZwaztvKMgUJf
Contributor
Author
|
domain:ui#1 · zhuangjianguo · session_01QsR2jUJ19MstFvFhjgiYTu 席位核对 · ACCEPT · 2026-11-02T08:37ZHead-sha:
|
Contributor
Author
|
triage#1 · os-zhuang · session_01AavokzJ5DndAwitDXvKy4U Contract-review-claim: Taken under Generated by Claude Code |
Contributor
Author
|
triage#1 · os-zhuang · session_01AavokzJ5DndAwitDXvKy4U Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS Generated by Claude Code |
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 Steedos · project thread
Fixes #29020
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
endDateField)时,月视图卡片右侧不再画「调整结束」拖拽柄,周/日视图事件底部的「调整结束」柄也不再画;移动卡片、顶部「调整开始」柄照旧。另外,日历默认的拖放保存在「要写的日期与记录现值完全相同」时不再发写请求。做法:CalendarView新增可选属性endEditable(默认 true),ObjectCalendar按是否声明endDateField传入。updated_at变了,所有「记录更新后」触发器和流程都为一次没人做的修改跑了一遍(通知、审计行、集成)。周视图里在事件上按下再松开(不移动)也会这样写一次。CalendarView不传新属性时行为不变。回滚即还原本 PR。ObjectCalendar.tsx的handleEventDropDefault开头新增的「无变化不写」判断与sameInstant;CalendarView.tsx月视图showResizeHandle与周/日视图底部柄的条件;ObjectCalendar.tsx渲染CalendarView处新增的endEditable。ui/下运行pnpm exec vitest run packages/plugin-calendar/src/__tests__/ObjectCalendar.endEditable-29020.test.tsx,预期 1 个文件、13 个测试全绿。What changes
CalendarViewProps.endEditable?: boolean(defaulttrue; the type is exported from the@object-ui/plugin-calendarentry, hence the widening declaration). Whenfalse:resize-enddrag payload dropped anyway hands nothing toonEventDrop;Moving a card and the time grid's top "Resize start" handle are unchanged.
ObjectCalendarpassesendEditable={Boolean(calendarConfig.endDateField)}. A view that declares an end field keeps both handles and keeps writing the end, including on a record whose end is empty.ObjectCalendar's default drop handler (handleEventDropDefault) returns before the optimistic update anddataSource.updatewhen the start it would write is the record's start, and either it writes no end or that end is the record's end. Both are compared as instants, read the way the grid placed the event (toDisplayDate), so a stored spelling that differs from the one written back still counts as unchanged; an empty or unparseable stored value never matches, so it still writes. This closes the second door to the same write: a press and release on a week-view event, without moving it, callsonEventDropwith the event's own dates and wrote them back, with or without an end field. A host that supplies its ownonEventDropis unaffected.Tests
New file
ui/packages/plugin-calendar/src/__tests__/ObjectCalendar.endEditable-29020.test.tsx, 13 cases:ObjectCalendar: no end field draws no "Resize event end" handle; no end field still moves the card and writes the start alone. Controls: with an end field the handle is drawn and dragging it writes the new end; with an end field and an empty end on the record, the handle is drawn and writes the end.ObjectCalendar: no end field (withallDayFielddeclared, so the record is drawn timed) draws the top handle and no bottom handle. Control: with an end field, both handles.CalendarViewdirectly:endEditabledefaults to drawing the handle;falsehides the month handle while the card still moves;falserefuses aresize-endpayload;falsehides the week view's bottom handle and keeps the top one.Acceptance notes
endDateFieldand noallDayField,ObjectCalendarmarks every record all-day, so the week and day views draw it in the all-day lane, which has no handles. The bottom-handle change matters only when the view also declaresallDayFieldand a record is flagged not all-day.calendar-view-renderer.tsx(the schema-drivencalendar-viewelement) does not forward the new prop, so authoredcalendar-viewnodes keep the defaulttrue, as before.Verification
All readings on head
88ee38a1(fixce572f2f, changeset declaration50f1987b, test fixture88ee38a1), base5d3667e2.Tests
CalendarView.tsxandObjectCalendar.tsxrestored from5d3667e2(the tests import the source, no rebuild involved), the new file ran 7 failed and 6 passed. Every case asserting the new behaviour failed; the six controls passed. Restored withgit checkout HEAD,git diff HEADempty, blob equal to HEAD.scripts/ablation-replace.mjsturned the guard's first condition intofalse && …(anchor 1 to 0, blob moved); the two press-and-release cases failed, 11 passed; restored,git diff HEADempty.pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-calendar/under the verify lock: 67 files passed, 490 tests passed, 95 skipped (the zone-driven cases that run only in their forks child).pnpm exec turbo run type-check --filter=@object-ui/plugin-calendar: 50 of 50 tasks successful.Gates
node scripts/pm/dispatch-gates.mjs --commandsderived 34 families; all 34 ran with exit 0 on head88ee38a1, the 33 unlocked ones with this body as the PR event (check-adr-0087-registration,check-changeset-no-major,check-closing-keyword-parity,check-empty-changeset,check-sdui-manifestamong them), andpnpm --dir ui exec vitest run scripts/locked: 169 files passed, 2 skipped (4,900 tests passed).dispatch-gates --ran: 34 derived, 34 run, 0 NOT-MEASURED, 0 UNRUN.node ui/scripts/check-new-cross-file-line-citations.mjs: 0 new citations.eslinton the three changed ui files: 0 errors; 52 warnings, the same counts (24 and 28) the two source files carry at the base, and none in the new test file.Generated by Claude Code