feat: comments marked as decisions, on top of the ticket and searchable
Whoever can change the ticket flags a comment as a decision (new event
CommentDecisionMarkedEvent on the comment). The ticket page lists its
decisions above the description, with a link to the comment in the
conversation (`?comment=<id>` scrolls to it and points at it), and the
search palette finds them by their text across my projects.
API: markDecision / PUT-DELETE /api/comments/{id}/decision; Issue.decisions
and GET /api/issues/{issue}/decisions; decisions(projectId?, search) and
GET /api/projects/{project}/decisions, GET /api/me/decisions. MCP:
mark_decision, search_decisions, and get_issue includes them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
Param,
|
||||
Patch,
|
||||
Post,
|
||||
Put,
|
||||
} from '@nestjs/common';
|
||||
import { ApiOkResponse, ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||
import { User } from '@task-stream/api/identity/domain';
|
||||
@@ -54,6 +55,29 @@ export class CommentsController {
|
||||
return this.comments.react(me.id, commentId, body.emoji, body.on);
|
||||
}
|
||||
|
||||
@Put(':commentId/decision')
|
||||
@ApiOperation({
|
||||
summary: 'Mark a comment as a decision of its ticket',
|
||||
description:
|
||||
'Whoever can change the ticket. Decisions are shown above the ticket and searchable (GET …/decisions).',
|
||||
})
|
||||
@ApiOkResponse({ type: CommandResultDto })
|
||||
@ApiCommandErrors()
|
||||
markDecision(@CurrentUser() me: User, @Param('commentId') commentId: string) {
|
||||
return this.comments.markDecision(me.id, commentId, true);
|
||||
}
|
||||
|
||||
@Delete(':commentId/decision')
|
||||
@ApiOperation({ summary: 'It is no longer a decision' })
|
||||
@ApiOkResponse({ type: CommandResultDto })
|
||||
@ApiCommandErrors()
|
||||
unmarkDecision(
|
||||
@CurrentUser() me: User,
|
||||
@Param('commentId') commentId: string,
|
||||
) {
|
||||
return this.comments.markDecision(me.id, commentId, false);
|
||||
}
|
||||
|
||||
@Delete(':commentId')
|
||||
@ApiOperation({ summary: 'Delete a comment (author or project admin)' })
|
||||
@ApiOkResponse({ type: CommandResultDto })
|
||||
|
||||
Reference in New Issue
Block a user