Skip to content

Comment Reaction API #74767

Closed
Closed

Description

@rebornix

The Comments API is stablized now, the next step is adding comment reaction support. To align with patterns we use in the Comments API, the new proposal now consists of two parts

Firstly, every comment can have a reactions property

interface Comment {
    reactions?: CommentReaction[];
}

interface CommentReaction {
	readonly label: string;
	readonly iconPath: string | Uri;
	readonly count: number;
	readonly authorHasReacted: boolean;
}

CommentReaction will be displayed under the comment body if count > 0 and iconPath is set properly.

To interact with the comments, extensions should register a CommentReactionHandler, which implements toggleReaction under the hood.

export interface CommentReactionHandler {
     toggleReaction(comment: Comment, reaction: CommentReaction): Promise<void>;
}

export interface CommentController {
    reactionHandler?: CommentReactionHandler;
}

Activity

  1. added this to the June 2019 milestone on Jun 3, 2019
  2. rebornix commented on Jun 3, 2019

    @rebornix
    ContributorAuthor

    As we discussed offline, the handler can be simplified to

    export interface CommentController {
        reactionHandler?: (comment: Comment, reaction: CommentReaction) => Promise<void>;
    }
  3. rebornix commented on Jun 24, 2019

    @rebornix
    ContributorAuthor

    Done.

  4. locked and limited conversation to collaborators on Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions