fix(settings/ui): single-card danger switch, radius sync, toolbar chevrons - #104
Merged
Conversation
8 tasks
kzamanbd
added a commit
to getdokan/dokan
that referenced
this pull request
Aug 17, 2026
Picks up getdokan/plugin-ui#104 (49abb30): the danger_switch field no longer draws its own card, so the data_clear_section is_danger flag in this branch renders a single destructive card instead of a doubled border.
kzamanbd
added a commit
to getdokan/dokan
that referenced
this pull request
Aug 17, 2026
) * fix(settings): flag data clear section as danger The danger_switch field no longer paints its own card, so the section around it has to supply the destructive tint and border. Without this flag the block rendered a neutral card with a second, inset red frame drawn by the field itself. * feat(settings): warn before leaving with unsaved changes Plugin UI guards its own sidebar navigation and the browser unload, but it cannot see this app's router. Track its dirty state and block route changes with useBlocker, confirming through an AlertDialog. The blocker compares pathnames only: UrlSync rewrites the query string on every subpage switch, and those navigations are already handled by plugin-ui's own guard. * fix(commission): close the 1px seam in combined inputs Two separate causes left a gap between the currency addon and its input: - WordPress admin's forms.css sets `margin: 0 1px` on inputs, holding the two halves apart. `!m-0` removes it. - dokan-ui's addOnLeft span already ships `border-r-0`, and we stripped `border-l` from the input as well, so nothing drew the shared edge. The percentage side keeps `!border-r-0` because its addon uses `-ml-px` with a full border to overlap and merge instead. * fix(settings): align schema defaults with reader fallbacks The new settings screen writes its schema default on the first save of an untouched page, so a default that disagrees with what the reading code assumes when the option is unset changes behaviour with no user action. - one_step_product_create: off -> on. Readers in functions.php and Assets.php fall back to 'on', so saving Vendors settings once turned off the single-page product form. - enabled_address_on_reg: on -> off. The three registration templates fall back to 'off', so saving Vendor Onboarding once added address fields to the vendor registration form. Both now match the legacy screen's defaults. Refs getdokan/dokan-pro#6067 (BUG-01, BUG-02) * fix(settings): restore legacy defaults for three more fields Same defect as BUG-01..03: the new screen writes its schema default on the first save of an untouched page, so a default that disagrees with the legacy one changes behaviour with no user action. - dokan_fontawesome_enabled: off -> on. The field is the inverse of the stored disable_dokan_fontawesome, so 'off' stored 'on' and dropped the font-awesome library from the frontend (Assets.php reads it with an 'off' fallback). - vendor_setup_wizard_message: no default -> the legacy welcome copy. - privacy_policy_content: no default -> the legacy policy copy. Both rich-text fields rendered empty and saved a blank string over the text the legacy screen ships. Found by diffing every schema default against apply_filters( 'dokan_settings_fields' ) with each field's legacy_transformer applied, so inverted and reshaped fields are not false positives. Refs getdokan/dokan-pro#6067 (BUG-04) * fix(settings): add Select page placeholder to privacy policy page The other five page-selects on Page Setup already prompt with "Select page"; the privacy policy page select fell back to the generic "Select..." from the field renderer. * chore(deps): bump @wedevs/plugin-ui to the merged settings UI fixes Picks up getdokan/plugin-ui#104 (49abb30): the danger_switch field no longer draws its own card, so the data_clear_section is_danger flag in this branch renders a single destructive card instead of a doubled border.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes proposed in this Pull Request
Settings UI fixes surfaced while wiring up the Dokan admin settings screens.
danger_switchfield (settings/fields.tsx)The Data Clear Consent block rendered its own card inside the section card its
parent already draws, so the block showed two borders a pixel apart, and its copy
stretched edge to edge on wide screens.
its own — like every other field. Flag the parent
is_dangerin the schema toget the destructive tint/border (
SettingsSectionalready supports it).sm:col-span-8(mirrorsFieldWrapper's label grid) sothe description wraps to a readable measure instead of running the full panel
width; switch moves to the matching
sm:col-span-4cell.text-xs→text-sm.color-mix(in oklab, var(--destructive) 82%, black).Raw
--destructiveis tuned for solid fills (buttons, switch tracks) and readstoo hot as text on the pale destructive card. An arbitrary value rather than a
new
destructive-strongtoken because consumer Tailwind builds map only--color-destructive, so a new token would compile here and be dead there.Radius consistency (
settings/fields.tsx,settings-content.tsx)Settings surfaces used a mix of
rounded-lg/rounded-xl/rounded-2xl/hardcoded
rounded-[4px]. Now one scale: containers share a radius, controlsrounded-md, checkboxesrounded-sm(token-derived, no hardcoded px), pillsrounded-full.Rich text editor toolbar (
ui/rich-text-editor.tsx)The three toolbar dropdowns are native
<select>s that inherit the host app'sselect styling. In WordPress admin that means a host-drawn arrow at the right
edge, painted on top of "Paragraph" / "Sans Serif" / "14 px" because the control
only reserved 8px of end padding.
New
ToolbarSelectwrapper:appearance-none bg-nonesuppresses the host arrow,ps-2 pe-6reserves space, and aChevronDownsits atend-1.5— logicalproperties, so RTL stays correct.
Also in this branch
feat(settings): unsaved-changes confirmation dialog + handlers(
settings-context.tsx,settings/index.tsx,settings-types.ts).fix(select-field): placeholder handling.fix(sidebar/layout-menu): sidebar menu/submenu styles.Related Pull Request(s)
'is_danger' => trueto the
data_clear_sectionschema entry; the danger block depends on it for itstint and border)
How to test
a readable measure, radius matches the Admin Area Access card above it.
chevrons sit clear of their labels, in both LTR and RTL.
Verified
npm run typecheck— cleannpm run build— clean; new utilities present indist/index.csssibling section cards, title and description resolve to the same darkened
destructive colour, text column measures ~63% of the card width.