Skip to content

Conversation

Copy link

Copilot AI commented Feb 10, 2026

Enables comment owners to pin/unpin their comments. Pinned comments appear at the top of ticket activity, maintaining chronological order within pinned and unpinned groups.

Backend

  • Modified get_comments() query to order by is_pinned DESC, creation ASC
  • Uses existing is_pinned field from HD Ticket Comment DocType

Frontend

  • Added Pin/Unpin action to comment dropdown menu (owner-only)
  • Visual pin indicator (Lucide icon) with accessibility label
  • Toggle via frappe.client.set_value with toast feedback
  • Passed isPinned through activity pipeline from API to CommentBox

Tests

  • test_pinned_comments_appear_first() - verifies pinned comments sort before unpinned
  • test_multiple_pinned_comments_order() - verifies chronological ordering within groups
Original prompt

Implement a “pin comment” action for HD Ticket Comments so owners can pin/unpin their comments and pinned comments appear at the top of ticket activity. Details:

  • Use the existing is_pinned field in helpdesk/helpdesk/doctype/hd_ticket_comment/hd_ticket_comment.json (field label “Is pinned”).
  • Locate the computed property that gathers ticket activities and update it to return pinned comments first (preserve relative ordering within pinned and unpinned groups, preferably most-recent-first as today).
  • Add a “Pin” action alongside existing owner actions (edit/delete) in the ticket comment UI. When clicked, set is_pinned=1; allow unpinning (toggle) as appropriate.
  • Ensure permission checks: only the comment owner should see the pin/unpin action.
  • Update any server/API endpoints if required to persist the is_pinned change.
  • Add/adjust tests if the repo has existing tests for ticket activities or comment actions.
  • Manual verification: pinned comments appear at the top of ticket activity list and remain sticky across reloads.
    Issue context: Pin comments in Ticket #2871.

This pull request was created from Copilot chat.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add pin comment functionality for HD Ticket Comments Implement pin comment action for HD Ticket Comments Feb 10, 2026
Copilot AI requested a review from RitvikSardana February 10, 2026 01: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.

2 participants