Skip to content

fix(ui): improve Connect Device screen layout alignment#3093

Merged
marcnause merged 4 commits intofossasia:flutterfrom
bhavjsh:fix/connect-device-ui-alignment-clean
Feb 26, 2026
Merged

fix(ui): improve Connect Device screen layout alignment#3093
marcnause merged 4 commits intofossasia:flutterfrom
bhavjsh:fix/connect-device-ui-alignment-clean

Conversation

@bhavjsh
Copy link
Contributor

@bhavjsh bhavjsh commented Feb 23, 2026

Improved the Connect Device screen UI by placing the connection steps inside a rectangular container with consistent padding and alignment for better visual structure.

Reduced unnecessary spacing for improved layout balance.

Recording attached.

pslab.mp4

Summary by Sourcery

Improve the Connect Device screen layout for clearer, better-aligned connection instructions.

Enhancements:

  • Wrap the connection steps in a full-width, bordered container with consistent padding and left-aligned content for improved visual structure.
  • Unify step text styling via a shared helper widget and adjust spacing around the connection status and instructions for a more balanced layout.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 23, 2026

Reviewer's Guide

Refactors the Connect Device screen’s connection steps into a styled, full‑width card-like container with consistent typography and spacing, and slightly tightens surrounding layout margins for better visual alignment.

Flow diagram for rendering connection steps in the updated Connect Device screen

flowchart TD
  A[Build_ConnectDeviceScreen] --> B{pslabIsConnected?}
  B -- Yes --> C[Show_connected_status_text_with_reduced_bottom_margin]
  B -- No --> D[Show_steps_to_connect_container]
  D --> E[Padding_horizontal_16]
  E --> F[Container_full_width]
  F --> G[Apply_surface_background_and_rounded_border]
  G --> H[Column_crossAxisAlignment_start]
  H --> I[Title_stepsToConnectTitle_fontSize_16_bold]
  I --> J[Spacing_12]
  J --> K[Step1_stepText_fontSize_14_lineHeight_1_35]
  K --> L[Spacing_8]
  L --> M[Step2_stepText_fontSize_14_lineHeight_1_35]
  M --> N[Spacing_8]
  N --> O[Step3_stepText_fontSize_14_lineHeight_1_35]
  O --> P[Spacing_8]
  P --> Q[Step4_stepText_fontSize_14_lineHeight_1_35]
Loading

File-Level Changes

Change Details Files
Extracted a reusable helper for step text styling to ensure consistent typography across all connection steps.
  • Introduced a private _stepText helper function returning a Text widget with unified font size and line height.
  • Replaced inline Text style definitions for each step label with calls to the _stepText helper.
lib/view/connect_device_screen.dart
Restyled the connection steps into a bordered surface container with adjusted spacing and alignment to create a clearer visual grouping.
  • Wrapped the steps area in a horizontal Padding to reduce side margins and align with overall screen padding.
  • Added a Container with full width, internal padding, rounded corners, and a border using the theme’s surface and divider colors.
  • Changed the steps title to left-aligned, slightly smaller, bold text without underline and added vertical spacing between title and steps.
  • Adjusted each step to use the shared _stepText style and introduced smaller vertical gaps between steps for a more compact layout.
lib/view/connect_device_screen.dart
Tweaked vertical spacing around the connection status text to better balance the screen layout.
  • Reduced bottom margin of the top status Container from 60 to 24 while keeping other margins unchanged.
lib/view/connect_device_screen.dart

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Consider renaming _stepText to something more specific like _connectStepText to make its purpose clearer when scanning the file alongside other potential helper widgets.
  • The new hard-coded paddings (outer Padding with 16 and inner Container with 16) change the previous 40px horizontal margin; double-check whether these should instead reference shared spacing constants or match the surrounding layout’s horizontal rhythm for consistency.
  • For the step text and title styling, you might want to reuse Theme.of(context).textTheme variants instead of raw TextStyle to keep typography consistent across the app and pick up theme-level changes automatically.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider renaming `_stepText` to something more specific like `_connectStepText` to make its purpose clearer when scanning the file alongside other potential helper widgets.
- The new hard-coded paddings (outer `Padding` with 16 and inner `Container` with 16) change the previous 40px horizontal margin; double-check whether these should instead reference shared spacing constants or match the surrounding layout’s horizontal rhythm for consistency.
- For the step text and title styling, you might want to reuse `Theme.of(context).textTheme` variants instead of raw `TextStyle` to keep typography consistent across the app and pick up theme-level changes automatically.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@rahul31124
Copy link
Contributor

Hello @bhavjsh,
The changes look great! Could you please format the files? Otherwise, the CI will fail

@github-actions
Copy link
Contributor

github-actions bot commented Feb 26, 2026

Build Status

Build successful. APKs to test: https://github.com/fossasia/pslab-app/actions/runs/22460730913/artifacts/5680120047.

Screenshots

Android Screenshots
iPhone Screenshots
iPad Screenshots

@marcnause marcnause force-pushed the fix/connect-device-ui-alignment-clean branch from 28adcfa to 1dc5c4f Compare February 26, 2026 20:52
@marcnause marcnause enabled auto-merge (squash) February 26, 2026 21:01
@marcnause marcnause merged commit 19c4f51 into fossasia:flutter Feb 26, 2026
12 checks passed
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.

3 participants