refactor(config-settings): shared frame renderer + line-diff redraw #133
No Reviewers
Labels
Clear labels
Area/CI
Area/Completions
Area/Components
Area/Config
Area/Docs
Area/Functions
Area/Integrations
Area/Prompt & Theme
Area/Scripts
Area/Tests
Compat/Breaking
Kind/Bug
Kind/Chore
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Performance
Kind/Refactor
Kind/Security
Kind/Testing
good first issue
help wanted
.github/workflows and repository automation
completions/ - tab-completion scripts
The opinionated-component system (C1-C6)
config.fish and conf.d/ - startup and environment
docs/manual/ and the generated manual, man page, and site
functions/ - user-facing functions and helpers
integrations/ - third-party tool wiring
themes/ and prompt appearance
scripts/ - standalone helper scripts
tests/ - the syntax lint and functional suite
Breaking change that won't be backward compatible
Something is not working
Tooling, dependencies, and housekeeping
Documentation changes
Improve existing functionality
New functionality
Makes existing behavior faster or lighter
Restructures code without changing behavior
This is security issue
Issue or pull request related to testing
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Low
4
The priority is low
Priority
Medium
3
The priority is medium
Reviewed
Confirmed
1
Issue has been confirmed
Reviewed
Duplicate
2
This issue or pull request already exists
Reviewed
Invalid
3
Invalid issue
Reviewed
Won't Fix
3
This issue won't be fixed
Status
Abandoned
3
Somebody has started to work on this but abandoned work
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
Well-scoped and self-contained; a good place to start
Maintainer is looking for someone to pick this up
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Assignees
rootiest (Rootiest)
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: rootiest/fish-config#133
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What
__config_settings_draw/_draw_subcat/_draw_valuehand-copied the width-tier table, centering prefix, ON/OFF/DEFAULT badge switch, and box-drawing/erase sequence three times (36–42% line-identical pairwise). Consolidated intofunctions/__config_settings_frame.fish(five verbs:width,title,badge,cursor,row).__config_settings_draw.fish__config_settings_draw_subcat.fish__config_settings_draw_value.fishFlicker regression — resolved
The frame-refactor above measured 1.35× the old redraw cost and made the pre-existing screen flicker more noticeable. Rather than merge that trade-off,
functions/config-settings.fishwas reworked from "erase whole panel, then redraw whole panel" on every keypress to a line-diff renderer: a new pure function__config_settings_diff_redrawrewrites an on-screen frame in place, touching only the lines that actually changed (bare\nto skip an unchanged line,\e[2K\r<content>\nto rewrite a changed one) — no full-screen erase at all on the common path.__cs_dispatch_draw) now captures each page's rendered lines into an array and derives panel height from the real output (count $new_frame) instead of a hand-maintained constant, removing a drift risk the old code had.AGENTS/specs/2026-09-08-config-settings-diff-redraw-design.md(repo-local, not tracked — see plan below for the full task history).Went through a full subagent-driven implementation (5 tasks, each independently reviewed) plus a final whole-branch review that caught one Critical bug (the inline editor's exit repaint had stopped printing after the dispatch refactor, blanking the panel on every commit/cancel of a value edit) and two Important ones (a quoted command-substitution inside
maththat silently no-ops on resize-while-editing, and the diff path missing wrap-awareness below 52 columns) — all fixed and re-reviewed clean.Still needs a human interactive pass (no
/dev/ttywas available to any agent in this pipeline, so nothing above was ever visually confirmed on a real terminal): openconfig-settings, confirm no flicker on arrow-key nav and on typing in the Sponge/Paths inline editor, and specifically exercise (a) editing a value then pressing Enter/Escape, (b) resizing while the editor is open, (c) a terminal narrower than 52 columns.The verification gate
A 377-case golden captures raw output bytes — including the
\e[<N>A\e[Jerase sequence — at every width tier (COLUMNS 100/88/84/70), both scopes, cursor on every row. All commits on this branch produce zero diff against it — the three draw functions' byte output is unchanged throughout, including by the redraw-model rework, which only touches the orchestration around them.The gate's own blind spot is deliberately demonstrated rather than hidden: at every tier the longest description is exactly the field width (43/43, 39/39, 35/35, 17/17) and
Integrationsis exactly 12 characters, so collapsing all three pages onto a plain truncate is byte-for-byte identical today and would pass the gate while silently discarding that hand-tuned property. A dedicated test step performs exactly that mutation and asserts the gate stays green — watching it pass is the point. The explicitfittoken per call site (pad/cut/shorten) and the comments at each site are what actually protect the property; the golden can't.Testing
fish tests/run-tests.fish— 233/233 lint, 409/409 assertions, 377/377 golden render cases, all green. New tests: line-count invariant lock and byte-exact coverage of__config_settings_diff_redraw's two line-classes (unchanged/changed), both ported intotests/test-session.fishfollowing main's suite-discovery refactor (see merge note below).Merged with
mainThis branch had fallen behind (
maingained a shared color-palette helper__fish_paletteand a full test-suite discovery rework since this branch was cut). Merged and resolved:__config_settings_draw*.fish's inlineset_colordeclarations →__fish_palette(same colors, shared helper).tests/functional.fish(deleted upstream, replaced bytests/test-session.fish'scheck/sectionidiom) → this branch's 3 new tests ported intotests/test-session.fishin that idiom.tests/config-settings-render.fishrenamed totests/test-config-settings-render.fishto match the newtest-*.fishdiscovery glob, and its manual function-sourcing loop updated to also source__fish_palette.fish(needed once the draw functions started calling it — caught by the golden gate itself, which failed with every color escape missing until fixed).tests/run-tests.fishandtests/test-session.fishotherwise taken as-is frommain.Now clean and mergeable.
refactor(config-settings): de-duplicate the TUI's three draw functionsto refactor(config-settings): shared frame renderer + line-diff redrawManual Verification
Result: PASS
Approved for merge