Skip to content

feat: support minimizing (hiding) comments#201

Merged
mshick merged 7 commits into
mainfrom
claude/bold-lamport-1dc179
Jun 19, 2026
Merged

feat: support minimizing (hiding) comments#201
mshick merged 7 commits into
mainfrom
claude/bold-lamport-1dc179

Conversation

@mshick

@mshick mshick commented Jun 19, 2026

Copy link
Copy Markdown
Owner

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 minimizeComment GraphQL mutation (keyed by the comment's node_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

Input Values Default Effect
create-minimized true | false false Minimize a comment immediately after it is created (not on later updates). A refresh-message-position recreate stays minimized.
delete-method delete | minimize delete When delete-on-status matches, delete (current behavior) or minimize the existing comment.
minimize-reason outdated | resolved | off-topic | duplicate | spam | abuse outdated Classifier shown in GitHub's UI for any minimize action.

New output

  • comment-minimized"true" when a comment was minimized.

Notes / decisions

  • Proxy: minimize needs write permissions the proxy (fork-PR) path doesn't grant, so combining proxy-url with create-minimized or delete-method: minimize fails fast with a clear error. The guard lives in the PR proxy branch, so comment-target: commit (which ignores proxy-url) can still minimize.
  • Scope: no un-minimize/toggle — create-minimized applies only at creation; nothing re-asserts or reverses view state on later runs (YAGNI).
  • minimize-reason is parsed case-insensitively and normalized to the GraphQL ReportedContentClassifiers enum (off-topicOFF_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: minimize minimizes 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

Copilot AI review requested due to automatic review settings June 19, 2026 02:49
…dc179

# Conflicts:
#	dist/index.js
#	dist/index.js.map

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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_id through 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.

Comment thread src/action.ts Outdated
Comment thread src/action.ts Outdated
Comment thread src/action.ts
@github-actions

Copy link
Copy Markdown
Contributor
Hello
Goodbye

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Goodnight
🌕
Updated at 02:57:53


Attachments: dogfood-files

@mshick mshick merged commit 6a876db into main Jun 19, 2026
6 checks passed
@mshick mshick deleted the claude/bold-lamport-1dc179 branch June 19, 2026 03:05
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.

2 participants