Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Aunshon
Copy link
Collaborator

@Aunshon Aunshon commented Oct 23, 2025

All Submissions:

  • My code follow the WordPress' coding standards
  • My code satisfies feature requirements
  • My code is tested
  • My code passes the PHPCS tests
  • My code has proper inline documentation
  • I've included related pull request(s) (optional)
  • I've included developer documentation (optional)
  • I've added proper labels to this pull request

Changes proposed in this Pull Request:

Related Pull Request(s)

  • Full PR Link

Closes

  • Closes #

How to test the changes in this Pull Request:

  • Steps or issue link

Changelog entry

Title

Detailed Description of the pull request. What was previous behaviour
and what will be changed in this PR.

Before Changes

Describe the issue before changes with screenshots(s).

After Changes

Describe the issue after changes with screenshot(s).

Feature Video (optional)

Link of detailed video if this PR is for a feature.

PR Self Review Checklist:

  • Code is not following code style guidelines
  • Bad naming: make sure you would understand your code if you read it a few months from now.
  • KISS: Keep it simple, Sweetie (not stupid!).
  • DRY: Don't Repeat Yourself.
  • Code that is not readable: too many nested 'if's are a bad sign.
  • Performance issues
  • Complicated constructions that need refactoring or comments: code should almost always be self-explanatory.
  • Grammar errors.

FOR PR REVIEWER ONLY:

As a reviewer, your feedback should be focused on the idea, not the person. Seek to understand, be respectful, and focus on constructive dialog.

As a contributor, your responsibility is to learn from suggestions and iterate your pull request should it be needed based on feedback. Seek to collaborate and produce the best possible contribution to the greater whole.

  • Correct — Does the change do what it’s supposed to? ie: code 100% fulfilling the requirements?
  • Secure — Would a nefarious party find some way to exploit this change? ie: everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities?
  • Readable — Will your future self be able to understand this change months down the road?
  • Elegant — Does the change fit aesthetically within the overall style and architecture?

Summary by CodeRabbit

  • Style

    • Improved spacing and alignment in admin pages for better visual consistency (create/edit vendor, tabs).
    • Enhanced button styling in filter controls.
    • Refined menu item text color for improved readability.
    • Adjusted input field styling for commission inputs.
    • Social platform icons are now clickable and open links in a new tab.
  • Chores

    • Increased input debounce delay, causing slightly slower live input updates for debounced fields.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 23, 2025

Walkthrough

This PR makes small UI and behavior tweaks across several components: header top margins, button styling/variant prop, vertical alignment, paired-input border/rounding classes, menu item text color, DebouncedInput default delay increased to 500ms, and vendor social icons wrapped with anchor links. No exported APIs were changed.

Changes

Cohort / File(s) Summary
Header Spacing
src/admin/dashboard/pages/vendor-create-edit/Create.tsx, src/admin/dashboard/pages/vendor-create-edit/Edit.tsx
Added mt-[24px] to header containers for vendor create/edit pages (presentation only).
Button Styling / Props
src/components/AdminFilter.tsx
"Add Filter" DokanButton: removed dokan-btn-tertiary className, added shadow-none className and variant="tertiary" prop.
Flex Alignment
src/components/AdminTab.tsx
Changed vertical alignment for additionalComponents container from items-enditems-center.
Paired Input Borders
src/components/commission/CommissionInputs.tsx
Adjusted paired input classes to remove right/left borders and corresponding rounded corners (!border-r-0, !rounded-r-none, !border-l-0, !rounded-l-none).
Menu Item Styling
src/components/dataviews/style.scss
Added color: #828282 to div[role="menuitem"] within portal Dokan dashboard styles.
Debounce Timing
src/components/DebouncedInput.tsx
Increased default delay prop from 300500 ms (debounce timing change).
Social Links Clickable
src/admin/dashboard/pages/vendors-single/SocialLinks.tsx
Wrapped social platform icons in anchor tags (href to platform or #, target="_blank", rel="noreferrer"), making icons clickable.

Sequence Diagram(s)

(Skipped — changes are presentation and a debounce default; no control-flow or new feature requiring a sequence diagram.)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

Need Dev Review Only

Suggested reviewers

  • mrabbani
  • shohag121

Poem

🐰 I nudged a margin, softened a line,

icons now open, inputs wait half a sign.
Buttons wear a variant, menu words hum low,
small tweaks, gentle hops — the dashboard's aglow.

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description is largely incomplete. It contains only the template structure with all checklist items unchecked and all required sections left empty, including "Changes proposed in this Pull Request," "How to test the changes," "Changelog entry," "Before Changes," and "After Changes." Despite the raw summary showing multiple UI changes across seven files (spacing, styling, debounce delays, and social links), the description provides no explanation of these changes, no rationale for the modifications, no testing instructions, and no before/after context.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title Check ❓ Inconclusive The pull request title "Fix/overall test" is vague and non-descriptive. While the raw summary shows multiple UI and styling changes across several components (spacing adjustments, button styling, alignment, debounce delays, and social links rendering), the title "overall test" does not convey any meaningful information about these changes. The title uses non-descriptive terms that don't clearly summarize the primary change or intent of the PR.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/overall-test

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0aa1eee and d9f5890.

📒 Files selected for processing (6)
  • src/admin/dashboard/pages/vendor-create-edit/Create.tsx (1 hunks)
  • src/admin/dashboard/pages/vendor-create-edit/Edit.tsx (1 hunks)
  • src/components/AdminFilter.tsx (1 hunks)
  • src/components/AdminTab.tsx (1 hunks)
  • src/components/commission/CommissionInputs.tsx (2 hunks)
  • src/components/dataviews/style.scss (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: e2e tests (3, 3)
  • GitHub Check: api tests (1, 1)
  • GitHub Check: e2e tests (1, 3)
  • GitHub Check: e2e tests (2, 3)
🔇 Additional comments (5)
src/admin/dashboard/pages/vendor-create-edit/Edit.tsx (1)

197-197: LGTM - Consistent header spacing.

The top margin addition aligns the "Update Vendor" header spacing with the same change in Create.tsx, maintaining visual consistency across the vendor creation and editing workflows.

src/admin/dashboard/pages/vendor-create-edit/Create.tsx (1)

127-127: LGTM - Consistent header spacing.

The top margin addition matches the identical change in Edit.tsx, ensuring uniform spacing across both vendor creation and editing views.

src/components/dataviews/style.scss (1)

81-81: LGTM - Menu item color styling.

The color addition provides consistent text styling for portal menu items.

src/components/commission/CommissionInputs.tsx (1)

59-59: LGTM - Connected input styling.

The border and border-radius adjustments create a visually connected pair of inputs for the percentage and flat commission fields, following a common UI pattern for grouped inputs. The use of Tailwind's ! important modifier appropriately ensures these styles override any conflicting defaults.

Also applies to: 97-97

src/components/AdminTab.tsx (1)

123-123: Verify existing AdminTab usages with additionalComponents render correctly after alignment change.

The alignment change from items-end to items-center is confirmed to affect real usages: SearchInput in vendors.tsx and buttons in withdraw/index.tsx. Manual testing is needed to confirm that these components and any other additionalComponents render correctly with center alignment. While the change appears semantically sound for a flex layout, visual regression testing is required to ensure no unintended layout shifts occur.

Comment on lines +176 to +177
className="flex gap-2 items-center justify-center shadow-none"
variant="tertiary"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify the button variant migration provides equivalent styling.

The change migrates from a class-based variant (dokan-btn-tertiary) to a prop-based variant (variant="tertiary"). Ensure that the DokanButton component properly supports the variant="tertiary" prop and that it provides equivalent or improved styling compared to the removed class.


🏁 Script executed:

#!/bin/bash
# Description: Verify DokanButton component supports variant prop and check for other usages of the old class

# Find DokanButton component definition to verify variant prop support
fd -e tsx -e ts -e jsx -e js 'DokanButton' --exec cat {} \; | rg -A10 -B5 'variant.*tertiary|DokanButton.*=.*\(|interface.*DokanButton'

# Search for any remaining usages of dokan-btn-tertiary class
rg -n 'dokan-btn-tertiary' -g '*.tsx' -g '*.ts' -g '*.jsx' -g '*.js' -g '*.css' -g '*.scss'

Length of output: 562


The script output reveals a potential issue: there are still usages of the dokan-btn-tertiary class in the codebase, including at line 193 in the same file (AdminFilter.tsx). Let me verify the DokanButton component and the migration status:

I need to inspect the actual component implementations to verify the variant support:

Let me examine the component files directly from the codebase:


🏁 Script executed:

#!/bin/bash
# View DokanButton component definition
echo "=== DokanButton Component ===" 
find . -name "DokanButton.tsx" -o -name "DokanButton.ts" -o -name "DokanButton.jsx" -o -name "DokanButton.js" | head -5 | xargs -I {} sh -c 'echo "File: {}"; cat "{}"'

echo -e "\n=== Button.tsx Component ===" 
cat src/components/Button.tsx

echo -e "\n=== AdminFilter.tsx around lines 176-177 and 193 ===" 
sed -n '160,210p' src/components/AdminFilter.tsx

Length of output: 3928


Approve lines 176-177 but fix incomplete migration at line 193.

The variant="tertiary" prop migration at lines 176-177 is correctly implemented and properly supported by the DokanButton component wrapper. However, verification reveals an incomplete migration in the same file: line 193 still uses the class-based approach className="flex dokan-btn-tertiary" instead of the prop-based variant. Update line 193 to use variant="tertiary" for consistency:

<DokanButton
    variant="tertiary"
    onClick={ handleReset }
>
🤖 Prompt for AI Agents
In src/components/AdminFilter.tsx around lines 176-177 and 193, lines 176-177
are fine but line 193 still uses className="flex dokan-btn-tertiary"; replace
that class-based styling with the prop-based API by removing the
"dokan-btn-tertiary" class and adding variant="tertiary" to the DokanButton
component while preserving other utility classes (e.g., keep "flex" or any
layout classes) and ensure onClick={handleReset} remains; verify
import/signature of DokanButton supports variant and run typecheck.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/admin/dashboard/pages/vendors-single/SocialLinks.tsx (2)

125-129: Include noopener in rel attribute for explicit security.

While modern browsers imply noopener from noreferrer, it's a security best practice to explicitly include both for broader compatibility and clarity when using target="_blank".

Apply this diff:

                     <a
                         href={ platform.url ?? '#' }
                         target="_blank"
-                        rel="noreferrer"
+                        rel="noopener noreferrer"
                     >

126-126: Consider removing unnecessary fallback.

The fallback to '#' is unnecessary since the filter at lines 104-106 already excludes platforms without URLs. This fallback should never be reached in practice.

If you prefer defensive programming, keep it as-is. Otherwise, simplify to:

-                        href={ platform.url ?? '#' }
+                        href={ platform.url }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bdb261a and 83bc425.

📒 Files selected for processing (1)
  • src/admin/dashboard/pages/vendors-single/SocialLinks.tsx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: e2e tests (3, 3)
  • GitHub Check: e2e tests (2, 3)
  • GitHub Check: api tests (1, 1)
  • GitHub Check: e2e tests (1, 3)

Comment on lines +125 to +129
<a
href={ platform.url ?? '#' }
target="_blank"
rel="noreferrer"
>
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Add accessible name to anchor element.

The anchor lacks an accessible name. The aria-label on the child RawHTML component (line 133) does not make the link accessible to screen readers. Links must have accessible names per WCAG guidelines.

Move the aria-label from the RawHTML to the anchor element:

-                    <a
-                        href={ platform.url ?? '#' }
-                        target="_blank"
-                        rel="noreferrer"
-                    >
+                    <a
+                        href={ platform.url ?? '#' }
+                        target="_blank"
+                        rel="noreferrer"
+                        aria-label={ platform.label }
+                    >
                         <RawHTML
                             key={ platform.key + '_icon' }
                             className="w-7 h-7 flex hover:cursor-pointer"
-                            aria-label={ platform.label }
                         >
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<a
href={ platform.url ?? '#' }
target="_blank"
rel="noreferrer"
>
<a
href={ platform.url ?? '#' }
target="_blank"
rel="noreferrer"
aria-label={ platform.label }
>
<RawHTML
key={ platform.key + '_icon' }
className="w-7 h-7 flex hover:cursor-pointer"
>
🤖 Prompt for AI Agents
In src/admin/dashboard/pages/vendors-single/SocialLinks.tsx around lines 125-129
(and the child RawHTML at ~133), the anchor lacks an accessible name; move the
aria-label from the child RawHTML to the anchor element so screen readers see
the link name. Update the <a> to include an aria-label (e.g., using
platform.name or a descriptive string like `Visit ${platform.name}`) and remove
the aria-label from RawHTML; ensure the anchor still has href, target and rel
attributes and that the aria-label provides a meaningful, unique name for each
platform.

@mrabbani mrabbani merged commit 4b83082 into develop Oct 23, 2025
1 of 5 checks passed
@mrabbani mrabbani deleted the fix/overall-test branch October 23, 2025 13:44
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.

3 participants