Skip to content

refactor: use x, defaultX and onXChange for state props - #983

Open
rohanchkrabrty wants to merge 2 commits into
feat/change-event-detailsfrom
refactor/controlled-state-props
Open

rohanchkrabrty wants to merge 2 commits into
feat/change-event-detailsfrom
refactor/controlled-state-props

Conversation

@rohanchkrabrty

Copy link
Copy Markdown
Contributor

Summary

  • Breaking: state props use x, defaultX and onXChange. Select searchValue, defaultSearchValue, onSearch become inputValue, defaultInputValue, onInputValueChange. DatePicker and RangePicker onSelect becomes onValueChange. Tour onStepChange becomes onStepIndexChange, with the step in details.step. DataView onTableQueryChange becomes onQueryChange.
  • Breaking: DataView query and FilterChip value were read on the first render only. They are now controlled with Base UI useControlled, and defaultQuery and defaultValue set the first value. DatePicker value also moves to useControlled.
  • FilterChip adds operation and defaultOperation. DataView passes each filter's operator to its chip, so a query with operator: 'neq' shows "is not".
  • Every new callback follows feat: pass a details object to change callbacks #979: Select forwards Base UI eventDetails. DatePicker, RangePicker, Tour, DataView and FilterChip onOperationChange pass details from createChangeDetails.
  • Docs: props tables, demos, mdx pages, the upgrading page, the consumer skill and the FilterChip Code Connect template. Tests cover the renames, the controlled DataView query, FilterChip value and operation, and a controlled DatePicker.

Stacked on #979. Retarget to main after it merges.

Decisions

  • FilterChip reports an operation change through the existing onOperationChange, now (operation, details). onValueChange keeps details.operation from feat: pass a details object to change callbacks #979. The details.reason comes from the operation Select.
  • DataView keeps its internal query, because the wire query leaves out filters with no value. A query from outside replaces it only when the two differ, so a new empty filter chip stays. A query change from outside does not call onQueryChange.
  • DataView calls onQueryChange in client mode too, so a controlled query works in both modes. Server mode still calls it on mount, as onTableQueryChange did. details.reason is none, because the call runs after the state change.
  • DatePicker still commits a typed date on Enter, blur or an outside click. It now calls onValueChange only when the typed date differs from the value. A day click passes reason item-press and a typed date passes input-change.
  • defaultOperation falls back to the first operation, as before. FilterChip keeps the typed text of a number column, so 1. and - stay editable under a controlled value.
  • docs/rfcs/003 and docs/V1-migration.md keep the old names, since they record earlier releases. DataTable keeps query and onTableQueryChange.

Overlap with open PRs

@vercel

vercel Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
apsara Ready Ready Preview Oct 19, 2026 9:25pm UTC

@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 285848b8-4242-4273-8ea0-412ae0fc3922

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • 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

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

@pkg-pr-new

pkg-pr-new Bot commented Oct 19, 2026

Copy link
Copy Markdown

Open in StackBlitz

pnpm add https://pkg.pr.new/@raystack/apsara@983

commit: d7c976e

This branch was successfully deployed

1 active deployment
Preview — d7c976ef Deployed Oct 19, 2026 by vercel[bot]
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.

1 participant