[Feature Request] chat.z.ai: Add Delete Message Option for Individual Messages in Chat Sessions
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 22
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
Feature Request: Add "Delete Message" Button to chat.z.ai
π Summary
Add a DELETE button/option for individual messages within a chat session, allowing users to remove specific messages (both user and assistant) without deleting the entire conversation.
π― Problem Description
Current State
chat.z.ai currently provides these per-message actions:
- β Copy β Copy message text to clipboard
- β Generate Again β Regenerate the AI response
- β Delete β MISSING β No way to remove individual messages
User Pain Points
| Scenario | Impact |
|---|---|
| Accidentally sent sensitive info | Cannot remove it from context |
| Wrong prompt sent | Must delete entire session or live with it |
| Want to refine conversation flow | No way to remove detours/mistakes |
| Context window management | Irrelevant messages consume tokens |
| Privacy concerns | Sensitive data persists in session history |
User Feedback
"We have COPY and GENERATE AGAIN, but how about DELETE?"
"We have no 'Delete' button in Z.AI. For example, I want to delete the message [in the blue square], but I CANNOT achieve it now."
β Joyboy2333 [ER2] (Discord)
β Proposed Solution
UI Design
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Current Message Hover Actions: ββ ββ ββββββββββββ βββββββββββββββββββ ββββββββββββββββ ββ β π β β π β β ποΈ β ββ β Copy β β Generate Again β β Delete β ββ ββββββββββββ βββββββββββββββββββ ββββββββββββββββ ββ ββ β NEW FEATURE ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ```
### Delete Confirmation Flow
User clicks Delete (ποΈ) on a message
β
βββββββββββββββββββββββββββββββββββββββ
β β οΈ Delete this message? ββ β
β This action cannot be undone. ββ The message will be removed from ββ the conversation context. ββ β
β [Cancel] [Delete Message] β
βββββββββββββββββββββββββββββββββββββββ
β
If confirmed:
β Message visually removed from UI
β Message removed from context window
β Subsequent messages re-contextualized
β Optional: Show "1 message deleted" placeholder
### Scope Options
| Delete Mode | Behavior | Use Case |
|------------|----------|----------|
| **Single Message** | Remove only clicked message | Quick cleanup of one mistake |
| **Message + Below** | Remove message AND all responses after | "Start over from here" |
| **Multiple Select** | Checkbox mode, batch delete | Bulk cleanup of irrelevant parts |
**Recommended MVP:** Start with Single Message, add others based on usage data.
---
## π§ Technical Considerations
### Backend Requirements
```javascript
// Proposed API endpoint
DELETE /api/v1/sessions/:sessionId/messages/:messageId
// Request headers
Authorization: Bearer {token}
// Response
{
success: true,
deletedMessageId: "msg_abc123",
affectedContextWindow: -450, // tokens freed
remainingMessages: 23
}
Context Window Management
When a message is deleted:
-
Immediate: Remove message from conversation history array
-
Token recalculation: Update context window size (free up tokens)
-
Continuity check: If deleted message breaks conversation flow:
- Option A: Keep subsequent messages as-is (may be confusing)
- Option B: Flag context gap with subtle indicator
- Option C: Re-summarize context for AI (expensive but clean)
-
Caching: Invalidate any cached context that included deleted message
Edge Cases
| Edge Case | Recommended Handling |
|---|---|
| Delete user's last message | Also remove AI's response to it |
| Delete system/instruction message | Block or warn (critical context) |
| Delete message with file attachment | Remove attachment reference too |
| Delete in active generation | Queue deletion after current response completes |
| Delete in shared/exported session | Mark as deleted; don't show in export |
| Undo requested | Restore from recent-deletion buffer (5-min window) |
π¨ UI/UX Specifications
Visual Design
Hover State (Desktop):
ββββββββββββββββββββββββββββββββββββββββββββββ
β [User Message Text] [π][π][ποΈ] β
ββββββββββββββββββββββββββββββββββββββββββββββ
β
Appears on hover
(like existing Copy/Regen)
Mobile (Touch):
ββββββββββββββββββββββββββββββββββββββ
β [User Message Text] [...] β β Swipe left OR
ββββββββββββββββββββββββββββββββββββββ Long press
β
βββββββββββββββββββ
β π Copy β
β π Regenerate β
β ποΈ Delete β β Red color
βββββββββββββββββββ
Deleted Message Placeholder (Optional):**
ββββββββββββββββββββββββββββββββββββββββββββββ
β ποΈ Message deleted β
β ββββββββββββββββββββββββββββββββββββββ β
β [Undo] [Dismiss] β
ββββββββββββββββββββββββββββββββββββββββββββββ β Shows for 10 seconds, then collapses to:
"[1 message removed]" (click to expand details)
Accessibility
- Keyboard shortcut: When message focused,
DeleteorBackspacetriggers delete - Screen reader: Announce "Message deleted" and update message count
- Color blind safe: Don't rely solely on red color; use icon + label
- Animation: Smooth fade-out (not instant disappear) so user sees what happened
π Success Metrics
| Metric | Target |
|---|---|
| Feature adoption | >15% of active users use within 2 weeks |
| Session retention | Users delete & continue (not abandon session) |
| Support tickets | Reduction in "delete my chat history" requests |
| Token efficiency | Average 10-20% context reduction after deletions |
π Implementation Priority
| Phase | Feature | Effort | Value |
|---|---|---|---|
| P0 | Single message delete (UI + API) | Medium | High |
| P1 | Delete confirmation dialog | Low | High |
| P1 | Undo buffer (5-minute window) | Medium | Medium |
| P2 | Batch/multi-select delete | High | Medium |
| P2 | "Delete + messages below" mode | Low | Medium |
| P3 | Export filtering (exclude deleted) | Low | Low |
Recommended MVP: Ship P0 + P1 first β covers 80% of use cases.
π§ͺ Testing Scenarios
- Basic Delete: Click delete on user message β confirm β message gone
- Cascade Delete: Delete user message β verify AI response also handled
- Context Check: After delete, send new message β AI doesn't reference deleted content
- Token Verify: Delete large message β context token count decreases
- Mobile Test: Long press β menu appears β delete works
- Offline/Poor Network: Delete queues and syncs when connected
- Permission Check: Non-owner cannot delete messages in shared session
- Undo Flow: Delete β undo within 5 min β message restored
π‘ Additional Context
- Affected Product: chat.z.ai web interface
- Reporter: Joyboy2333 [ER2] (Discord)
- Discord Thread: https://discord.com/channels/1346756824233148527/1539143797194227803
- Related Features: Copy, Generate Already exist on message hover
- Competitor Reference: ChatGPT has individual message edit/delete; Claude has message rewrite
Submitted by:
Regards,
Roman (Discord: bignavi_x)
- Z.ai Volunteer Ambassador
- Tech resources channel: https://t.me/VibeCodePrompterSystem
- Tech Blog: http://claw.rommark.dev/blog
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up β it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No implementation files, tests, or entry points are identified in the issue. Start by locating the chat.z.ai message actions and the proposed DELETE /api/v1/sessions/:sessionId/messages/:messageId endpoint, then define the MVP boundary; done means a confirmed single-message deletion updates the UI and conversation context, with the listed basic and context checks passing.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100