Skip to content

fix(web): preserve annotation drafts with a positioned dialog - #44810

Merged
lyzno1 merged 2 commits into
mainfrom
codex/annotation-reply-dialog
Oct 26, 2026
Merged

lyzno1 merged 2 commits into
mainfrom
codex/annotation-reply-dialog

Conversation

@lyzno1

@lyzno1 lyzno1 commented Oct 26, 2026

Copy link
Copy Markdown
Member

Summary

Failed annotation requests currently close the panel or clear its fields when continuous creation is selected. Keep the draft and display a retryable error instead; close or reset only after a successful save.

Use the existing Dialog anatomy for the right-side modal form, preserving its placement and both avatars. Co-locate the trigger and submission lifecycle, use native Field/Form validation, prevent dismissal and duplicate submission while saving, and return focus through Dialog. Continuous creation clears only the saved fields, keeps its checkbox preference, and focuses the next question.

Route creation through the generated console mutation and invalidate app annotation queries and quota on success. Retain the existing page/export refresh owners and handle unavailable cloud quota with retry.

Fixes #44809

Validation

  • Annotation unit suite: 67 tests passed across 12 files.
  • Chromium browser regression: 1 test passed, covering native reset, required validation after reset, continuous creation, and close/reopen focus.
  • vp run dify-web#type-check passed.
  • vp run -w check passed with existing repository warnings.
  • vp staged passed; its logical-property fixes and obsolete suppression cleanup are confined to touched annotation files.
  • Real localhost:3000 Chrome checks: initial focus, Tab/Shift+Tab containment, Escape and focus return, backdrop dismissal prevention, required validation, failed-request draft retention, pending interaction guards, successful creation and list refresh, continuous creation, and narrow/short viewports. The temporary annotation was deleted after verification.
  • Final Base UI lifecycle/API review found no actionable issues. Safari and assistive-technology verification were not performed.

Screenshots

Visually checked on localhost:3000: right-side placement and user/robot avatars retained; header, body, and footer use the shared Dialog components.

Checklist

  • I understand that this PR may be closed in case there was no previous discussion or issues.
  • I've verified the change and added or updated tests where meaningful regression risk justifies coverage.
  • I ran vp staged for the frontend.
  • Documentation update: not applicable; no public configuration or API changes.
  • Backend lint/type checks: not applicable; no backend changes.

From Codex

@github-actions github-actions Bot added size:XL This PR changes 500-999 lines, ignoring generated files. web This relates to changes on the web. labels Oct 26, 2026
hyoban
hyoban previously approved these changes Oct 26, 2026
@codecov

codecov Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.43%. Comparing base (c28e136) to head (45a3ba6).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #44810   +/-   ##
=======================================
  Coverage   89.43%   89.43%           
=======================================
  Files        5992     5991    -1     
  Lines      375786   375783    -3     
  Branches    76157    76148    -9     
=======================================
- Hits       336089   336087    -2     
+ Misses      33654    33653    -1     
  Partials     6043     6043           
Flag Coverage Δ
dify-ui 92.65% <ø> (ø)
web 89.46% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lyzno1
lyzno1 added this pull request to the merge queue Oct 26, 2026
Merged via the queue into main with commit 1df903c Oct 26, 2026
54 checks passed
@lyzno1
lyzno1 deleted the codex/annotation-reply-dialog branch October 26, 2026 09:51
@laipz8200 laipz8200 mentioned this pull request Nov 3, 2026
1 task done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adding an annotation loses the draft when the save request fails

2 participants