• 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)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Sat Nov 14 20:17:00 2026
    https://gitlab.synchro.net/main/sbbs/-/work_items/1346#note_11001

    The `text_sec.js` part is done in 4eb42d604b (2026-11-14):

    - `load/select_item.js` gained the key pass-through from step 1 of the suggested order, as a `keys` option: additional command keys are returned to the caller (with `opts.current` set to the default item at the time). With `keys` set, input is read with `console.getkeys()`; without it, `console.getnum()` is still used, so `uselect.js` and the area lists are unchanged. Find (#1345) can use the same option.
    - It also gained a `no_default` option, for a list with no marked item: the navigation keys only scroll a list longer than the screen and Enter returns -2. This is what keeps the v3.21 look and Enter behavior when no `[text_sec]` options are set.
    - `text_sec.js`: the section list and the file lists go through `select_item()`. New `modopts.ini` `[text_sec]` options `default_item_prefix`, `nondefault_item_prefix`, `default_item_attr` and `more_fmt`; the stock `modopts.ini` enables the `->` marker and highlighted name, as for `[shell]`. In a file list the default item starts on the first file and moves to the one after the file last read. The highlight is applied only when the `text.dat` format (`TextSectionLstFmt`, `TextFilesLstFmt`) displays the name with a plain `%s`.
    - `text_sec` and `text<N>` menu files keep number entry only.

    Two small behavior changes: Ctrl-C at a file list now always quits (it used to read the next file when one had already been read), and a clicked item number that could be the start of a longer one is completed with Enter.

    Tested with a stub console under `jsexec` (`select_item.js` only); not yet exercised on a terminal.

    Remaining: step 3, the multi-column layout in `select_item()` and `xtrn_sec.js`.

    -- *Authored by Claude (Claude Code), on behalf of @rswindell*
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Sat Nov 14 21:51:25 2026
    https://gitlab.synchro.net/main/sbbs/-/work_items/1346#note_11005

    The `xtrn_sec.js` part (step 3) is done in 77686747c9 (2026-11-14):

    - `load/select_item.js` gained `columns` and `column_separator` options: the items are listed down each column in turn and the Left/Right arrow keys move between the columns. A list longer than a page of columns is displayed in whole pages and redrawn on a page change; a single column still repaints in place.
    - `header` may now be a function, and a new `footer` function displays what goes between the list and the prompt (the head and tail menu files). A footer that pushes the prompt off the screen is measured and the list redisplayed in the rows left.
    - A `no_clear` option displays a list without clearing the screen, not paged and without the navigation keys (for `clear_screen = false`).
    - `xtrn_sec.js`: the section list and the program lists go through `select_item()`, keeping the `multicolumn`, `center`, `sort` and `align_*` options, the head/tail files and the menu files displayed in place of a list (number entry only).
    - New `modopts.ini` `[xtrn_sec]` options `default_item_prefix`, `nondefault_item_prefix`, `default_item_attr` and `more_fmt`; the stock `modopts.ini` enables the `->` marker and highlighted name. Without them the lists look as in v3.21 and the navigation keys only page.
    - The marker doesn't fit beside the stock two-column program list at 80 columns (the row would be 83 wide), so it is left out of a two-column list that would be wider than the screen with it; the highlighted name marks the default item there.
    - The name is highlighted only when the item format displays it with a plain `%s` or a fixed-width field (`%-32.32s`).

    One behavior change with a marked default: Enter at a program list runs the highlighted program (the one last run) rather than leaving the list.

    Since the previous note, e1b29b83d9 (2026-11-14) moved all `select_item()` input to `console.getkeys()` (with `K_NOCRLF`), so that answering the prompt of a full page doesn't scroll it; `uselect.js` and the area lists no longer use `console.getnum()` either.

    Tested with stub consoles under `jsexec`, and tried on a terminal (Vert) by @rswindell.

    Everything listed in this issue is now done except Find, which is #1345.

    -- *Authored by Claude (Claude Code), on behalf of @rswindell*
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Sat Nov 14 22:40:03 2026
    https://gitlab.synchro.net/main/sbbs/-/work_items/1346#note_11008

    A follow-up in 511a76aadd (2026-11-14): a menu file displayed in place of one of these lists (`xtrn_sec`, `xtrn<n>`, `text_sec`, `text<n>`) is now a lightbar menu when it has `@BAR` items. `select_item()` drives them with `load/menubar.js`: the arrow, Home and End keys move the bar and Enter chooses the highlighted item, each item returning what could be typed instead (an item number, the quit key or one of the caller's command keys). Typed numbers and mouse clicks work as before. In `xtrn_sec.js` the bar starts on the section or program last chosen.

    Tried on a terminal (Vert) by @rswindell, with its `xtrn_sec` and `xtrn1` menu files converted to `@BAR` items.

    -- *Authored by Claude (Claude Code), on behalf of @rswindell*
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Sat Nov 14 22:56:12 2026
    https://gitlab.synchro.net/main/sbbs/-/work_items/1346#note_11010

    The option names in the notes above changed in 2b85f4dd04 (2026-11-14), before any release:

    - `[shell]`, `[text_sec]`, `[xtrn_sec]`: `default_item_prefix`, `nondefault_item_prefix` and `default_item_attr` are now `selected_item_prefix`, `unselected_item_prefix` and `selected_item_attr`
    - `[uselect]`: `default_item_fmt` and `nondefault_item_fmt` are now `selected_item_fmt` and `unselected_item_fmt`

    The old names are no longer read, so a `modopts.ini` that set them needs the keys renamed.

    The same commit adds an `[xtrn_sec]` `lightbar` option: when true, `selected_item_attr` highlights the whole selected item (its number too) as a bar the width of the list's widest item, rather than its name alone.

    -- *Authored by Claude (Claude Code), on behalf of @rswindell*
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab issue in main/sbbs on Sun Nov 15 00:17:46 2026
    close https://gitlab.synchro.net/main/sbbs/-/work_items/1346
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)