Conversation
✅ knip — no dead codeNo unused files, exports, types, or dependencies detected. |
iamfj
force-pushed
the
issue-144
branch
3 times, most recently
from
July 4, 2026 16:22
f1ad2c7 to
994fbee
Compare
Add `issues activity <issue>`, which merges an issue's comment threads (root comments plus their nested replies) with its history events into a single chronological timeline, paginated with an opaque id cursor. Why: users and agents inspecting an issue previously had to correlate the separate `discussions` output with Linear's field-change history by hand. Linear exposes no unified activity connection, so the service materializes both connections, normalizes each history event into a compact list of meaningful changes (state, assignee, priority, project, cycle, title, estimate, labels, archived), resolves label IDs to names, and sorts the combined set ascending by creation time. Design notes and trade-offs: - History and comment connections are independent, so both are exhausted concurrently before assembly; label names depend on the history nodes and are resolved afterwards. Empty-change history events are dropped so they do not consume pagination slots. - As a stateless CLI there is no cross-invocation cache, so each `--after` page re-materializes the full timeline before slicing — the same materialize-then-slice model already used for discussion reply pagination. Cheap for typical issues; only pathological histories pay. - `--comments-only` skips history (and the dependent label lookup); `--with-reactions` returns normalized reactions on roots and replies. To feed the activity service, `discussion-service` is refactored to expose reusable reply helpers (`buildThreadRepliesIndex` / `collectThreadReplies`, with `filterThreadReplies` now layered on top) and issue-scoped reply-candidate fetchers, and `GetLabels` gains an `includeArchived` argument (default false) so historic label changes still resolve to names. The fetch-until-empty loop shared by every full-connection fetcher is extracted into a `collectConnection` helper in `common/types` so each fetcher only declares its query, per-page guard, and cursor extraction. Closes #144
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.
What does this PR do?
Adds an
issues activity <issue>command that merges comment threads (root comments plus nested replies) with issue history events into a single chronological timeline, paginated via an opaque id cursor. Flags--comments-onlyand--with-reactionscontrol inclusion of history events and normalized reactions; history events normalize state/assignee/priority/project/cycle/title/estimate/label/archived changes and resolve label IDs to names. Also refactorsdiscussion-serviceto expose reusable reply-index helpers (buildThreadRepliesIndex/collectThreadReplies) and issue-scoped reply-candidate fetchers consumed by the new activity service.Closes #144
Type of change
Checklist
npm run check:cipasses (lint + format)npx tsc --noEmitpasses (type check)npm testpasses (unit tests)Testing
Ran
npm run build,npm run check:ci,npx tsc --noEmit, andnpm test(873 tests passing, including the newactivity-servicesuite).