Skip to content

[WEB-9926] feat: slider work item properties - #91

Open
chiraghm4 wants to merge 1 commit into
mainfrom
feat/web-9926-slider-property
Open

chiraghm4 wants to merge 1 commit into
mainfrom
feat/web-9926-slider-property

Conversation

@chiraghm4

@chiraghm4 chiraghm4 commented Nov 27, 2026 •

Copy link
Copy Markdown

What

  • Was: every property model rejected property_type: "SLIDER". Listing or retrieving properties, or a work item type's properties, raised ValidationError in any workspace that had a slider property. A v1 slider value of 7 read back as 7.0.
  • Now: SLIDER parses on v1 (PropertyType, PropertyTypeEnum) and on v2 (both WorkItemPropertyType Literals), and a slider value stays an int, including 0.

Merge order

⚠️ Merge after makeplane/plane-ee#10995 (server-side slider support) and its separate enum migration PR. The change only widens what the SDK accepts, so it's safe against older servers.

This PR is independent of #89 and #90. It repeats #90's int addition to WorkItemPropertyValueDetail.value, so whichever merges second has one-line conflicts in the type lists, the value union and its docstring, plus a duplicated test_a_decimal_value_stays_a_float. Keep both sides, and one copy of that test.

Where to look

  • plane/models/enums.py, plane/models/v2/work_item_properties.py, plane/models/v2/work_item_types.py: the new enum and Literal member.
  • plane/models/work_item_properties.py: WorkItemPropertyValueDetail.value gains int, and the CreateWorkItemPropertyValue docstring documents sliders (whole number 0–10, 0 is a value, cleared with DELETE).

No change needed for:

  • Writes: CreateWorkItemPropertyValue.value already takes int, and value=0 is sent as {"value": 0}.
  • Settings: the server owns a slider's settings {"min": 0, "max": 10} and refuses any sent on create. SDK create models omit settings when unset, and v1 reads the shape as a plain dict (v2 settings is Any).
  • v2 custom_fields and the type schema's minimum/maximum.
  • Generated constants.

Proof

  • New offline tests:
    • a v1 SLIDER row parses, with its settings read as a dict
    • v1 slider values 0, 7 and 10 stay int, and a decimal stays float
    • value=0 is sent
    • both v2 property models parse SLIDER
    • v1 and v2 slider creates send no settings
    • customer properties refuse SLIDER (the golden's CustomerPropertyTypeEnum excludes it)
  • pytest tests/v2: 1083 passed, 430 skipped (live, no env). The offline tests in the two changed unit files pass.
  • ruff, black and mypy report no new findings. Their existing findings in these files on main are unchanged: black would reformat 2 files, ruff has 3 errors, and mypy has 56.

Not in this PR (follow-ups)

  • Property-type sets lag the api_v2 golden (14 types). v1 lacks EXTERNAL_DROPDOWN; both v2 Literals lack CASCADING/EXTERNAL_DROPDOWN. One property of a missing type makes the whole list page fail. Generating the (duplicated) v2 Literal from the golden in scripts/generate_v2_constants.py would close this.
  • Client-side slider rules (no settings, default_value or is_multi). The server already returns a clear 400.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added slider properties for work items, supporting whole-number values from 0 to 10. A value of 0 is valid, and sliders can be cleared.
    • Slider properties support settings when configured.
  • Updates
    • Slider properties are not available for customer properties.

- SLIDER parses on v1 (PropertyType, PropertyTypeEnum) and on both v2
  WorkItemPropertyType Literals; one slider property no longer fails a
  whole property listing with ValidationError.
- WorkItemPropertyValueDetail.value gains int, so a slider value reads
  back as an int (7, not 7.0; 0, not False).
- CreateWorkItemPropertyValue documents sliders: whole number 0-10,
  0 is a value, clear with DELETE.
- CustomerPropertyType docstring and refusal test cover SLIDER.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The SDK adds SLIDER to property type declarations. Property value models now accept integers, and tests cover slider parsing, serialization, and integer values.

Changes: Slider property support

Layer / File(s) Summary
Property type support
plane/models/enums.py, plane/models/v2/..., tests/unit/test_customers.py, tests/unit/test_work_item_properties.py, tests/v2/test_work_item_properties_resource.py
Property declarations accept SLIDER. Tests cover parsing, settings, serialization, and its exclusion from customer property types.
Integer slider values
plane/models/work_item_properties.py, tests/unit/test_work_item_properties.py
The value model accepts integers. Documentation describes whole-number slider values from 0 to 10, and tests check integer, decimal, and zero-value serialization.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Possibly related PRs

  • makeplane/plane-python-sdk#90: PR #90 updates overlapping property type declarations and value typing for RATING, so the changes may need reconciliation.

Suggested reviewers: akhil-vamshi-konam, prashant-surya, dheeru0198

Merge Risk: Minimal · up to 939a9

This change lets the SDK parse slider properties and integer slider values, including zero, instead of raising validation errors. It only widens what the SDK accepts, so merge-readiness risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "[WEB-9926] feat: slider work item properties" matches the main change. The PR adds SLIDER to the v1 enum and both v2 WorkItemPropertyType Literals, and it widens WorkItemPropertyValueDetail…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "[WEB-9926] feat: slider work item properties" matches the main change. The PR adds SLIDER to the v1 enum and both v2 WorkItemPropertyType Literals, and it widens WorkItemPropertyValueDetail.value to accept int. The ticket prefix and conventional-commit style are acceptable. The title does not mention the int widening or the customer-property exclusion, but those are secondary details.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e3641016-a792-4b28-9498-a0087f796f9e
Commits

Reviewing files that changed from the base of the PR and between 89b5a8a and 939a980.

Files selected for processing: 7

  • plane/models/enums.py
  • plane/models/v2/work_item_properties.py
  • plane/models/v2/work_item_types.py
  • plane/models/work_item_properties.py
  • tests/unit/test_customers.py
  • tests/unit/test_work_item_properties.py
  • tests/v2/test_work_item_properties_resource.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@makeplane

makeplane Bot commented Nov 27, 2026

Copy link
Copy Markdown

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

@dheeru0198 dheeru0198 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Checked against the server: slider values come back as integers, and 0 is sent. Merge after makeplane/plane-ee#10995.

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.

2 participants