feat: support minimizing (hiding) comments#201
Merged
Conversation
…dc179 # Conflicts: # dist/index.js # dist/index.js.map
There was a problem hiding this comment.
Pull request overview
This PR adds support for minimizing (collapsing/hiding) comments via GitHub’s minimizeComment GraphQL mutation, extending the action beyond create/update/delete to also support “hide on create” and “hide instead of delete-on-status”.
Changes:
- Adds new inputs (
create-minimized,delete-method,minimize-reason) and a new output (comment-minimized) to control minimize behavior. - Threads
node_idthrough existing-comment lookups and adapters so comments can be minimized via GraphQL. - Implements and tests minimize behavior for both PR/issue comments and commit comments, with a proxy-url fail-fast guard.
Reviewed changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/types.ts |
Adds MinimizeReason, extends Inputs, and includes node_id in existing comment types. |
src/minimize.ts |
Introduces a shared GraphQL helper for minimizeComment, wrapped in retry. |
src/config.ts |
Parses/validates new inputs and normalizes minimize reason to GraphQL enum values. |
src/comments.ts |
Returns node_id when locating an existing PR/issue comment. |
src/commit-comments.ts |
Returns node_id when locating an existing commit comment. |
src/action.ts |
Wires minimize into the main control flow (create-minimized and delete-method=minimize) and enforces proxy-url restriction. |
src/action.test.ts |
Adds MSW GraphQL handler + tests for minimize behavior and config validation. |
action.yml |
Declares new inputs and the comment-minimized output. |
README.md |
Documents minimizing behavior, new inputs, and new output. |
docs/superpowers/specs/2026-06-18-minimize-comments-design.md |
Adds design/spec documentation for the feature. |
docs/superpowers/plans/2026-06-18-minimize-comments.md |
Adds an implementation plan for the feature work. |
docs/superpowers/plans/2026-06-18-minimize-comments.md.tasks.json |
Adds task tracking metadata for the implementation plan. |
dist/index.js |
Updates the bundled distribution output to include the new minimize functionality (and additional unrelated bundle changes). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
Contributor
|
Goodnight Attachments: dogfood-files |
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.
Summary
Adds the ability to minimize (hide/collapse) comments instead of only creating, updating, or deleting them — addressing #197.
Hiding a comment isn't in the GitHub REST API; it's the
minimizeCommentGraphQL mutation (keyed by the comment'snode_id, with a required classifier). This PR wires that in behind three new inputs and a new output, for both the PR/issue and commit-comment paths.New inputs
create-minimizedtrue|falsefalserefresh-message-positionrecreate stays minimized.delete-methoddelete|minimizedeletedelete-on-statusmatches, delete (current behavior) or minimize the existing comment.minimize-reasonoutdated|resolved|off-topic|duplicate|spam|abuseoutdatedNew output
comment-minimized—"true"when a comment was minimized.Notes / decisions
proxy-urlwithcreate-minimizedordelete-method: minimizefails fast with a clear error. The guard lives in the PR proxy branch, socomment-target: commit(which ignoresproxy-url) can still minimize.create-minimizedapplies only at creation; nothing re-asserts or reverses view state on later runs (YAGNI).minimize-reasonis parsed case-insensitively and normalized to the GraphQLReportedContentClassifiersenum (off-topic→OFF_TOPIC); invalid values throw at config-parse time.Tests
Adds an MSW handler for the GraphQL endpoint and covers: create-minimized → mutation fired with the new node ID; plain updates do not minimize;
delete-method: minimizeminimizes instead of deleting; classifier default + override mapping;proxy-url+ minimize → config error; commit-comment minimize. Full suite: 83 passing.Design docs
Spec and implementation plan included under
docs/superpowers/for reviewer context (drop the last commit if you'd rather not keep them in-tree).🤖 Generated with Claude Code