feat: quick polls in comments that end in a decision
«📊 Añadir una encuesta» adds 2 to 6 options to a new comment. Members, viewers too, vote by clicking an option (one vote each, which they can change or take back) and see each option's votes as a bar. Whoever started it, or an admin, closes it with «Cerrar y decidir»: the most voted wins (none on a tie) and a «Decidido: …» reply marked as a decision shows above the ticket. Events of the comment (voted, closed). API: addComment(…, poll), votePoll, closePoll, Comment.poll; POST /api/comments/{id}/poll/vote and …/poll/close. MCP: add_comment poll, vote_poll, close_poll. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -379,6 +379,8 @@ export interface Comment {
|
||||
decision: boolean;
|
||||
/** Who marked it as a decision (null when it is not one). */
|
||||
decidedBy: UserRef | null;
|
||||
/** A quick poll in it, if any. */
|
||||
poll: CommentPoll | null;
|
||||
/** A conversation (top-level comment and its replies) that was settled. */
|
||||
resolved: boolean;
|
||||
/** Who settled it (null while open). */
|
||||
@@ -387,6 +389,14 @@ export interface Comment {
|
||||
editedAt: string | null;
|
||||
}
|
||||
|
||||
/** A quick poll in a comment: each option with who voted it. */
|
||||
export interface CommentPoll {
|
||||
options: { text: string; voters: UserRef[] }[];
|
||||
closed: boolean;
|
||||
/** Index of the winning option once closed (null on a tie). */
|
||||
winner: number | null;
|
||||
}
|
||||
|
||||
/** A decision found by its text, with its ticket. */
|
||||
export interface Decision {
|
||||
comment: Comment;
|
||||
|
||||
@@ -336,6 +336,18 @@ export abstract class CommentsGateway {
|
||||
issueId: string,
|
||||
body: string,
|
||||
replyTo?: string | null,
|
||||
/** A quick poll's options (2–6). */
|
||||
poll?: string[] | null,
|
||||
): Observable<CommandResult>;
|
||||
/** Votes in a comment's poll (null takes the vote back). */
|
||||
abstract votePoll(
|
||||
commentId: string,
|
||||
option: number | null,
|
||||
): Observable<CommandResult>;
|
||||
/** Closes a poll; with `decide`, its winner stays as a decision. */
|
||||
abstract closePoll(
|
||||
commentId: string,
|
||||
decide: boolean,
|
||||
): Observable<CommandResult>;
|
||||
abstract edit(commentId: string, body: string): Observable<CommandResult>;
|
||||
/** Adds (`on`) or takes back one's reaction. */
|
||||
|
||||
Reference in New Issue
Block a user