• Poll voting: lightbar ballot via a multi-select (Select Items) loadabl

    From Rob Swindell@VERT to GitLab issue in main/sbbs on Mon Nov 23 18:02:13 2026
    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
  • From Rob Swindell@VERT to GitLab note in main/sbbs on Mon Nov 23 18:45:22 2026
    https://gitlab.synchro.net/main/sbbs/-/work_items/1412#note_11378

    Added to the proposal (description updated, new item 2): expose `mselect()` to JavaScript as `console.mselect()`. JavaScript has no access to it today.

    - It goes through the same loadable module hook as the C++ ballot, the way `console.uselect()` goes through `sbbs_t::uselect()` and the Select Item module, so a JavaScript reader or shell shows the same ballot the C++ reader does, and the new module can be tried without casting a vote.
    - Return value: an array of the selected item indexes (empty if cancelled), which is easier to use from JavaScript than the bitmask the ballot stores; the C++ side keeps the bitmask.
    - A module must not call `console.mselect()` itself (it would run the module again). The stock `mselect.js` draws the list with `select_item.js`, as `uselect.js` does, and the method's documentation should warn sysops writing their own module.

    Kept in this issue rather than a separate one because the JavaScript method and the module share the same exposed state and hook; landing one without the other leaves either a method that bypasses the module or a module only C++ can reach.

    _Authored by Claude (Claude Code), on behalf of @rswindell_

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net