8000 feat(chat): edit a question you asked and get a new answer by adeelahmad · Pull Request #59 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(chat): edit a question you asked and get a new answer - #59

Merged
adeelahmad merged 7 commits into
mainfrom
claude/project-thread-3wdkfx
Oct 3, 2026
Merged

adeelahmad merged 7 commits into
mainfrom
claude/project-thread-3wdkfx

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: a question in a chat couldn't be changed; the only way to rephrase was to ask again at the end of the conversation.

After: each question you asked has an Edit button (on hover, always visible on touch). Editing it in place and pressing Send replaces that question, its answer and everything after it with the edited question and a fresh answer. The model only sees what came before the edited question. A conversation titled after its first question is retitled when that question is edited; a title you set is kept. Edit is hidden while an answer is being written.

How: POST /chats/{cid}/messages takes an optional edit (the id of one of your questions in that conversation; 404 otherwise). chat.rewind deletes that message and every later one, then the normal answer path runs. The UI drops those messages from the cached conversation while the new answer streams. OpenAPI and client regenerated with make openapi.

Motivation and Context

Adeel asked for the ability to edit a message in chat.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests.
  • My change requires documentation updates, and I have updated docs/ accordingly.
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md.

Tested: chat API tests on the in-memory engine and against a SurrealDB 3.2.4 server; full frontend jest (542), tsc, eslint, ruff.

🤖 Generated with Claude Code

https://claude.ai/code/session_012HJLUkBjcHPCPS9aGhPH2Y


Generated by Claude Code

claude added 2 commits October 3, 2026 00:23
POST /chats/{cid}/messages takes `edit`, the id of one of your earlier
questions: it and everything after it are replaced by the edited question
and its new answer. A conversation titled after the edited first question
is retitled; a title you set is kept. In the chat page, each question has
an Edit button (hidden while an answer is being written).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012HJLUkBjcHPCPS9aGhPH2Y
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012HJLUkBjcHPCPS9aGhPH2Y
@adeelahmad adeelahmad self-assigned this Oct 3, 2026
claude added 5 commits October 3, 2026 00:26
Editing a question keeps the files sent with it; the bubble shows them.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012HJLUkBjcHPCPS9aGhPH2Y
An edited question keeps the page it was asked from (chat on any page),
and a refused edit removes nothing.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012HJLUkBjcHPCPS9aGhPH2Y
@adeelahmad
adeelahmad merged commit 9057594 into main Oct 3, 2026
1 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0