Skip to content

Comments

Show parsed ticket IDs in /list output#60

Merged
WZ merged 1 commit intomainfrom
codex/list-show-ticket-ids
Feb 20, 2026
Merged

Show parsed ticket IDs in /list output#60
WZ merged 1 commit intomainfrom
codex/list-show-ticket-ids

Conversation

@WZ
Copy link
Owner

@WZ WZ commented Feb 20, 2026

What changed

  • /list now displays parsed ticket IDs from work_items.ticket_ids when present
  • Avoids duplicate prefixes when description already starts with the same [ticket] prefix
  • Keeps existing formatting for items without ticket IDs

Tests

  • Added unit tests for list description formatting and duplicate-prefix handling
  • go test ./...

Copilot AI review requested due to automatic review settings February 20, 2026 23:44
@WZ WZ merged commit 80a1468 into main Feb 20, 2026
3 checks passed
@WZ WZ deleted the codex/list-show-ticket-ids branch February 20, 2026 23:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Slack /list rendering to display parsed ticket IDs (from work_items.ticket_ids) as a [id1,id2] prefix on each item, while avoiding duplicate prefixes when the description already starts with the same ticket bracket.

Changes:

  • Update /list item rendering to use a ticket-aware description formatter.
  • Add helper functions to canonicalize ticket ID lists and detect leading [tickets] prefixes to prevent duplication.
  • Add unit tests covering list description formatting and duplicate-prefix behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
internal/integrations/slack/slack.go Renders /list items using formatItemDescriptionForList, with canonicalization and leading-prefix detection.
internal/integrations/slack/slack_logic_test.go Adds unit tests for ticket-prefix formatting and duplicate-prefix handling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1341 to +1346
func formatItemDescriptionForList(item WorkItem) string {
description := strings.TrimSpace(item.Description)
tickets := canonicalTicketList(item.TicketIDs)
if tickets == "" {
return description
}
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatItemDescriptionForList trims item.Description and returns the trimmed value even when there are no ticket IDs (or when the prefix is already present). Previously /list rendered item.Description verbatim, so this subtly changes output formatting and also contradicts the PR note about keeping existing formatting for items without ticket IDs. Consider keeping the original description for the no-ticket / already-prefixed cases (use a trimmed copy only for comparisons), and only trim when you actually need to construct a new prefixed string.

Copilot uses AI. Check for mistakes.
},
want: "[7003004] Add schema validation guard",
},
{
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new tests cover single-ID and single-prefix dedup, but they don't cover the case this code explicitly supports where the existing leading prefix contains multiple IDs and/or spaces (e.g. description starts with "[7003002, 7003003] ..." while TicketIDs is "7003002,7003003"). Adding a test case for that would better pin the intended canonicalization/dedup behavior.

Suggested change
{
{
name: "no duplicate when description has multi-id spaced prefix",
item: WorkItem{
Description: "[7003002, 7003003] Improve cache warm-up sequence",
TicketIDs: "7003002,7003003",
},
want: "[7003002, 7003003] Improve cache warm-up sequence",
},
{

Copilot uses AI. Check for mistakes.
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.

1 participant