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

Handle restored date filters when DataTable and DataView metadata changes after mount

Đang mở
#944 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

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

@Shreyag02 đang làm issue này rồi.

Từ ngày 6/10/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

Summary

Handle restored date filters when field metadata gains filterType: 'date' after mount in both DataTable and DataView.

  • DataTable: columns can gain date-filter metadata after DataTableRoot initializes tableQuery.
  • DataView: root fields can change after mount, and a view's fields override can register after the initial query loads. These changes affect effectiveFields.

In both cases, an untyped restored date filter can remain untyped. Client filtering can then match no rows, and server query emission can use string-filter behavior instead of date-filter behavior.

This limitation predates PR #919. The follow-up is separate from that PR.

Required changes

  • Derive missing filter types from the current DataTable columns and DataView effectiveFields when computing row-filter state and emitted queries.
  • Use the shared date-filter metadata helper where appropriate.
  • Preserve existing filter values, operators, explicit types, and user edits.
  • Do not reinitialize tableQuery from the original query or add an effect that replaces user edits.
  • Ensure DataView uses the active view's effective metadata, including its fields override.

Affected areas

  • DataTable: DataTableRoot, row-filter state derivation, and server query emission. The reviewed root file is packages/react/components/data-table/data-table.tsx.
  • DataView: DataViewRoot, effectiveFields, row-filter state derivation, and server query emission.
  • Shared date-filter metadata helpers and DataTable/DataView regression tests.

Acceptance criteria

  • Mount DataTable with an untyped restored date filter, then give its column filterType: 'date'. Client filtering compares whole days and selects the expected rows.
  • Repeat this scenario in DataView for both updated root fields and a view's late-registering fields override.
  • In server mode, both components emit the restored filter with date semantics and a viewer-local YYYY-MM-DD stringValue after date metadata becomes available.
  • Preserve the original filter value and any user edits made before metadata arrives.
  • Leave explicitly typed filters and unrelated filters unchanged.
  • Add regression tests for both components, including client filtering and server query emission.

References

Requested by @Shreyag02.

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

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.