fix: sender component supports custom sending functionality - #375
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdds a ChangeshasExternalContent feature
Estimated code review effort: 2 (Simple) | ~15 minutes Sequence Diagram(s)sequenceDiagram
participant Demo
participant Sender
participant SenderCore
participant ClearButton
Demo->>Sender: pass hasExternalContent from selectedFiles
Sender->>SenderCore: evaluate editor text and external content
SenderCore->>ClearButton: provide hasEditorContent
Sender->>Demo: emit submit or clear
Demo->>Demo: submit or remove selected files
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/demos/sender/actions-enhanced.vue`:
- Around line 18-20: The handleFiles handler in actions-enhanced.vue is
replacing selectedFiles with only the latest UploadButton emission, which drops
previously chosen files. Update handleFiles so it appends the new files to
selectedFiles.value instead of overwriting it, while preserving compatibility
with per-item removal in the demo flow.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 53258614-62e4-4731-a6e3-aabbe6aab860
📒 Files selected for processing (11)
docs/demos/sender/actions-enhanced.vuedocs/src/components/sender.mdpackages/components/src/sender-actions/clear-button/useClearButtonState.tspackages/components/src/sender/composables/useSenderCore.tspackages/components/src/sender/index.type.tspackages/components/src/sender/index.vuepackages/components/src/sender/types/context.tspackages/test/src/sender/helpers/index.tspackages/test/src/sender/index.vuepackages/test/src/sender/selectors.tspackages/test/src/sender/specs/basic.spec.ts
📦 Package Previewpnpm add https://pkg.pr.new/@opentiny/tiny-robot@5a5c591 pnpm add https://pkg.pr.new/@opentiny/tiny-robot-kit@5a5c591 pnpm add https://pkg.pr.new/@opentiny/tiny-robot-svgs@5a5c591 commit: 5a5c591 |
🧹 Preview Cleaned UpThe preview deployment has been removed. |

背景
Sender 在上传附件、图片等内容不写入编辑器文本的场景下,即使业务侧已有可提交内容,组件仍会因为编辑器为空而隐藏/禁用提交入口,导致无法提交仅包含外部内容的消息。
变更内容
hasExternalContentprop,用于标识是否存在附件、图片、文件列表等外部可提交内容。hasContent:编辑器文本或外部内容任一存在时为 true,用于提交按钮、快捷键提交和submit()方法。hasEditorContent:仅表示编辑器内文本内容,用于清空按钮等只作用于编辑器文本的场景。hasExternalContent的使用说明和 Props 表。测试
Props: hasExternalContent - 应该支持仅外部内容提交Summary by CodeRabbit
Summary by CodeRabbit
hasExternalContent.hasExternalContentbehavior in Sender docs.