Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Refactored some of the system menus to the new DRY method#8997

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
thebentern wants to merge1 commit intomulti-message-Storage
base:multi-message-Storage
Choose a base branch
Loading
fromrefactor-menus

Conversation

@thebentern
Copy link
Contributor

🙏 Thank you for sending in a pull request, here's some tips to get started!

❌ (Please delete all these tips and replace them with your text) ❌

  • Before starting on some new big chunk of code, it it is optional but highly recommended to open an issue first
    to say "Hey, I think this idea X should be implemented and I'm starting work on it. My general plan is Y, any feedback
    is appreciated." This will allow other devs to potentially save you time by not accidentially duplicating work etc...
  • Please do not check in files that don't have real changes
  • Please do not reformat lines that you didn't have to change the code on
  • We recommend using theVisual Studio Code editor along with the'Trunk Check' extension (In beta for windows, WSL2 for the linux version),
    because it automatically follows our indentation rules and its auto reformatting will not cause spurious changes to lines.
  • If your PR fixes a bug, mention "fixes #bugnum" somewhere in your pull request description.
  • If your other co-developers have comments on your PR please tweak as needed.
  • Please also enable "Allow edits by maintainers".
  • Please do not submit untested code.
  • If you do not have the affected hardware to test your code changes adequately against regressions, please indicate this, so that contributors and commnunity members can help test your changes.
  • If your PR gets accepted you can request a "Contributor" role in the Meshtastic Discord

🤝 Attestations

  • I have tested that my proposed changes behave as described.
  • I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • Heltec (Lora32) V3
    • LilyGo T-Deck
    • LilyGo T-Beam
    • RAK WisBlock 4631
    • Seeed Studio T-1000E tracker card
    • Other (please specify below)

Copy link
Contributor

CopilotAI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors multiple system menu implementations in the MenuHandler to use a new DRY (Don't Repeat Yourself) pattern via thecreateStaticBannerOptions template function. The refactoring replaces manual array management and callback logic with a type-safe, template-based approach usingMenuOption<T> structures.

Key changes:

  • IntroducesScreenColor struct and several type aliases (LoraRegionOption,TimezoneOption,CompassOption, etc.) to support strongly-typed menu options
  • Refactors 9 menu functions to use the new pattern: LoraRegionPicker, ClockFacePicker, TZPicker, positionBaseMenu, nodeNameLengthMenu, compassNorthMenu, GPSToggleMenu, GPSFormatMenu, and TFTColorPickerMenu
  • Fixes string literal split issues in the original code (e.g., "MY_" "919" → "MY_919")

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

FileDescription
src/graphics/draw/MenuHandler.hAdds ScreenColor struct to encapsulate RGB color values with a useVariant flag, and introduces type aliases for various menu option types to improve type safety
src/graphics/draw/MenuHandler.cppRefactors 9 menu functions from manual array/callback pattern to the new DRY createStaticBannerOptions pattern, improving maintainability and consistency while fixing string literal formatting issues

💡Add Copilot custom instructions for smarter, more guided reviews.Learn how to get started.

@jp-bennettjp-bennett added the cleanupCode cleanup or refactor labelDec 16, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

Assignees

No one assigned

Labels

cleanupCode cleanup or refactor

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@thebentern@jp-bennett

[8]ページ先頭

©2009-2025 Movatter.jp