open
https://gitlab.synchro.net/main/sbbs/-/work_items/1412
2026-11-23 18:02:13 -0800
Voting in a poll (the message reader's `V` command on a poll) only offers a numbered list: the answers are printed with numbers, the user types a number to toggle each answer, then Enter to submit. There is no interactive/lightbar alternative, and no way for a sysop to provide one.
## Today
- The ballot is drawn by `sbbs_t::mselect()` (`src/sbbs3/con_hi.cpp`), a numbered multi-select prompt using the `BallotHdr`, `BallotAnswerFmt`, `PollAnswerChecked` and `BallotVoteWhich` text strings. The poll ballot is its only caller.
- Single-item selection already has the pattern this needs: `sbbs_t::uselect()` runs the **Select Item** loadable module (SCFG->System->Loadable Modules->Select Item, `uselect` in `main.ini`) and falls back to its built-in numbered list only when no module is configured. The stock `uselect.js` / `uselect_tree.js` modules provide the lightbar versions, built on `exec/load/select_item.js` (paging and arrow-key navigation, also used by `text_sec.js`, `xtrn_sec.js` and `shell_lib.js`).
- Up/down voting on an ordinary post is a single U/D keystroke and doesn't need a selection UI.
## Proposal
1. Give `mselect()` a loadable module hook, like `uselect()`'s: a new **Select Items** (multi-select) entry in SCFG->System->Loadable Modules (`main.ini`). When a module is configured and runs, it decides the selection; otherwise the existing numbered list is used, unchanged.
- The module needs the header, the items, the maximum number of selections and the current selection, and must return the selected-items bitmask (0 = cancelled). These could be exposed the way `uselect()` exposes its items to its module (e.g. `console.mselect_items`, `console.mselect_title`, `console.mselect_max`), with the result returned as the module's exit value.
2. Add a stock `exec/mselect.js` module on top of `select_item.js`: arrow keys move, Space toggles the current answer (shown with the `PollAnswerChecked` mark), Enter submits, the quit key cancels. Use the same ballot text strings, so existing customizations and translations still apply, and make it customizable via `modopts.ini` like `uselect.js`.
## Why not the alternatives
- **A dedicated Voting module** would have to re-implement what the message reader already does correctly in C++ (the already-voted and closed-poll checks, building the vote message, notifying the poll's author). Only the selection UI is missing, and selection is what Synchronet already makes pluggable. A generic multi-select hook also serves any future multi-select prompt.
- **A lightbar hard-coded in C++** would duplicate the terminal handling (ANSI, PETSCII and plain ASCII, mouse hotspots, paging) that `select_item.js` already has, couldn't be customized or replaced by sysops (a module can be shadowed in `mods/`), and would be the only stock lightbar not written in JavaScript.
_Authored by Claude (Claude Code), on behalf of @rswindell_
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net