Skip to content

feat: implement VerticalResource view with layout and styling updates#344

Open
ansulagrawal wants to merge 5 commits into
masterfrom
feat/vertical-view
Open

feat: implement VerticalResource view with layout and styling updates#344
ansulagrawal wants to merge 5 commits into
masterfrom
feat/vertical-view

Conversation

@ansulagrawal

@ansulagrawal ansulagrawal commented May 10, 2026

Copy link
Copy Markdown
Owner

Todo (Pending Task):

  1. Fix CSS Issues

Summary by CodeRabbit

  • New Features

    • Added a Vertical View option and demo page for a resource-oriented vertical scheduler.
  • Improvements

    • Event items adapt height dynamically for better responsiveness.
    • More consistent table/layout sizing and fixed table rendering.
    • Header/week-number and non-working-time visuals now behave correctly in vertical vs horizontal views.
    • Example UI: new Vertical View menu item and refined task hover styling.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 10, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@coderabbitai[bot] has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 57 minutes and 21 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 21a04113-7b55-47e9-9585-7827ba6d23e6

📥 Commits

Reviewing files that changed from the base of the PR and between 7d0bbf7 and b4161ca.

📒 Files selected for processing (6)
  • src/components/BodyView.jsx
  • src/components/SchedulerData.js
  • src/components/index.jsx
  • src/examples/components/Slider.jsx
  • src/examples/components/TaskItem.jsx
  • src/examples/pages/VerticalView/index.jsx
📝 Walkthrough

Walkthrough

Adds a VerticalResource view mode and routes SchedulerData, header/body rendering, event placement, layout/CSS, and example routing to render resources vertically by time.

Changes

Vertical Resource View Feature

Layer / File(s) Summary
Type & Configuration Definition
src/config/default.js, src/config/scheduler.js
ViewType adds VerticalResource: 8; default config adds a Vertical view using the new type.
Core Data Handling
src/components/SchedulerData.js
isVerticalResourceView() method added; constructor and view switching route vertical mode to Hour cellUnit; _createHeaders() refactored to build timeSlots and produce resource-like headers in vertical mode; _createInitHeaderEvents() sets end==start for header events; _createInitRenderData() builds vertical slots from timeSlots; _getSpan() returns 1 for vertical; _createRenderData() matches events to slots/resource IDs and forces render; width helpers map VerticalResource to custom widths; addResource() recreates headers when vertical.
Header & Body Rendering
src/components/HeaderView.jsx, src/components/BodyView.jsx, src/components/ResourceView.jsx
HeaderView short-circuits week-number and uses per-cell width/minWidth in vertical mode; BodyView always assigns per-cell width and minWidth and applies non-working-time background from row.nonWorkingTime in vertical mode (otherwise from header.nonWorkingTime); ResourceView removes a -2 width offset and renders centered HH:mm label rows for vertical slots.
Event Item & Positioning
src/components/EventItem.jsx, src/components/ResourceEvents.jsx
EventItem stores height from props in state and uses it for inline styles; ResourceEvents computes selection start/end from slotId + config.minuteStep in vertical mode, positions items by row index (top = idx * eventItemLineHeight), passes explicit height to EventItem, and divides cell width by headerItem.count for per-item left/width.
Layout & Styling Integration
src/components/index.jsx, src/css/style.css
Main table width offsets removed; root table receives tableLayout: fixed and conditional vertical-view class; scheduler view <td> and background table receive explicit styles; CSS adds border-collapse: collapse and tightens .rbs.vertical-view .event-item margins.
Example Pages & Routing
src/examples/pages/VerticalView/index.jsx, src/examples/router.jsx, src/examples/components/Slider.jsx
New VerticalView example initializes a vertical SchedulerData with demo resources/events and handlers; router adds a lazy /vertical-view route; Slider adds a "Vertical View" menu item.
Supporting Improvements
src/examples/pages/Drag-And-Drop/class-based.jsx, src/examples/components/TaskItem.jsx, src/examples/css/style.css
DragAndDrop adds parentRef for responsive sizing; TaskItem uses .task-item-hover class for drag preview; example CSS removes global section bottom-margin and adds task hover effects.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

🐰 A vertical view hops into sight,
Resources stacked in morning light,
Events align in tidy rows,
Headers set where timeline flows,
Hop — the scheduler feels just right!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main feature being implemented: a new VerticalResource view mode with associated layout and styling updates across multiple components.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/vertical-view

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
src/examples/pages/Drag-And-Drop/class-based.jsx (1)

58-79: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Fix Biome-blocking prop indentation in <Scheduler>

CI is currently failing because the JSX props under <Scheduler> are not indented as Biome expects (see Line 62-Line 78). This blocks merge.

Suggested formatting fix
             <div ref={this.schedulerContainerRef} style={{ width: '100%', overflow: 'hidden' }}>
               <Scheduler
                 CustomResourceHeader={() => <div>Custom Header</div>}
                 schedulerData={viewModel}
                 parentRef={this.schedulerContainerRef}
-              prevClick={this.prevClick}
-              nextClick={this.nextClick}
-              onSelectDate={this.onSelectDate}
-              onViewChange={this.onViewChange}
-              eventItemClick={this.eventClicked}
-              viewEventClick={this.ops1}
-              viewEventText="Ops 1"
-              viewEvent2Text="Ops 2"
-              viewEvent2Click={this.ops2}
-              updateEventStart={this.updateEventStart}
-              updateEventEnd={this.updateEventEnd}
-              moveEvent={this.moveEvent}
-              movingEvent={this.movingEvent}
-              newEvent={this.newEvent}
-              subtitleGetter={this.subtitleGetter}
-              dndSources={[taskDndSource, resourceDndSource]}
-              toggleExpandFunc={this.toggleExpandFunc}
-              />
+                prevClick={this.prevClick}
+                nextClick={this.nextClick}
+                onSelectDate={this.onSelectDate}
+                onViewChange={this.onViewChange}
+                eventItemClick={this.eventClicked}
+                viewEventClick={this.ops1}
+                viewEventText="Ops 1"
+                viewEvent2Text="Ops 2"
+                viewEvent2Click={this.ops2}
+                updateEventStart={this.updateEventStart}
+                updateEventEnd={this.updateEventEnd}
+                moveEvent={this.moveEvent}
+                movingEvent={this.movingEvent}
+                newEvent={this.newEvent}
+                subtitleGetter={this.subtitleGetter}
+                dndSources={[taskDndSource, resourceDndSource]}
+                toggleExpandFunc={this.toggleExpandFunc}
+              />
             </div>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/examples/pages/Drag-And-Drop/class-based.jsx` around lines 58 - 79, The
JSX props on the <Scheduler> component are misindented and failing Biome;
reformat the <Scheduler> element so each prop (e.g., schedulerData, parentRef,
prevClick, nextClick, onSelectDate, onViewChange, eventItemClick,
viewEventClick, viewEvent2Click, updateEventStart, updateEventEnd, moveEvent,
movingEvent, newEvent, subtitleGetter, dndSources, toggleExpandFunc) is aligned
consistently (one prop per line indented to the same level beneath the opening
<Scheduler> tag) and ensure the closing "/>" is on its own line; update the prop
indentation to match the existing first props (CustomResourceHeader and
schedulerData) so Biome formatting passes.
src/components/EventItem.jsx (1)

528-534: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use dynamic line-height when dynamic height is provided.

Line 533 always uses config.eventItemHeight, which can visually misalign text when Line 528 applies a different runtime height.

💡 Proposed fix
         <span
           style={{
             marginLeft: '10px',
-            lineHeight: `${config.eventItemHeight}px`,
+            lineHeight: `${height || config.eventItemHeight}px`,
           }}
         >
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/EventItem.jsx` around lines 528 - 534, The span's inline style
uses a fixed lineHeight of config.eventItemHeight which desynchronizes when the
container uses a dynamic height prop; update the EventItem component to compute
the actual height (e.g., use the existing height prop fallback pattern:
actualHeight = height || config.eventItemHeight) and then set lineHeight to
`${actualHeight}px` (replace the direct use of config.eventItemHeight) so the
text vertical alignment follows the runtime height.
src/components/SchedulerData.js (1)

287-321: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Fix incorrect date-window initialization when entering VerticalResource view.

On Line 287, the this.viewType < viewType branch never handles ViewType.VerticalResource. Switching from Week/Month/Year into Vertical can keep a multi-day range, producing oversized hourly slot grids.

💡 Proposed fix
-        if (this.viewType < viewType) {
-          if (viewType === ViewType.Week) {
+        if (this.viewType < viewType) {
+          if (viewType === ViewType.Day || viewType === ViewType.VerticalResource) {
+            this.startDate = this.localeDayjs(new Date(date)).startOf('day');
+            this.endDate = this.startDate;
+            this.cellUnit = CellUnit.Hour;
+          } else if (viewType === ViewType.Week) {
             this.startDate = this.localeDayjs(new Date(date)).startOf('isoWeek');
             this.endDate = this.localeDayjs(new Date(this.startDate)).endOf('isoWeek');
           } else if (viewType === ViewType.Month) {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/SchedulerData.js` around lines 287 - 321, The code path
handling upgrades of viewType (the if block guarded by "if (this.viewType <
viewType)") never handles ViewType.VerticalResource, so switching into
VerticalResource from a larger range keeps multi-day startDate/endDate and
yields oversized hourly grids; in the same branch where Week/Month/Quarter/Year
are set, add a case for viewType === ViewType.VerticalResource (or combine it
with ViewType.Day) to set this.startDate = this.localeDayjs(new
Date(date)).startOf('day'), this.endDate = this.startDate, and this.cellUnit =
CellUnit.Hour so the date window is a single day when entering the
VerticalResource view.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/HeaderView.jsx`:
- Around line 63-67: Guard the week-number header rendering so it only runs when
week numbers are valid and vertical-resource mode is not enabled: in the header
rendering blocks that reference group.week and group.year (the <th
key={`week-${group.year}-${group.week}`} .../> block and the similar block
around lines 127-136), wrap the render with a check for showWeekNumber &&
!<vertical-resource-mode-flag> (or at minimum ensure group.week is
defined/non-null) so we skip producing week-number groups when vertical-resource
mode is active; update both occurrences to use the same guard to prevent invalid
week values and keys.

In `@src/components/SchedulerData.js`:
- Around line 930-935: The vertical-resource branch sets header.time to a
non-date identifier (this.headers = this.resources.map(... time: r.id ...)), but
later code in build/iterate over headers (where header.time is parsed as a Date
and header.start/header.end are computed) expects a Date/time value; update the
vertical case in isVerticalResourceView() to assign a proper date/time value
(e.g., the current view date or the existing visible date value used elsewhere)
to this.headers' time field and ensure nonWorkingTime stays correct so
subsequent parsing of header.time produces valid header.start/header.end ranges;
locate and change the assignment in the block that builds headers for vertical
resource view (the map assigning time: r.id) and make it consistent with the
header parsing logic.
- Around line 424-427: The responsive height calculation is subtracting the
week-number row twice: totalHeaderHeight currently adds week-number height but
headerHeight (e.g., schedulerHeaderHeight in the parent observer) already
includes that contribution. Modify the computation in SchedulerData by removing
the week-number addition from totalHeaderHeight (or simply use headerHeight
where appropriate) so baseHeight is computed as this.documentHeight -
headerHeight - (this.config.underneathHeight || 0) and avoid subtracting
showWeekNumber ? weekNumberRowHeight twice; update references to
totalHeaderHeight, baseHeight, this.config.tableHeaderHeight,
this.config.showWeekNumber, this.config.weekNumberRowHeight and headerHeight
accordingly.
- Around line 132-136: addResource currently updates resources and calls
_createRenderData but doesn't rebuild headers, causing missing columns in
vertical mode; modify addResource to mirror setResources by validating and
updating the resources collection and then calling this._createHeaders() before
this._createRenderData() (so locate addResource and insert a call to
_createHeaders() after the resources update and before _createRenderData(),
ensuring headers are regenerated when operating in vertical mode).

In `@src/examples/components/TaskItem.jsx`:
- Around line 23-37: The inline visual styles in the TaskItem component (the
style prop currently applied in TaskItem.jsx) should be moved into the
.task-item-hover CSS class to avoid specificity and !important usage; remove the
style prop from the TaskItem JSX, create/extend the .task-item-hover rule in
your stylesheet to include padding, margin, background-color, border,
border-radius, color, font-weight, font-size, list-style, cursor, box-shadow and
transition, and also add the :hover state there for the hover effects so base
and hover styles are consolidated under the .task-item-hover selector.

In `@src/examples/css/style.css`:
- Around line 162-165: Remove the use of !important from the
.task-item-hover:hover rules (background-color, border-color, box-shadow) to
satisfy the noImportantStyles Biome rule and CI, and fix the box-shadow rgba
formatting to include spaces after commas (use "rgba(0, 0, 0, 0.1)" style).
Update the CSS block for the .task-item-hover:hover selector to remove
"!important" on each property and correct the rgba argument spacing so
formatting checks pass.

In `@src/examples/pages/VerticalView/index.jsx`:
- Around line 28-50: The handlers prevClick, nextClick, onSelectDate and
onViewChange currently mutate the schedulerData in place (via
schedulerData.prev()/next()/setDate()/setViewType()) then call setViewModel with
the same object reference, so React may not re-render; fix by passing a new
reference to state after mutation (e.g., clone schedulerData or create a shallow
copy) when calling setViewModel so React sees a changed value — update each
handler (prevClick, nextClick, onSelectDate, onViewChange) to call setViewModel
with a newly created object (or use an existing clone() on schedulerData if
available) instead of the original schedulerData reference.

---

Outside diff comments:
In `@src/components/EventItem.jsx`:
- Around line 528-534: The span's inline style uses a fixed lineHeight of
config.eventItemHeight which desynchronizes when the container uses a dynamic
height prop; update the EventItem component to compute the actual height (e.g.,
use the existing height prop fallback pattern: actualHeight = height ||
config.eventItemHeight) and then set lineHeight to `${actualHeight}px` (replace
the direct use of config.eventItemHeight) so the text vertical alignment follows
the runtime height.

In `@src/components/SchedulerData.js`:
- Around line 287-321: The code path handling upgrades of viewType (the if block
guarded by "if (this.viewType < viewType)") never handles
ViewType.VerticalResource, so switching into VerticalResource from a larger
range keeps multi-day startDate/endDate and yields oversized hourly grids; in
the same branch where Week/Month/Quarter/Year are set, add a case for viewType
=== ViewType.VerticalResource (or combine it with ViewType.Day) to set
this.startDate = this.localeDayjs(new Date(date)).startOf('day'), this.endDate =
this.startDate, and this.cellUnit = CellUnit.Hour so the date window is a single
day when entering the VerticalResource view.

In `@src/examples/pages/Drag-And-Drop/class-based.jsx`:
- Around line 58-79: The JSX props on the <Scheduler> component are misindented
and failing Biome; reformat the <Scheduler> element so each prop (e.g.,
schedulerData, parentRef, prevClick, nextClick, onSelectDate, onViewChange,
eventItemClick, viewEventClick, viewEvent2Click, updateEventStart,
updateEventEnd, moveEvent, movingEvent, newEvent, subtitleGetter, dndSources,
toggleExpandFunc) is aligned consistently (one prop per line indented to the
same level beneath the opening <Scheduler> tag) and ensure the closing "/>" is
on its own line; update the prop indentation to match the existing first props
(CustomResourceHeader and schedulerData) so Biome formatting passes.
🪄 Autofix (Beta)

✅ Autofix completed


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6da65b35-dac3-40df-8f82-91dcc7740702

📥 Commits

Reviewing files that changed from the base of the PR and between 5980acb and b46518c.

📒 Files selected for processing (16)
  • src/components/BodyView.jsx
  • src/components/EventItem.jsx
  • src/components/HeaderView.jsx
  • src/components/ResourceEvents.jsx
  • src/components/ResourceView.jsx
  • src/components/SchedulerData.js
  • src/components/index.jsx
  • src/config/default.js
  • src/config/scheduler.js
  • src/css/style.css
  • src/examples/components/Slider.jsx
  • src/examples/components/TaskItem.jsx
  • src/examples/css/style.css
  • src/examples/pages/Drag-And-Drop/class-based.jsx
  • src/examples/pages/VerticalView/index.jsx
  • src/examples/router.jsx

Comment thread src/components/HeaderView.jsx Outdated
Comment thread src/components/SchedulerData.js Outdated
Comment thread src/components/SchedulerData.js Outdated
Comment thread src/components/SchedulerData.js
Comment thread src/examples/components/TaskItem.jsx Outdated
Comment thread src/examples/css/style.css Outdated
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Fixes Applied Successfully

Fixed 5 file(s) based on 6 unresolved review comments.

Files modified:

  • src/components/HeaderView.jsx
  • src/components/SchedulerData.js
  • src/examples/components/TaskItem.jsx
  • src/examples/css/style.css
  • src/examples/pages/VerticalView/index.jsx

Commit: 7d0bbf73f5dfae356bb5ec8382c325eb1bfff4dd

The changes have been pushed to the feat/vertical-view branch.

Time taken: 4m 22s

Fixed 5 file(s) based on 6 unresolved review comments.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/components/SchedulerData.js (1)

132-193: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Critical: Duplicate addResource method definitions — the vertical-mode header rebuild is silently lost.

addResource is declared twice in this class (lines 132-142 and lines 186-193). In JavaScript class bodies, the second definition wins, so the version that calls this._createHeaders() for isVerticalResourceView() is overridden by the later one that does not. As a result, adding a resource in vertical mode will not regenerate headers, leaving the new resource column missing — defeating the fix from the prior review. Biome is also failing the build on this duplicate.

🔧 Proposed fix: remove the second declaration
   getMinuteStepsInHour() {
     return 60 / this.config.minuteStep;
   }

-  addResource(resource) {
-    const existedResources = this.resources.filter(x => x.id === resource.id);
-    if (existedResources.length === 0) {
-      this.resources.push(resource);
-      this._createRenderData();
-      this.bumpVersion();
-    }
-  }
-
   addEventGroup(eventGroup) {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/SchedulerData.js` around lines 132 - 193, There are two
duplicate class methods named addResource; the second definition overrides the
first and omits the vertical-mode header regeneration. Remove the duplicate
addResource (the later one that only calls this._createRenderData() and
this.bumpVersion()) so the single addResource implementation used is the one
that checks this.isVerticalResourceView() and calls this._createHeaders(), then
this._createRenderData() and this.bumpVersion() to restore correct behavior.
src/components/HeaderView.jsx (1)

172-183: 🧹 Nitpick | 🔵 Trivial | 💤 Low value

Dependency schedulerData.isVerticalResourceView is a stable method reference, not a value.

This dep is the unbound prototype method — it never changes across renders, so it adds no reactivity. The memo already recomputes when headers change (and headers is rebuilt on view-type changes), so today it works incidentally. To make the intent explicit, depend on the call result or on schedulerData itself.

🔧 Suggested change
-    schedulerData.isVerticalResourceView,
+    schedulerData,
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/HeaderView.jsx` around lines 172 - 183, The dependency list
currently includes the unbound method reference
schedulerData.isVerticalResourceView which is stable and doesn't trigger
recomputation; replace that entry with the actual boolean result (call
schedulerData.isVerticalResourceView()) or depend on schedulerData itself so the
memo (the useMemo in HeaderView.jsx surrounding the array of deps including
cellUnit, headers, minuteStepsInHour, cellWidth, config, localeDayjs,
createCellStyle, getCellFormat, renderCellContent) will re-run when the view
orientation changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/SchedulerData.js`:
- Around line 993-996: The code currently assigns id: header.id and style:
header.style when building header items but header.id only exists in vertical
mode, which can produce undefined ids for non-vertical timeSlots; update the
logic in the header construction (where headers/timeSlots are mapped into header
items) to always produce a stable id and style — either by calling/adding an id
generator (e.g., use the time string or index) for header.id when missing or by
defaulting style to header.style || {} — or alternatively guard the assignment
here so id is set to a deterministic fallback; ensure this change is coordinated
with _createHeaders and will keep _createRenderData behavior intact.
- Line 427: The long single-line declaration of baseHeight is failing the
formatter; refactor the baseHeight initialization in SchedulerData.js by
breaking the expression across multiple lines or introducing a small
intermediate const (e.g. const underneathHeight = this.config.underneathHeight
|| 0) and then compute const baseHeight = this.documentHeight - headerHeight -
this.config.tableHeaderHeight - underneathHeight so the expression reflows and
respects line-length rules.
- Around line 1350-1363: The overlap check in SchedulerData.js uses non-existent
ts.start/ts.end on timeSlots (built in _createHeaders as {time, nonWorkingTime,
style}), so remove the dead branches and consistently compute slot start/end
from ts.time and this.config.minuteStep (using
this.localeDayjs(tsStart).add(...)) or alternatively populate start and end when
building timeSlots in _createHeaders; update the loop that references timeSlots
(the this.timeSlots.forEach block) to rely solely on ts.time-derived start/end
or ensure _createHeaders creates start/end fields so the existing branch is
meaningful.

In `@src/examples/components/TaskItem.jsx`:
- Around line 21-26: Move the <li> props onto a single opening tag line so Biome
formatting passes: update the TaskItem.jsx JSX for the <li> that currently uses
ref={dragRef} and className="task-item-hover" (rendering {task.name}) to have
both props on the same line of the <li> start tag instead of each on separate
lines; preserve the dragRef and className values and the child {task.name}
content and ensure no other whitespace/line breaks are introduced in that
opening tag.

In `@src/examples/pages/VerticalView/index.jsx`:
- Around line 28-50: The handlers (prevClick, nextClick, onSelectDate,
onViewChange) currently call setViewModel({ ...schedulerData }), which strips
the SchedulerData prototype and loses methods like
prev/next/setDate/setViewType; replace this with one of two fixes: (A) keep the
original SchedulerData instance and trigger a re-render by updating state with a
counter (e.g., increment a renderCounter via setState) instead of replacing
schedulerData, or (B) create a shallow copy that preserves the prototype (e.g.,
Object.assign(Object.create(Object.getPrototypeOf(schedulerData)),
schedulerData)) and pass that to setViewModel so SchedulerData methods remain
available; update all four handlers (prevClick, nextClick, onSelectDate,
onViewChange) to use the chosen approach.

---

Outside diff comments:
In `@src/components/HeaderView.jsx`:
- Around line 172-183: The dependency list currently includes the unbound method
reference schedulerData.isVerticalResourceView which is stable and doesn't
trigger recomputation; replace that entry with the actual boolean result (call
schedulerData.isVerticalResourceView()) or depend on schedulerData itself so the
memo (the useMemo in HeaderView.jsx surrounding the array of deps including
cellUnit, headers, minuteStepsInHour, cellWidth, config, localeDayjs,
createCellStyle, getCellFormat, renderCellContent) will re-run when the view
orientation changes.

In `@src/components/SchedulerData.js`:
- Around line 132-193: There are two duplicate class methods named addResource;
the second definition overrides the first and omits the vertical-mode header
regeneration. Remove the duplicate addResource (the later one that only calls
this._createRenderData() and this.bumpVersion()) so the single addResource
implementation used is the one that checks this.isVerticalResourceView() and
calls this._createHeaders(), then this._createRenderData() and
this.bumpVersion() to restore correct behavior.
🪄 Autofix (Beta)

✅ Autofix completed


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 49efcf49-f954-4473-bc4f-3d78ce51ddd7

📥 Commits

Reviewing files that changed from the base of the PR and between b46518c and 7d0bbf7.

📒 Files selected for processing (5)
  • src/components/HeaderView.jsx
  • src/components/SchedulerData.js
  • src/examples/components/TaskItem.jsx
  • src/examples/css/style.css
  • src/examples/pages/VerticalView/index.jsx

Comment thread src/components/SchedulerData.js Outdated
Comment thread src/components/SchedulerData.js
Comment thread src/components/SchedulerData.js
Comment thread src/examples/components/TaskItem.jsx
Comment thread src/examples/pages/VerticalView/index.jsx
@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Fixes Applied Successfully

Fixed 3 file(s) based on 5 unresolved review comments.

Files modified:

  • src/components/SchedulerData.js
  • src/examples/components/TaskItem.jsx
  • src/examples/pages/VerticalView/index.jsx

Commit: ca7001673766b9ae094312f6f9d14c6d1aedf873

The changes have been pushed to the feat/vertical-view branch.

Time taken: 2m 57s

@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

Note

Docstrings generation - SUCCESS
Generated docstrings and committed to branch feat/vertical-view (commit: b4161ca30efeb3bfff24a53940e253e5dd6e7ecb)

coderabbitai Bot and others added 2 commits May 11, 2026 16:57
Fixed 3 file(s) based on 5 unresolved review comments.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
Docstrings generation was requested by @ansulagrawal.

The following files were modified:

* `src/components/BodyView.jsx`
* `src/components/index.jsx`
* `src/examples/components/Slider.jsx`
* `src/examples/components/TaskItem.jsx`

These files were kept as they were:
* `src/components/HeaderView.jsx`
* `src/components/ResourceView.jsx`

These file types are not supported:
* `src/css/style.css`
* `src/examples/css/style.css`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant