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>
10 lines
310 B
Python
10 lines
310 B
Python
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
|
|
|