https://gitlab.synchro.net/main/sbbs/-/work_items/1353#note_11054
## Design note: sysop customization
Goal: good customization options for sysops (custom headers per directory, per library, or globally) and as few hard-coded UI elements as possible.
### What the built-in lister hard-codes today (listfile.cpp)
- Header: only one override, the per-directory `data/dirs/<code>.hdr`. No library-level or global header file.
- Box header: the CP437 box characters and width math are in the code; only the three inner lines come from text.dat (`BoxHdrLib`, `BoxHdrDir`, `BoxHdrFiles`).
- Short header: the underline is a fixed `\xC4` run.
- File line: fixed column order and widths (name 12, size 6 or 7), the `+` extended-description marker, the `-` missing-file marker, the batch letter attribute, and the FREE blink.
- Colors: the global SCFG `clr_file*` entries only.
### Headers and footers: the bbs.menu() lookup chain
Use `bbs.menu()` / `bbs.menu_exists()` as `xtrn_sec.js` does, so every header file gets terminal-type variants (.ans/.asc/.utf8/.rip...), width variants, language overlays, `mods/` shadowing and @-codes for free. Most specific wins:
1. `data/dirs/<code>.hdr` (existing; kept for compatibility)
2. `text/menu/filelist_<dircode>_head` (one directory)
3. `filelist_lib<N>_head` or a library-name form (one library; libraries have no internal code)
4. `filelist_head` (global)
5. Otherwise, the built-in box header, drawn from configurable strings
A matching `_tail` chain, plus an optional `filelist_page` file for the area above each page. Header files can use the existing `@LIB@`, `@LIBL@`, `@DIR@`, `@DIRL@` and `@FILES@` codes.
### File line: an @-code template
The file line is a template of @-codes with the standard format modifiers, e.g.:
@FILE_NAME-L12@@FLAGS@@LETTER@@FILE_SIZE-R7@ @FILE_DESC->@
- The `@FILE_*@` codes already exist (`FILE_NAME`, `FILE_DESC`, `FILE_SIZE`, `FILE_BYTES`, `FILE_CREDITS`, `FILE_DATE`, `FILE_UPLOADER`, `FILE_TIMES_DLED`, `FILE_TAGS`, ...), and `formatted_atcode()` already applies the width/alignment modifiers (`-L`/`-R`/`-C`, `-Z`, `-T`, `-U`/`-D`, `->`, and the `|` form). Columns can be reordered, resized, added or dropped without code changes, and any `@FILE_*@` code added later is usable in the lister for free.
- Default template reproduces today's layout.
- Lister-specific codes, substituted by the module before expansion (same modifier syntax): `@LETTER@` (batch letter), `@TAG@` (tagged/untagged marker), `@FLAGS@` (extended-description and missing-file markers), and a FREE-aware size code.
- Extended descriptions print below the line as today, not through the template.
- Search-term highlighting is applied by the module to the expanded description.
Prerequisite (C++): those codes resolve only while `sbbs_t::current_file` is set, which today happens only in `showfileinfo()`. Extend `bbs.expand_atcodes(string [,obj])` to accept a FileBase file object (in addition to a message header object) and make it the current file for the duration of the call, as is already done for messages.
### Everything else: [filelist] in modopts.ini
- Markers: extended-description, missing-file, FREE, tagged/untagged, batch-letter attributes.
- Lightbar: `selected_item_prefix` / `unselected_item_prefix` / `selected_item_attr` / `lightbar`, the same keys as `[xtrn_sec]`, `[text_sec]` and `[scancfg]`.
- Box header characters (top/side/corner strings), so plain-ASCII or UTF-8 boxes need no code change.
- Short-header underline character.
- Page indicator (`more_fmt`), command prompt, and the spacing between directories (replacing the hard-coded line breaks behind the doubled/missing blank-line bugs).
- Colors: default to the SCFG `clr_file*` values, each overridable.
- Existing text.dat strings remain the defaults, so `text.ini` overrides and translations keep working.
Per-library and per-directory option overrides: `[filelist:<dircode>]` and `[filelist:lib<N>]` sections (mirroring `[uselect:<title>]`). ARS sections in `ctrl/modopts/filelist.ini` are not enough on their own: ARS `LIB`/`DIR` test the user's *current* area, while a multi-directory scan lists areas the user is not in.
- *Authored by Claude (Claude Code), on behalf of @rswindell*
--- SBBSecho 3.38-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)