Skip to content

[WEB-9927] feat: dropdown option colors - #92

Open
chiraghm4 wants to merge 1 commit into
mainfrom
feat/web-9927-select-property-improvements
Open

chiraghm4 wants to merge 1 commit into
mainfrom
feat/web-9927-select-property-improvements

Conversation

@chiraghm4

Copy link
Copy Markdown

What

  • Was: Select / Multi select options had no color field. The option request models ignore unknown fields, so a settings passed on create or update was silently dropped, and the request still returned success.
  • Now: options carry settings = {"color": "#RRGGBB"} on v1 and v2: on reads, on create and update, on the inline options of a property create/update, and on context option inputs. {"color": None} clears a color.

Merge order

⚠️ Merge after makeplane/plane-ee#11125, the server-side option colors. Until it lands the server ignores the field, so the change is harmless against older servers.

Where to look

  • plane/models/v2/work_item_properties.py: settings on WorkItemPropertyOption, CreateWorkItemPropertyOption, UpdateWorkItemPropertyOption and WorkItemPropertyContextOptionInput.
  • plane/models/work_item_properties.py: settings on the v1 WorkItemPropertyOption, CreateWorkItemPropertyOption and UpdateWorkItemPropertyOption.

Watch out for: settings is typed dict[str, Any], not a typed OptionSettings model, on purpose. Every write dumps with exclude_none=True, which strips color=None from a nested model and sends {"settings": {}}, so clearing a color would quietly do nothing. A dict keeps the None. The update docstrings note that settings=None is dropped, not sent.

No change needed for the generated constants: regenerating from #11125's golden and from its merge base on preview gives identical output (the option operations have no ?fields= table).

Proof

  • New offline tests (v1 and v2):
    • an option reads its color
    • create and update send it, project and workspace scope
    • inline property options and context options send it
    • {"color": None} reaches the request body as null
  • 6 of the 8 fail with the model change reverted; the 2 read tests pass either way, because read models already allow extra fields.
  • pytest tests/v2 --ignore=tests/v2/integration: 1085 passed, 2 skipped. The offline tests in tests/unit/test_work_item_properties.py pass; the live suites are skipped (no env).
  • ruff, black and mypy report no new findings. Their existing findings on main are unchanged: black on the unit test file, 3 ruff errors in the unit test file, 56 mypy errors.
  • Not run live against a server with #11125.

Not in this PR (follow-ups)

  • Option weights: dormant on the server in #11125.
  • Customer property options (CreateCustomerPropertyOption): #11125 doesn't touch them.
  • Golden drift: regenerating the constants from current preview gives about 12k lines of unrelated changes, which need a separate catch-up.

🤖 Generated with Claude Code

Plane added a color to Select / Multi select options (makeplane/plane-ee#11125):
option.settings = {"color": "#RRGGBB"}, upper-cased by the server, cleared with
{"color": null}. The SDK's option request models ignore unknown fields, so a
color passed on create or update was silently dropped and the request still
succeeded.

- v2: add `settings` to WorkItemPropertyOption, CreateWorkItemPropertyOption
  (also the inline `options` on property create/update),
  UpdateWorkItemPropertyOption and WorkItemPropertyContextOptionInput.
- v1: add `settings` to WorkItemPropertyOption, CreateWorkItemPropertyOption
  and UpdateWorkItemPropertyOption.
- `settings` is a dict, not a typed model: writes dump with exclude_none, which
  would strip `color=None` from a model and turn a clear into a no-op.

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

coderabbitai Bot commented Nov 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

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: bd0084f5-f383-4bc5-b9f4-aa08eea4013c
Commits

Reviewing files that changed from the base of the PR and between 89b5a8a and 6683b08.

Files selected for processing: 4

  • plane/models/v2/work_item_properties.py
  • plane/models/work_item_properties.py
  • tests/unit/test_work_item_properties.py
  • tests/v2/test_work_item_properties_resource.py
  • 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

@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: the merge and {"color": null} rules match the docstrings, and None survives the exclude_none dump. Merge after makeplane/plane-ee#11125.

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