Skip to content

Conversation

@OrangeAndGreen
Copy link
Contributor

@OrangeAndGreen OrangeAndGreen commented Jun 11, 2025

https://dimagi.atlassian.net/browse/QA-7848
https://dimagi.atlassian.net/browse/QA-7847

On the Job Intro and Job Details pages, the button to proceed was to the right of some text.
On the Learning/Delivery Progress pages, the sync button was similar
On the Phone Verification page, similar again with the Change link

When translated to French it all gets bigger, and causes strange overflows.

I rearranged these components vertically to allow room for them to expand horizontally, such that rollover will be isolated to each component rather than squishing other components.

Example of the new look:

@coderabbitai
Copy link

coderabbitai bot commented Jun 11, 2025

📝 Walkthrough

Walkthrough

This change updates two XML layout files used in the application's UI. In fragment_connect_delivery_details.xml, a nested ConstraintLayout inside a CardView is replaced with a vertically oriented LinearLayout that now contains two TextView elements and a MaterialButton, with new alignment and background properties. In fragment_connect_job_intro.xml, the orientation of a LinearLayout inside a CardView is switched from horizontal to vertical, and a nested LinearLayout is removed in favor of placing two TextView elements directly inside the parent, with adjusted styling and alignment for the MaterialButton. No changes were made to exported or public entities.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI
    participant CardView
    participant LinearLayout
    participant TextView
    participant MaterialButton

    User->>UI: Opens delivery details or job intro fragment
    UI->>CardView: Inflate CardView layout
    CardView->>LinearLayout: Initialize vertical LinearLayout
    LinearLayout->>TextView: Display action title/label
    LinearLayout->>TextView: Display action details/summary
    LinearLayout->>MaterialButton: Display action button (aligned to end)
    User->>MaterialButton: Interact with button
Loading

Possibly related PRs

Suggested reviewers

  • Jignesh-dimagi
✨ Finishing Touches
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Commit Unit Tests in branch dv/button_spacing_fix2
  • Post Copyable Unit Tests in Comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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: 2

🧹 Nitpick comments (1)
app/res/layout/fragment_connect_job_intro.xml (1)

99-99: Align button and margins consistently
android:layout_gravity="end" correctly right-aligns the button, but pairing it with android:layout_marginStart is confusing. If you intend spacing from the end edge, switch to android:layout_marginEnd.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b14ce66 and 052f629.

📒 Files selected for processing (2)
  • app/res/layout/fragment_connect_delivery_details.xml (2 hunks)
  • app/res/layout/fragment_connect_job_intro.xml (1 hunks)
🔇 Additional comments (3)
app/res/layout/fragment_connect_job_intro.xml (3)

76-76: Orientation update is correct
Changing the inner LinearLayout to vertical prevents overlap and supports longer translations by stacking text and button.


79-85: Static start label looks good
The new TextView for connect_job_intro_start_label is well scoped with wrap_content and proper styling.


87-93: Verify dynamic text assignment
This TextView (connect_job_intro_learning_summary) has no android:text in XML. Ensure its content is set in code or add a tools:text placeholder, otherwise it will render blank.

Comment on lines +163 to +172
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginEnd="2dp"
app:layout_constraintEnd_toStartOf="@+id/connect_delivery_button"
app:layout_constraintTop_toTopOf="parent">
android:background="@color/connect_darker_blue_color">
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Flatten redundant wrappers
You’ve introduced a LinearLayout inside a ConstraintLayout and duplicated the same background on both. Consider making the LinearLayout the direct child of the CardView (removing the inner ConstraintLayout) and drop the extra background on one of them to simplify the view hierarchy.

🤖 Prompt for AI Agents
In app/res/layout/fragment_connect_delivery_details.xml around lines 163 to 172,
there is a redundant nested layout where a LinearLayout is inside a
ConstraintLayout with duplicated background attributes. To fix this, remove the
inner ConstraintLayout and make the LinearLayout the direct child of the
CardView, then remove the duplicate background attribute from one of the layouts
to simplify the view hierarchy and avoid unnecessary nesting.

Comment on lines +195 to +207
<com.google.android.material.button.MaterialButton
android:id="@+id/connect_delivery_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/connect_job_info_download"
app:layout_constraintTop_toBottomOf="@id/connect_delivery_action_details"
app:layout_constraintEnd_toEndOf="parent"
android:layout_gravity="end"
android:backgroundTint= "@color/white"
android:drawableEnd= "@drawable/ic_connect_arrow_forward_20px"
android:textColor= "@color/cc_brand_color"
app:iconTint="@color/cc_brand_color"
/>
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Clean up misplaced constraint attributes
The MaterialButton is now inside a vertical LinearLayout, so the app:layout_constraint* attributes have no effect and should be removed. Also adjust margins—use android:layout_marginEnd for end-side spacing—and drop any unused android:gravity on the button.

🤖 Prompt for AI Agents
In app/res/layout/fragment_connect_delivery_details.xml between lines 195 and
207, remove the constraint layout attributes app:layout_constraintTop_toBottomOf
and app:layout_constraintEnd_toEndOf from the MaterialButton since it is inside
a LinearLayout where constraints do not apply. Replace any spacing adjustments
with android:layout_marginEnd for proper end margin. Also, remove the
android:layout_gravity attribute from the button as it is unnecessary inside the
LinearLayout.

shubham1g5
shubham1g5 previously approved these changes Jun 12, 2025
Base automatically changed from dv/connect_menu_button_fix to feature/connect June 12, 2025 04:25
@shubham1g5 shubham1g5 dismissed their stale review June 12, 2025 04:25

The base branch was changed.

@shubham1g5 shubham1g5 merged commit 9357e51 into feature/connect Jun 12, 2025
1 of 2 checks passed
@shubham1g5 shubham1g5 deleted the dv/button_spacing_fix2 branch June 12, 2025 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-integration-tests Skip android tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants