Skip to content

fix(web): preserve annotation editor drafts and dialog sessions - #44825

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

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

Conversation

@lyzno1

@lyzno1 lyzno1 commented Oct 26, 2026

Copy link
Copy Markdown
Member

Summary

Annotation editing can leave edit mode after a failed save, and concurrent question/answer updates can overwrite the other field. This change keeps drafts on failure, serializes submissions against the latest saved values, and gives list and chat editors the same generated mutation and deletion ownership.

  • Replace the annotation editing Drawers with positioned, uncontrolled Dialogs using real triggers and standard header/body/footer parts. Preserve both avatars and mirror the panel position in RTL. Simplify the add dialog's open state and remove its unnecessary viewport.
  • Keep the list dialog mounted across filtering, empty results, and loading transitions. Preserve the other field's draft through successive saves, restore field focus after pending ends, and provide a connected list fallback when the opener disappears.
  • Load hit history only when selected, keyed by annotation and page, with explicit loading/error/retry states. Preserve drafts across tab changes.
  • Guard pending saves/deletes, retain retryable failures, close after successful deletion, and force nested confirmation backdrops. Editing invalidates annotation queries; deletion also refreshes quota usage through features.

Fixes #44823

Validation

  • 94 related unit tests passed; reran the 24 affected owner tests after the final changes.
  • 3 Chromium Browser Mode regressions passed, covering add-dialog lifecycle, adjacent/list focus after deletion, and a filtered-out row retaining its editor session and other-field draft.
  • Web type check, vp staged, and repository vp run -w check passed (repository check reports existing warnings).
  • Verified the running localhost application: successful edits, blocked-request failure/retry, two saves after the filtered list becomes empty, nested deletion failure/retry, focus restoration, preserved avatars, Farsi RTL, 390px mobile width, and a 320×360 short viewport. Verified forced deletion backdrops, keyboard trapping, Escape/cancel, and preserved drafts. Restored English and removed only the disposable validation annotation.
  • Safari and assistive technology were not tested.

Checklist

  • Associated issue linked.
  • Verified changed behavior and updated meaningful regression tests.
  • Ran frontend vp staged and type checking.
  • Documentation update not required; backend checks not applicable.

From Codex

@github-actions github-actions Bot added web This relates to changes on the web. size:XXL This PR changes 1000+ lines, ignoring generated files. 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

❌ Patch coverage is 99.63235% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.46%. Comparing base (51e643f) to head (a627d02).

Files with missing lines Patch % Lines
web/app/components/app/annotation/list.tsx 98.36% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #44825   +/-   ##
=======================================
  Coverage   89.45%   89.46%           
=======================================
  Files        5994     5997    +3     
  Lines      375954   375962    +8     
  Branches    76162    76175   +13     
=======================================
+ Hits       336321   336346   +25     
+ Misses      33610    33593   -17     
  Partials     6023     6023           
Flag Coverage Δ
dify-ui 92.65% <ø> (ø)
web 89.48% <99.63%> (+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.

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Vinext bundle analysis

JS gzip: 🟢 −723 B (−<0.01%) · CSS gzip: 🟢 −8 B (−<0.01%)

All client output Base gzip → Merge gzip Gzip change
JS 9727.65 KiB → 9726.94 KiB 🟢 −723 B (−<0.01%)
CSS 338.45 KiB → 338.44 KiB 🟢 −8 B (−<0.01%)

Entry changes: 🟠 83 increased · 🟢 86 decreased · ⚪ 1 raw-only changes (gzip).

Largest entry changes

Top 5 by absolute gzip delta. Static dependencies overlap; do not sum entries.

Source entry Base gzip → Merge gzip Gzip change
app/(shareLayout)/agent/[token]/page.tsx 1035.49 KiB → 1027.46 KiB 🟢 −8.03 KiB (−0.78%)
app/(shareLayout)/chat/[token]/page.tsx 1032.87 KiB → 1024.84 KiB 🟢 −8.03 KiB (−0.78%)
app/(shareLayout)/environment/chat/[token]/page.tsx 1032.87 KiB → 1024.84 KiB 🟢 −8.03 KiB (−0.78%)
app/components/base/chat/chat-with-history/index.tsx 1030.26 KiB → 1022.23 KiB 🟢 −8.03 KiB (−0.78%)
app/components/explore/try-app/app/index.tsx 1057.10 KiB → 1050.06 KiB 🟢 −7.04 KiB (−0.67%)
Top 20 of 170 changed entries (full paths and raw sizes)
Source entry Base gzip → Merge gzip Gzip change Raw change
dynamic-entry: app/(shareLayout)/agent/[token]/page.tsx 1035.49 KiB → 1027.46 KiB 🟢 −8.03 KiB (−0.78%) 🟢 −22.06 KiB (−0.67%)
dynamic-entry: app/(shareLayout)/chat/[token]/page.tsx 1032.87 KiB → 1024.84 KiB 🟢 −8.03 KiB (−0.78%) 🟢 −22.06 KiB (−0.67%)
dynamic-entry: app/(shareLayout)/environment/chat/[token]/page.tsx 1032.87 KiB → 1024.84 KiB 🟢 −8.03 KiB (−0.78%) 🟢 −22.06 KiB (−0.67%)
dynamic-entry: app/components/base/chat/chat-with-history/index.tsx 1030.26 KiB → 1022.23 KiB 🟢 −8.03 KiB (−0.78%) 🟢 −22.06 KiB (−0.67%)
dynamic-entry: app/components/explore/try-app/app/index.tsx 1057.10 KiB → 1050.06 KiB 🟢 −7.04 KiB (−0.67%) 🟢 −20.28 KiB (−0.60%)
dynamic-entry: app/(shareLayout)/chatbot/[token]/page.tsx 1027.58 KiB → 1020.54 KiB 🟢 −7.04 KiB (−0.68%) 🟢 −20.28 KiB (−0.62%)
dynamic-entry: app/components/explore/try-app/index.tsx 1360.25 KiB → 1361.32 KiB 🟠 +1.07 KiB (+0.08%) 🟠 +2.41 KiB (+0.05%)
dynamic-entry: app/components/app/configuration/index.tsx 1407.59 KiB → 1408.64 KiB 🟠 +1.05 KiB (+0.07%) 🟠 +2.41 KiB (+0.05%)
dynamic-entry: app/components/workflow/panel/chat-record/index.tsx 1434.53 KiB → 1435.57 KiB 🟠 +1.04 KiB (+0.07%) 🟠 +2.41 KiB (+0.05%)
dynamic-entry: app/components/workflow/panel/debug-and-preview/index.tsx 1440.88 KiB → 1441.92 KiB 🟠 +1.04 KiB (+0.07%) 🟠 +2.41 KiB (+0.05%)
dynamic-entry: app/components/app/log-annotation/index.tsx 1082.53 KiB → 1082.20 KiB 🟢 −337 B (−0.03%) 🟢 −276 B (−<0.01%)
dynamic-entry: app/components/workflow/nodes/agent-v2/panel.tsx 1657.14 KiB → 1657.05 KiB 🟢 −92 B (−<0.01%) 🟠 +436 B (+<0.01%)
dynamic-entry: app/components/workflow/nodes/agent/panel.tsx 1534.42 KiB → 1534.33 KiB 🟢 −84 B (−<0.01%) 🟠 +438 B (+<0.01%)
dynamic-entry: app/components/workflow/nodes/parameter-extractor/panel.tsx 1395.65 KiB → 1395.58 KiB 🟢 −70 B (−<0.01%) 🟠 +438 B (+<0.01%)
dynamic-entry: app/components/workflow/nodes/question-classifier/panel.tsx 1395.53 KiB → 1395.46 KiB 🟢 −70 B (−<0.01%) 🟠 +438 B (+<0.01%)
dynamic-entry: app/components/workflow/nodes/http/panel.tsx 1396.54 KiB → 1396.47 KiB 🟢 −69 B (−<0.01%) 🟠 +438 B (+<0.01%)
dynamic-entry: app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/pipeline/page.tsx 1437.29 KiB → 1437.23 KiB 🟢 −66 B (−<0.01%) 🟠 +438 B (+<0.01%)
dynamic-entry: app/components/snippets/index.tsx 1399.43 KiB → 1399.37 KiB 🟢 −66 B (−<0.01%) 🟠 +438 B (+<0.01%)
dynamic-entry: app/components/workflow/nodes/trigger-webhook/panel.tsx 1390.62 KiB → 1390.55 KiB 🟢 −66 B (−<0.01%) 🟠 +438 B (+<0.01%)
dynamic-entry: app/components/workflow/features.tsx 1404.15 KiB → 1404.09 KiB 🟢 −65 B (−<0.01%) 🟠 +438 B (+<0.01%)
📦 0 package attribution changes (uncompressed modules)

Showing 0 of 0, ordered by absolute module-size delta.

Package Base Merge Δ
No package attribution changes — — —
Measurement details and build revisions

Base: 51e643fff174e4daf02eea87a623333990adf9ce · Merge: 598c7c8900016256d8c5f9cc4c627b3fb7691f1c
Vinext: 1.2.1 → 1.2.1; Rolldown: 1.2.15 → 1.2.15

Raw JS change: 🟢 −186 B (−<0.01%) · Raw CSS change: 🟢 −101 B (−<0.01%)

🟠 Increase · 🟢 Decrease · ⚪ Unchanged. Colors indicate direction, not a performance budget verdict. Percentages use the base size.

Entries follow only static edges in the official Rolldown chunk graph, deduplicating shared files. Dynamic entries are measured when loaded; they are not page first-load metrics. Entry totals overlap and must not be summed.
Package attribution sums module sizes reported by Rolldown, not compressed emitted bytes. Gzip totals are measured per emitted file. This is Vinext output, not Next.js/Turbopack output.
Report only: increases do not fail this check. Missing or incompatible analysis data does.

Download base/merge snapshots and official Rolldown analysis reports.

Comparison: event base SHA vs the tested merge commit at GITHUB_SHA (PR or merge queue).

@lyzno1
lyzno1 added this pull request to the merge queue Oct 26, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 26, 2026
@lyzno1
lyzno1 added this pull request to the merge queue Oct 26, 2026
Merged via the queue into main with commit 7cd11ab Oct 26, 2026
54 checks passed
@lyzno1
lyzno1 deleted the codex/annotation-edit-dialog branch October 26, 2026 12:26
@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:XXL This PR changes 1000+ 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.

Annotation editors can discard failed drafts and overwrite concurrent field updates

2 participants