Skip to content

Conversation

@ArnavBallinCode
Copy link
Member

@ArnavBallinCode ArnavBallinCode commented Dec 5, 2025

Screen.Recording.2025-12-06.at.1.21.30.AM.mov

Fix Schedule Page Auto-Scroll Issue (Proper Widget Fix)

This PR properly fixes the jarring auto-scroll when navigating to the schedule page by updating the pretalx-schedule widget to support a disable-auto-scroll attribute.

Fixes #1430

Changes

1. Updated Widget (pretalx-schedule.min.js)

2. Updated Template (schedule.html)

  • Added disable-auto-scroll attribute to <pretalx-schedule> element
  • Fixed template syntax by ensuring all Django tags are on single lines

How It Works

The widget now accepts a disable-auto-scroll attribute:

<pretalx-schedule
    event-url="..."
    disable-auto-scroll
></pretalx-schedule>

## Summary by Sourcery

Disable the pretalx schedule widget’s automatic scrolling on the schedule page and tidy up the schedule template markup.

Bug Fixes:
- Prevent jarring automatic scrolling when opening the schedule page by enabling the pretalx-schedule widget’s disable-auto-scroll behavior.

Enhancements:
- Simplify and normalize the schedule.html template markup and Django tag formatting for improved readability.

- Updated pretalx-schedule.min.js with new widget supporting disable-auto-scroll
- Added disable-auto-scroll attribute to schedule.html pretalx-schedule element
- Fixed template syntax by putting all Django template tags on single lines

The widget changes are from fossasia/eventyay-talk-schedule fix/disable-auto-scroll branch.

Fixes fossasia#1430
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Dec 5, 2025

Reviewer's Guide

Adds support for a disable-auto-scroll attribute in the pretalx schedule widget and wires it up in the agenda schedule template while cleaning up Django template formatting and tag usage.

File-Level Changes

Change Details Files
Wire new disable-auto-scroll widget attribute into the schedule page template and normalize Django template formatting.
  • Ensure container_width block tag is rendered on a single line to avoid template parsing issues.
  • Re-indent and reflow header_right block markup, keeping Django template tags intact but moving them onto cleaner, mostly single-line structures.
  • Simplify agenda_content block by reducing unnecessary whitespace and aligning if/for blocks without changing logic.
  • Add disable-auto-scroll attribute to the pretalx-schedule custom element so the client-side widget can opt out of auto-scrolling.
  • Keep the NoJS fallback schedule markup functionally unchanged while re-indenting its translation block.
app/eventyay/agenda/templates/agenda/schedule.html
Update pretalx schedule frontend widget bundle to understand disable-auto-scroll and suppress automatic scrolling when requested.
  • Replace/minify the pretalx-schedule.min.js bundle with a version built from fossasia/eventyay-talk-schedule that includes the new disable-auto-scroll prop handling.
  • Ensure the widget reads the disable-auto-scroll attribute from the pretalx-schedule element and skips its initial auto-scroll behavior when present.
  • Preserve existing widget behavior (event URL, version, locale, timezone, list/grid format, styling) aside from the conditional auto-scroll change.
app/eventyay/static/agenda/js/pretalx-schedule.min.js

Assessment against linked issues

Issue Objective Addressed Explanation
#1430 Prevent the automatic scroll-to-top behavior when users click session-related menu items (within the pretalx schedule/talk widget).
#1430 Ensure that navigation transitions within the session/schedule view are smooth and do not cause visible page movement.
#1430 Apply the fix across all talk component pages that use the pretalx schedule widget (e.g., Sessions, Speakers, Tracks) by updating the shared widget behavior.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • The pretalx-schedule element is now on a single long line with many attributes, which makes future diffs and reviews harder; consider keeping the tag itself on one line but wrapping attributes across multiple lines for readability while still respecting the template-engine constraint you’re fixing.
  • The new disable-auto-scroll attribute is always enabled; if there are scenarios where auto-scroll is still desirable, consider making this behavior conditional (e.g., driven by a view flag or template variable) instead of hard-coded.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `pretalx-schedule` element is now on a single long line with many attributes, which makes future diffs and reviews harder; consider keeping the tag itself on one line but wrapping attributes across multiple lines for readability while still respecting the template-engine constraint you’re fixing.
- The new `disable-auto-scroll` attribute is always enabled; if there are scenarios where auto-scroll is still desirable, consider making this behavior conditional (e.g., driven by a view flag or template variable) instead of hard-coded.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@ArnavBallinCode ArnavBallinCode changed the title Fixes Fixes Autoscroll on Sessions page Dec 5, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an auto-scroll issue on the schedule page by updating the pretalx-schedule widget to support a disable-auto-scroll attribute and applying it in the template. The changes include both widget updates (compiled JavaScript) and template formatting improvements.

  • Updated the pretalx-schedule widget to support disableAutoScroll prop that prevents auto-scrolling to current time on page load
  • Added disable-auto-scroll attribute to the <pretalx-schedule> element in the schedule template
  • Cleaned up template formatting by normalizing Django tags and indentation

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
app/eventyay/static/agenda/js/pretalx-schedule.min.js Added disableAutoScroll prop to schedule components and integrated it into scroll logic to prevent automatic scrolling when the attribute is present
app/eventyay/agenda/templates/agenda/schedule.html Added disable-auto-scroll attribute to the widget element and cleaned up template formatting with consistent indentation and single-line Django tags

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ArnavBallinCode
Copy link
Member Author

There is a UI issue on the sessions page, I will fix it with a new pr once this is merged, dont want to add that into this for it to be clean and not confusing to the changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Page scrolls upward when clicking session menu items

1 participant