Introduce LabeledOption and RangeValues named types
Replace all tuple[str, str] annotations with purpose-specific names: - LabeledOption = tuple[str, str] for (value, label) pairs used in FilterChoice, FilterSelect params, _modifier_options, _find_label, and _extract_labeled. - RangeValues(min, max) NamedTuple for _parse_range return values, making the two fields self-documenting at every call site. Export LabeledOption from common.components alongside SearchSelectOption. Document the "name compound types explicitly" convention in CLAUDE.md. https://claude.ai/code/session_01EyAJcMoDktLrY9tSbdHViA
This commit is contained in:
@@ -42,6 +42,7 @@ from common.components.primitives import (
|
||||
)
|
||||
from common.components.search_select import (
|
||||
FilterSelect,
|
||||
LabeledOption,
|
||||
SearchSelect,
|
||||
SearchSelectOption,
|
||||
searchselect_selected,
|
||||
@@ -87,6 +88,7 @@ __all__ = [
|
||||
"PopoverTruncated",
|
||||
"SearchField",
|
||||
"FilterSelect",
|
||||
"LabeledOption",
|
||||
"SearchSelect",
|
||||
"SearchSelectOption",
|
||||
"searchselect_selected",
|
||||
|
||||
Reference in New Issue
Block a user