ADFA-3534: Fix flickering code when font size is small#1324
Conversation
dara-abijo-adfa
commented
May 20, 2026
- Increased the minimum font size from 6sp to 8sp to avoid rendering issues
- Save new font size set by zooming
|
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 (4)
📝 WalkthroughRelease NotesFeatures & Improvements
Bug Fixes
Technical Changes
|
| Layer / File(s) | Summary |
|---|---|
Gesture detection setup app/src/main/java/com/itsaky/androidide/ui/CodeEditorView.kt |
ScaleGestureDetector and SimpleOnScaleGestureListener are imported, a lateinit detector field is declared, and the detector is initialized with an onScale handler that maps pinch scale factors to changeFontSizeBy calls and routes touch events through the detector. |
Minimum font size bounds app/src/main/java/com/itsaky/androidide/ui/CodeEditorView.kt, app/src/main/java/com/itsaky/androidide/preferences/editorPrefExts.kt, app/src/main/res/layout/layout_text_size_slider.xml |
The editor minimum font size constant is raised from 6f to 8f, changeFontSizeBy now early-returns when the computed size equals the current value and only then updates the editor text size and persists the preference, text size dialog validation changes from < 6 || > 32 to !in 8.0..32.0, and the slider UI minimum is updated from 6.0 to 8.0. |
Editor Cache Optimization
| Layer / File(s) | Summary |
|---|---|
Line span cache threshold editor-treesitter/src/main/java/io/github/rosemoe/sora/editor/ts/LineSpansGenerator.kt |
LineSpansGenerator.CACHE_THRESHOLD is increased from 60 to 100 to allow more cached line-span entries before eviction. |
Possibly related PRs
- appdevforall/CodeOnTheGo#1036: Both PRs modify font-size update logic in
CodeEditorView.ktto support zooming via input gestures (pinch vs. Ctrl+mouse wheel).
Suggested reviewers
- itsaky-adfa
- jatezzz
- Daniel-ADFA
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
🐰 A pinch of magic, a gesture so keen,
Now fonts dance between bounds quite clean,
Eight to thirty-two, the editor's sweet song,
With cache set fuller, performance stays strong! ✨
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (4 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | The title directly addresses the main objective: fixing flickering code when font size is small by increasing the minimum font size from 6sp to 8sp. |
| Description check | ✅ Passed | The description accurately summarizes the two key changes: increasing minimum font size to 8sp and persisting font size changes from zooming. |
| Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
📝 Generate docstrings
- Create stacked PR
- Commit on current branch
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Commit unit tests in branch
ADFA-3534-flickering-code-text
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 @coderabbitai help to get the list of available commands and usage tips.