Repository navigation
View window rendering - #4668
getheobald wants to merge 10 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-rendering Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tt-windows-shared-rendering Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| return { | ||
| gridColumnStart: getStartCol(event.date), | ||
| gridColumnEnd: getEndCol(addWeeksToDate(event.date, 1)), | ||
| ...ganttElementPositionStyles(getElementPositionPx(event.date, addWeeksToDate(event.date, 1), scale)), |
There was a problem hiding this comment.
Events are still hardcoded to one week, make it 1 day and let the minimum width floor handle visibility
| @@ -225,6 +235,97 @@ export const getElementWidthPx = (start: Date, end: Date, timeWindow: GanttTimeW | |||
There was a problem hiding this comment.
The minimum width is set in days, so the floor ranges from about 21px (Month) to 93px (Week). Use a pixel floor instead: Math.max(days * pixelsPerDay, GANTT_MIN_ELEMENT_PX)
| searchText, | ||
| history | ||
| history, | ||
| timeWindow |
There was a problem hiding this comment.
With timeWindow in the effect's dependencies, every view switch rebuilds all collections, even Week ↔ Month. Depend on GANTT_TIME_WINDOWS[timeWindow].showTasks instead
| if (projects && teams) { | ||
| requestRefresh(projects, teams, editedProjects, addedProjects, { ...filters, showCars }, searchText); | ||
| // some windows (Year) never show tasks, regardless of the filter | ||
| const hideTasks = (filters.hideTasks ?? false) || !GANTT_TIME_WINDOWS[timeWindow].showTasks; |
There was a problem hiding this comment.
Year view hides tasks, but the "show tasks" filter checkbox still shows as checked
|
|
||
| setWidth(newWidth); // sync render | ||
| setCorrectWidth(getCorrectWidth(newWidth)); | ||
| const days = getDistanceFromLeft(e.clientX) / scale.pixelsPerDay; |
There was a problem hiding this comment.
Nit: rename the local days to daysFromStart
| const onDrop = (day: Date) => { | ||
| const days = ceilToMultipleOf7(differenceInDays(day, task.start)); | ||
| const onDrop = (weekStart: Date) => { | ||
| const days = ceilToSnap(differenceInDays(weekStart, task.start)); |
There was a problem hiding this comment.
Nit: rename the local days to daysFromStart
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
Changes
Screenshots
To Do
More extensive testing is covered in #4485 - that's where I wanna do all the regression testing with editing flow and all that. But that needs the editing fix from my other PR first.
Checklist
It can be helpful to check the
ChecksandFiles changedtabs.Please review the contributor guide and reach out to your Tech Lead if anything is unclear.
Please request reviewers and ping on slack only after you've gone through this whole checklist.
yarn.lockchanges (unless dependencies have changed)Closes #4666
Closes #4480
Closes #4481
Closes #4482
Closes #4483
Closes #4484