Skip to content

Ribbon config initial - #6305

Open
RensDofferhoff wants to merge 3 commits into
developmentfrom
ribbonConfigInitial
Open

Ribbon config initial#6305
RensDofferhoff wants to merge 3 commits into
developmentfrom
ribbonConfigInitial

Conversation

@RensDofferhoff

@RensDofferhoff RensDofferhoff commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

What

Makes the ribbon fully user-configurable in two ways:

  1. Every module — including the seven core/common ones — can be (de)selected in the + modules menu.
  2. The order of modules on the ribbon is user-configurable via ↑/↓ arrows in the modules menu.

Design decisions

  • Deselecting never destroys work. Hiding a module no longer calls DynamicModules::unloadModule(), so live analyses stay in the results. Unloading remains reserved for genuine uninstall/replace flows.
  • "Common" means default-on, nothing more. The isCommon flag (from modules-settings.json, optionally seeded by enterprise TOML OverrideCommon) only provides the initial set of enabled modules; users may change everything afterwards.
  • The stored selection is authoritative once it exists. A one-time migration (modulesSelectionMigrated) appends the core modules to selections stored before this change, so upgrading users don't lose their core modules.
  • OverrideCommon seeds, doesn't enforce. It seeds the initial module order once (when no order is stored yet); afterwards the user's stored order wins.

How it works

  • Enabled-set persists in MODULES_REMEMBERED (existing setting, now '|'-joined and parsed with SkipEmptyParts); order persists in the new MODULES_ORDER.
  • Order is applied at the end of RibbonModel::loadModules(). Special buttons (Data, New-data, separator, R-console) stay anchored; disabled modules keep their position, so re-enabling returns a module to its spot. Modules not mentioned in the stored order (newly installed, first run) append at the end.
  • Reordering goes through RibbonModelUncommon::moveModule(filtered, filtered)RibbonModel::moveModule(source, source) with proper beginMoveRows/endMoveRows, so both the menu and the ribbon update live.

Fixed along the way

  • Ribbon separators (the divider next to New/Edit Data) disappeared: separators inherited remember = true and were disabled by the new selection pass. They're now excluded from the selection.
  • Special buttons (Data, Data-Resize, …) were being written into MODULES_REMEMBERED every time their enabled state changed; only selection participants (modules + R-console) are stored now.
  • Empty-string artifact from splitting an unset '|'-joined setting.

How to test

  1. Fresh config → core modules on ribbon, all modules listed with checkboxes in + menu.
  2. Deselect a core module with a live analysis of it → analysis stays, button disappears; restart → persists (with remember-pref on).
  3. Move modules with ↑/↓ → ribbon order changes live; restart → order persists.
  4. Disable a middle module, restart, re-enable → returns to its position.
  5. Deselect everything → only special buttons remain, no crash.
  6. ALT-navigation and keyboard Left/Right still traverse the ribbon in visual order.

Deferred

Drag & drop reordering (menu and/or ribbon) — arrows cover the functionality accessibly; ribbon-side DnD specifically fights reuseItems, interactive: false, the wheel MouseArea and ALT/keyboard navigation, so it needs dedicated testing time.

JASP Developer and others added 2 commits August 26, 2026 14:37
…eference; logs use sandbox only on Windows
- Every module, the common/core ones included, can be (de)selected in the + modules menu; deselecting merely hides it from the ribbon instead of removing its analyses (unloading is reserved for uninstall/replace)
- The stored selection is authoritative once it exists; the common flag only provides the initial default set and a one-time migration appends the core modules to selections stored before this change
- Module order is user-configurable through up/down arrows in the modules menu; the order persists in MODULES_ORDER, is applied at startup, disabled modules keep their position, and special buttons (data, separator, R-console) stay anchored
- OverrideCommon from enterprise TOML merely seeds the initial order when none is stored yet
- Fix separators disappearing from the ribbon and special buttons polluting the remembered selection
@RensDofferhoff

Copy link
Copy Markdown
Contributor Author

@juliuspfadt see https://static.jasp-stats.org/Nightlies/ for builds

its not quite what you wanted but its a start

…other modules

Modules installed while running used to be appended after the anchored R-console button (so they sat below it in the modules-menu without working reorder-arrows) and were never enabled, because the old isCommon||enabled fallback disappeared when enabled() became purely the stored state. They are now inserted at the end of the module-segment and enabled (and remembered) immediately.
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