Repository navigation
fix: start the file editor as editable as its recovered draft, and stop forging a selection through a pick - #6973
Merged
Merged
Conversation
…op forging a selection through a pick Two browser tests ended with an unchanged-write finding after #6936 made a LeafElement draw inside Leaf's set of its state. lf-file-editor created its CodeMirror view read-only and recovered a kept draft only afterwards, so on a reload with a draft the first paint in the same setup task made the file writable: tabindex was set on the content and removed again in one script. Drafts now come back before the editor exists, and it starts with the read-only state the paint would give it, from one rule both use. test_one_shared_added_option_has_one_action_payload_across_tabs forged `selected` on an option the state never held. The `add` draw put the DOM back to the state and the pick in the same click restored it. The test now drops the forged selection once the draft generation has recorded it, so both tabs send with their state's selection and the picks still have to carry the option only the generation recorded. Closes #6964
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.
Two browser tests have ended with an
unchanged writefinding since #6936. That PR made aLeafElementdraw inside Leaf's set of itsstate, so two draws that used to land in separate tasks now land in one script. The write watch then sees the attribute end where it started. The two findings have separate causes.lf-file-editor,tabindexon CodeMirror's content. The editor was created read-only, and a draft kept across a reload was recovered only after that. On reload the first paint in the same setup task found the file writable, sotabindex="0"was set and removed in one script. Drafts are now recovered before the editor is created, and the editor starts with the read-only state the paint would give it. Creation and the paint share onereadOnly(of)rule.lf-options,selectedon#job-mounts. This one was made by the test.test_one_shared_added_option_has_one_action_payload_across_tabsforgesselectedin the DOM so that the draft generation records it, but the tab's state never held it. The click'sadddraw put the DOM back to the state, and the pick in the same click restored it. The test now removes the forged attribute once the generation has recorded it. Both tabs then send with their state's selection, and the test'spicks == {("job-mounts", <added>)}assertion still requires the pick to come from the generation's recorded choice. The widget is unchanged. On a real page the DOM follows the state, so this double write can't happen there.Both tests failed on
7da7a6a71(currentmainwhen this run started) and pass with the change. Other checks that pass on this branch: the file editor's reload, retry, export, first-read-wait, phone and navigation tests intests/browser/test_render_files.py, the otheroptiontest intest_shared_drafts.py,pnpm run checkand pre-commit.Closes #6964 — automated triage