Skip to content

Conversation

@AsCress
Copy link
Collaborator

@AsCress AsCress commented Aug 17, 2025

Does the following additions:

  1. Minor layout fixes
  2. Addition of the Play functionality in the Wave Generator screen.

Screenshots / Recordings

  1. Board Connected:
untitled.mp4
  1. Board Not Connected:
untitled1.mp4

Summary by Sourcery

Enhance the Wave Generator screen with functional Play controls allowing users to open the oscilloscope or logic analyzer when the hardware is connected, update layout structure for consistent UI, and extend localization support with new strings.

New Features:

  • Enable Play menu in Wave Generator screen to navigate to oscilloscope or logic analyzer with connection checks and error feedback

Enhancements:

  • Refine Wave Generator screen layout by repositioning SafeArea and integrating instrument icons in the Play menu

Chores:

  • Add new localization keys for 'sharingMessage' and 'delete'

@AsCress AsCress self-assigned this Aug 17, 2025
@AsCress AsCress added Feature New addition to the existing app flutter labels Aug 17, 2025
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Aug 17, 2025

Reviewer's Guide

Reorganized the Wave Generator screen layout, integrated Play functionality to launch Oscilloscope/Logic Analyzer with device-connection checks, and extended localization with two new string keys.

Sequence diagram for Play button launching Oscilloscope/Logic Analyzer with connection check

sequenceDiagram
    actor User
    participant WaveGeneratorScreen
    participant ScienceLab
    participant Navigator
    participant ScaffoldMessenger
    User->>WaveGeneratorScreen: Tap Play button
    WaveGeneratorScreen->>User: Show menu (Oscilloscope/Logic Analyzer)
    User->>WaveGeneratorScreen: Select instrument
    WaveGeneratorScreen->>ScienceLab: isConnected()
    alt Device connected
        WaveGeneratorScreen->>Navigator: Navigate to instrument screen
    else Device not connected
        WaveGeneratorScreen->>ScaffoldMessenger: Show not connected message
    end
Loading

Class diagram for updated WaveGeneratorScreen and localization keys

classDiagram
    class WaveGeneratorScreen {
        +String sineWaveCircuit
        +String squareWaveCircuit
        +String oscilloscopeIcon
        +String logicAnalyzerIcon
    }
    class AppLocalizations {
        +String sharingMessage
        +String delete
    }
    class AppLocalizationsEn {
        +String sharingMessage
        +String delete
    }
    AppLocalizations <|-- AppLocalizationsEn
Loading

File-Level Changes

Change Details Files
Restructure widget tree for proper SafeArea and provider usage
  • Moved SafeArea inside CommonScaffold body
  • Removed top-level SafeArea wrapper
  • Cleaned up MultiProvider and Consumer nesting
lib/view/wave_generator_screen.dart
Implement Play menu to navigate to instruments with connectivity checks
  • Replaced static play/save buttons with a PopupMenuButton using play_arrow icon
  • Hooked menu items to Navigator.pushNamedAndRemoveUntil for oscilloscope and logic analyzer
  • Integrated ScienceLab.isConnected() checks with Snackbar on failure
lib/view/wave_generator_screen.dart
Add new icons and assets for instrument menu items
  • Declared widget.oscilloscopeIcon and widget.logicAnalyzerIcon paths
  • Updated PopupMenuItem children to display Image.asset icons
lib/view/wave_generator_screen.dart
Extend localization with sharingMessage and delete keys
  • Added getters for sharingMessage and delete in AppLocalizations
  • Provided English translations in AppLocalizationsEn
lib/l10n/app_localizations.dart
lib/l10n/app_localizations_en.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 there - I've reviewed your changes and they look great!


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.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 17, 2025

@marcnause marcnause merged commit 7df4c24 into fossasia:flutter Aug 19, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature New addition to the existing app flutter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants