Skip to content

feat/make-dokan-settings-components#53

Open
Aunshon wants to merge 47 commits intofeat/settings-componentsfrom
feat/make-dokan-settings-components
Open

feat/make-dokan-settings-components#53
Aunshon wants to merge 47 commits intofeat/settings-componentsfrom
feat/make-dokan-settings-components

Conversation

@Aunshon
Copy link
Collaborator

@Aunshon Aunshon commented Feb 16, 2026

Summary by CodeRabbit

Release Notes

New Features

  • Added Settings component for dynamic, schema-driven configuration management
  • Added ColorPicker component for color selection
  • Added RadioImageCard for rich radio button options with image support

Documentation

  • Added comprehensive Settings component developer documentation

Improvements

  • Enhanced Input component styling and focus states
  • Updated Storybook to support MDX documentation files
  • Expanded Popover component with Close and Arrow variants
  • Improved menu navigation with automatic expansion for nested items

Aunshon and others added 18 commits February 10, 2026 12:48
… stories

- Introduced new `Popover`, `Skeleton`, and `ScrollArea` components in the UI library.
- Added Storybook stories for each component (`Popover.stories.tsx`, `Skeleton.stories.tsx`, `ScrollArea.stories.tsx`) showcasing their usage and variations.
- Exported new components in the `ui/index.ts` for external use.
update: add cursor style for Button on mouse over
…tion

- Added `ShowHideField` component to support toggling visibility of password-like fields.
- Replaced `ToggleGroup` in `RadioCapsuleField` with `ButtonToggleGroup` for improved styling and functionality.
- Enhanced event log UI in `Settings` stories with better empty state messaging.
- Used `RawHTML` for safer and more consistent rendering of descriptions.
- Added `layout` prop with default "horizontal" option to `FieldWrapper` for flexible layouts.
- Updated input wrapper to support responsive width.
- Enhanced link styling in descriptions with `text-primary` and `underline` classes.
- Introduced `layout` property in specific settings fields for full-width layout.
- Introduced `layout` prop in `FieldWrapper` with "horizontal" as default for flexible layouts.
- Updated styles for input wrappers and added responsive width adjustments.
- Enhanced prefix/postfix UX with better positioning and hover effects.
- Added `doc_link_text` property across relevant settings fields for customizable link text.
- Standardized `layout` and styling in other settings components and stories.
- Introduced `layout` prop in `FieldWrapper` with "horizontal" as default for flexible layouts.
- Updated styles for input wrappers and added responsive width adjustments.
- Enhanced prefix/postfix UX with better positioning and hover effects.
- Added `doc_link_text` property across relevant settings fields for customizable link text.
- Standardized `layout` and styling in other settings components and stories.
…ehavior

- Adjusted `border-muted` for default states and refined `border-primary` application on selection.
- Improved hover styles with `group-hover` for better visual feedback.
- Simplified className logic for cleaner style definitions.
…ries

- Used `RawHTML` for consistent rendering of `prefix` and `postfix` in field components.
- Introduced comprehensive settings for product advertisement including cost, slots, and visibility options.
- Added request-for-quote settings with toggles for AJAX functionality, redirect behavior, and out-of-stock quotes.
…d components

- Updated image styles in settings components with rounded corners and borders for better visuals.
- Included `doc_link_text` property across several settings for improved link customization.
- Adjusted layout and spacing in `RadioGroup` and `FieldContent` for more consistent design.
- Refined description and link styling with `text-primary` and `underline` classes.
…cing

- Improved alignment and spacing by restructuring `Field` component layout.
- Simplified wrapping div structure in `SettingsFieldGroup`.
feat: add Popover, Skeleton, and ScrollArea components with Storybook stories
…rt in settings

- Introduced `ColorPickerField` for rendering color picker inputs in settings.
- Added `ColorPicker` component using `@wordpress/components` for primary functionality.
- Extended `fields` and `field-renderer` to support `color_picker` and `select_color_picker` variants.
- Updated `Settings.stories` with a `Store Brand Color` field to demonstrate color picker usage.
@Aunshon Aunshon self-assigned this Feb 16, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 16, 2026

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.

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
📝 Walkthrough

Walkthrough

A comprehensive Settings component system is introduced with context-based state management, field rendering for multiple input types, sidebar navigation, and supporting utilities for data formatting, validation, and dependency resolution. Package.json is expanded with build scripts, dependencies, and public subpath exports. Storybook configuration is updated to support MDX files, and new UI components (ColorPicker, RadioImageCard) are added.

Changes

Cohort / File(s) Summary
Settings Component System
src/components/settings/index.tsx, src/components/settings/settings-context.tsx, src/components/settings/settings-content.tsx, src/components/settings/field-renderer.tsx, src/components/settings/fields.tsx, src/components/settings/settings-sidebar.tsx, src/components/settings/settings-formatter.ts, src/components/settings/settings-types.ts, src/components/settings/Settings.mdx
Introduces complete settings UI system with context-based state, field components (text, number, textarea, select, switch, radio, checkbox, color picker, HTML), dependency-driven rendering, per-scope dirty tracking, validation with multiple rules, searchable sidebar navigation, data formatting with hierarchy resolution, and comprehensive developer documentation.
Package Configuration
.storybook/main.ts, package.json
Updates Storybook to load MDX story files. Expands package.json with build scripts (storybook, build, lint, typecheck), peer dependencies (React >=17.0.0), runtime dependencies (WordPress, UI, styling libraries), dev dependencies (Storybook, Tailwind, types), Node >=22 requirement, and public subpath exports for components/ui, providers, themes, utils, and settings.
UI Component Enhancements
src/components/ui/color-picker.tsx, src/components/ui/color-picker.stories.tsx, src/components/ui/radio-group.tsx, src/components/ui/popover.tsx, src/components/ui/input.tsx, src/components/ui/layout-menu.tsx, src/components/ui/index.ts
Introduces ColorPicker component with Popover integration and four story variants. Adds RadioImageCard for image-based radio selections. Extends Popover with Close and Arrow components. Adds testId and auto-expand logic to LayoutMenu. Minor Input styling adjustment.
Public API
src/index.ts
Re-exports Settings component, useSettings hook, data utilities (formatSettingsData, extractValues), and types from the new settings module.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant SettingsUI as Settings UI
    participant SettingsProvider as SettingsProvider
    participant FieldRenderer as FieldRenderer
    participant Context as Settings Context

    User->>SettingsUI: Open Settings with schema
    SettingsUI->>SettingsProvider: Initialize with schema/values
    SettingsProvider->>SettingsProvider: Format & normalize schema
    SettingsProvider->>Context: Set initial state (pages, values, errors)
    
    User->>SettingsUI: Click sidebar item
    SettingsUI->>Context: Update navigation (activePage/activeSubpage)
    Context->>SettingsUI: Notify state change
    SettingsUI->>SettingsUI: Re-render content area

    User->>SettingsUI: Update field value
    SettingsUI->>FieldRenderer: Trigger onChange
    FieldRenderer->>Context: Call updateValue(scope, key, value)
    Context->>Context: Validate field & update values
    Context->>Context: Mark scope as dirty
    SettingsUI->>SettingsUI: Re-render with updated state

    User->>SettingsUI: Click Save button
    SettingsUI->>Context: Trigger onSave with page values
    Context->>SettingsUI: Call onSave callback
    SettingsUI->>SettingsUI: Reset dirty state
Loading
sequenceDiagram
    participant Schema as Schema (Flat Array)
    participant Formatter as formatSettingsData()
    participant Tree as Hierarchical Tree
    participant Evaluator as evaluateDependencies()
    participant Validator as validateField()

    Schema->>Formatter: Pass flat settings array
    Formatter->>Formatter: Resolve parent pointers (bottom-up)
    Formatter->>Formatter: Construct root pages
    Formatter->>Formatter: Enrich nodes recursively
    Formatter->>Formatter: Normalize options & validations
    Formatter->>Tree: Return hierarchical structure
    
    Tree->>Evaluator: Element + values
    Evaluator->>Evaluator: Evaluate dependencies
    Evaluator->>Tree: Return shouldDisplay boolean

    Tree->>Validator: Element + field value
    Validator->>Validator: Check validation rules (required, min, max, etc.)
    Validator->>Tree: Return error string or null
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Poem

🐰 Through fields and forms we hippity-hop,
Settings flow from page to stop,
Context wisdom lights the way,
Dependencies kept neat each day,
Save your state with joy and cheer—
The perfect form is finally here! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 76.19% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat/make-dokan-settings-components' accurately describes the main change: introducing a comprehensive new Settings component system with multiple related sub-components, hooks, and utilities.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into feat/settings-components

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/make-dokan-settings-components

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.

@Aunshon Aunshon changed the base branch from main to feat/settings-components February 16, 2026 03:25
- Introduced `NoticeField` for rendering alert-style notices in settings.
- Extended `field-renderer` to support the `notice` field variant.
- Added `scrollBarClassName` prop to `ScrollArea` for improved customization.
- Updated `settings-content` to use `ScrollArea` for consistent scrolling behavior.
- Introduced `CopyField` for rendering copyable input fields with flexible layouts.
- Added `InfoField` to display information with titles, descriptions, and optional external links.
- Extended `field-renderer` to support `copy_field` and `info` variants.
- Updated `fields` and `ui` exports to include new components.
- Introduced `CopyInput`, a reusable input component with copy-to-clipboard functionality.
- Added Storybook stories demonstrating various use cases, including labels, custom durations, and callbacks.
…ories

- Enabled dynamic icon rendering in `FieldLabel` using Lucide icons.
- Updated `Settings.stories` to include an example with the `CircleCheck` icon.
- Introduced `AI Assist` page with configurable settings for content generation.
- Added support for OpenAI and Gemini APIs with selection fields for engine, API keys, and model options.
- Enhanced `Settings.stories` with examples showcasing AI-powered product information generation.
…ents

- Updated default AI engine values to `chatgpt` and refined model options for both ChatGPT and Gemini.
- Enhanced image styles in settings with added padding and refined borders.
- Improved link styling with `text-primary` and `hover:underline` classes.
- Updated Gemini icon source for better visual consistency.
…ories

- Introduced `Vendor` settings with `Vendor Onboarding` and `Vendor Capabilities` subsections.
-
- Introduced `RichTextField` to the field renderer for rich text editing.
- Enhanced `RichTextEditor` with `value` and `onChange` support for better state control.
- Added toolbar improvements, including a new link button and reordered undo/redo actions.
- Updated `Settings.stories` with example usage of the rich text field.
…tings stories

- Enabled dynamic rendering of `startIcon` and `endIcon` in field options using Lucide icons.
- Updated `Settings.stories` to incorporate examples with new icon properties.
- Refined tooltips, link styling, and external link visuals across settings stories.
- Standardized `doc_link_text` for improved accessibility and clarity.
…customization

- Added detailed tooltips for subscription fields to improve clarity.
- Introduced email notification options for subscription expiry alerts, including subject and body customization.
- Updated default values for alert days before expiry and enhanced related field descriptions.
- Introduced `GoogleAnalyticsField` to the field renderer for seamless integration with Google Analytics.
- Added support for connecting, disconnecting, and selecting Analytics profiles via dropdown.
- Updated `Settings.stories` to include examples showcasing the new field and its configurations
- Introduced `Vendor Verification` page with subsections for email verification, vendor verification settings, and SMS gateways.
- Added support for email verification notices, marketplace verified icons, and verification methods.
- Integrated Twilio and Vonage SMS gateway configurations with connect/disconnect options.
- Introduced `Transaction` page with subsections for commissions, fees, and withdrawal settings.
- Added configurable fields for commission types (fixed/category-based), admin commission, and parent-category behavior.
- Enhanced fee distribution options for shipping, product tax, and shipping tax.
- Integrated withdrawal method configuration for PayPal and bank transfer, including fees and toggle switches.
… in settings

- Added `CombineInput` component for percentage and number inputs with optional swapping and custom money signs.
- Integrated `CombineInputField` into the field renderer for settings.
- Updated `Settings.stories` with `combine_input` field examples, including swapped and automated use cases.
- Added Storybook stories for `CombineInput` showcasing different configurations and interactivity.
- Added `isNested` and `isGroupParent` props to FieldRenderer and settings components to support advanced layout rendering.
- Implemented `switch_group` variant logic, enabling grouped fields with toggle functionality.
- Enhanced various field components (e.g., `TextField`, `SelectField`) to pass `...rest` props for nested styling.
- Updated settings stories and types to include nested field scenarios with hierarchical dependencies.
…ayout adjustments

- Added `isGroupParent` prop to multiple components for enhanced hierarchical rendering.
- Updated child component logic to handle nested and grouped field layouts.
- Refined spacing and styling for nested and grouped fields to improve visual hierarchy.
- Introduced `Shipment` page with sections for tracking, logging, and customer delivery confirmation.
- Added configurable fields for enabling shipment tracking, API logging, and marking orders as received.
- Integrated shipment provider options with switch-based enablement for multiple carriers.
- Updated `Settings.stories` to reflect new shipment settings and provider configurations.
- Introduced `RadioIconCard` component for icon-based radio field rendering.
- Added `radio_variant` field property to dynamically switch between `RadioImageCard` and `RadioIconCard`.
- Updated `RadioGroup` to handle `RawHTML` labels and conditional layout adjustments.
- Enhanced `Settings.stories` with examples using the new `RadioIconCard` and `radio_box` variant.
- Enhanced `Settings.stories` with updated external link styles (text-primary underline).
- Introduced new `ImageCard` and `IconCard` stories showcasing `RadioImageCard` and `RadioIconCard` components.
- Improved radio group flexibility with visual examples of image and icon-based selections.
- Introduced `Compliance` page with subsections for `Privacy` and `EU Compliance` settings.
- Added configurable privacy fields, including policy display, admin access restriction, and data clear options.
- Integrated EU compliance settings for vendor and customer fields, invoice overrides, and Germanized WooCommerce support.
- Updated `Settings.stories` with hierarchical compliance features and detailed documentation links.
- Introduced `is_danger` prop to `SettingsElement` for rendering danger-specific styles.
- Updated component classes to conditionally apply destructive styling based on `is_danger`.
- Enhanced `Settings.stories` with danger examples using `TriangleAlert` icon and updated field labels.
- Improved tooltip and description handling for danger-styled settings components.
- Updated `Settings` component to use `<RawHTML>` for titles in mobile and desktop views to allow HTML rendering.
- Refactored hardcoded image URLs in `Settings.stories` to use a shared `image` variable for improved maintainability.
- Introduced `PreviewMulticheckField` for enhanced multicheck rendering with image and description support.
- Added `vendor_info_preview` and `single_product_preview` field variants to `FieldRenderer`.
- Updated `Settings.stories` with examples of preview fields, including tooltips and image URLs.
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