Modules: what ships inside Postulo is a module, with sub-modules, categories, and switches that cascade #873

Closed
opened 2026-10-10 16:11:36 +00:00 by tiagoagueda · 1 comment
Owner

Plugins of the internal type are called Modules from now on, even though they share the plugin internals, and they gain a hierarchy:

  • a module is always a parent and may have several sub-modules; a sub-module has exactly one parent;
  • parents and children may have several categories (like labels);
  • switching a parent on from off switches it and all its children on (Basecoat switch on for each); a child can then be switched off or on on its own;
  • switching a parent off switches it off and disables its children's switches.

What exists today

  • Built-ins are declared with @declares(shipped(name=, label=, kind=, description=)) (plugins/base.py:300) and registered from each app's ready(); Manifest is a frozen dataclass (base.py:160).
  • No hierarchy and no categories: the only grouping is kind (plugins/kinds.py:27-55, a coloured badge from partials/plugin_tags.html; Server settings → Plugins draws the raw slug instead, templates/server/plugins.html:59).
  • Switches: PluginPolicy (plugins/models.py:88), decided by policy._decide (policy.py:158-209), drawn on Server settings → Plugins (plugins.html:82-115) and saved by core/server_views.py:1287-1343. Built-ins are never the person's (_decide :195-200, #200).
  • Provenance already names built-ins Internal (plugins/provenance.py).

What would change

  • Manifest.parent (a module's name) and Manifest.categories (a tuple of slugs with translated labels); a module that is a parent has none.
  • _decide consults the parent first: a child of a switched-off parent is off and not switchable; the memo invalidated on the parent's row.
  • Server settings → Plugins nests children under their parent, the children's switches disabled while the parent is off; switching a parent on clears its children's off rows.
  • Internal becomes Module in labels, badges and the wiki; third-party packages stay plugins.

Decisions

  • What a parent is. Recommended: a module with no behaviour of its own — a grouping row whose switch is the children's master — so "Multiple fields" and the others below need no code beyond their declaration.
  • Re-enabling a parent switches every child on, as asked, forgetting which were off. Recommended, as asked; the alternative (remember the children's choices) is noted for review.
  • Categories vs kinds. Recommended: kinds stay (they are what the registry loads by), categories are display labels only.

The modules themselves: #875, #876, #877; logos #874; the repository plugins' counterpart #883.

Checked against main at 8c3d03570. From the maintainer's improvements list of 2026-10-07 (plugins).

Plugins of the internal type are called **Modules** from now on, even though they share the plugin internals, and they gain a hierarchy: - a module is always a parent and may have several **sub-modules**; a sub-module has exactly one parent; - parents and children may have several **categories** (like labels); - switching a parent **on** from off switches it and all its children on (Basecoat switch on for each); a child can then be switched off or on on its own; - switching a parent **off** switches it off and **disables** its children's switches. ## What exists today - Built-ins are declared with `@declares(shipped(name=, label=, kind=, description=))` (`plugins/base.py:300`) and registered from each app's `ready()`; `Manifest` is a frozen dataclass (`base.py:160`). - No hierarchy and no categories: the only grouping is `kind` (`plugins/kinds.py:27-55`, a coloured badge from `partials/plugin_tags.html`; *Server settings → Plugins* draws the raw slug instead, `templates/server/plugins.html:59`). - Switches: `PluginPolicy` (`plugins/models.py:88`), decided by `policy._decide` (`policy.py:158-209`), drawn on *Server settings → Plugins* (`plugins.html:82-115`) and saved by `core/server_views.py:1287-1343`. Built-ins are never the person's (`_decide` `:195-200`, #200). - Provenance already names built-ins *Internal* (`plugins/provenance.py`). ## What would change - `Manifest.parent` (a module's name) and `Manifest.categories` (a tuple of slugs with translated labels); a module that is a parent has none. - `_decide` consults the parent first: a child of a switched-off parent is off and not switchable; the memo invalidated on the parent's row. - *Server settings → Plugins* nests children under their parent, the children's switches `disabled` while the parent is off; switching a parent on clears its children's `off` rows. - *Internal* becomes *Module* in labels, badges and the wiki; third-party packages stay *plugins*. ## Decisions - **What a parent is.** Recommended: a module with no behaviour of its own — a grouping row whose switch is the children's master — so "Multiple fields" and the others below need no code beyond their declaration. - **Re-enabling a parent** switches every child on, as asked, forgetting which were off. Recommended, as asked; the alternative (remember the children's choices) is noted for review. - **Categories vs kinds.** Recommended: kinds stay (they are what the registry loads by), categories are display labels only. The modules themselves: #875, #876, #877; logos #874; the repository plugins' counterpart #883. Checked against `main` at `8c3d03570`. From the maintainer's improvements list of 2026-10-07 (plugins).
tiagoagueda added this to the 0.6.0 milestone 2026-10-10 16:11:36 +00:00
Author
Owner

Fixed in 318f03fcc on main.

Fixed in 318f03fcc on main.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Postulo/postulo#873
No description provided.