StatusLine: per-section visibility toggles (wiring pass for #1492) - #2148
Open
asdf8675309 wants to merge 1 commit into
Open
asdf8675309 wants to merge 1 commit into
asdf8675309 wants to merge 1 commit into
Conversation
…ssler#1492) Lands the section-toggle mechanism accepted in danielmiessler#1492 (@thatsjet) but never wired through the script: SHOW_HEADER/STATE/EFFORT/DOCTOR/MEMORY/VERSIONS/ AGENTS/CONTEXT/USAGE/QUOTE default true (zero behavior change out of the box), overridable per-user via settings.json so overrides survive version upgrades that overwrite this script: "preferences": { "statusline": { "sections": { "state": false } } } Same design danielmiessler#1492 proposed: script-level SHOW_* defaults, a jq eval reading preferences.statusline.sections, key names regex-restricted to ^[a-z]+$ and values normalized to literal true/false so a malformed override can never inject into the eval. Two additions beyond the original proposal, both for sections that shipped after danielmiessler#1492 was filed: SHOW_INTERVIEW (the interview-due chip) and SHOW_ACCOUNT (the logged-in-account line). Also replaces danielmiessler#1492's "separators owned by their section" rule with a general _had_output flag: sep()/sep_dot() print only when something has appeared since the last divider, then reset. This covers a case the static rule can't: DOCTOR/MEMORY/INTERVIEW render conditionally on a data file's presence even when their SHOW_* flag is true, so a fixed "does the section before me have its flag on" check would still leave orphaned separators or a leading rule with nothing above it when data happens to be absent. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I was otherwise commenting these lines out each version change, so I figured it made sense to just make them optional. Found the #1492 .
Lands the section-toggle mechanism accepted in #1492 (@thatsjet) but was not wired through the script: SHOW_HEADER/STATE/EFFORT/DOCTOR/MEMORY/VERSIONS/ AGENTS/CONTEXT/USAGE/QUOTE default true (zero behavior change out of the box), overridable per-user via settings.json so overrides survive version upgrades that overwrite this script:
"preferences": { "statusline": { "sections": { "state": false } } }
Same design #1492 proposed: script-level SHOW_* defaults, a jq eval reading preferences.statusline.sections, key names regex-restricted to ^[a-z]+$ and values normalized to literal true/false so a malformed override can never inject into the eval.
Two additions beyond the original proposal, both for sections that shipped after #1492 was filed: SHOW_INTERVIEW (the interview-due chip) and SHOW_ACCOUNT (the logged-in-account line).
Also replaces #1492's "separators owned by their section" rule with a general had_output flag: sep()/sep_dot() print only when something has appeared since the last divider, then reset. This covers a case the static rule can't: DOCTOR/MEMORY/INTERVIEW render conditionally on a data file's presence even when their SHOW* flag is true, so a fixed "does the section before me have its flag on" check would still leave orphaned separators or a leading rule with nothing above it when data happens to be absent.