Skip to content

fix(schedule): centralize render completion and auto-scroll#1410

Merged
JohnVillalovos merged 1 commit into
LibreBooking:developfrom
labmecanicatec:fix-1409
Jun 1, 2026
Merged

fix(schedule): centralize render completion and auto-scroll#1410
JohnVillalovos merged 1 commit into
LibreBooking:developfrom
labmecanicatec:fix-1409

Conversation

@labmecanicatec

Copy link
Copy Markdown
Collaborator

Refactor schedule rendering to remove duplicated completion logic in both render branches. Introduce a single finishRender flow that:

  • initializes reservable interactions when enabled
  • hides the loading indicator
  • resets renderingEvents
  • triggers autoScrollToToday

Close: #1409
Assisted-by: Copilot:GPT-4.1

Copilot AI 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.

Pull request overview

Centralizes schedule render-completion logic into a single finishRender helper and moves auto-scroll-to-today into a reusable function that runs after reservations are rendered, fixing the bug where auto.scroll.today had no effect because it ran before reservations were drawn.

Changes:

  • Introduces autoScrollToToday() (guarded by a one-shot hasAutoScrolledToday flag) using scrollIntoView.
  • Removes the early auto-scroll attempt in init() that ran before reservations rendered.
  • Consolidates the post-render steps (initReservable, hide loader, reset flag, auto-scroll) into a finishRender() closure used by both render branches.

Refactor schedule rendering to remove duplicated completion logic in both render branches.
Introduce a single finishRender flow that:
- initializes reservable interactions when enabled
- hides the loading indicator
- resets renderingEvents
- triggers autoScrollToToday

Close: LibreBooking#1409
Assisted-by: Copilot:GPT-4.1

@JohnVillalovos JohnVillalovos left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @labmecanicatec

LGTM

@JohnVillalovos JohnVillalovos merged commit 2c58149 into LibreBooking:develop Jun 1, 2026
16 checks passed
@labmecanicatec labmecanicatec deleted the fix-1409 branch June 4, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] schedule scroll

3 participants