• install-xtrn.js: support adding file viewers ([viewer:] sections of fi

    From Rob Swindell@VERT to GitLab issue in main/sbbs on Mon Nov 23 14:04:22 2026
    open https://gitlab.synchro.net/main/sbbs/-/work_items/1408
    2026-11-23 14:04:21 -0800

    `exec/install-xtrn.js` can install online programs, editors, events and services, but it has no way to register a **file viewer** (the `[viewer:<n>]` sections of `ctrl/file.ini`, configured in SCFG under File Options->Viewable Files). A program that can display files of some type, such as SixelView (`xtrn/sixelview`, see #1402) for PDFs and pictures, can't offer to register itself as the viewer for those types.

    ## Why `[ini:]` doesn't work for this

    - **Section name:** viewers are stored as `[viewer:0]`, `[viewer:1]`, ... `install-xtrn.js` splits an `[ini:<file>:<section>]` name on `:`, so `[ini:file.ini:viewer:6]` targets section `viewer`.
    - **Numbering:** even with the full name, the installer would have to pick the next unused viewer number, which `[ini:]` can't compute.
    - **Commas:** `[ini:]` splits `values` on `,` before `eval()`ing them, and a viewer's `extension` value is itself a comma-separated list (`PDF,PNG,JPG`).

    An `[exec:]` helper script can work around all of this, but each program would carry its own copy of the same logic.

    ## Proposal

    A native section type, for example:

    ```ini
    [viewer:PDF,PNG,JPG,JPEG,GIF]
    cmd = ?../xtrn/sixelview/sixelview.js %f
    ars = ANSI
    ex_mode = EX_STDIO
    prompt = Use SixelView to view PDF and picture files
    ```

    - The section name holds the extension list; `cmd`, `ars` and `ex_mode` map to the `[viewer:<n>]` keys of the same names (`ex_mode` `eval()`d against `sbbsdefs.js`, like `settings` for `[prog:]`).
    - Appended to `ctrl/file.ini` as `[viewer:<next unused number>]`.
    - If an existing viewer already covers any of the same extensions, ask the sysop whether to add the new one anyway (an unattended `-auto` install skips it), since viewers are tried in order and the first one matching the file's extension (whose `ars` the user meets) is used.
    - The usual `note` / `prompt` / `required` keys apply, and the existing configuration recycle covers it.

    Possibly also worth the same treatment later: testable file types (`[tester:<n>]`), and archive extraction/compression (`[extractor:<n>]`, `[compressor:<n>]`), which have the same section format.

    _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 14:08:53 2026
    https://gitlab.synchro.net/main/sbbs/-/work_items/1408#note_11356

    Placement of a newly installed viewer in the list (this replaces the "ask the sysop / skip it" handling of overlapping extensions in the description):

    - A new viewer for **specific (non-wildcard) types** is inserted **before** any existing viewer that covers one of the same extensions, and before any **wildcard** viewer. Otherwise an existing entry, or a catch-all such as `*`, would match the file first and the new viewer would never be used.
    - A new **wildcard** viewer (an extension containing `*` or `?`, which `file_type_match()` matches as `*.<type>`) is appended at the **end** of the list, so it doesn't take over types that already have their own viewers.

    Viewers are tried in the order their `[viewer:<n>]` sections appear in `file.ini` (first match whose `ars` the user meets wins), so inserting means writing the new section ahead of those entries, and renumbering the sections so the numbers still follow the file order, as SCFG does when it saves.

    _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 issue in main/sbbs on Tue Nov 24 19:32:00 2026
    close https://gitlab.synchro.net/main/sbbs/-/work_items/1408
    2026-11-24 19:31:58 -0800

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