Skip to content

Conversation

@shohag121
Copy link
Member

@shohag121 shohag121 commented Nov 4, 2025

…Status` page

  • Introduced a loader with custom SVGs for better user feedback during status checks.
  • Improved empty state illustration with smaller SVG and updated layout for clarity.
  • Simplified error handling in API call by removing unused parameter.

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

How to test the changes in this Pull Request:

  • Steps or issue link

Changelog entry

No change log needed

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

  • New Features
    • Added a visible loading card with spinner and “Checking your Dokan Status” message.
  • Style
    • Redesigned no-data screen with centered layout, updated placeholder visuals and larger status text: “Your Dokan is up-to-date.”
    • Updated status table styling so it now follows the revised base table appearance.

✏️ Tip: You can customize this high-level summary in your review settings.

…Status` page

- Introduced a loader with custom SVGs for better user feedback during status checks.
- Improved empty state illustration with smaller SVG and updated layout for clarity.
- Simplified error handling in API call by removing unused parameter.
@shohag121 shohag121 self-assigned this Nov 4, 2025
@shohag121 shohag121 added the In Progress The issues is being worked on label Nov 4, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 4, 2025

Walkthrough

The Status component now short-circuits rendering when loading to show a dedicated loading UI. The no-data UI and SVGs were redesigned and typography adjusted. A dokan-status-table class was added to the status table and base Tailwind selectors were updated to exclude that class from certain global table rules.

Changes

Cohort / File(s) Summary
Status component — loading / no-data UI
src/Status/Status.tsx
Adds an early-return loading render with spinner and message "Checking your Dokan Status"; restructures no-data state to centered flex layout, updates SVG placeholder graphics, and increases message font size (text-md → text-lg). i18n text changed to "Your Dokan is up-to-date."
Table class + global style exclusion
src/Status/Elements/Table.tsx, src/base-tailwind.scss
Adds dokan-status-table class to the status table element. Updates .dokan-layout selectors to exclude .dokan-status-table (alongside .dataviews-view-table) from table/th/td global rules.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant StatusComponent as Status.tsx
  participant DataLayer as API/Data Hook
  Note over StatusComponent: Mount / Render
  User->>StatusComponent: open status page
  StatusComponent->>DataLayer: fetch/check dokan status
  DataLayer-->>StatusComponent: loading=true (initial)
  alt loading
    StatusComponent-->>User: render LoadingUI ("Checking your Dokan Status", spinner)
  else loaded
    DataLayer-->>StatusComponent: loading=false, data or empty
    alt has data
      StatusComponent-->>User: render Status Table (`dokan-status-table`)
    else no data
      StatusComponent-->>User: render NoData UI (centered SVG, "Your Dokan is up-to-date.")
    end
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Inspect src/Status/Status.tsx early-return to ensure no lifecycle/side-effect regressions.
  • Verify SVG changes for accessibility (title/aria) and responsive sizing.
  • Confirm .dokan-status-table addition and src/base-tailwind.scss selector update don't unintentionally alter other table styles.

Suggested labels

Dev Review Done

Suggested reviewers

  • mrabbani

Poem

🐰 A little hop for interface cheer,
Spinner twirls while data draws near.
Centered SVGs brighten the state,
"Your Dokan is up-to-date" — celebrate! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description includes changes summary but lacks implementation details for testing, before/after comparisons, and most contributor checklist items are unchecked. Complete the PR description template sections: add testing steps, include before/after screenshots, check completed items in the contributor checklist, and provide more detailed technical implementation notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly describes the main changes: adding a loading state UI and enhancing empty state illustrations on the Status page.
Linked Issues check ✅ Passed The PR implements the primary objectives from issue #1010: adds a loading state UI with custom SVGs, improves empty state illustrations, and updates the Status page design.
Out of Scope Changes check ✅ Passed All changes are scoped to the Status page UI/UX: loading state, empty state illustrations, and associated styling in base-tailwind.scss for table styling consistency.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/status-page-design

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 761f707 and 62d17f2.

📒 Files selected for processing (1)
  • src/base-tailwind.scss (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/base-tailwind.scss
⏰ 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 (1, 3)
  • GitHub Check: api tests (1, 1)
  • GitHub Check: e2e tests (3, 3)
  • GitHub Check: e2e tests (2, 3)

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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

🧹 Nitpick comments (2)
src/Status/Status.tsx (2)

134-231: LGTM! Consider extracting SVGs for maintainability.

The loading state implementation is solid—it provides clear user feedback with appropriate visual elements and internationalized text. The early return pattern improves readability.

For better maintainability, consider extracting the inline SVGs into separate components:

// icons/DokanLogoIcon.tsx
export const DokanLogoIcon = () => (
    <svg width="62" height="62" viewBox="0 0 62 62" fill="none" xmlns="http://www.w3.org/2000/svg">
        {/* SVG content */}
    </svg>
);

// icons/SpinnerIcon.tsx
export const SpinnerIcon = () => (
    <svg className="w-10 h-10 rounded-full animate-spin" viewBox="0 0 27 27" fill="none" xmlns="http://www.w3.org/2000/svg">
        {/* SVG content */}
    </svg>
);

This would reduce file length and make the icons reusable across the codebase.


274-375: LGTM! Minor accessibility enhancement suggested.

The updated empty state UI is well-structured with improved centering and a more personalized message. The SVG illustration and layout changes align with the PR objectives.

Consider adding an accessible label to the SVG for screen readers:

 <svg
     width="146"
     height="99"
     viewBox="0 0 146 99"
     fill="none"
     xmlns="http://www.w3.org/2000/svg"
     className="mb-4"
+    role="img"
+    aria-label={ __( 'Dokan status illustration', 'dokan-lite' ) }
 >

Note: This empty state will also be shown when the API call fails (see previous comment about error handling).

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between be5afb8 and 1875a8a.

📒 Files selected for processing (1)
  • src/Status/Status.tsx (3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-19T06:19:41.376Z
Learnt from: mrabbani
Repo: getdokan/dokan PR: 2891
File: src/admin/dashboard/pages/vendors-single/InformationTabs/WithdrawTab.tsx:58-59
Timestamp: 2025-09-19T06:19:41.376Z
Learning: The Dokan codebase uses 'dokan-lite' as the text domain for WordPress internationalization (__() function calls).

Applied to files:

  • src/Status/Status.tsx
⏰ 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 (2, 3)
  • GitHub Check: e2e tests (3, 3)
  • GitHub Check: api tests (1, 1)
  • GitHub Check: e2e tests (1, 3)

Comment on lines +46 to 48
.catch( () => {
setLoading( false );
} );
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 error logging and user feedback for failed status checks.

The simplified error handler doesn't log errors or inform users when the API call fails. This means users will see the "up-to-date" message (lines 370-371) even when the status check actually failed, which is misleading.

Consider adding error logging and state tracking:

+    const [ error, setError ] = useState< string | null >( null );
+
     useEffect( () => {
         apiFetch< Array< StatusElement > >( {
             path: 'dokan/v1/admin/dashboard/status',
         } )
             .then( ( data ) => {
                 setAllSettings( data );
                 setLoading( false );
             } )
-            .catch( () => {
+            .catch( ( err ) => {
+                console.error( 'Failed to fetch Dokan status:', err );
+                setError( __( 'Failed to load status. Please try again.', 'dokan-lite' ) );
                 setLoading( false );
             } );
     }, [] );

Then display the error state in the render section instead of the success message when error is set.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/Status/Status.tsx around lines 46 to 48, the catch block swallows errors
and only calls setLoading(false); update it to log the caught error
(console.error or the app logger), set an error state (e.g., setError(error
message or object) and setLoading(false)), and ensure the render uses that error
state to show an error message/UI instead of the success "up-to-date" text when
error is set; keep existing success flow when no error.

- Added `dokan-status-table` class to improve scoping and avoid global table style conflicts.
- Updated Tailwind overrides to exclude `.dokan-status-table` from default resets.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

In Progress The issues is being worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants