Commit 4fbfaec
authored
[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>1 parent 4297661 commit 4fbfaec
File tree
3 files changed
+82
-33
lines changed- zeppelin-web-angular/src/app/pages/workspace/notebook
- paragraph
- code-editor
3 files changed
+82
-33
lines changedLines changed: 12 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
132 | 139 | | |
133 | 140 | | |
134 | 141 | | |
| |||
142 | 149 | | |
143 | 150 | | |
144 | 151 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
152 | 156 | | |
153 | | - | |
154 | 157 | | |
155 | 158 | | |
156 | 159 | | |
| |||
Lines changed: 36 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
| 44 | + | |
46 | 45 | | |
47 | 46 | | |
48 | 47 | | |
| |||
83 | 82 | | |
84 | 83 | | |
85 | 84 | | |
86 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
87 | 90 | | |
88 | 91 | | |
89 | 92 | | |
| |||
175 | 178 | | |
176 | 179 | | |
177 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
178 | 210 | | |
179 | 211 | | |
180 | 212 | | |
| |||
Lines changed: 34 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
192 | 199 | | |
193 | 200 | | |
194 | 201 | | |
| |||
206 | 213 | | |
207 | 214 | | |
208 | 215 | | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
217 | 229 | | |
218 | 230 | | |
219 | 231 | | |
| |||
223 | 235 | | |
224 | 236 | | |
225 | 237 | | |
226 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
227 | 241 | | |
228 | 242 | | |
229 | 243 | | |
| |||
251 | 265 | | |
252 | 266 | | |
253 | 267 | | |
| 268 | + | |
254 | 269 | | |
255 | | - | |
256 | 270 | | |
257 | 271 | | |
258 | 272 | | |
| |||
0 commit comments