Repository navigation
fix(tui): draw one copy chip, under the newest answer, only once it settles - #1622
Merged
Merged
Conversation
…ettles Every settled reply drew its own `[复制]` row, so a long conversation was a column of identical buttons. `/copy` copies the last assistant answer, so the chip is that same verb made pressable over the block it would copy: the transcript now draws exactly one, under its newest answer. - `copy_head` (computed by `copy_head_of`) names the message the chip sits under, and `sync_compact_layout` compares it so the incremental splice paths notice when it moves; the reply above loses the chip and the new answer gains it in one rebuild. - Nothing is drawn while `run_in_flight`, and a `pending` message is never the head: a chip under a half-written answer copies half a sentence, and excluding a streaming reply also keeps a delta splicing instead of rebuilding the transcript on every slice. - `rerender_message` now reports the rebuild it falls back to when the chip moved, so the reader's frame is still told. Tests pin one chip for a multi-turn transcript, none mid-run, and the chip moving to the answer a run settles. Docs (en + zh-CN) say the same.
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.
The TUI transcript drew a
[复制]row under every settled reply, so a long conversation read as a column of identical buttons./copycopies the last assistant answer, so the chip is that same verb made pressable over the block it would copy: the transcript now draws exactly one, under its newest answer.Commits
fix(tui)draw one copy chip, under the newest answer, only once it settles —copy_head(fromcopy_head_of) names the message the chip sits under;sync_compact_layoutcompares it so the incremental splice paths notice when it moves, and the reply above loses the chip while the new answer gains it in one rebuild. Nothing is drawn whilerun_in_flight, and apendingmessage is never the head (a chip under a half-written answer would copy half a sentence, and excluding a streaming reply also keeps a delta splicing instead of rebuilding on every slice).rerender_messagenow reports the rebuild it falls back to when the chip moved. Docs (en + zh-CN) say the same.Verification
Run in the main checkout at
9c1fabc1bwith the pinned toolchain (rustc 1.99.1fromrust-toolchain.toml; the Homebrew 1.96.0 onPATHwas shadowed) andulimit -n 8192:cargo fmt --all -- --check→ cleancargo check -p future-tui --all-targets→ clean (20.7s)cargo clippy -p future-tui --all-targets -- -D warnings→ clean (13.4s)cargo test -p future-tui --lib→ 1839 passed, 0 failed, 4 ignored (20.0s)make check-docs→ 421 docs OK, 0 pairs pending bilingualization, provider matrix 13 rowsUser-visible changes
Every settled reply used to carry its own copy chip; now exactly one chip is drawn, under the newest answer, and nothing is drawn while a run is in flight.
/copykeeps copying the last assistant answer, so the pressable chip and the verb still agree. Revert94e655d32. No setting, default value, migration or wire change.