ADFA-4715: Word wrap switch in logs#1562
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
|
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 (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 Walkthrough
Risks / best-practice considerations:
WalkthroughOutput fragments now support a persisted word-wrap preference. The editor bottom sheet adds a toggle action, synchronizes it with supported fragments, and updates editor word-wrap state through preference-change events. ChangesOutput word-wrap control
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant EditorBottomSheet
participant EditorPreferences
participant OutputFragment
User->>EditorBottomSheet: Toggle word-wrap action
EditorBottomSheet->>EditorPreferences: Persist outputWordWrap
EditorPreferences->>OutputFragment: Publish OUTPUT_WORD_WRAP change
OutputFragment->>OutputFragment: Apply editor word-wrap state
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
app/src/main/java/com/itsaky/androidide/fragments/output/WrappableOutputFragment.kt (1)
25-41: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRun the required Spotless formatters.
app/src/main/java/com/itsaky/androidide/fragments/output/WrappableOutputFragment.kt#L25-L41: format Kotlin with ktlint and tabs.app/src/main/java/com/itsaky/androidide/fragments/output/NonEditableEditorFragment.java#L108-L119: format Java with Eclipse formatting and tabs.app/src/main/res/layout/layout_editor_bottom_sheet.xml#L10-L135: format XML with Eclipse WTP and tabs.As per coding guidelines, Java, Kotlin, and XML files must use tabs and the project's Spotless formatter.
🤖 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 `@app/src/main/java/com/itsaky/androidide/fragments/output/WrappableOutputFragment.kt` around lines 25 - 41, Run the project's Spotless formatters on app/src/main/java/com/itsaky/androidide/fragments/output/WrappableOutputFragment.kt lines 25-41 using ktlint with tabs, app/src/main/java/com/itsaky/androidide/fragments/output/NonEditableEditorFragment.java lines 108-119 using Eclipse Java formatting with tabs, and app/src/main/res/layout/layout_editor_bottom_sheet.xml lines 10-135 using Eclipse WTP formatting with tabs.Source: Coding guidelines
app/src/main/java/com/itsaky/androidide/ui/EditorBottomSheet.kt (1)
662-669: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winUse
EditorPreferencesas the sole word-wrap state source.This reads
OutputWordWrapPrefs, while the action persists onlyEditorPreferences.outputWordWrap. A value in the secondary store can override the persisted setting; useEditorPreferences.outputWordWraphere when syncing the fragment and action.Proposed change
- val prefs = context.getSharedPreferences("OutputWordWrapPrefs", Context.MODE_PRIVATE) - val isEnabled = prefs.getBoolean(currentFragment.wordWrapPrefKey, currentFragment.isWordWrapEnabled()) + val isEnabled = EditorPreferences.outputWordWrapAs per coding guidelines, reuse existing helpers and maintain one owner per concern.
🤖 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 `@app/src/main/java/com/itsaky/androidide/ui/EditorBottomSheet.kt` around lines 662 - 669, Update the word-wrap synchronization block in EditorBottomSheet so it reads the enabled state exclusively from EditorPreferences.outputWordWrap instead of the OutputWordWrapPrefs SharedPreferences store. Use that value for both WrappableOutputFragment.setWordWrapEnabled and binding.wordWrapOutputAction.isChecked, preserving the existing conditional synchronization behavior.Source: Coding guidelines
🤖 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 `@app/src/main/java/com/itsaky/androidide/ui/EditorBottomSheet.kt`:
- Line 201: Complete accessibility support for the word-wrap toggle: in
EditorBottomSheet.kt, keep wordWrapOutputAction’s checked state and state-aware
content description synchronized at the tab-change, toggle-listener, and
fragment-synchronization sites (201-201, 284-290, and 662-669), and register the
required long-press tooltip listener at the toggle setup. In
layout_editor_bottom_sheet.xml lines 105-115, use the appropriate state-aware
cd_* resource; in strings.xml line 691, add enable/disable word-wrap
descriptions and the contextual tooltip string.
In `@app/src/main/res/layout/layout_editor_bottom_sheet.xml`:
- Around line 73-115: Constrain the output-action row in
layout_editor_bottom_sheet.xml by giving every text action, from
search_output_action through clear_output_action, a bounded relationship to
word_wrap_output_action using a horizontal chain, Flow, or equivalent
overflow-safe layout; preserve the icon’s end alignment and prevent localized
text from overlapping or escaping. Also update
resources/src/main/res/values/styles.xml lines 204-216 to avoid forcing
unconstrained wrap_content widths for EditorBottomSheet.OutputActionButton.
---
Nitpick comments:
In
`@app/src/main/java/com/itsaky/androidide/fragments/output/WrappableOutputFragment.kt`:
- Around line 25-41: Run the project's Spotless formatters on
app/src/main/java/com/itsaky/androidide/fragments/output/WrappableOutputFragment.kt
lines 25-41 using ktlint with tabs,
app/src/main/java/com/itsaky/androidide/fragments/output/NonEditableEditorFragment.java
lines 108-119 using Eclipse Java formatting with tabs, and
app/src/main/res/layout/layout_editor_bottom_sheet.xml lines 10-135 using
Eclipse WTP formatting with tabs.
In `@app/src/main/java/com/itsaky/androidide/ui/EditorBottomSheet.kt`:
- Around line 662-669: Update the word-wrap synchronization block in
EditorBottomSheet so it reads the enabled state exclusively from
EditorPreferences.outputWordWrap instead of the OutputWordWrapPrefs
SharedPreferences store. Use that value for both
WrappableOutputFragment.setWordWrapEnabled and
binding.wordWrapOutputAction.isChecked, preserving the existing conditional
synchronization behavior.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b2847274-9fe6-42dc-8ff9-039c3fb1a9fd
📒 Files selected for processing (8)
app/src/main/java/com/itsaky/androidide/fragments/output/LogViewFragment.ktapp/src/main/java/com/itsaky/androidide/fragments/output/NonEditableEditorFragment.javaapp/src/main/java/com/itsaky/androidide/fragments/output/WrappableOutputFragment.ktapp/src/main/java/com/itsaky/androidide/ui/EditorBottomSheet.ktapp/src/main/res/layout/layout_editor_bottom_sheet.xmlpreferences/src/main/java/com/itsaky/androidide/preferences/internal/EditorPreferences.ktresources/src/main/res/values/strings.xmlresources/src/main/res/values/styles.xml
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
app/src/main/java/com/itsaky/androidide/ui/EditorBottomSheet.kt (1)
672-679: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winKeep the content description synchronized during fragment preference sync.
Line 678 updates only
isChecked, bypassingupdateWordWrapButtonState(). When this path applies a fragment-specific preference, TalkBack can announce the wrong action for the visible state. Replace the direct assignment withupdateWordWrapButtonState(isEnabled).🤖 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 `@app/src/main/java/com/itsaky/androidide/ui/EditorBottomSheet.kt` around lines 672 - 679, In the fragment preference sync within the showWordWrap/WrappableOutputFragment branch, replace the direct binding.wordWrapOutputAction.isChecked assignment with updateWordWrapButtonState(isEnabled) so the checked state and content description remain synchronized.Source: Coding guidelines
🤖 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.
Outside diff comments:
In `@app/src/main/java/com/itsaky/androidide/ui/EditorBottomSheet.kt`:
- Around line 672-679: In the fragment preference sync within the
showWordWrap/WrappableOutputFragment branch, replace the direct
binding.wordWrapOutputAction.isChecked assignment with
updateWordWrapButtonState(isEnabled) so the checked state and content
description remain synchronized.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2b4d2d77-ff0e-47f8-8a07-dbf2edf0e078
📒 Files selected for processing (4)
app/src/main/java/com/itsaky/androidide/ui/EditorBottomSheet.ktapp/src/main/res/layout/layout_editor_bottom_sheet.xmlidetooltips/src/main/java/com/itsaky/androidide/idetooltips/TooltipTag.ktresources/src/main/res/values/strings.xml
🚧 Files skipped from review as they are similar to previous changes (1)
- app/src/main/res/layout/layout_editor_bottom_sheet.xml
Allow users turn word wrapping on/off in logs