Do not re-insert signature when opening a draft#13146
Conversation
Assisted-by: ClaudeCode:claude-opus-4-8 Signed-off-by: Jan C. Borchardt <925062+jancborchardt@users.noreply.github.com>
9567629 to
9e36af9
Compare
|
(Rebased, all tests were passing before also.) |
|
@coderabbitai review and find out if there is existing logic to handle this, because this was fixed before |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Look at the PR diff first
gh pr diff 13146 --repo nextcloud/mail
echo "=== PR FILES CHANGED ==="
gh pr view 13146 --repo nextcloud/mail --json files --jq '.files[].path'Length of output: 3936 🏁 Script executed: #!/bin/bash
# Search for existing draft-opening signature guards
echo "=== Signature insertion logic ==="
rg -n "signature" --type vue --type js --type ts -C3 src/ | grep -i "draft\|isDraft\|is_draft" -A3 -B3
echo "=== isDraft checks around signature ==="
rg -nP "isDraft|is_draft" src/ --type vue --type js --type ts -C5
echo "=== Draft-related signature skip logic ==="
rg -n "signature" src/ --type vue --type js --type ts -lLength of output: 968 🏁 Script executed: #!/bin/bash
# Find all JS/Vue/TS files related to signatures
fd -e vue -e js -e ts . src/ --exec grep -l -i "signature" {} \;
echo "=== Look for draft checks in composer ==="
rg -rn "draft" src/ --include="*.vue" --include="*.js" --include="*.ts" -lLength of output: 1785 🏁 Script executed: #!/bin/bash
echo "=== Files changed in PR ==="
gh pr diff 13146 --repo nextcloud/mail --name-only
echo ""
echo "=== Full diff ==="
gh pr diff 13146 --repo nextcloud/mailLength of output: 3944 🏁 Script executed: #!/bin/bash
echo "=== Relevant Composer.vue sections ==="
# Get the insertSignature method and surrounding context
rg -n "insertSignature\|changeSignature\|isFirstOpen\|isDraft\|onEditorReady" src/components/Composer.vue -A2 -B2
echo ""
echo "=== changeSignature data definition ==="
rg -n "changeSignature" src/components/Composer.vue -A5 -B5
echo ""
echo "=== isFirstOpen usage ==="
rg -n "isFirstOpen" src/components/Composer.vue -A5 -B5Length of output: 4292 🏁 Script executed: #!/bin/bash
echo "=== Git log for signature/draft related changes ==="
git log --oneline --all -50 -- src/components/Composer.vue
echo ""
echo "=== Previous fixes mentioning draft+signature ==="
git log --oneline --all --grep="signature" --grep="draft" --all-match -20
git log --oneline --all --grep="draft.*signature\|signature.*draft" -20Length of output: 3673 🏁 Script executed: #!/bin/bash
echo "=== InsertSignatureCommand.js ==="
cat -n src/ckeditor/signature/InsertSignatureCommand.js
echo ""
echo "=== SignaturePlugin.js ==="
cat -n src/ckeditor/signature/SignaturePlugin.js
echo ""
echo "=== Git log for InsertSignatureCommand / SignaturePlugin ==="
git log --oneline -20 -- src/ckeditor/signature/InsertSignatureCommand.js
git log --oneline -20 -- src/ckeditor/signature/SignaturePlugin.js
echo ""
echo "=== Was there ever a guard in onEditorReady? Check git log for that area ==="
git log --all --oneline --follow -30 -- src/components/Composer.vue | head -30Length of output: 10792 🏁 Script executed: #!/bin/bash
# Check if isFirstOpen was previously used to guard insertSignature
# Look at older versions of onEditorReady in Composer.vue
git log --all --oneline -30 -- src/components/Composer.vue
echo ""
# Show any commit that mentions 'signature' in its message related to Composer
git log --all --oneline --grep="signature" -- src/components/Composer.vue
echo ""
# Check if there are any related issues or PRs mentioned in the git log
git log --all --format="%H %s %b" --grep="draft" --grep="signature" --all-match | head -50Length of output: 3163
Existing logic in
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughA new Draft-aware signature insertion
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
|
/backport to stable5.10 |
|
Thanks. I knew we had something like that. Rabbit just didn't find it. |

When you have a signature enabled and open a draft, that signature gets inserted. This can even result in multiple insertions of the signature if you open the draft multiple times. When opening a draft, the signature should never be inserted, as this is already done at initial composition.
🤖 AI (if applicable)
Assisted-by: ClaudeCode:claude-opus-4-8
Summary by CodeRabbit