Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WEB-2629] chore: workspace draft issue ux copy updated #5825

Merged
merged 3 commits into from
Oct 14, 2024

Conversation

anmolsinghbhatia
Copy link
Collaborator

@anmolsinghbhatia anmolsinghbhatia commented Oct 14, 2024

Reference:

[WEB-2629]

Summary by CodeRabbit

Release Notes

  • New Features

    • Updated text across various components to enhance clarity and user experience, including changes to dialog titles and button labels.
    • Improved messaging for success notifications related to draft creation and deletion.
  • Bug Fixes

    • Simplified deletion success messages and clarified modal content regarding draft deletion.
  • Documentation

    • Enhanced empty state messaging for draft issues to provide clearer guidance for users.

Copy link
Contributor

coderabbitai bot commented Oct 14, 2024

Walkthrough

This pull request introduces several text updates across multiple components related to draft issues in the application. Changes include modifications to button labels, dialog titles, and messages displayed to users, enhancing clarity and consistency in terminology. Notably, the WorkspaceDraftHeader, ConfirmIssueDiscard, and various modal components have updated text to better reflect their functionality. Additionally, some props and logic have been simplified, particularly in the WorkspaceDraftIssueDeleteIssueModal, while the overall structure and functionality of the components remain largely unchanged.

Changes

File Path Change Summary
web/app/[workspaceSlug]/(projects)/drafts/header.tsx Updated breadcrumb label from "Draft" to "Drafts" and button text from "Draft issue" to "Draft an issue".
web/core/components/issues/confirm-issue-discard.tsx Changed dialog title from "Draft Issue" to "Save this draft?" and updated explanatory text and button labels.
web/core/components/issues/issue-modal/base.tsx Modified success toast messages and added error handling in issue creation and update functions.
web/core/components/issues/issue-modal/draft-issue-layout.tsx Updated success message for draft creation from "Draft Issue created successfully." to "Draft created."
web/core/components/issues/issue-modal/form.tsx Changed header from "Create draft" to "Create a draft" and updated button texts for saving drafts.
web/core/components/issues/workspace-draft/delete-modal.tsx Removed isSubIssue prop and simplified deletion success message to "draft deleted." Updated modal title.
web/core/components/issues/workspace-draft/draft-issue-block.tsx Changed menu item label from "Move to issues" to "Move to project".
web/core/constants/empty-state.ts Updated title and description for WORKSPACE_DRAFT_ISSUES entry, including changes to button text.

Possibly related PRs

Suggested labels

🌐frontend, 🧹chore, 🌟improvement

Suggested reviewers

  • sriramveeraghanta
  • SatishGandham

Poem

In the realm of drafts where ideas play,
A little tweak brightens the day.
"Drafts" now shine, with buttons so clear,
A hop, a skip, our goals draw near.
With messages sweet, like carrots in bloom,
We craft our stories, dispelling the gloom! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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 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.

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: 2

🧹 Outside diff range and nitpick comments (5)
web/core/components/issues/workspace-draft/delete-modal.tsx (1)

68-68: Consider capitalizing the success message

The simplified success message "draft deleted." is concise and aligns well with the component's focus on drafts. However, to improve readability and adhere to common conventions, consider capitalizing the first letter of the message.

Suggested change:

-            message: `draft deleted.`,
+            message: `Draft deleted.`,
web/core/components/issues/confirm-issue-discard.tsx (1)

67-69: Clear and informative description

The updated description provides valuable context about the purpose of saving a draft. It effectively communicates the benefit to the user.

Consider removing the extra space after "later." on line 68:

-                          You can save this issue to Drafts so you can come back to it later.{" "}
+                          You can save this issue to Drafts so you can come back to it later.
web/core/components/issues/workspace-draft/draft-issue-block.tsx (1)

77-77: LGTM! Consider updating the menu item key for consistency.

The change from "Move to issues" to "Move to project" improves clarity for users. This update aligns well with the PR objectives of updating UX copy.

For consistency, consider updating the menu item key from "move-to-issues" to "move-to-project". This would make the key match the new title:

-      key: "move-to-issues",
+      key: "move-to-project",
       title: "Move to project",
web/core/components/issues/issue-modal/base.tsx (1)

209-209: Remove unnecessary trailing space in success message

The success message for creating a regular issue now ends with an extra space. This is likely unintentional and should be removed for consistency.

Consider updating the line as follows:

-        message: `${is_draft_issue ? "Draft created." : "Issue created successfully."} `,
+        message: `${is_draft_issue ? "Draft created." : "Issue created successfully."}`,
web/core/components/issues/issue-modal/form.tsx (1)

425-425: LGTM: Improved button text clarity with a minor suggestion

The change from "Create draft issue" to "Save to Drafts" is an improvement. It clarifies the action being performed and aligns better with common draft functionality in applications. This update should enhance user understanding of where their work will be stored.

Consider capitalizing "Drafts" for consistency with UI standards:

-                      ? "Save to Drafts"
+                      ? "Save to Drafts"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 4b450f8 and baa49bc.

📒 Files selected for processing (8)
  • web/app/[workspaceSlug]/(projects)/drafts/header.tsx (2 hunks)
  • web/core/components/issues/confirm-issue-discard.tsx (2 hunks)
  • web/core/components/issues/issue-modal/base.tsx (1 hunks)
  • web/core/components/issues/issue-modal/draft-issue-layout.tsx (1 hunks)
  • web/core/components/issues/issue-modal/form.tsx (2 hunks)
  • web/core/components/issues/workspace-draft/delete-modal.tsx (3 hunks)
  • web/core/components/issues/workspace-draft/draft-issue-block.tsx (1 hunks)
  • web/core/constants/empty-state.ts (1 hunks)
🧰 Additional context used
🪛 GitHub Check: lint-web
web/core/components/issues/workspace-draft/delete-modal.tsx

[failure] 93-93:
' can be escaped with &apos;, &lsquo;, &#39;, &rsquo;

🔇 Additional comments (10)
web/app/[workspaceSlug]/(projects)/drafts/header.tsx (2)

44-44: LGTM: Improved label consistency

The change from "Draft" to "Drafts" in the breadcrumb label improves consistency with the component name and better represents the presence of multiple draft issues. This minor text update enhances the user interface without affecting functionality.


63-63: LGTM: Enhanced button text clarity

The change from "Draft issue" to "Draft an issue" improves the grammatical structure and clarity of the button text. This minor update enhances the user experience by making the action more explicit, aligning well with the PR objective of updating UX copy.

web/core/components/issues/workspace-draft/delete-modal.tsx (2)

11-11: LGTM: Import statement cleanup

The removal of the useProject hook from the import statement is consistent with the changes in the component. This cleanup helps maintain code clarity by keeping only the necessary imports.


22-22: LGTM: Prop removal consistent with type changes

The removal of the isSubIssue prop from the destructured props is consistent with the changes to the Props type. This simplification improves the component's interface.

To ensure this change doesn't break any parent components, please run the following script:

✅ Verification successful

Verified: No remaining usages of isSubIssue prop found

The search for the isSubIssue prop in WorkspaceDraftIssueDeleteIssueModal did not return any results. This change is safe and does not affect any parent components.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining usage of isSubIssue prop with WorkspaceDraftIssueDeleteIssueModal

# Test: Search for components passing isSubIssue to WorkspaceDraftIssueDeleteIssueModal
rg --type typescript --type tsx 'WorkspaceDraftIssueDeleteIssueModal.*isSubIssue'

Length of output: 118


Script:

#!/bin/bash
# Description: Check for any remaining usage of isSubIssue prop with WorkspaceDraftIssueDeleteIssueModal

# Corrected Test: Search for components passing isSubIssue to WorkspaceDraftIssueDeleteIssueModal
rg --type ts --type tsx 'WorkspaceDraftIssueDeleteIssueModal.*isSubIssue'

Length of output: 103


Script:

#!/bin/bash
# Description: Check for any remaining usage of isSubIssue prop with WorkspaceDraftIssueDeleteIssueModal

# Corrected Test: Search for components passing isSubIssue to WorkspaceDraftIssueDeleteIssueModal
rg 'WorkspaceDraftIssueDeleteIssueModal.*isSubIssue' --glob '*.ts' --glob '*.tsx'

Length of output: 83

web/core/components/issues/confirm-issue-discard.tsx (2)

64-64: Improved dialog title clarity

The change from "Draft Issue" to "Save this draft?" enhances the user's understanding of the dialog's purpose. It's more action-oriented and clearly communicates the intended action.


Line range hint 1-95: Overall improvement in UX copy

The changes in this file significantly improve the clarity and consistency of the user interface for saving draft issues. The updated dialog title, description, and button text work together to provide a clearer understanding of the action being taken.

These updates align well with the PR objective of improving the workspace draft issue UX copy. Great job on enhancing the user experience!

web/core/components/issues/issue-modal/draft-issue-layout.tsx (1)

107-107: Improved UX copy for draft creation success message

The change from "Draft Issue created successfully." to "Draft created." is a good improvement. It makes the success message more concise while maintaining clarity. This update aligns well with the PR objective of enhancing UX copy.

web/core/components/issues/issue-modal/form.tsx (2)

275-275: LGTM: Improved header text clarity

The change from "Create draft" to "Create a draft" improves the grammar and readability of the header text. This minor update enhances the user experience by making the text more natural and easier to understand.


426-426: LGTM: Improved consistency in button text

The change from "Create" to "Save" for the general save button improves consistency with standard UI terminology. This update aligns well with the "Save to Drafts" option and provides a more universally understood action for forms. The change enhances the overall consistency of the user interface.

web/core/constants/empty-state.ts (1)

764-768: LGTM! Improved empty state messaging for workspace draft issues.

The changes to the WORKSPACE_DRAFT_ISSUES entry enhance the user experience:

  1. The updated title "Half-written issues, and soon, comments will show up here." is more descriptive and inclusive, mentioning both issues and comments.
  2. The new description provides clearer guidance and encourages user interaction: "To try this out, start adding an issue and leave it mid-way or create your first draft below. 😉"
  3. The primary button text "Create your first draft" is more action-oriented and aligns better with the empty state context.

These modifications should help users better understand the purpose of this section and encourage them to interact with the draft issues feature.

Comment on lines +92 to +93
title="Delete draft"
content={<>Are you sure you want to delete this draft? This can't be undone.</>}
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

LGTM: Improved clarity in modal title and content

The updates to the modal title and content accurately reflect the action of deleting a draft, which is consistent with the component's new focus. The content clearly communicates the permanence of the action, which is important for user awareness.

There's a minor issue with the apostrophe in "can't" as flagged by the static analysis tool. To resolve this, please apply the following change:

-      content={<>Are you sure you want to delete this draft? This can't be undone.</>}
+      content={<>Are you sure you want to delete this draft? This can&apos;t be undone.</>}

This change will ensure proper rendering of the apostrophe across different environments.

📝 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
title="Delete draft"
content={<>Are you sure you want to delete this draft? This can't be undone.</>}
title="Delete draft"
content={<>Are you sure you want to delete this draft? This can&apos;t be undone.</>}
🧰 Tools
🪛 GitHub Check: lint-web

[failure] 93-93:
' can be escaped with &apos;, &lsquo;, &#39;, &rsquo;

@@ -80,7 +82,7 @@ export const ConfirmIssueDiscard: React.FC<Props> = (props) => {
Cancel
</Button>
<Button variant="primary" size="sm" onClick={handleDeletion} loading={isLoading}>
{isLoading ? "Saving" : "Save draft"}
{isLoading ? "Saving" : "Save to Drafts"}
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Inconsistent Capitalization of "Drafts" in User-Facing Text

The shell script results indicate that "Drafts" is used inconsistently across various user-facing components and messages. To ensure a uniform user experience, please update all instances of "draft" to "Drafts" in user interface elements and documentation.

  • Update button texts, messages, and labels to use "Drafts" consistently.
  • Review and adjust dialog titles and descriptions to match the new capitalization.
🔗 Analysis chain

Consistent button text

The change from "Save draft" to "Save to Drafts" aligns well with the updated dialog title and description. It clearly indicates the action and destination of the draft.

To ensure consistency across the application, please verify that "Drafts" is capitalized in other relevant components and documentation. Run the following script to check for inconsistencies:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for inconsistent usage of "drafts" vs "Drafts"

# Test: Search for variations of "draft" or "drafts" (case-insensitive)
rg -i '\bdrafts?\b' --type tsx --type ts

Length of output: 70


Script:

#!/bin/bash
# Description: Check for inconsistent usage of "drafts" vs "Drafts"

# Test: Search for variations of "draft" or "drafts" (case-insensitive) in .ts and .tsx files
rg -i '\bdrafts?\b' -g '*.ts' -g '*.tsx'

Length of output: 16708

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants