Fix TextInputNode placeholder not respecting configured background color#233
Conversation
When a Background color is configured on TextInputNode, the placeholder text now renders with the correct background fill instead of inheriting the terminal's default background. Two changes: - Fill the input area with the configured background before rendering any content (text, cursor, placeholder). - Set background before writing placeholder text so it displays correctly against the configured background.
Asserts (via VirtualTerminal.GetBackground) that a configured Background is applied to both the placeholder glyph cells and the trailing empty cells, and that cells stay default when no Background is set.
Aaronontheweb
left a comment
There was a problem hiding this comment.
Verified against the render-context semantics: both edits are required (after the up-front Fill the code calls ResetColors(), and WriteAt stamps the current bg per cell, so the placeholder write must re-set Background). The up-front Fill also correctly covers trailing empty cells, so the whole input region now shows the configured background — a slightly broader (and desirable) fix than the title suggests.
Pushed render regression tests (commit d974000) using VirtualTerminal.GetBackground to assert placeholder + trailing cells get the configured bg, and stay default when none is set.
No public API change (method-body only). LGTM.
|
This looks good @jsantos98 - thank you. Please consider configuring your git setup with commit signature verification https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification |
Problem
When a
Backgroundcolor is configured onTextInputNode(e.g. for a styled command panel), the placeholder text renders with the terminal's default background instead of the configured one. This creates a visual inconsistency — the input area has the correct background when text is present, but shows the wrong background when only the placeholder is displayed.Fix
Two changes in
TextInputNode.Render:Testing
Verified in the Zerix CLI project where
TextInputNodeis used withBackground = AppTheme.CommandPanelBackground(#333842). The placeholder now correctly renders with the panel background color instead of the terminal default.