Repository navigation
编辑和合并不再覆盖期间别处的改动 - #203
Merged
Merged
编辑和合并不再覆盖期间别处的改动#203
Conversation
保存只带这次输入的和还没保存上的字段;Agent 合并的确认说明和执行时核对的是同一份要删的草稿;冲突后等新资料读到再提示;编辑改用 BEGIN IMMEDIATE。
上一次保存刚成功、页面还没重新渲染时,输入不再把已保存的字段一起重发。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
为什么改
Codex 审查导师管理、材料、模板、统计和个人资料时,发现三处“旧内容覆盖新内容”:
改了什么
updateMentor多带before:打开编辑时读到的姓名、别名、邮箱、单位、主页和研究方向。核心用BEGIN IMMEDIATE拿到写锁,再拿当前资料和before比较;不同就不保存,提示“打开编辑之后,这位导师的资料在别处有了变化……关掉后重新打开,再改一次。”,界面等导师详情重新读取完再显示这条提示,重新打开就是新资料;合并冲突时也等新的预览读到才能再点“合并”。mergeMentors多带discardedDrafts,即预览给出的那份。核心在写事务里、删草稿之前重新算一遍,不同就不合并,界面让预览重新读取,用户看过新的预览再合并。Agent 合并时,确认说明也先核对这份清单,确认的和执行时核对的是同一份。要删的草稿按种类排序。ProfileForm三个字段都改成可选,核心只改传了的字段,空字符串清空。界面每次保存只带这次输入的和还没保存上的字段,已经保存上的不再重发;保存上了的仍按输入的原样显示(行尾的换行和空格不会在输入中途消失),被别处改了就显示新的。ProfileFields自己读个人资料,免得父组件传进来的资料和保存状态在同一次渲染里对不上。before、discardedDrafts怎么填,以及updateProfile只改传了的字段。docs/ui.md(编辑资料冲突、个人资料自动保存)、docs/data-model.md(合并草稿)。怎么验证的
an_edit_does_not_undo_what_changed_since_it_began:编辑期间别处加了邮箱时不保存;从新资料开始的编辑能保存。a_draft_written_after_the_preview_is_not_discardedblank_fields_are_cleared_and_missing_ones_staya_merge_is_confirmed_only_with_the_drafts_it_discards(Agent 合并)saves only what is typed and not saved yet, and shows what an Agent saveddoes not send a field again whose save finished before the page heard of it:拦住 TanStack Query 的通知,模拟保存刚成功、页面还没重新渲染时用户就输入;改之前会把已保存的字段一起重发。profile.tsx上失败;mentor::edit的比较、merge的草稿核对后,对应的两个测试各自失败;cargo fmt --check、clippy(tools/check-rust.mjs);pnpm --dir ui check。first_approval_previews_the_whole_letter_and_sends_the_dialog_rendering1 个,单独重跑都过。pnpm check本地太慢(这台机器要近 1 小时),以 CI 为准。