Skip to content

feat: add "Completed at" date filter for work items (#8923)#8927

Open
muhammadusman586 wants to merge 2 commits intomakeplane:previewfrom
muhammadusman586:feat/filter-work-items-completed-at
Open

feat: add "Completed at" date filter for work items (#8923)#8927
muhammadusman586 wants to merge 2 commits intomakeplane:previewfrom
muhammadusman586:feat/filter-work-items-completed-at

Conversation

@muhammadusman586
Copy link
Copy Markdown

@muhammadusman586 muhammadusman586 commented Apr 23, 2026

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, and Start date, but not on Completed at — even though completed_at is an existing attribute on work items. This makes it difficult to see what was actually completed at certain points in time, since Updated at can change if a completed item is edited.

Changes:

  • Added "completed_at" to WORK_ITEM_FILTER_PROPERTY_KEYS in @plane/types so the rich filter adapter recognizes it as a valid filter property
  • Added getCompletedAtFilterConfig factory function in @plane/utils (following the same pattern as getCreatedAtFilterConfig / getUpdatedAtFilterConfig)
  • Registered the completed_at filter config in the useWorkItemFiltersConfig hook (apps/web/ce)
  • Added "completed_at" to all relevant page filter lists in ISSUE_DISPLAY_FILTERS_BY_PAGE (profile_issues, archived_issues, my_issues, issues)
  • Extended client-side date filtering in checkIssueDateFilter and getFilteredWorkItems to handle completed_at

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Test Scenarios

  1. Navigate to any project's work items view and open the filter dropdown — "Completed at" should appear as a filter option
  2. Apply a "Completed at > after [date]" filter — only work items completed after that date should be shown
  3. Apply a "Completed at > before [date]" filter — only work items completed before that date should be shown
  4. Apply a date range filter on "Completed at" — only work items completed within the range should be shown
  5. Verify the filter works across all views: project issues, my issues, archived issues, profile issues
  6. Verify the filter persists when switching between layouts (list, kanban, spreadsheet, etc.)
  7. Verify incomplete work items (where completed_at is null) are correctly excluded when a "Completed at" filter is active

References

Closes #8923

Summary by CodeRabbit

  • New Features
    • Added "Completed at" date filter: filter work items and issues by completion date across issues, my issues, archived items, and profile pages.
    • Completion-date filtering supports exact and range queries for more precise results.
  • Types & Compatibility
    • Filter inputs and UI now accept completion-date values for consistent behavior across the app and API.

Copilot AI review requested due to automatic review settings April 23, 2026 09:51
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 23, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d800d454-66b5-434a-a570-a8c78520f022

📥 Commits

Reviewing files that changed from the base of the PR and between 83c3e3b and 50d79fd.

📒 Files selected for processing (1)
  • apps/api/plane/utils/filters/filterset.py
✅ Files skipped from review due to trivial changes (1)
  • apps/api/plane/utils/filters/filterset.py

📝 Walkthrough

Walkthrough

Adds a "Completed on" (completed_at) date filter across UI registration, filter factory, types, constants, and store evaluation so work items can be filtered by their completion date on multiple pages.

Changes

Cohort / File(s) Summary
Filter registration (UI hook)
apps/web/ce/hooks/work-item-filters/use-work-item-filters-config.tsx
Registers completed_at by instantiating getCompletedAtFilterConfig (enabled, with CalendarLayoutIcon) and adding it to returned configs and configMap.
Filter factory (utils)
packages/utils/src/work-item-filters/configs/filters/date.ts
Adds exported factory getCompletedAtFilterConfig to build the "Completed at" date filter config with supported date operators and multi-select support.
Filter evaluation logic (store)
apps/web/core/store/issue/helpers/base-issues-utils.ts
Extends checkIssueDateFilter signature to accept completed_at and updates getFilteredWorkItems to evaluate completed_at via existing date-checking logic.
Constants & display config
packages/constants/src/issue/filter.ts
Adds "completed_at" to ISSUE_DISPLAY_FILTERS_BY_PAGE filter lists for profile_issues, archived_issues, my_issues, and issues.
Types / view props
packages/types/src/view-props.ts
Adds "completed_at" to WORK_ITEM_FILTER_PROPERTY_KEYS and an optional `completed_at?: string[]
API filterset
apps/api/plane/utils/filters/filterset.py
Declares completed_at as a filterable field with exact and range lookups so API filter inputs can include completed_at__exact/completed_at__range.

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through code to add one chat,
A tiny filter: "Completed at".
Dates now bloom where they once sat,
Hop, click, view — and voilà, that’s that! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly describes the main feature: adding a 'Completed at' date filter for work items, directly matching the changeset's primary objective.
Description check ✅ Passed The PR description comprehensively covers all sections of the template, including detailed changes, feature type selection, thorough test scenarios, and proper issue reference.
Linked Issues check ✅ Passed The code changes fully implement the requirements from issue #8923: completed_at is exposed as a filterable property, available across all specified views, enabling users to filter by actual completion time.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the completed_at date filter feature; no unrelated modifications or scope creep detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_at to the allowed work item filter property keys in @plane/types.
  • Introduced a getCompletedAtFilterConfig factory in @plane/utils and registered it in the web filter config hook.
  • Exposed completed_at in 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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/utils/src/work-item-filters/configs/filters/date.ts (1)

87-103: LGTM.

getCompletedAtFilterConfig is a faithful mirror of getCreatedAtFilterConfig/getUpdatedAtFilterConfig. Consider a future refactor to extract a shared factory parameterized by label to 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

📥 Commits

Reviewing files that changed from the base of the PR and between 03a2be8 and 653fd92.

📒 Files selected for processing (5)
  • apps/web/ce/hooks/work-item-filters/use-work-item-filters-config.tsx
  • apps/web/core/store/issue/helpers/base-issues-utils.ts
  • packages/constants/src/issue/filter.ts
  • packages/types/src/view-props.ts
  • packages/utils/src/work-item-filters/configs/filters/date.ts

Comment thread apps/web/core/store/issue/helpers/base-issues-utils.ts
@muhammadusman586 muhammadusman586 force-pushed the feat/filter-work-items-completed-at branch from 653fd92 to 83c3e3b Compare April 23, 2026 10:06
@muhammadusman586
Copy link
Copy Markdown
Author

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.

@sriramveeraghanta
Copy link
Copy Markdown
Member

Thanks for your contribution. Our team will look into this and merge the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature]: filter work items on "Completed on"

4 participants