This is an automated email from the ASF dual-hosted git repository.
voidmatcha pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zeppelin.git
The following commit(s) were added to refs/heads/master by this push:
new f3f6036a3f [ZEPPELIN-6774] Label the pending Assistant delete action
Close
f3f6036a3f is described below
commit f3f6036a3f7f89403cd2b9c2adccd2bef3651083
Author: Minho Jang <[email protected]>
AuthorDate: Thu Nov 26 09:34:54 2026 +0900
[ZEPPELIN-6774] Label the pending Assistant delete action Close
### What is this PR for?
After a user confirms deletion of an AI Assistant conversation, the dialog
still labels its dismiss action **Cancel**, even though dismissing it cannot
cancel the request. Use **Close** while deletion is pending and keep **Cancel**
before confirmation. Deletion and focus restoration behavior are unchanged.
### What type of PR is it?
Bug Fix
### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-6774
### How should this be tested?
From `zeppelin-web-angular/projects/zeppelin-react`, run:
```sh
npm test -- AssistantConversationPanel.spec.tsx -t 'delet|modal Escape'
```
Verify that **Cancel** before confirmation sends no delete request. With a
delete response delayed, verify that **Close** and Escape dismiss the dialog
and return focus to the trigger without aborting or repeating the request. Once
the request succeeds, the conversation should disappear from the list.
### Questions:
* Does the license files need to update? No.
* Is there breaking changes for older versions? No.
* Does this needs documentation? No.
Closes #5619 from miinhho/ZEPPELIN-6774-assistant-delete-dismiss.
Signed-off-by: YONGJAE LEE <[email protected]>
---
.../ui/AssistantConversationPanel.spec.tsx | 21 +++++++++++++--------
.../ui/DeleteConversationDialog.tsx | 2 +-
2 files changed, 14 insertions(+), 9 deletions(-)
diff --git
a/zeppelin-web-angular/projects/zeppelin-react/src/pages/assistant-workspace/ui/AssistantConversationPanel.spec.tsx
b/zeppelin-web-angular/projects/zeppelin-react/src/pages/assistant-workspace/ui/AssistantConversationPanel.spec.tsx
index 52e8403417..bcc8ccdbd3 100644
---
a/zeppelin-web-angular/projects/zeppelin-react/src/pages/assistant-workspace/ui/AssistantConversationPanel.spec.tsx
+++
b/zeppelin-web-angular/projects/zeppelin-react/src/pages/assistant-workspace/ui/AssistantConversationPanel.spec.tsx
@@ -974,7 +974,7 @@ describe('AssistantConversationPanel', () => {
);
});
- it.each(['Cancel', 'Escape'])(
+ it.each(['Close', 'Escape'])(
'dismisses a pending delete with %s without cancelling the API or changing
a later confirmation',
async dismissal => {
const source = fixture();
@@ -987,18 +987,23 @@ describe('AssistantConversationPanel', () => {
await mountPanel(source);
await select('Revenue analysis');
- fireEvent.click(screen.getByRole('button', { name: 'Delete Revenue
analysis' }));
+ const trigger = screen.getByRole('button', { name: 'Delete Revenue
analysis' });
+ trigger.focus();
+ fireEvent.click(trigger);
const confirm = within(screen.getByRole('dialog')).getByRole('button', {
name: 'Delete conversation' });
fireEvent.click(confirm);
fireEvent.click(confirm);
expect(remove).toHaveBeenCalledExactlyOnceWith('c1');
- const cancel = within(screen.getByRole('dialog')).getByRole('button', {
name: 'Cancel' });
- if (dismissal === 'Escape') fireEvent.keyDown(cancel, { key: 'Escape' });
- else fireEvent.click(cancel);
+ const pendingDialog = screen.getByRole('dialog');
+ expect(document.activeElement).toBe(pendingDialog);
+ const close = within(pendingDialog).getByRole('button', { name: 'Close'
});
+ if (dismissal === 'Escape') fireEvent.keyDown(pendingDialog, { key:
'Escape' });
+ else fireEvent.click(close);
expect(screen.queryByRole('dialog')).toBeNull();
+ expect(document.activeElement).toBe(trigger);
await select('Notebook summary');
fireEvent.click(screen.getByRole('button', { name: 'Delete Notebook
summary' }));
@@ -1036,10 +1041,10 @@ describe('AssistantConversationPanel', () => {
fireEvent.click(screen.getByRole('button', { name: 'Delete Revenue
analysis' }));
fireEvent.click(within(screen.getByRole('dialog')).getByRole('button', {
name: 'Delete conversation' }));
- fireEvent.click(within(screen.getByRole('dialog')).getByRole('button', {
name: 'Cancel' }));
+ fireEvent.click(within(screen.getByRole('dialog')).getByRole('button', {
name: 'Close' }));
fireEvent.click(screen.getByRole('button', { name: 'Delete Revenue
analysis' }));
- expect(screen.getByRole('dialog')).toBeTruthy();
+ expect(within(screen.getByRole('dialog')).getByRole('button', { name:
'Close' })).toBeTruthy();
await act(async () => gate.resolve());
@@ -1091,7 +1096,7 @@ describe('AssistantConversationPanel', () => {
fireEvent.click(listTrigger());
fireEvent.click(screen.getByRole('button', { name: 'Delete Revenue
analysis' }));
fireEvent.click(within(screen.getByRole('dialog')).getByRole('button', {
name: 'Delete conversation' }));
- fireEvent.click(within(screen.getByRole('dialog')).getByRole('button', {
name: 'Cancel' }));
+ fireEvent.click(within(screen.getByRole('dialog')).getByRole('button', {
name: 'Close' }));
fireEvent.click(screen.getByRole('button', { name: 'Delete Notebook
summary' }));
fireEvent.click(within(screen.getByRole('dialog')).getByRole('button', {
name: 'Delete conversation' }));
diff --git
a/zeppelin-web-angular/projects/zeppelin-react/src/pages/assistant-workspace/ui/DeleteConversationDialog.tsx
b/zeppelin-web-angular/projects/zeppelin-react/src/pages/assistant-workspace/ui/DeleteConversationDialog.tsx
index ae7382d995..c91b1bc8df 100644
---
a/zeppelin-web-angular/projects/zeppelin-react/src/pages/assistant-workspace/ui/DeleteConversationDialog.tsx
+++
b/zeppelin-web-angular/projects/zeppelin-react/src/pages/assistant-workspace/ui/DeleteConversationDialog.tsx
@@ -94,7 +94,7 @@ export const DeleteConversationDialog = ({
)}
<div className={styles.confirmationActions}>
<button ref={cancel} type="button" className={styles.action}
onClick={onCancel}>
- Cancel
+ {deleting ? 'Close' : 'Cancel'}
</button>
<button type="button" className={styles.primaryAction}
disabled={deleting} onClick={onConfirm}>
Delete conversation