Repository navigation
fix: close a resolved thread's margin card over the empty reply box Send leaves - #5364
Merged
Merged
Conversation
Since #5039 a send leaves the caret in the reply box. Acceptance ends the reply's editing session, but when the agent then resolved the thread, the thread pass carried the still-focused box to the resolved thread's reply (`mayReplyTo` admitted every thread), and that focus started a new session through the row's focusin. The session kept the resolved card in the margin, so an editor the user had finished with stayed open. A focused reply box now carries the user to a resolved thread only while a reply is being written there (`replyIsEditing`), as the carry's own header already said. The user's own edit in a box with no session now begins one, so a reply typed into the box Send left is retained through an agent's Resolve like any reply being written; without that, the stricter carry took those words off the screen. test_reply_admission_finishes_or_restores_its_native_session[margin-accepted] failed on main from #5039 and passes again. The new test_typing_in_the_box_a_send_left_keeps_its_reply_through_settlement covers the typed case. Closes #5147
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.
When an agent resolved a thread right after the user's reply in its margin card was accepted, the card stayed open with its reply editor. That is the
margin-acceptedcase oftest_reply_admission_finishes_or_restores_its_native_session, which has failed on everycirun onmainsince #5039. Bisecting the ten commits between the last passing run and the first failing one finds #5039.Cause. #5039 leaves the caret in the reply box after Send. Acceptance still ends the reply's editing session. But when the agent's Resolve redrew the thread,
holdThreadPlacecarried the focused box to the resolved thread's reply, becausemayReplyToadmitted every thread. Focusing that box fired the row'sfocusin, which started a new session, and a session keeps a resolved thread's card in the margin (annotation-inventory.js). So focus was opening an editing session that the user never started.Change.
mayReplyTo(thread/focus.js) carries a reply box to a resolved thread only while a reply is being written there (replyIsEditing). The comment aboveholdThreadPlacealready stated that rule.saveinthread/replies.js). Open threads in the panel on a phone, and seven more thread-surface fixes from a Firefox pass #5039 says the box Send leaves "counts as written in only once the user types there or comes back to it". Coming back to the box already started a session throughfocusin, but typing did not. With only the first change, a reply typed into that box disappeared from the screen when the agent resolved the thread, and the suite's words-left-screen watcher reported it.Tests.
margin-acceptedfails onmainand passes with this change.test_typing_in_the_box_a_send_left_keeps_its_reply_through_settlementis new. It types into the box Send left, then has the agent resolve the thread. It passes with both changes and fails when only the carry rule is applied.tests/browser/drafts,margin/test_card_reply.py, andthreads/test_composing.py,test_agent_replies.pyandtest_seated_threads.py;pnpm run test:runtime(777 tests);pnpm run check:browser; and pre-commit.test_draft_editing.py::test_a_draft_uses_shared_editing_and_saves_exact_markdown_source. It fails the same way onmainwithout this change and in main's recentciruns.Closes #5147 — automated triage