Skip to content

Fix #3781: Resolve JS crashes and prevent legend panel collapse on in… - #6007

Open
aasthag01-26 wants to merge 3 commits into
learning-unlimited:mainfrom
aasthag01-26:fix-legend-panel
Open

aasthag01-26 wants to merge 3 commits into
learning-unlimited:mainfrom
aasthag01-26:fix-legend-panel

Conversation

@aasthag01-26

Copy link
Copy Markdown

…teraction

Description

Related Issue

Closes #3781

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactor / cleanup
  • CI/CD or build change

Testing

  • Existing tests pass
  • New tests added (if applicable)
  • Manually verified

AI Disclosure

Checklist

  • Self-reviewed the code
  • Updated documentation (if needed)
  • No new warnings or errors introduced

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.

🟢 Approval recommended

The remaining feedback is limited to small cleanup/documentation consistency items and does not affect the correctness of the crash fixes or legend interaction behavior.

Pull request overview

This PR addresses UI/JS stability issues in the ajax scheduling module related to the scheduling matrix: it hardens cell rendering/tooltip logic to avoid runtime errors on missing data, and adjusts the legend toggle behavior to prevent unintended collapse during interaction.

Changes:

  • Prevent legend interactions from bubbling and causing unintended UI side-effects; update button label based on actual legend visibility.
  • Make Cell rendering and tooltip generation resilient to missing fields (e.g., flags, emailcode, missing categories) to avoid JS crashes.
  • Preserve selection highlighting behavior while updating cell styles.
File summaries
File Description
esp/public/media/scripts/ajaxschedulingmodule/ESP/Scheduler.js Stops click propagation for legend interactions and bases button text on legend visibility.
esp/public/media/scripts/ajaxschedulingmodule/ESP/Cell.js Adds defensive checks for tooltip/background rendering and adjusts styling logic to reduce crashes and UI glitches.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +69 to +73

// this.el.css("background-color", "");
// this.el.css("background", "");
// this.el.css("color", "");

Comment on lines +343 to +350
/**
* Create data for the tooltip
*/
this.tooltip = function(){
var currentSection = this.section || this.ghostSection;

// 1. Guard check: Agar cell khali hai toh empty string return karein
if (!currentSection) return "";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ajax scheduler checks need legends or descriptions

2 participants