| 1 | # Pin to Top Plugin DOX |
| 2 | |
| 3 | ## Purpose |
| 4 | |
| 5 | - Own built-in pinning for chat and scheduled-task rows in the sidebar. |
| 6 | |
| 7 | ## Ownership |
| 8 | |
| 9 | - `plugin.yaml` owns the always-enabled plugin metadata. |
| 10 | - `helpers/pins.py` and `api/` own persistent pin state and authenticated toggle/read endpoints. |
| 11 | - `webui/pin-to-top-store.js` owns row ordering and divider callbacks. |
| 12 | - `extensions/webui/sidebar-row-actions-menu/` owns the dropdown action. |
| 13 | |
| 14 | ## Local Contracts |
| 15 | |
| 16 | - Pin state is separated into `chat` and `task` groups and stored under the `plugin_pin_to_top` persistent KVP key. |
| 17 | - The plugin must register sidebar row-list callbacks; it must not patch chat/task stores or inject controls directly into rows. |
| 18 | - Pinned items sort before unpinned items, older pins remain first, and existing order is preserved within the unpinned group. |
| 19 | - The menu label and icon must reflect whether the active row is pinned. |
| 20 | |
| 21 | ## Work Guidance |
| 22 | |
| 23 | - Keep the plugin always enabled and configuration-free. |
| 24 | - Keep runtime state under `usr/` through the shared persistent KVP helper. |
| 25 | |
| 26 | ## Verification |
| 27 | |
| 28 | - Run `pytest plugins/_pin_to_top/tests tests/test_sidebar_row_actions.py`. |
| 29 | |
| 30 | ## Child DOX Index |
| 31 | |
| 32 | No child DOX files. |