• Find (/ and N) in the area selection lists and uselect: search by name

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

    ## Idea

    Add a **Find** command to the numbered-list selectors: the message group/sub-board and file library/directory selection lists (`J` in shells built on `shell_lib.js`), and the `uselect.js` "Select Item" module. Both are now built on the shared `exec/load/select_item.js` library, which already supports paging and arrow-key, Home/End and PgUp/PgDn navigation, so Find can be implemented there once.

    The area lists benefit the most: on a system with many message groups and sub-boards, finding the sub-board named "Linux" currently means knowing (or guessing) which group it is in, then paging through that group's list.

    ## Proposed behavior

    - **`/` or `F`**: prompt for search text (on the prompt line, defaulting to the previous search), then move the default item to the first match after the current item, scrolling or paging the list as needed.
    - **`N`**: find the next match, wrapping around to the top of the list. Possibly accept **Ctrl-G** as an alias.
    - The prompt (or a hint line) should mention the new keys.

    ### Boolean search terms

    Case-insensitive, with a small self-contained matcher:

    - `linux games`: both words (AND)
    - `linux | bsd`: either word (OR)
    - `!test` or `-test`: exclude a word (NOT)
    - `"exact phrase"`: quoted phrase

    The DD area choosers (`xtrn/DDAreaChoosers/`) already offer search via `/` with `N` for "next", so those keys would be familiar to users.

    ### What gets matched

    Each caller decides via a new `select_item()` option, e.g. `opts.match(index, matcher)`:

    - area lists: description, short name and internal code (e.g. `DOVE-SYSOPS`)
    - `uselect`: the item name

    ## Open design questions

    1. **Search scope in the area lists**: only the list currently displayed (the groups, or one group's sub-boards), or **all sub-boards in all groups** (and all directories in all libraries)? The latter is what users usually want: a match in another group would switch to that group's sub-board list with the match as the default item, and `N` would continue across groups. More work, but that is where Find pays off. `uselect` only needs the in-list search.
    2. **Input function**: `console.getnum()` (even with its new `navkeys` argument) returns only digits, the quit key and navigation keys. Options:
    - use the existing `console.getkeys(keys, max)`, which returns any key from a caller-supplied list (control characters included, so it covers the arrow keys too) or a number up to `max` with the same auto-submit behavior; numbers come back flagged with the high bit (`0x80000000`), so check how the JS binding reports them. No rebuild needed.
    - or add a `hotkeys` argument to `console.getnum()` (another native change). 3. **Key conflicts to avoid**: **Ctrl-F** cannot be used, because Synchronet translates the Right arrow key to Ctrl-F (`TERM_KEY_RIGHT` is `CTRL_F` in `sbbsdefs.h`), so the two can't be told apart. **Ctrl-N** is PgDn (`TERM_KEY_PAGEDN`).
    4. **Custom menu files**: when a sysop's `grps`/`subs<N>`/`libs`/`dirs<N>` menu file is displayed in place of the generated list, should Find still work (moving the default number shown in the prompt), or be disabled like the arrow keys are?

    -- *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 23:57:00 2026
    https://gitlab.synchro.net/main/sbbs/-/work_items/1345#note_11017

    Implemented in 678ac2ea59, 8d732cb540 and d24c718863 (all 2026-11-14):

    - **`bool_search(expression [,text] [,...])`**: a new global JS function wrapping the native boolean search engine. It returns true when the expression matches across the strings given and throws, with the syntax error as the message, on an invalid expression. It has no user interaction of its own.
    - **`load/select_item.js`**: a caller that passes a `search` function (returning the text of an item) gets Find.
    - `F` (or `/`) prompts on the prompt's line with `SearchStringPrompt`, defaulting to the previous expression; `?` displays the `textsrch` help and a syntax error is reported with `InvalidSearchExpression`, each followed by the prompt again.
    - `N` and `P` repeat the search forward and backward, wrapping and changing page as needed; `FindStringNotFound` when nothing matches.
    - Until there has been a search in the list as displayed, `N` and `P` page the list like PgDn and PgUp.
    - **What is searched**: the area lists (description, name and, for sub-boards and directories, internal code), `uselect.js` (item name), `text_sec.js` (section name; file description and filename) and `xtrn_sec.js` (name and internal code).
    - **The keys are named in the prompt** itself: e.g. `Which, Find, Quit, or [3]: `, then `Which, Find, Next, Prev, Quit, or [3]: ` after a search; a `Which or Quit: ` prompt becomes `Which, Find, or Quit: `. The words are `gettext()` strings using the `@Find@`, `@Next@` and `@Previous@` text, spliced in ahead of the prompt's first command key, so the `text.dat` prompt strings (also used by lists without Find) are unchanged.

    Where this differs from the proposal above:

    - Keys are read uppercased, so `n`/`N` are not distinguished: `N` is next and `P` is previous. No Ctrl-G alias.
    - Find is not offered in a list without a selected item (the plain v3.21 look of `text_sec.js` and `xtrn_sec.js`), nor for a menu file displayed in place of a list (open question 3).
    - Input goes through `console.getkeys()` (open question 1); no `getnum()` change was needed.
    - `;FIND` is unchanged.

    Tried on a terminal (Vert) by @rswindell. The C++ was compiled with MSVC only.

    The SyncRetro lobby's own Find (a filter) takes the same expressions as of 19e6873e97 (2026-11-14).

    -- *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/1345
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)