Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

DataView filters: support icons on select options (and use field.icon)

Đang mở Phù hợp với người mới
#942 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 6 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
86/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
react, typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Bắt đầu từ kiểu FilterSelectOption và thành phần FilterChip được nêu trong issue, cùng với phần hiện thực Select.Item hiển thị SelectItemProps và leadingIcon. Dò tìm nơi các tùy chọn bộ lọc được spread và nơi mục menu "Add filter" được dựng để xem tại sao DataViewField.icon không bao giờ được đọc. Xong khi các tùy chọn mang leadingIcon/disabled, một chip có một giá trị hiển thị icon đó, field.icon xuất hiện trong menu và chip, và các bài test component hiện có của DataView/FilterChip vẫn pass.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

  1. Let filter options take the same extras Select.Item does, instead of adding fields one by one:

    type FilterSelectOption = {
      value: FilterValueType;
      label: string;
    } & Pick<SelectItemProps, 'leadingIcon' | 'disabled'>;
    

    FilterChip would spread those onto Select.Item. label stays a plain string, since search, accessibility and the "N selected" text all depend on it.

  2. 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".

  3. Use field.icon for the "Add filter" menu item and the chip's leadingIcon.

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.

Ngôn ngữ chính
TypeScript
Star
69
Fork
13
Merge trung bình
4 ngày 14 giờ
Pull request đã merge (30 ngày)
34

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của raystack/apsara

Tất cả issue của raystack/apsara

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.