[ZEPPELIN-6298] Fix cursor-related issues in New UI's Paragraph

### What is this PR for?
**Description:**
Cursor behavior in the New UI’s paragraph needs to be fixed for several cursor related actions, including double-clicking, running all above/below, adding(clone), and removing paragraphs.

When **cloneParagraph()** is called, it internally calls **addParagraph()**, which has already been tested. The same addParagraph-related code is also applied in #5044. If either PR is merged first, I will rebase accordingly. I have also confirmed that **cloneParagraph()** works correctly through #5044.

Due to timing issues, I used `setTimeout` for **removeParagraph()** and **doubleClickParagraph()**. Since this is in the UI area, it likely won’t have major side effects, but I will look into it further.

**Expected:**
- When **doubleClickParagraph()** is executed, the cursor should move to the end of the paragraph.
- When **runAllAbove()** or **runAllBelow()** is executed, the current cursor position should be remembered, and after execution, focus should return to the previous cursor position.
- When **addParagraph()** is executed, the newly added paragraph should receive focus.
- When **removeParagraph()** is executed, focus should move to the paragraph that takes the deleted paragraph’s place.

**Actual (New UI):**
- When **doubleClickParagraph()** is executed, the cursor moves to the beginning instead of the end.
- After **runAllAbove()** or **runAllBelow()**, focus is lost completely.
- When **addParagraph()** is executed, the new paragraph does not automatically receive focus.
- After **removeParagraph()**, focus may not move to the correct paragraph.

**[Appropriate action - Classic UI]**

https://github.com/user-attachments/assets/fc0066f7-4e03-4e3b-9d5b-2f33df415ba7

Run all above -> Run all below -> Double click .md paragraph  -> Add paragraph -> Delete paragraph

**[AS-IS]**

https://github.com/user-attachments/assets/f699f788-cf29-4c4c-8c47-2ef34d7962f0

Run all above -> Run all below -> Double click .md paragraph  -> Add paragraph -> Delete paragraph

**[TO-BE]**

https://github.com/user-attachments/assets/1206c524-103f-4328-85ee-04408073b628

Run all above -> Run all below -> Double click .md paragraph  -> Add paragraph -> Delete paragraph


### What type of PR is it?
Bug Fix

### Todos

### What is the Jira issue?
* [[ZEPPELIN-6298](https://issues.apache.org/jira/browse/ZEPPELIN-6298)]

### How should this be tested?

### Screenshots (if appropriate)

### Questions:
* Does the license files need to update? N
* Is there breaking changes for older versions? N
* Does this needs documentation? N


Closes #5057 from dididy/fix/ZEPPELIN-6298.

Signed-off-by: ChanHo Lee <chanholee@apache.org>
3 files changed
tree: 1172ea86ff9d380c59c715e0efe281c67d57798d
  1. .github/
  2. .mvn/
  3. alluxio/
  4. angular/
  5. bigquery/
  6. bin/
  7. build-tools/
  8. cassandra/
  9. conf/
  10. dev/
  11. docs/
  12. elasticsearch/
  13. examples/
  14. file/
  15. flink/
  16. flink-cmd/
  17. groovy/
  18. hbase/
  19. helium-dev/
  20. influxdb/
  21. java/
  22. jdbc/
  23. k8s/
  24. licenses/
  25. livy/
  26. markdown/
  27. mongodb/
  28. neo4j/
  29. notebook/
  30. python/
  31. rlang/
  32. scripts/
  33. shell/
  34. spark/
  35. spark-submit/
  36. sparql/
  37. testing/
  38. zeppelin-client/
  39. zeppelin-client-examples/
  40. zeppelin-common/
  41. zeppelin-distribution/
  42. zeppelin-examples/
  43. zeppelin-integration/
  44. zeppelin-interpreter/
  45. zeppelin-interpreter-integration/
  46. zeppelin-interpreter-parent/
  47. zeppelin-interpreter-shaded/
  48. zeppelin-jupyter/
  49. zeppelin-jupyter-interpreter/
  50. zeppelin-jupyter-interpreter-shaded/
  51. zeppelin-plugins/
  52. zeppelin-server/
  53. zeppelin-test/
  54. zeppelin-web/
  55. zeppelin-web-angular/
  56. zeppelin-zengine/
  57. .appveyor.yml
  58. .asf.yaml
  59. .gitattributes
  60. .gitignore
  61. Dockerfile
  62. LICENSE
  63. mvnw
  64. mvnw.cmd
  65. NOTICE
  66. pom.xml
  67. README.md
  68. Roadmap.md
  69. SECURITY-README.md
  70. STYLE.md
README.md

Apache Zeppelin

Documentation: User Guide
Mailing Lists: User and Dev mailing list
Continuous Integration: core frontend rat
Contributing: Contribution Guide
Issue Tracker: Jira
License: Apache 2.0

Zeppelin, a web-based notebook that enables interactive data analytics. You can make beautiful data-driven, interactive and collaborative documents with SQL, Scala and more.

Core features:

  • Web based notebook style editor.
  • Built-in Apache Spark support

To know more about Zeppelin, visit our web site https://zeppelin.apache.org

Getting Started

Install binary package

Please go to install to install Apache Zeppelin from binary package.

Build from source

Please check Build from source to build Zeppelin from source.