• text_sec.js and xtrn_sec.js: arrow-key navigation, highlight and pagin

    From Rob Swindell@1:103/705 to GitLab issue in main/sbbs on Fri Nov 13 18:58:45 2026
    open https://gitlab.synchro.net/main/sbbs/-/work_items/1346

    ## Idea

    Give the text files section (`exec/text_sec.js`) and the external programs section (`exec/xtrn_sec.js`) the same list behavior the message/file area selection lists (`J` in shells built on `shell_lib.js`) and the `uselect.js` Select Item module now have, by building them on the shared `exec/load/select_item.js` library:

    - arrow-key, Home/End and PgUp/PgDn navigation of the default item
    - pagination of lists longer than the screen, with an `[x-y of n]` indicator
    - a configurable default-item marker and highlight (e.g. `->` and a highlighted or reverse-video name), as with the `[shell]` `default_item_prefix`, `nondefault_item_prefix` and `default_item_attr` options in `ctrl/modopts.ini`
    - in-place repainting (no screen clear) after the first draw
    - Find, once #1345 is implemented

    ## text_sec.js

    - **Section list** (`console.getnum()` at `text_sec.js:102`): a plain numbered list, a direct fit for `select_item()`.
    - **File list** (`console.getkeys(keys, list.length)` at `text_sec.js:128`): mixes item numbers with letter commands (`?`, the quit key, and the sysop's `A`dd, `R`emove, `E`dit and `D` commands). `select_item()` would need to return such keys to its caller. Find (#1345) needs the same thing, so implementing that pass-through once (e.g. by switching `select_item()` to `console.getkeys()`, which already accepts a key list plus a numeric range) covers both.
    - Its menu files (`text_sec`, per-section menus) displayed in place of the generated list keep number-entry-only behavior, as in the area lists.

    ## xtrn_sec.js

    More work, because of its layout options:

    - **Multi-column lists**: by default (`[xtrn_sec]` `multicolumn`, `XtrnProgLstFmt`, `singlecolumn_height`) programs are listed two per row. `select_item()` is single-column today; it would need a row/column layout (each item's screen row and column recorded for in-place repainting) and Left/Right navigation. Note that the Right arrow arrives as Ctrl-F (`TERM_KEY_RIGHT`), which is why #1345 can't use Ctrl-F for Find. Related: #915 (multi-column section lists, `sections_multicolumn_fmt`).
    - **`center`** option and the section-list formats (`multicolumn_section_fmt` etc.).
    - **Menu files**: per-section `xtrn<N>`/`xtrn<code>` menus displayed in place of the list, and `_head`/`_tail` files around it; the head/tail lines must count against the page height.
    - **Highlight**: `XtrnProgLstFmt` (and the section formats) would need the same treatment as the area lists: pad the default item's name to the list's widest before applying the highlight attributes, applied only when the format's name field has the expected width, so a customized format is never misaligned. Options would go in `[xtrn_sec]` alongside the existing ones.

    ## Suggested order

    1. Key pass-through in `select_item()`, then Find (#1345).
    2. `text_sec.js`: section list, then file list.
    3. Multi-column layout in `select_item()`, then `xtrn_sec.js` (sections and programs).

    Without the new `modopts.ini` options, the lists should look as they do in v3.21 (as with the area lists), so existing systems are unaffected until a sysop opts in.

    -- *Authored by Claude (Claude Code), on behalf of @rswindell*
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)