Repository navigation
fix(plugin-calendar): no resize handle in the week/day views without an end field; calendar-view forwards a host endEditable - #29292
Merged
Conversation
…nd; calendar-view forwards a host endEditable Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jRjkd6BVRcw6N7MyTu
…iew opens Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jRjkd6BVRcw6N7MyTu
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jRjkd6BVRcw6N7MyTu
Contributor
Author
|
domain:ui#1 · zhuangjianguo · session_01QsR2jUJ19MstFvFhjgiYTu 席位核对 · ACCEPT · 2026-11-02T11:29ZHead-sha:
|
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 #29197
Clause-②: no
Metadata-protocol: none
维护者速读
endDateField)时,周视图和日视图的事件上不再画任何调整大小的拖拽柄,顶部「调整开始」柄也去掉了;拖动事件本身照旧可以移动。另外,按页面节点编写的calendar-view现在会把宿主传入的endEditable交给日历组件,和ObjectCalendar行为一致。endEditable时calendar-view的行为也不变。endEditable是 calendar month view: the resize-end handle is drawn when the view declares no end-date field, and dragging it PATCHes the unchanged start date (updated_at bumps, update triggers fire) #29020 新加、尚未发版的属性,这次只是让它的false也覆盖顶部柄,类型没变。回滚即还原本 PR。CalendarView.tsx里周/日视图顶部柄的条件和handleEventPointerDown开头新增的拦截;calendar-view-renderer.tsx新增的resolveAuthoredEndEditable与转交处;ObjectCalendar.endEditable-29020.test.tsx里两条改了预期的用例。ui/下运行pnpm exec vitest run packages/plugin-calendar/src/__tests__/CalendarView.noEndNoResize-29197.test.tsx,预期 1 个文件、12 个测试全绿。What changes
CalendarView, week and day views:endEditable={false}now also hides the top "Resize start" handle, so with no stored end the time grid draws no resize handle at all.handleEventPointerDownignores the top and bottom zones whenendEditableisfalse; a body drag still moves the event. The month view is as calendar month view: the resize-end handle is drawn when the view declares no end-date field, and dragging it PATCHes the unchanged start date (updated_at bumps, update triggers fire) #29020 left it (no "Resize event end" handle). The prop's doc now says whatfalsemeans: the events have no stored end, so no view draws a resize handle. The type is unchanged.ObjectCalendar: unchanged. It already passesendEditable={Boolean(calendarConfig.endDateField)}, so a view with no end field now draws no top handle either.calendar-viewrenderer: forwards a host'sendEditableas a declared host hatch, the way it forwardsslotMinutes: a boolean reachesCalendarView, anything else gets the absent-key answer (the defaulttrue). No registry input,@object-ui/typeskey or metadata key is added.content/docs/frontend/plugins/plugin-calendar.mdx.Premise note (why the renderer forwards rather than derives). A
calendar-viewnode'sendDateFielddefaults toend:CalendarViewSchema.endDateFieldcarries@default 'end'in@object-ui/types, and the renderer readsschema.endDateField || 'end'. So every authored node names an end field, and derivingendEditablefrom it would always givetrue. Only the host knows its records keep no end, so the renderer forwards the host's boolean. Handles need a hostonEventDropin the first place (JSON cannot carry a function), so the hatch sits beside the callback that makes them appear.Tests
New file
ui/packages/plugin-calendar/src/__tests__/CalendarView.noEndNoResize-29197.test.tsx, 12 cases:CalendarViewdirectly, week and day:endEditable={false}draws neither the top nor the bottom handle. Control: the default draws both.ObjectCalendar, week and day: a view with no end field (withallDayFielddeclared, so the record is drawn timed) draws no top handle and no bottom handle. Control: a view with an end field draws both.calendar-viewthroughSchemaRenderer: a hostonEventDropwithendEditable: falsedraws neither time-grid handle in the week view and no "Resize event end" handle in the month view. Controls: noendEditablefrom the host draws both handles, and a non-boolean'false'gets the default (both handles).Updated
ObjectCalendar.endEditable-29020.test.tsx: the two cases that pinned the top handle staying with no end field (one throughObjectCalendar, one onCalendarViewdirectly) now assert it is gone; the end-field controls are untouched.Acceptance notes
.changeset/29020-calendar-resize-without-end-field.md(unreleased) still says the top "Resize start" handle is unchanged. Both changesets ship in the same release, so the changelog will carry that line and this one's correction side by side. It is outside this claim's file surface and left as it is.endEditablefalse the top and bottom zones have no element to press. It keeps the gesture closed if a handle is drawn by some later change.ui/packages/plugin-calendar/README.mdkeeps its one-line summary ("Drag top/bottom edges to resize start/end times"), which stays true for views with an end field; it is outside this claim's file surface.Verification
Readings on head
d28a86c7, base45e9b2f1.Tests
CalendarView.tsxandcalendar-view-renderer.tsxrestored from45e9b2f1(the tests import the source, no rebuild involved), the same two files ran 8 failed and 17 passed. Every case asserting the new behaviour failed (six in the new file, the two flipped calendar month view: the resize-end handle is drawn when the view declares no end-date field, and dragging it PATCHes the unchanged start date (updated_at bumps, update triggers fire) #29020 cases); every control passed. Restored withgit checkout HEAD,git diff HEADempty, both blobs equal to HEAD.pnpm exec vitest run --maxWorkers=2 packages/plugin-calendar/fromui/, under the verify lock: 68 files passed, 502 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 66 families; all 66 ran with exit 0 on headd28a86c7, the 65 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). Two needed a second run:check:skill-examplesfirst refused with exit 3 (PREREQUISITE NOT MET,@objectstack/client-reactunbuilt) and ran exit 0 after building it; inpnpm --dir ui exec vitest run scripts/(locked, 171 files) one case,check-hand-rolled-comment-mask"exits 0 as a process", a whole-tree scan, timed out at 15 s in the full run, and its file alone then passed 22 of 22; the rest of the run was 168 files passed, 2 skipped.dispatch-gates --ran: 66 derived, 66 run, 0 NOT-MEASURED, 0 UNRUN.node ui/scripts/check-new-cross-file-line-citations.mjs: 0 new citations.eslinton the four changed ui files: 0 errors; 25 warnings, the same counts (24 and 1) the two source files carry at the base, and none in the two test files.Generated by Claude Code