From 2ac8e5c0d4353be3ebcc46b47ba133593fa59b9b Mon Sep 17 00:00:00 2001 From: Rootiest Date: Mon, 7 Sep 2026 20:00:59 -0400 Subject: [PATCH] feat(config-settings): add __config_settings_frame shared renderer The width tier, title-border arithmetic, ON/OFF/DEFAULT badge, cursor cell and table row are currently hand-copied across the three draw functions. This adds them once, with the two geometry identities derived rather than hand-maintained: a row's chrome is a fixed 21 columns, so field_w is iw - 21 - label_w (reproducing both iw-33 and iw-34), and a title border is dashes = iw - visible(segment) - 1 (reproducing all three of iw-23, iw-len-3 and iw-L-S-22). The frame owns no page height. Every verb prints exactly one line or fragment, so the fixed-16 category and value pages and the dynamic 7+n sub-category page keep their heights, and config-settings.fish's erase is unaffected. No caller yet, so rendering cannot move: the golden's existing page section is byte-identical (verified with cmp -n over its previous size) and the file only gains frame-verb cases appended after it. --- functions/__config_settings_frame.fish | 155 ++++++++++++++++++++++++ tests/config-settings-render.fish | 54 +++++++++ tests/golden/config-settings-render.txt | 54 +++++++++ 3 files changed, 263 insertions(+) create mode 100644 functions/__config_settings_frame.fish diff --git a/functions/__config_settings_frame.fish b/functions/__config_settings_frame.fish new file mode 100644 index 0000000..a02c53e --- /dev/null +++ b/functions/__config_settings_frame.fish @@ -0,0 +1,155 @@ +# Copyright (C) 2026 Rootiest +# SPDX-License-Identifier: AGPL-3.0-or-later + +# SYNOPSIS +# __config_settings_frame width +# __config_settings_frame title

+# __config_settings_frame badge [ ] +# __config_settings_frame cursor +# __config_settings_frame row