Skip to content

feat: Improve PR comment UX - show resolved conflicts and new-conflict badges#50

Merged
zkoppert merged 2 commits into
mainfrom
feat/improved-comment-ux
Mar 22, 2026
Merged

feat: Improve PR comment UX - show resolved conflicts and new-conflict badges#50
zkoppert merged 2 commits into
mainfrom
feat/improved-comment-ux

Conversation

@zkoppert

@zkoppert zkoppert commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

Closes #49

What it does

Improves the PR comment experience by making the bot's comments more informative and transparent about how conflicts evolve over time.

Changes

  1. Auto-update banner - Adds a note at the top of every comment: "🔄 This comment updates automatically as conflicts are detected and resolved." This sets expectations that the comment is live.

  2. 🆕 badge on new conflicts - Newly detected conflicts get a 🆕 indicator in the table. On the next run (if still present), the badge is removed. Gives authors a visual cue for what changed.

  3. Collapsed resolved conflicts section - Instead of silently removing resolved conflicts, they're moved to a collapsed <details> section with strikethrough formatting and the date they resolved. Preserves history without cluttering the main view.

  4. All-resolved message - When all conflicts for a PR are resolved, the comment updates to show "✅ All Merge Conflicts Resolved" with the resolved history.

  5. Bug fix: unchanged conflicts no longer dropped - Previously, post_pr_comments() only received new/changed conflicts. If a PR had 3 conflicts and only 1 was new, the comment update would show only that 1 conflict, dropping the other 2. Now all active conflicts are passed so every PR's comment shows its full picture.

Known limitation

The 🆕 badge only persists until the next action run. If the action runs multiple times before the author checks the comment (e.g., hourly on weekdays), the badge will already be gone by the time they look. This is acceptable for now - the resolved section and banner still provide meaningful context about how conflicts evolved. A future improvement could address this with a notification bump reply (see #49 for discussion). Open to ideas on how we might solve this. 👂🏻

State file changes

  • ConflictFingerprint now stores PR display info (title, URL, author) so resolved conflicts can render meaningful details
  • State file gains a resolved_conflicts list with resolved_at timestamps
  • Resolved entries are pruned after 7 days
  • Backward compatible: old state files without the new fields still load correctly

Example comment format

Active conflicts + resolved section

⚠️ Potential Merge Conflicts Detected

🔄 This comment updates automatically as conflicts are detected and resolved.

This PR may conflict with 2 other PR(s):

Conflicting PR Conflicting Files (Lines)
🆕 #456 (Refactor auth) src/auth.py (L15-L20)
#789 (Add logging) src/app.rb (L10-L30)

What to do: Review the overlapping changes and coordinate with @bob, @charlie to resolve conflicts.

✅ 1 previously resolved conflict
Conflicting PR Resolved
#100 (Fix typo) Mar 19, 2026

This is an automated notification from pr-conflict-detector.

Testing

  • 269 unit tests pass (99.2% coverage)
  • All 5 linters pass clean (pylint 10/10)
  • New tests cover: enriched fingerprints, resolved state tracking/pruning, new comment format with banner/badges/resolved section, all-resolved comment, flip-flop dedup, timezone-naive safety, backward compatibility with old state files

@zkoppert zkoppert self-assigned this Mar 20, 2026
@github-actions github-actions Bot added the feature New feature or functionality label Mar 20, 2026
@zkoppert
zkoppert force-pushed the feat/improved-comment-ux branch from 95edbcf to f897dfb Compare March 20, 2026 22:29
…badges

- Add auto-update banner to PR comments so users know the comment is live
- Show 🆕 badge on newly detected conflicts for visual distinction
- Show resolved conflicts in a collapsed <details> section instead of
  silently removing them
- Show 'All Merge Conflicts Resolved' message when all conflicts resolve
- Enrich state fingerprints with PR display info (title, URL, author)
  so resolved conflicts can still render meaningful details
- Track resolved conflicts in state file with 7-day TTL and pruning
- Fix existing bug where unchanged conflicts were dropped from comments
  when only new/changed conflicts were passed to the comment builder
- Pass all active conflicts to post_pr_comments() so every PR's comment
  shows its full conflict picture

Closes #49

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@zkoppert
zkoppert force-pushed the feat/improved-comment-ux branch from f897dfb to cfe8369 Compare March 20, 2026 22:29
The blockquote syntax (>) looks off in PR comments. Italics render
cleaner and are better suited for this context.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@zkoppert

Copy link
Copy Markdown
Contributor Author

Files are getting long. I've opened an issue to do a refactor after this merges (don't want this pr review to be any more painful than it has to be).

@jmeridth jmeridth left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Very nice. Easy to read code, good tests.

@zkoppert
zkoppert merged commit fdefed5 into main Mar 22, 2026
43 checks passed
@zkoppert
zkoppert deleted the feat/improved-comment-ux branch March 22, 2026 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or functionality release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Improve PR comment UX - show resolved conflicts and indicate new ones

2 participants