fix(ui): restrict edit to latest user message (#747)
fix(ui): restrict edit to latest user message (#747) Only the latest user turn shows the pencil/edit affordance. Older user messages remain read-only (copy + timestamp still work). Avoids the misleading implication that historical messages can be lightly edited when the actual action truncates the session and restarts the conversation from that point. Closes #744 Co-authored-by: franksong2702 <franksong2702@users.noreply.github.com>
This commit is contained in:
9
tests/test_issue744.py
Normal file
9
tests/test_issue744.py
Normal file
@@ -0,0 +1,9 @@
|
||||
import pathlib
|
||||
|
||||
|
||||
def test_only_latest_user_message_gets_edit_button():
|
||||
src = pathlib.Path("static/ui.js").read_text(encoding="utf-8")
|
||||
assert "let lastUserRawIdx=-1;" in src
|
||||
assert "const isEditableUser=isUser&&rawIdx===lastUserRawIdx;" in src
|
||||
assert "const editBtn = isEditableUser ?" in src
|
||||
|
||||
Reference in New Issue
Block a user