feat: add "Completed at" date filter for work items (#8923)#8927
feat: add "Completed at" date filter for work items (#8923)#8927muhammadusman586 wants to merge 2 commits intomakeplane:previewfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughAdds a "Completed on" ( Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UIHook as "use-work-item-filters-config"
participant Types as "types / constants"
participant Utils as "date filter utils"
participant Store as "base-issues-utils (store)"
User->>UIHook: request filter configs
UIHook->>Types: reference `completed_at` key
UIHook->>Utils: instantiate getCompletedAtFilterConfig (enabled + icon)
Utils-->>UIHook: return completed_at config
UIHook-->>User: provide configs (includes completed_at)
User->>Store: apply filters (includes completed_at)
Store->>Utils: checkIssueDateFilter(issue, "completed_at", values)
Utils-->>Store: match boolean
Store-->>User: filtered work items
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds a new rich date filter property (“Completed at”) for work items so users can filter by when an item was completed (using the existing completed_at attribute), consistent with other date filters like Created/Updated.
Changes:
- Added
completed_atto the allowed work item filter property keys in@plane/types. - Introduced a
getCompletedAtFilterConfigfactory in@plane/utilsand registered it in the web filter config hook. - Exposed
completed_atin relevant page filter lists and extended client-side date filtering to recognize it.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/utils/src/work-item-filters/configs/filters/date.ts | Adds a getCompletedAtFilterConfig date filter config factory consistent with existing date configs. |
| packages/types/src/view-props.ts | Adds completed_at to WORK_ITEM_FILTER_PROPERTY_KEYS so the rich filter adapter accepts it. |
| packages/constants/src/issue/filter.ts | Enables completed_at as an available filter on relevant issue/work-item pages. |
| apps/web/core/store/issue/helpers/base-issues-utils.ts | Extends client-side date filtering helpers to handle completed_at. |
| apps/web/ce/hooks/work-item-filters/use-work-item-filters-config.tsx | Registers the completed-at filter config so it appears in the UI filter dropdown. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/utils/src/work-item-filters/configs/filters/date.ts (1)
87-103: LGTM.
getCompletedAtFilterConfigis a faithful mirror ofgetCreatedAtFilterConfig/getUpdatedAtFilterConfig. Consider a future refactor to extract a shared factory parameterized bylabelto eliminate the four near-identical date config builders, but not blocking.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/utils/src/work-item-filters/configs/filters/date.ts` around lines 87 - 103, There are three near-identical date filter builders (getCompletedAtFilterConfig, getCreatedAtFilterConfig, getUpdatedAtFilterConfig); extract a single factory function (e.g., createDateFilterConfigFactory) that accepts the label string and returns a function matching the same signature (<P extends TFilterProperty>(key: P) => TCreateFilterConfig<P, TCreateDateFilterParams>) and contains the shared createFilterConfig call (id: key, ...params, icon: params.filterIcon, allowMultipleFilters: true, supportedOperatorConfigsMap: getSupportedDateOperators(params)); then replace getCompletedAtFilterConfig/getCreatedAtFilterConfig/getUpdatedAtFilterConfig to call that factory with their respective labels to eliminate duplication while preserving types and behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/web/core/store/issue/helpers/base-issues-utils.ts`:
- Around line 255-259: The branch checking for the "completed_at" filter in
activeFilters inside base-issues-utils.ts is unreachable because
IIssueFilterOptions doesn't expose completed_at; remove the "completed_at" case
(or guard it behind a feature flag/commented TODO) so only supported date keys
("start_date" and "target_date") call checkIssueDateFilter(workItem, filterKey,
filterValues); reference the symbols activeFilters, checkIssueDateFilter, and
IIssueFilterOptions and either delete the completed_at condition or postpone
adding it until IIssueFilterOptions/UI support is implemented.
---
Nitpick comments:
In `@packages/utils/src/work-item-filters/configs/filters/date.ts`:
- Around line 87-103: There are three near-identical date filter builders
(getCompletedAtFilterConfig, getCreatedAtFilterConfig,
getUpdatedAtFilterConfig); extract a single factory function (e.g.,
createDateFilterConfigFactory) that accepts the label string and returns a
function matching the same signature (<P extends TFilterProperty>(key: P) =>
TCreateFilterConfig<P, TCreateDateFilterParams>) and contains the shared
createFilterConfig call (id: key, ...params, icon: params.filterIcon,
allowMultipleFilters: true, supportedOperatorConfigsMap:
getSupportedDateOperators(params)); then replace
getCompletedAtFilterConfig/getCreatedAtFilterConfig/getUpdatedAtFilterConfig to
call that factory with their respective labels to eliminate duplication while
preserving types and behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 32805237-8d4c-4c29-b311-5e29a9a8fbac
📒 Files selected for processing (5)
apps/web/ce/hooks/work-item-filters/use-work-item-filters-config.tsxapps/web/core/store/issue/helpers/base-issues-utils.tspackages/constants/src/issue/filter.tspackages/types/src/view-props.tspackages/utils/src/work-item-filters/configs/filters/date.ts
653fd92 to
83c3e3b
Compare
|
Hi @sriramveeraghanta, just following up on this PR. The implementation is complete and aligns with the existing date filter patterns. Would appreciate your review when you get a chance, or let me know if any changes are needed from my side. |
|
Thanks for your contribution. Our team will look into this and merge the changes. |
Description
Adds a new "Completed at" date filter for work items, allowing users to filter by when a work item was completed.
Currently, users can filter on
Due date,Created at,Updated at, andStart date, but not onCompleted at— even thoughcompleted_atis an existing attribute on work items. This makes it difficult to see what was actually completed at certain points in time, sinceUpdated atcan change if a completed item is edited.Changes:
"completed_at"toWORK_ITEM_FILTER_PROPERTY_KEYSin@plane/typesso the rich filter adapter recognizes it as a valid filter propertygetCompletedAtFilterConfigfactory function in@plane/utils(following the same pattern asgetCreatedAtFilterConfig/getUpdatedAtFilterConfig)completed_atfilter config in theuseWorkItemFiltersConfighook (apps/web/ce)"completed_at"to all relevant page filter lists inISSUE_DISPLAY_FILTERS_BY_PAGE(profile_issues,archived_issues,my_issues,issues)checkIssueDateFilterandgetFilteredWorkItemsto handlecompleted_atType of Change
Test Scenarios
completed_atis null) are correctly excluded when a "Completed at" filter is activeReferences
Closes #8923
Summary by CodeRabbit