Skip to content

feat(comment): Hidden comments - #9052

Open
Vignesh (vicky1999) wants to merge 3 commits into
microsoft:mainfrom
vicky1999:vicky1999/7431-hidden-comments
Open

Vignesh (vicky1999) wants to merge 3 commits into
microsoft:mainfrom
vicky1999:vicky1999/7431-hidden-comments

Conversation

@vicky1999

Copy link
Copy Markdown
Contributor

Solves #7431

Summary

  • whether a comment is minimized or not and the reason for minimized is available in IssueComment and PullRequestReviewComment.
  • Added the two fields (isMinimized, minimizedReason) to gql query and used in the component to minimize with the reason open the comment on click.
  • Added fold and unfold svg files from octicons to match the UI.

Demo:

Hidden.comments.mp4

Follow ups

  • It looks like there's a button to hide the comment with reason. It could be a follow up if it need to be added on the webview.

Copilot AI balanced review requested due to automatic review settings October 10, 2026 19:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Expanded comment interactions currently collapse the comment, keyboard toggling is unavailable, and missing reasons render as “undefined”.

2 open findings
What changed in this PR

Adds support for displaying GitHub-minimized comments as collapsible entries with their minimization reason.

Changes:

  • Fetches and propagates minimization metadata.
  • Adds collapsible comment UI, styling, and icons.
  • Adds parser and component tests.
File Description
webviews/​editorWebview/​test/​comment.test.tsx Tests minimized comment rendering.
webviews/​editorWebview/​index.css Styles minimized comments.
webviews/​components/​timeline.tsx Formatting-only change.
webviews/​components/​icon.tsx Exports fold icons.
webviews/​components/​comment.tsx Implements minimized comment UI.
src/​test/​github/​utils.test.ts Tests metadata parsing.
src/​github/​utils.ts Propagates minimization metadata.
src/​github/​queriesShared.gql Queries minimization fields.
src/​github/​graphql.ts Extends GraphQL comment types.
src/​common/​timelineEvent.ts Extends timeline comment events.
src/​common/​comment.ts Extends shared comment data.
resources/​icons/​unfold.svg Adds unfold icon.
resources/​icons/​fold.svg Adds fold icon.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread webviews/components/comment.tsx Outdated
Comment thread webviews/components/comment.tsx Outdated
Copilot AI balanced review requested due to automatic review settings October 11, 2026 19:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new component test targets the wrong element and fails, while enum-based reasons can render with raw underscores.

1 open finding
2 resolved since last review
Previously missed (1)

In code that hasn't changed since last review

Medium severity Normalize enum separators in user-facing reason labels

webviews/​components/​comment.tsx:91

GraphQL returns enum values such as OFF_TOPIC; lowercasing alone renders the user-facing reason as off_topic. Normalize enum separators (or map the enum to display labels) so all supported reasons are readable.

🧠 Review effort: Balanced

Comment thread webviews/editorWebview/test/comment.test.tsx Outdated
Copilot AI balanced review requested due to automatic review settings October 11, 2026 19:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Classifier reasons containing underscores are rendered incorrectly in the user-facing message.

0 open findings

1 resolved since last review
Previously missed (1)

In code that hasn't changed since last review

Medium severity Normalize underscores in minimized reason

webviews/​components/​comment.tsx:91

minimizedReason can contain classifier values such as OFF_TOPIC (as represented by the new parser test), so lowercasing alone renders the user-facing reason as off_topic. Normalize underscores to hyphens so the message matches GitHub's “off-topic” wording.

🧠 Review effort: Balanced

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