fix(group): block admins from leaving a group with clear in-app guidance#7
Conversation
WalkthroughThe PR prevents group admins from leaving a group without stepping down. It exposes the ChangesAdmin-Leave Protection
🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 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)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/screen/group_detail.rs (1)
22-31: 💤 Low valueThe
npubfield check is not dead code; the documentation is misleading.The parameter
pubkeyactually receives bech32-encoded npub values (frommember_npub()andself.account), not raw hex as the doc comment claims. Thenpubfield check on line 30 is a live code path that matches when the admins list contains objects withnpubfields.However, the doc comment saying "hex, as returned by the daemon" is inaccurate. Consider clarifying that the function matches bech32-encoded npub values or raw pubkey strings, not hex.
🤖 Prompt for 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. In `@src/screen/group_detail.rs` around lines 22 - 31, The doc comment for is_admin is inaccurate: the pubkey parameter can be a bech32-encoded npub (from member_npub() or self.account) as well as raw pubkey strings, so update the documentation to reflect that the function matches either bech32 npub values or raw pubkey strings (and that admins may contain bare strings or objects with pubkey/npub fields); leave the implementation (is_admin) unchanged but change the comment to something like “pubkey (bech32 npub or raw pubkey string)”.
🤖 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.
Nitpick comments:
In `@src/screen/group_detail.rs`:
- Around line 22-31: The doc comment for is_admin is inaccurate: the pubkey
parameter can be a bech32-encoded npub (from member_npub() or self.account) as
well as raw pubkey strings, so update the documentation to reflect that the
function matches either bech32 npub values or raw pubkey strings (and that
admins may contain bare strings or objects with pubkey/npub fields); leave the
implementation (is_admin) unchanged but change the comment to something like
“pubkey (bech32 npub or raw pubkey string)”.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: bf76e12b-d619-4e43-9f00-d44874d26ef3
📒 Files selected for processing (2)
src/app.rssrc/screen/group_detail.rs
Summary by CodeRabbit
Release Notes