Conversation
bad6977 to
c47a2c6
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 Walkthrough
WalkthroughAdds handling for configuration changes to ensure the editor caret is visible after layout, replaces a mutable map with a thread-safe ConcurrentHashMap for per-file timestamps, and updates those timestamps immediately after fragment saves. Changes
Sequence Diagram(s)sequenceDiagram
participant Activity as EditorHandlerActivity
participant Fragment as EditorFragment
participant View as EditorView
Activity->>Fragment: find current editor fragment
Activity->>View: post doOnNextLayout callback
Note right of View: after layout completes
View-->>Activity: invoke callback
Activity->>Fragment: call ensurePositionVisible()
Fragment->>View: adjust caret/scroll position
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
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 Tip CodeRabbit can scan for known vulnerabilities in your dependencies using OSV Scanner.OSV Scanner will automatically detect and report security vulnerabilities in your project's dependencies. No additional configuration is required. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@app/src/main/java/com/itsaky/androidide/activities/editor/EditorHandlerActivity.kt`:
- Around line 731-733: The writes to fileTimestamps in the save flow are not
synchronized and can race with onPause() and checkForExternalFileChanges() which
run on Dispatchers.IO; make fileTimestamps thread-safe by replacing its backing
map with a concurrent data structure (e.g., Java's ConcurrentHashMap) or
protecting all accesses with a single Mutex, update references to fileTimestamps
used in saveAllAsync(), onPause(), and checkForExternalFileChanges()
accordingly, and ensure the frag.file?.let { savedFile -> fileTimestamps[...] =
savedFile.lastModified() } write uses the new thread-safe access pattern.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2bcabb1b-5878-4445-b34b-5d8c3c2491cd
📒 Files selected for processing (1)
app/src/main/java/com/itsaky/androidide/activities/editor/EditorHandlerActivity.kt
app/src/main/java/com/itsaky/androidide/activities/editor/EditorHandlerActivity.kt
Show resolved
Hide resolved
…ation change Ensure cursor visibility after layout changes and update file timestamps after saving.
c47a2c6 to
ac0e79b
Compare
Description
This PR addresses issues related to UI glitches and state loss when the device configuration changes (e.g., docking to DeX or rotating the screen). It ensures the editor centers the cursor in the viewport after a resize and correctly updates file timestamps to prevent sync conflicts.
Details
onConfigurationChangedlogic to triggerensurePositionVisibleafter the next layout pass, keeping the user's focus on the active line.fileTimestampsmap upon successful file saves to ensure the IDE tracks the latest buffer state accurately.Before changes
document_5012592404868368210.mp4
After changes
document_5012592404868368211.mp4
Ticket
ADFA-3122