Skip to content

Fix checkbox alignment and text positioning for multi-line checklist items#982

Open
krahulshharmaa wants to merge 2 commits intoCrustack:mainfrom
krahulshharmaa:ui/fix-checkbox-alignment
Open

Fix checkbox alignment and text positioning for multi-line checklist items#982
krahulshharmaa wants to merge 2 commits intoCrustack:mainfrom
krahulshharmaa:ui/fix-checkbox-alignment

Conversation

@krahulshharmaa
Copy link
Copy Markdown

@krahulshharmaa krahulshharmaa commented Apr 17, 2026

Solved the alignment issue, the impacted file is recycler_list_item.xml.

Summary by CodeRabbit

  • Style
    • Refined list item layout for improved visual consistency: adjusted vertical alignment of checkboxes, text input and drag handle, aligned checkbox to the text baseline, positioned text input toward the top with added vertical padding for better readability and cleaner spacing across the list interface.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8a2126bf-604b-46e1-9441-0db1c9f19f54

📥 Commits

Reviewing files that changed from the base of the PR and between e6d90f1 and 7080cab.

📒 Files selected for processing (1)
  • app/src/main/res/layout/recycler_list_item.xml
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/src/main/res/layout/recycler_list_item.xml

📝 Walkthrough

Walkthrough

Removed parent-driven vertical centering and adjusted alignment/padding in the recycler list item layout: CheckBox now aligns to EditText baseline with a baseline offset, EditText is top-aligned with explicit vertical padding, and DragHandle's vertical-centering attribute was toggled.

Changes

Cohort / File(s) Summary
Layout Alignment Refactoring
app/src/main/res/layout/recycler_list_item.xml
Removed android:gravity="center_vertical" from @id/Content; toggled android:layout_centerVertical on @id/DragHandle; replaced @id/CheckBox's layout_centerVertical with android:layout_alignBaseline="@id/EditText" and app:lastBaselineToBottomHeight="7sp"; changed @id/EditText from centered to android:layout_alignParentTop="true", `android:gravity="top

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I nibbled at constraints, hopped over the line,
I nudged baselines closer, added padding just fine.
No more vertical centering muddle in sight,
Now items stand tidy, all cozy and right.
A little rabbit cheer for this layout delight.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix checkbox alignment and text positioning for multi-line checklist items' directly and specifically describes the main changes in the pull request, which involve adjusting checkbox baseline alignment and EditText positioning in the layout file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
app/src/main/res/layout/recycler_list_item.xml (1)

35-45: DragHandle still uses layout_centerVertical — intentional?

With the CheckBox and EditText now pinned to the top of the row, DragHandle remains vertically centered in the parent. On tall multi-line items the drag handle will float to the middle of the row while the checkbox sits at the top, which may look inconsistent. If the intent is "everything aligned with the first line," consider switching DragHandle to layout_alignTop="@id/EditText" (with matching top padding) as well; otherwise this can be ignored.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/main/res/layout/recycler_list_item.xml` around lines 35 - 45, The
DragHandle ImageButton currently uses android:layout_centerVertical which causes
it to float while the CheckBox and EditText are top-aligned; replace
android:layout_centerVertical="true" with android:layout_alignTop="@id/EditText"
(or the actual EditText id) so the drag handle aligns to the first line, and
ensure its top padding matches the EditText/CheckBox padding so vertical spacing
is consistent; remove the centerVertical attribute to avoid conflicting
constraints.
🤖 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/res/layout/recycler_list_item.xml`:
- Around line 47-52: Replace the CheckBox's top alignment with baseline
alignment so the checkbox and EditText text line up: in the MaterialCheckBox
with id "CheckBox" remove android:layout_alignTop="@id/EditText" and use
android:layout_alignBaseline="@id/EditText" (or if using ConstraintLayout, use
app:layout_constraintBaseline_toBaselineOf="@id/EditText"); if you observe a 1px
optical offset after testing, add the MaterialCheckBox attribute
app:lastBaselineToBottomHeight="7sp" to fine-tune alignment across font scales
and multi-line cases.

---

Nitpick comments:
In `@app/src/main/res/layout/recycler_list_item.xml`:
- Around line 35-45: The DragHandle ImageButton currently uses
android:layout_centerVertical which causes it to float while the CheckBox and
EditText are top-aligned; replace android:layout_centerVertical="true" with
android:layout_alignTop="@id/EditText" (or the actual EditText id) so the drag
handle aligns to the first line, and ensure its top padding matches the
EditText/CheckBox padding so vertical spacing is consistent; remove the
centerVertical attribute to avoid conflicting constraints.
🪄 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: f12ad39d-8ed8-43c7-bce1-e56a9a2abb54

📥 Commits

Reviewing files that changed from the base of the PR and between c9cfaff and e6d90f1.

📒 Files selected for processing (1)
  • app/src/main/res/layout/recycler_list_item.xml

Comment thread app/src/main/res/layout/recycler_list_item.xml Outdated
@krahulshharmaa
Copy link
Copy Markdown
Author

Are we going to merge this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants