Skip to content

[WIKI-509] feat: comment copy link option #7385

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

Merged
merged 6 commits into from
Jul 14, 2025

Conversation

aaryan610
Copy link
Member

@aaryan610 aaryan610 commented Jul 10, 2025

Description

This PR includes the following changes-

  1. Ability to copy the link to a work item comment.
  2. On page load, the comment scrolls to the center of the page and gets highlighted for a brief time period.
  3. Refactor the comment card and editor.

Type of Change

  • Feature (non-breaking change which adds functionality)

Media

Screen.Recording.2025-07-10.at.19.33.29.mov

Summary by CodeRabbit

  • New Features

    • Added the ability to copy direct links to individual comments, with feedback notifications for success or failure.
    • Introduced a contextual quick actions menu for comments, including options such as editing, copying links, toggling access, and deleting.
    • Enhanced comment card interface with improved display and editing modes.
    • Added support for smooth scrolling to comments via URL hash.
  • Improvements

    • Updated comment components for better modularity and maintainability.
    • Expanded translation support for new comment-related notifications across multiple languages.
  • Bug Fixes

    • Standardized error handling and notification messages for comment actions.

Copy link
Contributor

coderabbitai bot commented Jul 10, 2025

Walkthrough

This update refactors the comment card functionality by splitting the previous monolithic component into separate display, edit, and quick action components. It introduces a new custom hook for hash-based scrolling, adds a comment link copying feature, updates types and translation files for multiple languages, and adjusts related imports and props accordingly.

Changes

Files/Paths Change Summary
apps/web/ce/components/comments/comment-block.tsx Minor code cleanup: reordered hooks, added comments, changed conditional rendering from empty fragment to null.
apps/web/core/components/comments/card/display.tsx
apps/web/core/components/comments/card/edit-form.tsx
apps/web/core/components/comments/card/root.tsx
apps/web/core/components/comments/quick-actions.tsx
Added new modular components: CommentCardDisplay, CommentCardEditForm, CommentCard, and CommentQuickActions for improved separation of concerns and maintainability.
apps/web/core/components/comments/comment-card.tsx Removed the previous monolithic CommentCard component and its logic.
apps/web/core/components/comments/comments.tsx Updated to use new CommentCard path; added and passed new props showAccessSpecifier and showCopyLinkOption to each comment card.
apps/web/core/components/issues/issue-detail/issue-activity/activity-comment-root.tsx Updated import path for CommentCard; added and explicitly set showAccessSpecifier and showCopyLinkOption props.
apps/web/core/components/issues/issue-detail/issue-activity/helper.tsx Enhanced useCommentOperations hook: added copyCommentLink operation, refactored signatures, improved error handling, and updated toast messages.
packages/types/src/issues/activity/issue_comment.ts Updated TCommentsOperations type: added copyCommentLink method, simplified deleteCommentReaction signature.
packages/hooks/src/use-hash-scroll.ts
packages/hooks/src/index.ts
Introduced and exported a new useHashScroll custom hook for hash-based scrolling to elements.
packages/i18n/src/locales/.../translations.json (all language folders) Added new translation keys for comment link copy success and error messages under issue.comments.copy_link for all supported languages.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CommentCard
    participant CommentQuickActions
    participant useCommentOperations
    participant Clipboard
    participant Toast

    User->>CommentCard: Opens comment options
    CommentCard->>CommentQuickActions: Renders quick actions menu
    User->>CommentQuickActions: Clicks "Copy Link"
    CommentQuickActions->>useCommentOperations: copyCommentLink(commentId)
    useCommentOperations->>Clipboard: Copies link
    alt Success
        Clipboard-->>useCommentOperations: Success
        useCommentOperations->>Toast: Show "copy success"
    else Failure
        Clipboard-->>useCommentOperations: Failure
        useCommentOperations->>Toast: Show "copy error"
    end
Loading
sequenceDiagram
    participant User
    participant useHashScroll
    participant DOM

    User->>Browser: Navigates to URL with #commentId
    Browser->>useHashScroll: hashchange event
    useHashScroll->>DOM: scrollToElement(commentId)
Loading

Suggested labels

ready_to_merge

Suggested reviewers

  • sriramveeraghanta
  • prateekshourya29

Poem

A hop, a skip, a scroll to see,
Comments now shine modularly!
With links to copy, and hashes to jump,
Quick actions await with a thump-thump-thump.
In many tongues, the message is clear—
This bunny’s code brings feedback near! 🐇✨

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

Copy link

makeplane bot commented Jul 10, 2025

Pull Request Linked with Plane Work Items

Comment Automatically Generated by Plane

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 comments (1)
apps/web/core/components/issues/issue-detail/issue-activity/helper.tsx (1)

187-187: Critical: Incomplete dependency array in useMemo hook.

The useMemo dependency array is missing several dependencies that are used within the operations object, including issueDetails, projectDetails, currentUser, t (translation function), and various getter functions from the store hooks. This can cause stale closures where the operations object doesn't update when these dependencies change.

Add the missing dependencies to prevent stale closures:

-  }, [workspaceSlug, projectId, issueId, createComment, updateComment, uploadEditorAsset, removeComment]);
+  }, [
+    workspaceSlug, 
+    projectId, 
+    issueId, 
+    issueDetails,
+    projectDetails,
+    currentUser,
+    t,
+    createComment, 
+    updateComment, 
+    uploadEditorAsset, 
+    removeComment,
+    createCommentReaction,
+    removeCommentReaction,
+    getCommentReactionsByCommentId,
+    commentReactionsByUser,
+    getCommentReactionById,
+    getUserDetails
+  ]);
🧹 Nitpick comments (12)
packages/i18n/src/locales/en/translations.json (1)

888-891: Avoid message duplication—reuse the existing generic “link copied” keys

The catalogue already exposes similar strings (common.link_copied, common.link_copied_to_clipboard, etc.).
Adding another pair that differs only by the “Comment” prefix will fragment translations and burden all locale files.
Unless a comment-specific nuance is absolutely required, consider referencing the existing keys or hoisting these two into a shared namespace.

No functional issue, just a localisation-maintenance heads-up.

packages/i18n/src/locales/zh-TW/translations.json (1)

1048-1051: Prefer “留言” over “評論” for consistency

Throughout the file, the concept comment is translated as 留言 (e.g., issue.comments.placeholder, create/update/remove toasts).
The newly-added copy-link messages switch to 評論, which breaks the established terminology and may confuse users.

-        "success": "評論連結已複製到剪貼簿",
-        "error": "複製評論連結時出錯。請稍後再試。"
+        "success": "留言連結已複製到剪貼簿",
+        "error": "複製留言連結時出錯。請稍後再試。"

Aligning the wording keeps UX copy coherent across screens.
No other changes required.

packages/i18n/src/locales/vi-VN/translations.json (1)

1045-1049: Replace “clipboard” with the localized term “bảng tạm” for consistency.

Everywhere else in this locale, “clipboard” is translated as “bảng tạm” (e.g., keys 731–735, 913). Keeping the wording consistent avoids confusing users and improves the overall polish of the Vietnamese UI.

-        "success": "Liên kết bình luận đã được sao chép vào clipboard",
+        "success": "Liên kết bình luận đã được sao chép vào bảng tạm",
packages/i18n/src/locales/id/translations.json (1)

1046-1048: Favor phrasing consistency with existing “link copied” toasts

Other clipboard-success strings in this locale (e.g., common.link_copied_to_clipboard, common.link_copied) omit the word “berhasil”. Aligning the tone across all success toasts keeps the UX consistent.

-        "success": "Tautan komentar berhasil disalin ke clipboard",
+        "success": "Tautan komentar disalin ke clipboard",
packages/i18n/src/locales/pt-BR/translations.json (1)

1048-1050: Finalize punctuation for consistency with neighboring messages

Most success/error toast strings in this file terminate with a period.
"success" under "upload" (line 1046) follows that pattern, while the newly-added "copy_link.success" string omits it. Add the trailing period to align with the prevailing convention and avoid style drift.

-        "success": "Link do comentário copiado para a área de transferência",
+        "success": "Link do comentário copiado para a área de transferência.",
packages/i18n/src/locales/zh-CN/translations.json (1)

1047-1049: Keep error-message wording consistent with neighbouring strings

Other error messages in the same "issue.comments" block use “…请稍后重试。”.
For consistency, replace “再试” with “重试”.

-        "error": "复制评论链接时出错。请稍后再试。"
+        "error": "复制评论链接时出错。请稍后重试。"
packages/i18n/src/locales/ko/translations.json (1)

1046-1049: Unify error-message wording & spacing with existing strings

Most other error messages use the phrasing 다시 시도해주세요. (no space between 시도해 and 주세요).
The newly-added copy-link error has an extra space: 다시 시도해 주세요. – this is inconsistent and will look jarring in the UI.

-        "error": "댓글 링크 복사 중 오류가 발생했습니다. 나중에 다시 시도해 주세요."
+        "error": "댓글 링크 복사 중 오류가 발생했습니다. 나중에 다시 시도해주세요."
packages/i18n/src/locales/ja/translations.json (1)

1047-1049: Nit: adjust particle for more natural Japanese

がクリップボードにコピーされました sounds slightly stilted compared with existing success toasts that use the direct-object particle . Consider:

-        "success": "コメントリンクがクリップボードにコピーされました",
+        "success": "コメントリンクをクリップボードにコピーしました",

(No functional impact – purely wording.)

packages/i18n/src/locales/pl/translations.json (1)

1048-1050: Prefer “skopiowano” / “linku” for style & grammar consistency

Elsewhere in this file the passive-voice form „skopiowano” is used (e.g. line 312: „Link do projektu skopiowano do schowka”).
Likewise, the genitive of link is „linku”, not „linka”. Updating keeps the wording uniform and grammatically correct.

         "copy_link": {
-        "success": "Link do komentarza skopiowany do schowka",
-        "error": "Błąd podczas kopiowania linka do komentarza. Spróbuj ponownie później."
+        "success": "Link do komentarza skopiowano do schowka",
+        "error": "Błąd podczas kopiowania linku do komentarza. Spróbuj ponownie później."
         }
packages/i18n/src/locales/ua/translations.json (1)

1048-1050: Unify clipboard-related phrasing with existing strings

Earlier messages (e.g. "link_copied_to_clipboard", line 733) use “до буфера обміну” and start error texts with “Не вдалося …”.
Keeping wording consistent across the locale prevents jarring UX.

-    "success": "Посилання на коментар скопійовано в буфер обміну",
-    "error": "Помилка при копіюванні посилання на коментар. Спробуйте пізніше."
+    "success": "Посилання на коментар скопійовано до буфера обміну",
+    "error": "Не вдалося скопіювати посилання на коментар. Спробуйте пізніше."
packages/i18n/src/locales/ro/translations.json (1)

1044-1049: Keep terminology & phrasing consistent with existing Romanian strings

Elsewhere in this file we translate “clipboard” as “memoria temporară” and we hyphen-separate “Link-ul”.
For coherence, tweak the new keys accordingly and align the error wording with the prevailing “Te rugăm să încerci din nou” pattern.

-        "success": "Linkul comentariului a fost copiat în clipboard",
-        "error": "Eroare la copierea linkului comentariului. Încercați din nou mai târziu."
+        "success": "Link-ul comentariului a fost copiat în memoria temporară",
+        "error": "Eroare la copierea link-ului comentariului. Te rugăm să încerci din nou mai târziu."
apps/web/core/components/issues/issue-detail/issue-activity/helper.tsx (1)

36-62: Consider making copyCommentLink async for better error handling.

The function currently doesn't return a Promise, which prevents callers from handling errors or knowing when the operation completes. Making it async would improve the API consistency with other operations.

Update the function signature and implementation:

-      copyCommentLink: (id) => {
+      copyCommentLink: async (id) => {
         if (!workspaceSlug || !issueDetails) return;
         try {
           const workItemLink = generateWorkItemLink({
             workspaceSlug,
             projectId: issueDetails.project_id,
             issueId,
             projectIdentifier: projectDetails?.identifier,
             sequenceId: issueDetails.sequence_id,
           });
           const commentLink = `${workItemLink}#comment-${id}`;
           await copyUrlToClipboard(commentLink);
           setToast({
             title: t("common.success"),
             type: TOAST_TYPE.SUCCESS,
             message: t("issue.comments.copy_link.success"),
           });
         } catch (error) {
           console.error("Error in copying comment link:", error);
           setToast({
             title: t("common.error.label"),
             type: TOAST_TYPE.ERROR,
             message: t("issue.comments.copy_link.error"),
           });
         }
       },
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5fbe411 and 34c67d3.

📒 Files selected for processing (30)
  • apps/web/ce/components/comments/comment-block.tsx (1 hunks)
  • apps/web/core/components/comments/card/display.tsx (1 hunks)
  • apps/web/core/components/comments/card/edit-form.tsx (1 hunks)
  • apps/web/core/components/comments/card/root.tsx (1 hunks)
  • apps/web/core/components/comments/comment-card.tsx (0 hunks)
  • apps/web/core/components/comments/comments.tsx (3 hunks)
  • apps/web/core/components/comments/quick-actions.tsx (1 hunks)
  • apps/web/core/components/issues/issue-detail/issue-activity/activity-comment-root.tsx (2 hunks)
  • apps/web/core/components/issues/issue-detail/issue-activity/helper.tsx (8 hunks)
  • apps/web/core/hooks/use-hash-scroll.ts (1 hunks)
  • packages/i18n/src/locales/cs/translations.json (1 hunks)
  • packages/i18n/src/locales/de/translations.json (1 hunks)
  • packages/i18n/src/locales/en/translations.json (1 hunks)
  • packages/i18n/src/locales/es/translations.json (1 hunks)
  • packages/i18n/src/locales/fr/translations.json (1 hunks)
  • packages/i18n/src/locales/id/translations.json (1 hunks)
  • packages/i18n/src/locales/it/translations.json (1 hunks)
  • packages/i18n/src/locales/ja/translations.json (1 hunks)
  • packages/i18n/src/locales/ko/translations.json (1 hunks)
  • packages/i18n/src/locales/pl/translations.json (1 hunks)
  • packages/i18n/src/locales/pt-BR/translations.json (1 hunks)
  • packages/i18n/src/locales/ro/translations.json (1 hunks)
  • packages/i18n/src/locales/ru/translations.json (1 hunks)
  • packages/i18n/src/locales/sk/translations.json (1 hunks)
  • packages/i18n/src/locales/tr-TR/translations.json (1 hunks)
  • packages/i18n/src/locales/ua/translations.json (1 hunks)
  • packages/i18n/src/locales/vi-VN/translations.json (1 hunks)
  • packages/i18n/src/locales/zh-CN/translations.json (1 hunks)
  • packages/i18n/src/locales/zh-TW/translations.json (1 hunks)
  • packages/types/src/issues/activity/issue_comment.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • apps/web/core/components/comments/comment-card.tsx
🧰 Additional context used
🧠 Learnings (4)
apps/web/core/components/issues/issue-detail/issue-activity/activity-comment-root.tsx (1)
Learnt from: mathalav55
PR: makeplane/plane#6107
File: web/ce/components/workspace-notifications/sidebar/notification-card/options/archive.tsx:11-14
Timestamp: 2024-11-28T07:02:54.664Z
Learning: When components are still located in `core`, it's appropriate for files to import them using `@/components/...`, and the migration to the new import paths is not necessary in such cases.
packages/i18n/src/locales/pl/translations.json (1)
Learnt from: janreges
PR: makeplane/plane#6743
File: packages/i18n/src/store/index.ts:160-161
Timestamp: 2025-03-11T19:42:41.769Z
Learning: In the Plane project, the file 'packages/i18n/src/store/index.ts' already includes support for Polish language translations with the case "pl".
apps/web/core/components/issues/issue-detail/issue-activity/helper.tsx (1)
Learnt from: vamsikrishnamathala
PR: makeplane/plane#7214
File: web/core/store/issue/helpers/base-issues.store.ts:117-117
Timestamp: 2025-06-16T07:23:39.497Z
Learning: In the updateIssueDates method of BaseIssuesStore (web/core/store/issue/helpers/base-issues.store.ts), the projectId parameter is intentionally made optional to support override implementations in subclasses. The base implementation requires projectId and includes an early return check, but making it optional allows derived classes to override the method with different parameter requirements.
packages/i18n/src/locales/cs/translations.json (1)
Learnt from: janreges
PR: makeplane/plane#6743
File: packages/i18n/src/store/index.ts:160-161
Timestamp: 2025-03-11T19:42:41.769Z
Learning: In the Plane project, the file 'packages/i18n/src/store/index.ts' already includes support for Polish language translations with the case "pl".
🧬 Code Graph Analysis (1)
apps/web/ce/components/comments/comment-block.tsx (1)
packages/i18n/src/hooks/use-translation.ts (1)
  • useTranslation (23-35)
⏰ 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). (1)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (32)
packages/i18n/src/locales/de/translations.json (1)

1044-1049: Translation entries look correct and consistent

The new copy_link.success/error messages are well-formed, use clear German phrasing, and fit the established JSON structure. No issues spotted.

packages/i18n/src/locales/es/translations.json (1)

1048-1052: LGTM! Spanish translations are accurate and well-structured.

The comment copy link translations are grammatically correct and appropriately placed within the "issue.comments" section. The success and error messages provide clear feedback to Spanish-speaking users.

apps/web/core/hooks/use-hash-scroll.ts (5)

4-12: Well-defined TypeScript interfaces.

The type definitions are clear and provide good structure for the hook's API. The return type clearly indicates what consumers can expect.


63-71: Robust hash parsing with good delimiter support.

The extractIdsFromHash function handles multiple delimiters well and includes proper string cleaning. The regex pattern and filtering logic are appropriate for parsing URL hash fragments.


77-81: Proper SSR safety check.

The getCurrentHash function correctly handles server-side rendering by checking for window availability and safely extracts the hash value.


84-117: Well-structured effect with proper cleanup.

The useEffect implementation correctly:

  • Handles initial load and hash changes
  • Includes proper event listener cleanup
  • Has appropriate dependencies in the dependency array
  • Manages state updates safely

The effect properly responds to route changes via the pathname dependency, which is important for SPA navigation.


120-135: Clear and well-documented return interface.

The return object provides a clean API with descriptive JSDoc comments. The interface makes it easy for consumers to understand what each property represents.

packages/i18n/src/locales/tr-TR/translations.json (1)

1046-1052: All locale JSON files validated successfully

The tr-TR translations for upload and copy_link are clear, and all JSON files parse without errors. Nothing else to address here.

packages/i18n/src/locales/it/translations.json (1)

1043-1046: Add the same issue.comments.copy_link keys to every base/other locale for parity

The Italian strings look correct, but make sure the equivalent keys are present in the default (en) locale and any other supported locales; otherwise the UI will fall back or render raw keys for those languages.
No action needed in this file.

packages/i18n/src/locales/ru/translations.json (1)

1047-1051: LGTM! Well-structured Russian translations for the copy link feature.

The translation keys follow the established pattern and provide clear, contextually appropriate feedback messages for both success and error scenarios of the comment copy link functionality.

apps/web/core/components/issues/issue-detail/issue-activity/activity-comment-root.tsx (2)

7-7: LGTM! Import path correctly updated for the refactored component structure.

The import path change from "@/components/comments/comment-card" to "@/components/comments/card/root" aligns with the component modularization described in the PR.


60-62: LGTM! Good prop handling for the new comment features.

The explicit boolean conversion !!showAccessSpecifier improves type safety, and the new showCopyLinkOption prop correctly enables the copy link functionality. The implicit true value is appropriate since this feature should be available in the issue activity context.

packages/i18n/src/locales/ko/translations.json (1)

1046-1047: Sanity-check trailing comma after "upload" block

Line 1046 closes the "upload" object and adds a comma.
If the "copy_link" block is the final property under "comments", that comma will break the JSON. Double-check the lines that follow – the safest option is:

      },                // keep comma only when more keys follow
      "copy_link": { }

Run a quick jq . translations.json to ensure the file still parses.

packages/i18n/src/locales/ja/translations.json (1)

1047-1049: All locale bundles include copy_link translations
Verified that every translations.json file defines both issue.comments.copy_link.success and issue.comments.copy_link.error. No missing keys were detected.

packages/i18n/src/locales/cs/translations.json (1)

1044-1048: Copy-link strings LGTM

The added copy_link translations are grammatically correct, follow existing wording style, and keep the JSON structure valid. No further changes required.

packages/i18n/src/locales/fr/translations.json (1)

1046-1050: Copy-link translations look good.

Both success and error messages are idiomatic, consistent with earlier “Lien … copié dans le presse-papiers” patterns, and punctuation matches the surrounding file. No further action needed.

apps/web/ce/components/comments/comment-block.tsx (1)

20-29: Minor internal tidy-up acknowledged.

• Added section comments improve readability.
• Moving useTranslation lower and returning null instead of an empty fragment are harmless behavioural no-ops and slightly clearer.

Nothing else to flag.

packages/i18n/src/locales/sk/translations.json (1)

1047-1051: Translation strings added correctly for Slovak locale.

The new copy_link translations under issue.comments are well-structured and follow the existing pattern. The Slovak translations appear appropriate for success and error scenarios when copying comment links.

apps/web/core/components/comments/comments.tsx (4)

10-10: Import path updated correctly.

The import path change from "./comment-card" to "./card/root" reflects the component refactoring and modularization.


21-22: New props added with appropriate typing.

The optional boolean props showAccessSpecifier and showCopyLinkOption are well-named and properly typed, enabling conditional feature rendering.


26-35: Props destructured cleanly with sensible defaults.

The destructuring includes appropriate default values (false) for the new props, ensuring backward compatibility while enabling the new features.


74-75: Props correctly passed down to CommentCard.

The new props are properly passed to each CommentCard instance, enabling the conditional rendering of access specifier and copy link features.

packages/types/src/issues/activity/issue_comment.ts (2)

44-44: New copyCommentLink method added correctly.

The method signature is appropriate for copying comment links - takes a commentId string parameter and returns void since it's a side-effect operation.


50-50: deleteCommentReaction signature update verified
All occurrences of deleteCommentReaction now use two parameters (commentId, reactionEmoji), matching the updated type definition. No references to a third userReactions parameter remain.

apps/web/core/components/comments/card/root.tsx (3)

1-25: Well-structured component imports and type definitions.

The imports are organized logically and the TCommentCard type interface is comprehensive with appropriate optional properties.


26-44: Clean component structure with proper state management.

The component uses appropriate React patterns:

  • Proper destructuring with defaults
  • useRef for editor reference
  • useState for editing mode
  • Early return for null checks

45-85: Excellent composition pattern implementation.

The component effectively composes smaller components (CommentCardDisplay, CommentCardEditForm, CommentQuickActions) and manages the editing state transitions cleanly. The conditional rendering logic is clear and maintainable.

apps/web/core/components/comments/quick-actions.tsx (3)

1-33: Excellent component setup and permissions logic.

The component structure is well-organized with proper imports, type definitions, and clear permission derivation based on user authorization.


34-75: Well-structured menu items with proper optimization.

The useMemo optimization is appropriate here and the menu item configuration is clean and maintainable. Each item has proper conditional rendering logic and integrates well with the translation system.


77-113: Clean menu rendering with proper accessibility.

The menu rendering logic is excellent with:

  • Proper conditional rendering based on shouldRender
  • Good use of styling utilities
  • Accessible menu structure
  • Proper icon and text rendering
apps/web/core/components/comments/card/display.tsx (1)

1-82: Well-structured component with proper React patterns.

The component correctly implements hash-based comment highlighting with appropriate cleanup, conditional rendering of access specifiers, and proper integration with MobX for reactive updates. The timeout cleanup in the useEffect hook prevents memory leaks, and the component structure follows React best practices.

apps/web/core/components/comments/card/edit-form.tsx (1)

1-130: Comprehensive edit form implementation with proper form handling.

The component effectively combines react-hook-form with the rich text editor, implements proper keyboard shortcuts, handles file uploads, and manages form states correctly. The async submission flow and button state management are well implemented.

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 (4)
packages/hooks/src/use-hash-scroll.ts (4)

15-21: Fix JSDoc parameter documentation mismatch.

The JSDoc says @param {TArgs} args but the function uses destructured parameters. Update the documentation to match the actual implementation.

 /**
  * Custom hook for handling hash-based scrolling to a specific element
  * Supports multiple IDs in URL hash (comma-separated, space-separated, or other delimiters)
  *
- * @param {TArgs} args - The ID of the element to scroll to
+ * @param {TArgs} args - Configuration object containing elementId, pathname, and optional scrollDelay
  * @returns {TReturnType} Object containing hash match status and scroll function
  */

49-50: Consider using a more appropriate error handling approach.

Using console.warn for production errors might not be ideal. Consider using a proper error reporting mechanism or making the error handling configurable.

   } catch (error) {
-    console.warn("Hash scroll error:", error);
+    // Consider using a proper error reporting mechanism
+    if (process.env.NODE_ENV === 'development') {
+      console.warn("Hash scroll error:", error);
+    }
     return false;
   }

61-69: Optimize regex compilation for better performance.

The regex pattern is being created on every function call. Consider extracting it to a constant for better performance.

+const DELIMITER_REGEX = /[,\s|;]+/;
+
 const extractIdsFromHash = (hashString: string | null): string[] => {
   if (!hashString) return [];

   // Split by common delimiters and clean up
   return hashString
-    .split(/[,\s|;]+/) // Split by comma, space, pipe, or semicolon
+    .split(DELIMITER_REGEX) // Split by comma, space, pipe, or semicolon
     .map((id) => id.trim()) // Remove whitespace
     .filter((id) => id.length > 0); // Remove empty strings
 };

23-23: Add input validation for scrollDelay.

The hook doesn't validate that scrollDelay is a positive number, which could cause unexpected behavior.

-const { elementId, pathname, scrollDelay = 200 } = args;
+const { elementId, pathname, scrollDelay = 200 } = args;
+
+// Validate scrollDelay is a positive number
+const validScrollDelay = typeof scrollDelay === 'number' && scrollDelay >= 0 ? scrollDelay : 200;

Then use validScrollDelay instead of scrollDelay throughout the hook.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 80d079a and 43000a5.

📒 Files selected for processing (3)
  • apps/web/core/components/comments/card/display.tsx (1 hunks)
  • packages/hooks/src/index.ts (1 hunks)
  • packages/hooks/src/use-hash-scroll.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/hooks/src/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/web/core/components/comments/card/display.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). (1)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
packages/hooks/src/use-hash-scroll.ts (1)

82-115: LGTM! Well-structured effect with proper cleanup.

The useEffect properly handles hash changes, initial load, and cleanup. The dependency array correctly includes pathname to handle route changes, and the event listener cleanup is properly implemented.

@sriramveeraghanta sriramveeraghanta merged commit 2c70c1a into preview Jul 14, 2025
5 of 6 checks passed
@sriramveeraghanta sriramveeraghanta deleted the feat/comment-copy-link branch July 14, 2025 11:37
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.

3 participants