Skip to content

Conversation

@RKBoss6
Copy link

@RKBoss6 RKBoss6 commented Dec 13, 2025

Added the option to add separators by adding this to your existing menu:

"General Settings":"separator",

And it'll make a separator for that, for better organization.
I got the idea when looking at app settings pages, some of which were really long, and not that organized. Instead of adding different pages for each category, it would be nice to have it all scrollable and still organized.

Screenshots:

download (1)



s

Hopefully it'll help keep things organized in the future, and I think it looks pretty clean and modern as well.

Adjusted the rendering of menu items and updated scroll properties.
Copilot AI review requested due to automatic review settings December 13, 2025 03:27
@RKBoss6
Copy link
Author

RKBoss6 commented Dec 13, 2025

Since this is my first or second PR here, what are the steps I need to take? I need to update the docs, should I add this for bangle.js 1 as well?

Copy link

Copilot AI 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 adds support for separator elements in the E.showMenu function for Bangle.js Q3 devices. Separators provide visual organization for long menu lists by allowing developers to add labeled divider lines between menu sections.

Key Changes:

  • Added separator detection logic that identifies menu items with string value "separator" or "Separator"
  • Implemented custom rendering for separators with centered text and horizontal divider line
  • Adjusted title scroll offset from -24px to -32px and updated rendering position
Comments suppressed due to low confidence (1)

libs/js/banglejs/E_showMenu_Q3.js:165

  • The select function does not check if the selected item is a separator. When a separator is clicked, it will execute Bangle.buzz(20) and may cause unintended behavior. Add a check to return early if the item is a separator string, similar to the check in the draw function: if ("string" == typeof item && (item == "separator" || item == "Separator")) return;
    select : function(idx, touch) {
      if (idx<0) return back&&back(); // title
      var item = menu[keys[idx]];
      Bangle.buzz(20);
      if ("function" == typeof item) item(touch);
      else if ("object" == typeof item) {
        if ("number" == typeof item.value) {
          showSubMenu(item, keys[idx]);
        } else {
          // if a bool, just toggle it
          if ("boolean"==typeof item.value)
            item.value=!item.value;
          if (item.onchange) item.onchange(item.value, touch);
          if (l.scroller.isActive()) l.scroller.drawItem(idx);
        }
      }
    }

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

RKBoss6 and others added 7 commits December 12, 2025 22:32
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

1 participant