Skip to content

🐛 fix: update message deletion logic to use optimisticDeleteMessage & Fix conversation shortcut keys#11222

Closed
sxjeru wants to merge 12 commits into
lobehub:mainfrom
sxjeru:1.55
Closed

🐛 fix: update message deletion logic to use optimisticDeleteMessage & Fix conversation shortcut keys#11222
sxjeru wants to merge 12 commits into
lobehub:mainfrom
sxjeru:1.55

Conversation

@sxjeru

@sxjeru sxjeru commented Jan 5, 2026

Copy link
Copy Markdown
Contributor

💻 Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 👷 build
  • ⚡️ perf
  • ✅ test
  • 📝 docs
  • 🔨 chore

🔗 Related Issue

🔀 Description of Change

  • 删除并重新生成可正确删除旧消息,且避免跳变影响体验
  • 修复删除最后一个分支的消息(如 3/3),整条消息会不再显示
  • 使消息控制快捷键重新生效

已知问题:

  • 对多分支消息进行 删除并重新生成,最后的删除过程会导致短暂的消息消失并出现。

🧪 How to Test

  • Tested locally
  • Added/updated tests
  • No tests needed

📸 Screenshots / Videos

Before After
... ...

📝 Additional Information

@vercel

vercel Bot commented Jan 5, 2026

Copy link
Copy Markdown

@sxjeru is attempting to deploy a commit to the LobeHub OSS Team on Vercel.

A member of the Team first needs to authorize it.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @sxjeru, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@codecov

codecov Bot commented Jan 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.73684% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.63%. Comparing base (bca8cf6) to head (5f40c77).
⚠️ Report is 1 commits behind head on next.

Additional details and impacted files
@@            Coverage Diff             @@
##             next   #11222      +/-   ##
==========================================
- Coverage   73.63%   72.63%   -1.00%     
==========================================
  Files        1212     1179      -33     
  Lines       97566    89649    -7917     
  Branches    10602     9698     -904     
==========================================
- Hits        71841    65120    -6721     
+ Misses      25634    24438    -1196     
  Partials       91       91              
Flag Coverage Δ
app 67.34% <94.73%> (+0.06%) ⬆️
database ?
packages/agent-runtime 88.57% <ø> (ø)
packages/context-engine 85.52% <ø> (ø)
packages/conversation-flow 92.32% <ø> (ø)
packages/file-loaders 87.04% <ø> (ø)
packages/memory-user-memory 67.12% <ø> (ø)
packages/model-bank 100.00% <ø> (ø)
packages/model-runtime 86.72% <ø> (ø)
packages/prompts 78.32% <ø> (ø)
packages/python-interpreter 92.90% <ø> (ø)
packages/ssrf-safe-fetch 0.00% <ø> (ø)
packages/utils 93.07% <ø> (ø)
packages/web-crawler 95.62% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Store 67.24% <ø> (ø)
Services 50.30% <ø> (ø)
Server 68.33% <ø> (ø)
Libs 39.86% <ø> (ø)
Utils 93.60% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sxjeru sxjeru marked this pull request as ready for review January 5, 2026 05:26
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jan 5, 2026
@gru-agent

gru-agent Bot commented Jan 5, 2026

Copy link
Copy Markdown
Contributor

TestGru Assignment

Summary

Link CommitId Status Reason
Detail 8a82181f9d08341ea8ceba9030c6eca9952ea19d 🚫 Skipped No files need to be tested {"src/features/Conversation/ConversationProvider.tsx":"File path does not match include patterns.","src/features/Conversation/HotkeyRegistry.tsx":"File path does not match include patterns.","src/features/Conversation/store/slices/generation/action.test.ts":"File path does not match include patterns.","src/features/Conversation/store/slices/generation/action.ts":"File path does not match include patterns.","src/features/Conversation/store/slices/message/action/crud.ts":"File path does not match include patterns."}

History Assignment

Tip

You can @gru-agent and leave your feedback. TestGru will make adjustments based on your input

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @sxjeru, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@arvinxx

arvinxx commented Jan 23, 2026

Copy link
Copy Markdown
Member

#11760 I fixed the deletion issue here, let's keep only the shortcut key in this PR


This comment was translated by Claude.

Original Content https://github.com//pull/11760 删除的问题我在这里修了,这个 PR 只保留 shortcut key 吧

@sxjeru sxjeru closed this Jan 24, 2026
@sxjeru sxjeru deleted the 1.55 branch January 24, 2026 02:02
@sxjeru sxjeru restored the 1.55 branch January 24, 2026 02:02
@sxjeru sxjeru reopened this Jan 24, 2026
@sxjeru

sxjeru commented Jan 24, 2026

Copy link
Copy Markdown
Contributor Author

@arvinxx I don't think the handling in #11760 is quite complete. Deleting and then regenerating messages in scenarios like 2/3 will cause noticeable jumps - first jumping to 1/3, then to 3/3, which doesn't feel good from a user experience perspective.
Also, deleting the 3/3 message will cause it to disappear directly.

It would be better to implement the logic in this PR, which generates the message first and then deletes the original one in the background.


This comment was translated by Claude.

Original Content @arvinxx 我认为 #11760 的处理不太完善。先删除再生成消息在类似 2/3 场景中会出现明显的跳变,先跳到 1/3,再跳到 3/3,观感上不太好。 而且删除 3/3 消息也会直接消失。

最好还是能按本 pr 先生成消息再在后台删除原本那条的逻辑实现。

@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jan 24, 2026
@sxjeru sxjeru closed this Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

2 participants