-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Fix critical jQuery migration bugs in timeline and event handling #20847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
|
@copilot Please continue working on this branch. Run the timeline feature specs and investigate failures as best you can. |
I've added a critical fix for the timeline width calculation that could prevent rendering failures: Commit ed5bbf6: Added fallback to The previous code would return Unfortunately, I cannot run the timeline feature specs in this environment as the Docker test setup requires configuration files ( Summary of all fixes made:
These fixes address the core jQuery migration issues that would cause timeline rendering and interaction problems. |
b9015a3 to
5c7ccd2
Compare
ed5bbf6 to
5c7ec07
Compare
- Fix keyPressFn callback registration in timeline cell mouse handler - Fix selection state to update all matching rows, not just first - Fix timing of hidden attribute in persistent toggle animations - Fix getNamespaceAndType to properly return null for namespace-only events Co-authored-by: myabc <[email protected]>
The original jQuery code `$element.children().width()` gets the width of the first child element, not the sum of all children. This was incorrectly translated to summing all children widths, which would cause timeline rendering issues. Co-authored-by: myabc <[email protected]>
Co-authored-by: myabc <[email protected]>
If the timeline container's first child doesn't have a width yet (e.g., during initial render), fall back to document.body.clientWidth to ensure we always have a valid width for calculating visible days. This prevents division by zero and ensures the timeline can render even if elements aren't fully laid out. Co-authored-by: myabc <[email protected]>
5c7ec07 to
a799e05
Compare
Fixes timeline spec failures caused by incorrect jQuery-to-native DOM migrations. Six critical bugs were preventing timeline interactions from working correctly.
Timeline Width Calculation
jQuery's
$element.children().width()returns the width of the first child, not the sum. The migration incorrectly computed the sum of all children widths, causing incorrect viewport dimensions:Fallback Added: If the timeline container's first child doesn't have a width yet (e.g., during initial render), the code now falls back to
document.body.clientWidthto ensure we always have a valid width for calculating visible days. This prevents division by zero and ensures the timeline can render even if elements aren't fully laid out.Event Handler Registration
Timeline escape key handler was wrapped in an arrow function that returned the handler instead of calling it:
Selection State Updates
Selection transformer only updated the first matching row instead of all rows for a work package (important for work packages with relations):
Additional Fixes
nullinstead of empty string for namespace-only events (.timelinecell)hiddenattribute after slide animation completes (400ms) instead of next frame✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.