Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: layout issues on android #804

Merged
merged 2 commits into from
Mar 11, 2025
Merged

fix: layout issues on android #804

merged 2 commits into from
Mar 11, 2025

Conversation

hrzlgnm
Copy link
Owner

@hrzlgnm hrzlgnm commented Mar 11, 2025

Closes #792

Summary by Sourcery

Enhancements:

  • Introduces different CSS classes for desktop and mobile devices to improve layout responsiveness.

Copy link

sourcery-ai bot commented Mar 11, 2025

Reviewer's Guide by Sourcery

This pull request addresses layout issues on Android by introducing conditional styling based on whether the application is running on a desktop or mobile device. It leverages the IsDesktopSignal context to apply different CSS classes to various components, ensuring a more responsive and platform-appropriate user interface.

Updated class diagram for UI components with conditional styling

classDiagram
    class App {
        +layout_class: Signal<String>
    }
    class Browse {
        +layout_class: Signal<String>
        +input_class: Signal<String>
        +grid_class: Signal<String>
    }
    class ResolvedServiceItem {
        +card_class: Signal<String>
    }
    class AutoCompleteServiceType {
        +input_class: Signal<String>
        +class: Signal<String>
    }
    class Metrics {
    }

    note for App "App component now uses layout_class Signal for conditional styling."
    note for Browse "Browse component now uses layout_class, input_class and grid_class Signals for conditional styling."
    note for ResolvedServiceItem "ResolvedServiceItem component now uses card_class Signal for conditional styling."
    note for AutoCompleteServiceType "AutoCompleteServiceType component now uses input_class and class Signals for conditional styling."
Loading

File-Level Changes

Change Details Files
Added conditional styling based on the platform (desktop/mobile) to several components.
  • Introduced an IsDesktopSignal context to determine the platform.
  • Applied different CSS classes based on the is_desktop signal for the outer layout, browse layout, resolved service cards, resolved service grid, and input fields.
  • Created new CSS classes for mobile and desktop layouts and components.
src/app.rs
styles.css

Assessment against linked issues

Issue Objective Addressed Explanation
#792 The layout is too wide on Android.
#792 Only at most 2 resolved services are visible in the emulator.

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!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

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

@github-actions github-actions bot added the bug Something isn't working label Mar 11, 2025
Copy link

@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 @hrzlgnm - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider using a single Signal::derive to determine the class name instead of multiple signals.
  • It looks like you're querying the IsDesktopSignal context in multiple components; consider creating a custom hook to encapsulate this logic.
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟢 Documentation: all looks good

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.

@hrzlgnm hrzlgnm enabled auto-merge (squash) March 11, 2025 21:35
@hrzlgnm hrzlgnm merged commit b81cd28 into main Mar 11, 2025
5 checks passed
@hrzlgnm hrzlgnm deleted the fix/792-android-layout branch March 11, 2025 21:45
@hrzlgnm hrzlgnm added the ignore label Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ignore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Layout on Android is broken
1 participant