• For #1422: DDFileLister: Make use of the new bool_search() function, i

    From Rob Swindell@VERT to GitLab note in main/sbbs on Wed Nov 25 18:56:02 2026
    https://gitlab.synchro.net/main/sbbs/-/merge_requests/756#note_11500

    Review of the `require()` additions and related changes.

    For reference, `require(file, symbol)` (`src/sbbs3/js_global.cpp`) only checks whether `symbol` is already defined. If it is, it returns without loading anything. If not, it loads the whole file and then throws `symbol '...' not defined by script '...'` if the symbol is still missing.

    **1. `require("text.js", "InvalidSearchExpression")` breaks v3.20/v3.21.** `InvalidSearchExpression` was added to `text.js` in 64cf7e3d7f (label-21-fusion, 2026-05-13), during v3.22 development; the `v3.21a` `text.js` doesn't define it. On those builds (the script still accepts `system.version_num >= 32000`), this line reloads `text.js`, still can't find the symbol, and throws at startup. So the lister won't run on exactly the builds the substring-search fallback is meant for.

    Suggested fix: drop that `require()` and use `bbs.text(bbs.text.InvalidSearchExpression)` (as `exec/load/select_item.js` does). The string is only needed when `bool_search()` exists, so it's always defined there.

    **2. The seven `require("sbbsdefs.js", "FL_...")` lines do nothing.** The existing `require("sbbsdefs.js", "K_UPPER")` already loads all of `sbbsdefs.js`, and the `FL_*` constants have been in it since 45bd54228f (pain-3-foam, 2002-11-30). Each extra line finds its symbol and returns. They can be removed.

    **3. The `FL_FINDDESC` to `FL_FIND` rename is churn.** `FL_FIND` is defined as `FL_FINDDESC` in `sbbsdefs.js`, so the bits are identical. The `typeof(FL_FIND)` fallback block only exists to support the rename. Keeping `FL_FINDDESC` would remove the alias block and three diff hunks (and the debug output would keep printing `FL_FINDDESC`).

    **Smaller items:**

    - End of `searchDirWithDescUpper()`: `if (/\r\n$/.test(extdesc)) extdesc = lfexpand(extdesc)` only expands text that already ends in CRLF, where `lfexpand()` does nothing. It looks inverted. On the `bool_search()` path, an `extdesc` with bare LFs is now never expanded, whereas the old code expanded it whenever the short description didn't match.
    - `listFilespec = "*"` has no effect: in description-search mode `gFilespec` is still `"*"` (it's only set from argv in the `FL_NO_HDR`/`FL_VIEW` branches).
    - `ddFileListerFileMatchesBoolSearch()` could pass `f.desc || ""` etc. the way `exec/listfiles.js` does instead of six `typeof` guards. Not wrong, just long.

    The `bool_search()` integration itself (validating with `bool_search(expr, "")`, showing the `textsrch` menu on `?`, passing name/desc/extdesc/tags/author) matches stock `listfiles.js`. Item 1 is the one that needs fixing before merge.

    *Authored by Claude (Claude Code), on behalf of @rswindell*

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