-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
feat: Stop editor scrolling to top #26754
feat: Stop editor scrolling to top #26754
Conversation
const { row, column } = cursorPosition; | ||
editor.moveCursorToPosition({ row, column }); | ||
editor.focus(); | ||
editor.renderer.updateFontSize(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This operation(updateFontSize) seems redundant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. I already modify the code to remove that line of code.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #26754 +/- ##
=======================================
Coverage 69.48% 69.49%
=======================================
Files 1894 1894
Lines 74151 74165 +14
Branches 8243 8244 +1
=======================================
+ Hits 51527 51539 +12
- Misses 20555 20557 +2
Partials 2069 2069
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
superset-frontend/src/SqlLab/components/AceEditorWrapper/index.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: JUST.in DO IT <[email protected]>
….tsx Co-authored-by: JUST.in DO IT <[email protected]>
Co-authored-by: JUST.in DO IT <[email protected]>
…m/puridach-w/superset into feat/stop-editor-scrolling-to-top # Conflicts: # superset-frontend/src/SqlLab/components/AceEditorWrapper/index.tsx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the contribution.
Co-authored-by: Puridach Wutthihathaithamrong <> Co-authored-by: JUST.in DO IT <[email protected]>
Co-authored-by: Puridach Wutthihathaithamrong <> Co-authored-by: JUST.in DO IT <[email protected]>
Co-authored-by: Puridach Wutthihathaithamrong <> Co-authored-by: JUST.in DO IT <[email protected]>
SUMMARY
This contribution introduces a vital usability upgrade to the SQL Editor within Apache Superset. The enhancement consists of a coding modification that embeds the cursor position into the Redux state.
Traditionally, every time users switch between SQL Lab tabs, the SQL editor viewport resets, forcing them to scroll from the top to locate their last worked-on position. This scenario presents an inconvenience that disrupts workflow and decreases editing efficiency.
This update directly addresses the issue. Upon rendering the SQL editor, it now auto-focuses on the saved cursor position from the Redux state, aligning the screen with the user's last point of work. Users can now effortlessly switch tabs, and upon their return, find the SQL Editor positioned exactly where they left off.
BEFORE SCREENSHOTS OR ANIMATED GIF
Before.-.stop.editor.mov
AFTER SCREENSHOTS OR ANIMATED GIF
After.-.stop.editor.mov
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION