Repository navigation
feat: add comment list to read issue comments - #42
Closed
seraph-pixelperfect wants to merge 1 commit into
Closed
seraph-pixelperfect wants to merge 1 commit into
seraph-pixelperfect wants to merge 1 commit into
Conversation
`comment list <ref>` reads an issue's comment thread through the root
`comments` connection, scoped via `filter: { issue: { id: { eq: } } }`
(the connection has no issueId argument in current @linear/sdk), ordered
`orderBy: createdAt` (Linear connections sort descending, so newest-first
with no client-side reversing). TOON list rows render author (user, falling
back to externalUser for integration comments), body truncated to a
200-char preview (`--full` disables), and relative creation time, with a
count line, definitive empty state, and reply hints. Bare `comment <ref>`
--body` keeps dispatching to create exactly as before.
Closes #19
This was referenced Aug 19, 2026
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #19. Depends on #41.
Stacked on #41 (stack: #37 → #38 → #39 → #40 → #41). Review this PR with
feat/fields-wiringas the base; do not retarget — CI runs when retargeted to main after the stack merges; local gates below are the evidence.What
Comments were write-only (
comment <ref> --body). This adds a read path:linear-axi comment list <IDENTIFIER|UUID>— renders the issue's comment thread, newest first, as a TOON list (author, body, relative creation time).--fulldisables body truncation.comment <ref> --body "..."(no subcommand) keeps dispatching to create exactly as before — the create path stays the default, only the literal first positionallistselects the reader (no Linear ref —TEAM-NUMBERor UUID — can collide with that word).Schema evidence (source:
@linear/sdkv90.0.0 vianpm pack @linear/sdk,dist/index-zxW4m1xd.d.mts)QueryCommentsArgs(line ~20044) =after / before / filter?: CommentFilter / first / includeArchived / last / orderBy?: PaginationOrderBy. There is noissueIdargument on the rootcommentsconnection in the current schema (there was in older Linear API versions). The thread is scoped viafilter: { issue: { id: { eq: $issueId } } }:CommentFilter.issueis aNullableIssueFilter→IssueFilter.idis anIssueIdComparatorwitheq?: ID.Commenttype):body: String("The comment content in markdown format"),createdAt: DateTime,user?: Maybe<User>("The user who wrote the comment. Null for comments created by integrations or bots without a user association"),externalUser?: Maybe<ExternalUser>(integration author,displayName: String). We selectid, body, user { name }, externalUser { displayName }, createdAt.PaginationOrderBy(lines ~16597–16600) offers onlycreatedAt | updatedAt. APaginationSortOrderenum (Ascending/Descending) exists in the SDK types but is not an argument on this connection (only on new-style sort inputs likeApproximateNeedCountSort), so there is no server-side direction flag. Linear's connections sort descending (newest first) — per Linear's pagination docs (https://linear.app/developers/pagination) and the Apollo Studio Linear schema reference ("Available options are createdAt (default) and updatedAt", direction fixed), matching this repo's live-verified precedent (fetchIssues/fetchProjects/fetchCyclesall document newest/most-recent-first withorderBy:). ThereforeorderBy: createdAtreturns the newest comment first with no client-side reversing.Chosen over
updatedAt: a thread's stable order is creation order —updatedAtwould make an edited old comment jump to the top.Demo (real render via stubbed fetch, same stub shape as the tests)
$ linear-axi comment list AXI-19(before: unknown-subcommand error path would not exist — this command simply did not work; after:)$ linear-axi comment list AXI-19 --full:$ linear-axi comment AXI-19 --body "LGTM"(bare create, unchanged dispatch):(The third thread row shows the
externalUser.displayNamefallback for integration comments; the empty state renderscount: 0+comments: 0 found+ a start-the-thread hint.)Local gates (real output)
pnpm build— OKpnpm lint— OKpnpm run build:skill -- --check—skills/linear-axi/SKILL.md is up to date.pnpm test—Test Files 12 passed (12)/Tests 124 passed (124)(base: 110 in 11 files; +14 in newtest/comment-list.test.ts)pnpm run format:check— red pre-existing on the same 18 files as the base branch (CI does not run it); no newly flagged files —pnpm exec prettier --check test/comment-list.test.tspasses and all new code in touched files is prettier-clean (remaining deviations are pre-existing lines untouched by this PR).Test coverage: subcommand dispatch (
listvs bare create — create still hitsmutation Commentwith the same variables), document shape (filter: { issue: { id: { eq: $issueId } } },orderBy: createdAt, requested fields,{issueId, first}variables), newest-first rendering order, truncation by default +--full, empty state + count line, NOT_FOUND on an unresolvable ref, unknown flags rejected on both paths,fetchCommentscursor pagination.Ambiguities / judgment calls (flagging for review)
(N chars total)note and a--fullhint. Easy one-line constant to change.orderBy: createdAtrelies on Linear's fixed descending order (same assumption the repo already ships for issues/projects/cycles). If live behavior ever differed, a one-line.reverse()would fix it — tests pin the render-order contract, not the server's.comment --body "list" LIN-1would dispatch tolist(first non---token wins). This quirk is shared withissueCommand's positional switch (issue --title createbehaves the same way); kept consistent rather than special-cased. Documented forms (comment <ref> --body,comment list <ref>) are unaffected.comments(issueId: $id); the current schema has no such argument, so the filter form above is used instead (cited). Functionally equivalent, one extra field in the document.Run \linear-axi comment list ` to read the thread`) for discoverability. Flags/dispatch/queries on the create path are byte-identical to before; only this hint is new.CI caveat
No CI checks will appear on this PR —
ci.ymlonly triggers on PRs targetingmain. When the stack merges and this is retargeted, CI runs then; local gates above are the evidence in the meantime. Separately: if checks do run and look failed, verify quota — Linear-adjacent GHA billing/spending-limit rejections present like check failures; checkgh run view <run-id>or the jobs API for a billing annotation or emptystepswith ~3-4s duration. If quota-blocked, this PR relies on the local output above rather than retries.Identity
Automated agent dispatch authenticated as
seraph-pixelperfect, submitted for human review — not self-approved. Merge is a human decision.