DataView filters: support icons on select options (and use field.icon)
维护者通常 6 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 86/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- react, typescript
- 领域
- frontend
调研方向
从 issue 中提到的类型 FilterSelectOption 和组件 FilterChip 开始,再加上展示 SelectItemProps 和 leadingIcon 的 Select.Item 实现。追踪过滤选项在何处被 spread,以及 "Add filter" 菜单项在何处被构建,以了解为什么 DataViewField.icon 从未被读取。完成标准是:选项带有 leadingIcon/disabled,单值 chip 显示该图标,field.icon 出现在菜单和 chip 中,并且 DataView/FilterChip 现有的组件测试仍然通过。
由索引模型根据 Issue 内容生成。
描述
Select filters in DataView can only show plain text options right now. A lot of filters can have an icon that goes with each value, like a status dot, a priority glyph, or an avatar. Without it, the filter dropdown looks different from the column it's filtering, and it's slower to scan.
Select.Item already supports leadingIcon. But FilterSelectOption is just { value, label }, and FilterChip only passes label through, so there's no way to get an icon in.
Also, DataViewField has an icon prop, but as far as I can tell nothing reads it. It doesn't show in the "Add filter" menu or on the chip.
What I'd suggest
-
Let filter options take the same extras
Select.Itemdoes, instead of adding fields one by one:type FilterSelectOption = { value: FilterValueType; label: string; } & Pick<SelectItemProps, 'leadingIcon' | 'disabled'>;FilterChipwould spread those ontoSelect.Item.labelstays a plain string, since search, accessibility and the "N selected" text all depend on it. -
When one value is picked, show its icon in the chip as well, not just in the dropdown. Multiple values can keep showing "N selected".
-
Use
field.iconfor the "Add filter" menu item and the chip'sleadingIcon.
I'd skip a render-prop like renderOption. It would break the text-based stuff above, and every app would end up drawing options differently. If two-line options are ever needed (name + email), a description field would cover that better.
- 主要语言
- TypeScript
- 星标
- 68
- 派生
- 13
- 平均合并
- 4 天 19 小时
- 30 天内合并 PR
- 37
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
raystack/apsara 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 6 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 6 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 6 天内回复
-
难度 4/5 3-5 天 新手友好度 30/100
维护者通常 6 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
维护者通常 6 天内回复
相似的 Issue
-
bug skills
难度 2/5 1-3 小时 新手友好度 77/100
equinor/fusion-framework#5846 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 74/100
-
难度 2/5 1-3 小时 新手友好度 85/100
Eyevinn/open-videocore#1256 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
[Bug]: Theme preset geist points at undefined --font-geist可能已有人在做 @claude 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 73/100
维护者通常 1 天内回复