Skip to content
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

fix(sqllab): Skip AceEditor in inactive tabs #30171

Conversation

justinpark
Copy link
Member

SUMMARY

Since destroyInactiveTabPane is disabled for improving rendering perf on switching tabs in #26791, I have confirmed that the Ace Editor was monitoring and responding to events even on inactive tabs.
As a result, race conditions related to the cursor position were occurring when switching between tabs. This commit addresses these issues by modifying the behavior so that, similar to destroyInactiveTabPane, the Ace Editor component is excluded when a tab becomes inactive.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

before--inactive-ace-editor.mov

Active:

after--inactive-ace-editor.mov

TESTING INSTRUCTIONS

Specs are added

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@dosubot dosubot bot added change:frontend Requires changing the frontend sqllab Namespace | Anything related to the SQL Lab labels Sep 5, 2024
height={`${aceEditorHeight}px`}
hotkeys={hotkeys}
/>
{isActive && (
Copy link
Member

Choose a reason for hiding this comment

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

@justinpark Isn't possible to just make the ace editor stop listening to events when inactive instead of removing it from the DOM? That way you would retain the previous performance gains.

Copy link
Member Author

Choose a reason for hiding this comment

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

@michael-s-molina That approach involves many aspects that need to be checked, such as regression, making it challenging to implement as a hotfix.
It would be better to revisit and resolve the issue related to the performance of the Ace Editor (if we feel downgrade) after addressing the current problem.

@michael-s-molina michael-s-molina merged commit 4d1db9e into apache:master Sep 6, 2024
36 of 37 checks passed
@michael-s-molina michael-s-molina added v4.0 Label added by the release manager to track PRs to be included in the 4.0 branch v4.1 Label added by the release manager to track PRs to be included in the 4.1 branch labels Sep 6, 2024
michael-s-molina pushed a commit that referenced this pull request Sep 6, 2024
sadpandajoe pushed a commit that referenced this pull request Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change:frontend Requires changing the frontend size/M sqllab Namespace | Anything related to the SQL Lab v4.0 Label added by the release manager to track PRs to be included in the 4.0 branch v4.1 Label added by the release manager to track PRs to be included in the 4.1 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants