feat/stop autocorrecting me#206
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughPR adds mention autocorrect prevention via a new ChangesMention Protection and Mobile Input UX
Sequence Diagram(s)sequenceDiagram
participant User
participant Textarea
participant MentionGuard
participant SelectionAPI
User->>Textarea: Type mention + autocorrect trigger
Textarea->>MentionGuard: beforeinput (insertReplacementText)
MentionGuard->>SelectionAPI: Read selectionStart/End
SelectionAPI-->>MentionGuard: Selection range
MentionGuard->>MentionGuard: Normalize selected text + nickname set (case-insensitive)
alt Selected text matches nickname
MentionGuard->>Textarea: preventDefault()
Textarea-->>User: Autocorrect blocked
else No match
Textarea-->>User: Autocorrect applied
end
sequenceDiagram
participant MessageHandler as CHANMSG/<br/>MULTILINE_MESSAGE
participant Store
participant CurrentUser as Current Server<br/>User
participant Notification
MessageHandler->>Store: Fetch replyMessage if ID present
Store-->>MessageHandler: Message or null
MessageHandler->>CurrentUser: Get current username
CurrentUser-->>MessageHandler: Username
alt replyMessage.userId == currentUser.username
MessageHandler->>MessageHandler: isReplyToMe = true
MessageHandler->>MessageHandler: hasMention = true
else checkForMention detected
MessageHandler->>MessageHandler: hasMention = true
else Own message
MessageHandler->>MessageHandler: hasMention = false
end
MessageHandler->>Store: Populate newMessage.mentioned
alt Not historical & outside active channel
alt hasMention true
MessageHandler->>Notification: showMentionNotification
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
|
Automated deployment preview for the PR in the Cloudflare Pages. |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@src-tauri/plugins/share-sheet/.tauri/tauri-api/Sources/Tauri/Invoke.swift`:
- Around line 33-38: The new implementation of getArgs() uses force-unwraps and
forced casts (self.data.data(using: .utf8)!, JSONSerialization result cast as!
NSDictionary, and JSTypes.coerceDictionaryToJSObject(...)!) which can crash the
process; restore the previous guarded error handling by: check UTF-8 conversion
(guard let jsonData = self.data.data(using: .utf8) else { throw NSError(...) }),
use JSONSerialization and guard that the top-level value is an NSDictionary via
conditional cast (guard let dict = data as? NSDictionary else { throw
NSError(...) }), and unwrap the result of JSTypes.coerceDictionaryToJSObject
safely (guard let jsObj = JSTypes.coerceDictionaryToJSObject(dict,
formattingDatesAsStrings: true) else { throw NSError(...) }) and return jsObj;
also verify this file is not an unintended vendored/generated change and revert
if it was modified accidentally.
In `@src-tauri/plugins/share-sheet/.tauri/tauri-api/Sources/Tauri/Tauri.swift`:
- Line 22: The PluginManager.shared singleton currently holds a strong reference
via the public var viewController: UIViewController? which prevents view
controllers set in onWebviewCreated from being deallocated; revert this to a
weak reference (e.g., make viewController a weak var of type UIViewController?)
so the assigned controller can be released when dismissed, and verify this
change under .tauri/tauri-api is intentional (or remove the accidental
regeneration) to restore the previous lifecycle behavior.
- Around line 78-90: The vendored Tauri iOS bridge in Tauri.swift is using an
incorrect IMP signature (currently casting methodIMP to use OpaquePointer) which
causes the NSError to be deallocated and the code to leak via
Unmanaged.passRetained(error); fix this by upgrading the tauri dependency to the
version that uses AutoreleasingUnsafeMutablePointer<NSError?> for the
selectorWithThrows/methodIMP bridge, then regenerate the vendored sources via
build.rs so the method cast for methodIMP uses the correct signature (i.e.
`@convention`(c) (Any?, Selector, Invoke,
AutoreleasingUnsafeMutablePointer<NSError?>) -> Void) and remove the
Unmanaged.passRetained(error) leak workaround and the manual OpaquePointer
usage.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2aaffde3-2ed2-4943-9c4e-82b6b10bd6e5
⛔ Files ignored due to path filters (1)
src-tauri/gen/apple/ObsidianIRC_iOS/Info.plistis excluded by!**/gen/**
📒 Files selected for processing (7)
src-tauri/plugins/share-sheet/.tauri/tauri-api/Sources/Tauri/Invoke.swiftsrc-tauri/plugins/share-sheet/.tauri/tauri-api/Sources/Tauri/Tauri.swiftsrc/components/layout/ChatArea.tsxsrc/components/ui/MediaCommentsSidebar.tsxsrc/hooks/useMentionAutocorrectGuard.tssrc/lib/platformUtils.tstests/hooks/useMentionAutocorrectGuard.test.ts
|
This will be great |
|
Can we get rid of coderabbit |
Summary by CodeRabbit
Release Notes
New Features
Tests