Skip to content

Cleanup splash refactor #730

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

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

shrutiparmar2003
Copy link

@shrutiparmar2003 shrutiparmar2003 commented Apr 13, 2025

Description

Hi team!

I’ve refactored the OpeningSplashScreen class to align better with SeedSigner’s overall code structure and make it more maintainable for contributors. Here’s a quick summary of the improvements:

  • Replaced self.logo with self.image_path to match the update introduced in PR Refactor LogoScreen: Add docstring, rename variable, and add state flag #728 for LogoScreen. This keeps our screen classes consistent.
  • Introduced an is_active flag to clearly indicate when the screen is active or has completed its task—helpful for future state management.
  • Enhanced the in-code comments with clear, beginner-friendly explanations to make onboarding and collaboration smoother.

Why These Changes Matter:

These updates support SeedSigner’s goals of:

  • Maintaining consistency across the UI screens
  • Following the MVC pattern cleanly
  • Reducing redundancy
  • Making the codebase more accessible to new contributors

This builds on my previous PR #728 , and I’m continuing to make steady progress.

I’ve verified that the code syntax is clean on my Windows machine. Full functionality testing will require a Raspberry Pi due to the spidev dependency.

This pull request is categorized as a:

  • New feature
  • Bug fix
  • Code refactor
  • Documentation
  • Other

Checklist

  • I’ve run pytest and made sure all unit tests pass before submitting the PR

If you modified or added functionality/workflow, did you add new unit tests?

  • No, I’m a fool
  • Yes
  • N/A

I have tested this PR on the following platforms/os:

Note: Keep your changes limited in scope; if you uncover other issues or improvements along the way, ideally submit those as a separate PR. The more complicated the PR the harder to review, test, and merge.

- Changed to image_path to match LogoScreen (PR #XXX).
- Introduced is_active flag for better state tracking.
- Added clear, friendly comments to guide future edits.
@Advaitgaur004
Copy link

The same thing is handled by previous PR, check this out #729

@shrutiparmar2003
Copy link
Author

The same thing is handled by previous PR, check this out #729

Hi @Advaitgaur004 ,

Thank you so much for your helpful feedback! I’ve been working on the Code Cleanup project in small steps—my PR #730 for OpeningSplashScreen added self.image_path and and a universal flag is_active to improve consistency and tracking. I was planning a next PR to refactor ScreensaverScreen with the same approach, plus clearer comments like ‘Move logo with random increments for screensaver effect. I want to make sure I’m on the right track—does this sound good, or should I adjust my focus? I’d really appreciate your guidance!

Best,
Shruti

@shrutiparmar2003
Copy link
Author

shrutiparmar2003 commented Apr 14, 2025

Hello @kdmukai !
I’ve been working on PR #730 for OpeningSplashScreen, where I added self.image_path and is_active to help with consistency. I’m thinking of applying the same idea to ScreensaverScreen with a comment like “Move logo with random increments for screensaver effect” to keep things clear. I’d love to follow the seedsigner.gui.screens pattern—could you share any tips or updates that might work well for ScreensaverScreen or the others? I’m eager to learn and adjust with your input!

super().__init__()
self.logo = load_image("logo_black_240.png")
self.image_path = load_image("logo_black_240.png") # Renamed for consistency
Copy link
Contributor

Choose a reason for hiding this comment

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

load_image returns a PIL.Image object. This proposed rename confuses what is being operated on in later calls.

@kdmukai
Copy link
Contributor

kdmukai commented May 1, 2025

NACK.

I am always in favor of clear comments, but the additions here are only modestly helpful or read like AI text and many are just unnecessary.

I would prefer to see the refactoring in this area be completed in PR #718 first. Then perhaps a follow up PR could be issued if there are further improvements to make.

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