Skip to content

Conversation

@AnujChhikara
Copy link
Contributor

@AnujChhikara AnujChhikara commented Jun 10, 2025

Date: 10 June 2025

Developer Name: @AnujChhikara


Issue Ticket Number

Description

  • This PR addresses the inconsistency in task status display on the extension request card. Previously, completed tasks were shown with the status "COMPLETED". To align with our standardized terminology, this PR updates the display logic to show "DONE" for all completed tasks.
  • I have made changes for both without and dev flag as both use different component and we don't want to miss this change in dev flag component .

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

Screenshot 1
brave_EwfcEY0V1j.mp4

Test Coverage

Screenshot 1

image
image

Additional Notes

Description by Korbit AI

What change is being made?

Replace the task status "COMPLETED" with "DONE" in the extension request card display logic and associated tests.

Why are these changes being made?

This change aligns the task status in the interface with user expectations by using a more conventional and easily understood term "DONE" instead of "COMPLETED", thus improving user interpretation of task statuses. The update is reflected across the relevant components and test cases to ensure consistent behavior and display.

Is this description stale? Ask me to generate a new description by commenting /korbit-generate-pr-description

@cloudflare-workers-and-pages
Copy link

Deploying dashboard-rds with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0271393
Status: ✅  Deploy successful!
Preview URL: https://81bf3001.dashboard-rds.pages.dev
Branch Preview URL: https://refactor-replace-complete-wi.dashboard-rds.pages.dev

View logs

@coderabbitai
Copy link

coderabbitai bot commented Jun 10, 2025

Summary by CodeRabbit

  • New Features
    • Task status labeled as "COMPLETED" is now displayed as "DONE" in relevant screens.
  • Bug Fixes
    • Improved reliability of toast notification display after approving a task request.
  • Tests
    • Added test coverage for tasks with "COMPLETED" status, ensuring correct UI display.
    • Enhanced test reliability by explicitly waiting for toast notifications.
  • Chores
    • Introduced new mock data for tasks and extension requests with "COMPLETED" status.

Walkthrough

The changes introduce support for the "COMPLETED" task status across the application. Mock data for a completed task and its related extension request was added. The UI logic in components and extension requests scripts now normalizes "COMPLETED" to display as "DONE". Corresponding test cases and mock data handling were updated to validate this scenario.

Changes

File(s) Change Summary
mock-data/tasks/index.js, mock-data/extension-requests/index.js Added new mock objects: taskCompleted and extensionRequestsTaskCompleted; updated exports.
components/request-card/script.js, extension-requests/script.js Modified task status display logic: "COMPLETED" is now shown as "DONE".
__tests__/extension-requests/extension-requests.test.js Enhanced tests: added scenarios for tasks with status "COMPLETED" and updated mock data handling.
__tests__/task-requests/task-requestDetails.test.js Improved test reliability by explicitly waiting for toast visibility after approving a request.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI
    participant MockServer
    participant Component

    User->>UI: Navigates to extension request page
    UI->>MockServer: Requests task details (with taskId)
    MockServer-->>UI: Responds with taskCompleted data (status: "COMPLETED")
    UI->>Component: Passes task status
    Component->>Component: Normalizes status ("COMPLETED" → "DONE")
    Component-->>UI: Renders status as "DONE"
    UI-->>User: Displays extension request card with status "DONE"
Loading

Poem

A task once marked as "COMPLETED"
Now shines as "DONE," not defeated!
With mock data in tow,
And tests all aglow,
The UI hops forward, quite fleet-ed!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@AnujChhikara AnujChhikara self-assigned this Jun 10, 2025
Copy link

@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: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 80ed80f and 0271393.

📒 Files selected for processing (6)
  • __tests__/extension-requests/extension-requests.test.js (5 hunks)
  • __tests__/task-requests/task-requestDetails.test.js (1 hunks)
  • components/request-card/script.js (1 hunks)
  • extension-requests/script.js (1 hunks)
  • mock-data/extension-requests/index.js (2 hunks)
  • mock-data/tasks/index.js (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
__tests__/extension-requests/extension-requests.test.js (3)
mock-data/constants.js (2)
  • STAGING_API_URL (1-1)
  • LOCAL_TEST_PAGE_URL (2-2)
mock-data/tasks/index.js (1)
  • taskCompleted (94-118)
mock-data/extension-requests/index.js (1)
  • extensionRequestsTaskCompleted (221-237)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build-test (22.x)
🔇 Additional comments (8)
__tests__/task-requests/task-requestDetails.test.js (1)

426-428: LGTM! Excellent test reliability improvement.

Adding the explicit wait for toast visibility prevents potential race conditions and makes the test more robust. This ensures the toast component is fully rendered before proceeding with assertions.

mock-data/extension-requests/index.js (1)

221-247: LGTM! Mock data structure is consistent and well-formed.

The new extensionRequestsTaskCompleted mock object follows the established patterns and provides the necessary data structure for testing extension requests related to completed tasks.

mock-data/tasks/index.js (1)

94-124: LGTM! Mock data correctly represents a completed task.

The taskCompleted mock object is well-structured with logical field values (100% completion, "COMPLETED" status) that properly support testing the status normalization feature.

components/request-card/script.js (1)

392-395: LGTM! Status normalization logic is correctly implemented.

The conditional check properly normalizes the "COMPLETED" status to "DONE" for consistent UI display. The variable scope change from const to let is necessary and appropriate for the reassignment.

extension-requests/script.js (1)

1434-1437: LGTM! Consistent status normalization across components.

The implementation matches the logic in components/request-card/script.js, ensuring uniform behavior when displaying task status across different parts of the application. This consistency is crucial for maintaining a coherent user experience.

__tests__/extension-requests/extension-requests.test.js (3)

10-10: LGTM: Mock data imports properly added

The imports for extensionRequestsTaskCompleted and taskCompleted are correctly added and follow the existing import patterns.

Also applies to: 24-28


143-155: LGTM: Network interception for COMPLETED task status

The network interception setup correctly handles the specific task ID and returns the appropriate mock data for the COMPLETED status scenario.


381-396: LGTM: Extension requests network interception setup

The network interception properly handles both dev and non-dev flag scenarios for the extension requests filtered by task ID and status.

Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Functionality Inconsistent Task Status Value ▹ view
Functionality Inconsistent Status Transformation ▹ view
Files scanned
File Path Reviewed
mock-data/tasks/index.js
mock-data/extension-requests/index.js
components/request-card/script.js
extension-requests/script.js

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

Copy link
Contributor

@pankajjs pankajjs left a comment

Choose a reason for hiding this comment

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

LGTM

@AnujChhikara AnujChhikara changed the title Fix: replace COMPLETED task status with Done in extension request card fix(#1011): update extension request card status from 'Completed' to 'Done' Aug 28, 2025
@RealDevSquad RealDevSquad deleted a comment from MayankBansal12 Sep 2, 2025
@AnujChhikara AnujChhikara deleted the refactor/replace-complete-with-done branch September 17, 2025 19:51
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.

Replace "COMPLETED" with "DONE" status in Extension Request card

3 participants