Repository navigation
Conversation
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.
Refs ora-space/circus#1139
问题
侧栏快速连点两个工作流时,两条
selectWorkflow并发:各自await自己的 flush,最终选中取决于两次保存谁先 resolve,不一定是用户最后点的;先返回的一条还会提前解除编辑区的inert。修复
selectWorkflow引入单调递增的workflowSwitchGenerationtoken:++generation,记为本次的 token;token !== 当前最新 token,说明有更新的选择,直接 return——不改选中、不解除inert,把切换权交给最新那次;inert;这样只有最后一次选择生效,切换完成前编辑区一直
inert。exportLibraryWorkflow在selectWorkflow后检查selectedWorkflowId === workflowId,过期调用不改选中所以不会为未选中的行打开导出,无需额外改动。测试
新增确定性测试「keeps the last workflow picked when two switches overlap their saves」:拦截草稿 PUT 分两个 gate,先点 B 再点 C;放行 B 的保存后断言选中未变、编辑区仍
inert;放行 C 的保存后断言最终选中 C、inert解除。验证:
vitest817 全过、tsc、oxlint、vite build全绿。