Skip to content

[ZEPPELIN-6776] Preserve unsent Assistant drafts when reopening the notebook sidebar - #5622

Merged
voidmatcha merged 4 commits into
apache:masterfrom
miinhho:ZEPPELIN-6776-assistant-draft-reopen
Nov 28, 2026
Merged

voidmatcha merged 4 commits into
apache:masterfrom
miinhho:ZEPPELIN-6776-assistant-draft-reopen

Conversation

@miinhho

@miinhho miinhho commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

What is this PR for?

Closing the AI Assistant sidebar discards unsent text. Reopening it on the same notebook in the same authenticated session now restores each draft to the conversation it belongs to, including the draft for a conversation that has not been created yet.

Each conversation session decides what to retain when the sidebar closes. An already submitted run can finish while the sidebar is closed, and restoring a draft does not create a conversation or send a question. A successful pending deletion removes the draft with its conversation; a failed deletion leaves the draft intact. Drafts do not carry over to another notebook, authenticated session, or page reload.

What type of PR is it?

Improvement

What is the Jira issue?

How should this be tested?

From zeppelin-web-angular/projects/zeppelin-react, run:

npm test -- AssistantWorkspace.spec.tsx useAssistantPanel.spec.tsx AssistantConversationPanel.spec.tsx
  1. Type a question without sending it, close the sidebar, and reopen it on the same notebook. Verify that the text is restored and no question is sent.
  2. Start a response in conversation A, switch to B, and type an unsent draft. Close and reopen the sidebar before or after A finishes. Verify that A's answer and B's draft are both available without resubmitting either.
  3. Switch to another notebook or authenticated session and verify that the draft does not carry over.

Questions:

  • Does the license files need to update? No.
  • Is there breaking changes for older versions? No.
  • Does this needs documentation? No.

@voidmatcha voidmatcha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

#5621 has been merged. Could you rebase onto the latest master, prevent the empty state from appearing while the conversation list reloads after reopening the sidebar with an unsent draft, and add a regression test for this case?

- Retain unsent text and existing submitted runs within the notebook session.
- Preserve uncertain-send recovery and reconcile deletes that finish while hidden.
- Ignore stale view responses and prevent delayed creation from sending a hidden request.
- Let each session decide what to retain when the sidebar closes.
- Separate deferred initial history from post-run synchronization.
- Verify a late earlier page cannot populate a reopened draft.
Reset the discarded conversation list to its initial loading state on draft-only close.
Cover draft restoration and show the empty state only after a successful empty response.
@miinhho
miinhho force-pushed the ZEPPELIN-6776-assistant-draft-reopen branch from dc48d6e to 9cbec0f Compare November 26, 2026 15:34
@miinhho

miinhho commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I rebased onto master. In 9cbec0f, closing the sidebar with only an unsent draft resets the conversation list to its initial loading state. A regression test verifies that the draft is restored on reopen and “No conversations yet” appears only after the reload succeeds with an empty list.

@voidmatcha voidmatcha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM 👍

@voidmatcha
voidmatcha merged commit af17379 into apache:master Nov 28, 2026
33 of 34 checks passed
@voidmatcha

Copy link
Copy Markdown
Member

Merged into master (af17379).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants