Plugin surface: let a plugin add a dashboard widget #1102

Closed
opened 2026-10-30 21:25:19 +00:00 by tiagoagueda · 0 comments
Owner

The dashboard is a grid of widgets (#125, closed), and a plugin cannot add one. plugins/api.py says what a widget is handed is deliberately not on the surface yet. This asks for that decision.

What exists today

  • Built-in widgets in applications/widgets.py, jobs/widgets.py and core/widgets_builtin.py.
  • plugins/api.py: "What a dashboard widget is handed (#125) is deliberately not here yet."
  • Plugins that would use one: postulo-imap (suggestions waiting), postulo-francetravail (the next declaration date), postulo-dav (the last sync).

What would change

  • A widget contract on the plugin surface: a name, a size, a template, and a function handed the user that returns a context.
  • postulo.plugins.testing checks it, as it checks the rest of the surface.

Decisions

  • What a widget is handed. Recommended: the user and the plugin's own connection, never a queryset; it reads through the surface's helpers, which are scoped already.
  • Caching. Recommended: as for built-in widgets.

Checked against main at daee30b15 (2026-10-30). From the status review and feature suggestions of 2026-10-30.

The dashboard is a grid of widgets (#125, closed), and a plugin cannot add one. `plugins/api.py` says what a widget is handed is deliberately not on the surface yet. This asks for that decision. ## What exists today - Built-in widgets in `applications/widgets.py`, `jobs/widgets.py` and `core/widgets_builtin.py`. - `plugins/api.py`: "What a dashboard widget is handed (#125) is deliberately not here yet." - Plugins that would use one: postulo-imap (suggestions waiting), postulo-francetravail (the next declaration date), postulo-dav (the last sync). ## What would change - A widget contract on the plugin surface: a name, a size, a template, and a function handed the user that returns a context. - `postulo.plugins.testing` checks it, as it checks the rest of the surface. ## Decisions - **What a widget is handed.** Recommended: the user and the plugin's own connection, never a queryset; it reads through the surface's helpers, which are scoped already. - **Caching.** Recommended: as for built-in widgets. Checked against `main` at `daee30b15` (2026-10-30). From the status review and feature suggestions of 2026-10-30.
tiagoagueda added this to the 0.6.0 milestone 2026-10-30 21:25:19 +00:00
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#1102
No description provided.