You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR fixes empty-value handling in the documentation component's render_select function by filtering out empty strings ("") from Literal type arguments before selecting a default value and rendering select options.
Changes made:
Filters out empty-string literal values when building the literal_values list for Union[Literal, Breakpoints] types
Uses the first non-empty argument as the initial option for Literal types, with a fallback to the original first arg if all values are empty
Excludes empty-string items from the rx.select dropdown item list
Issue found:
The color_scheme popover grid (line ~190) still iterates over list(map(str, type_.__args__)) without filtering empty strings — the same fix applied to the rx.select branch was not applied here, so an empty swatch could still be rendered in the color picker grid
Confidence Score: 4/5
Safe to merge after fixing the missed empty-string filter in the color_scheme popover grid
The fix is correct and targeted, but the color_scheme popover was not updated with the same empty-string filter applied elsewhere, leaving a real rendering defect in that branch
pcweb/pages/docs/component.py — color_scheme popover color grid loop at line 190
Important Files Changed
Filename
Overview
pcweb/pages/docs/component.py
Filters empty strings from Literal type args in select/option rendering, but misses the same filter in the color_scheme popover grid loop
Missing empty-string filter in color_scheme popover
The same empty-string filtering applied to the rx.select dropdown at line 213 was not applied to the color_scheme popover grid. An empty string in type_.__args__ would still be rendered as a color swatch here, producing a broken/invisible tile in the color picker.
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
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.
Closes #1795