Skip to content

PY-46: GitHub Integration Nacharbeiten#27

Merged
kaesetoast merged 3 commits into
mainfrom
py-46-github-integration-nacharbeiten
May 22, 2026
Merged

PY-46: GitHub Integration Nacharbeiten#27
kaesetoast merged 3 commits into
mainfrom
py-46-github-integration-nacharbeiten

Conversation

@kaesetoast

@kaesetoast kaesetoast commented May 22, 2026

Copy link
Copy Markdown
Member

Task

PY-46: GitHub Integration Nacharbeiten

Summary

Summary by CodeRabbit

  • New Features

    • "Needs action only" toggle to focus actionable PR feedback; hidden addressed counts shown.
    • Collapsible sections for addressed findings with badges, inline digest summaries, and a “Bot” tag.
  • Style

    • Addressed findings get emerald-themed border/background and adjusted summary text color.
    • Summary banners show distinct icons for needs-action vs addressed.
  • Refactor

    • Feed and commit lists memoized; commits now sorted newest-first for stable display.
  • Bug Fixes

    • Markdown sanitization updated to preserve collapsible details/summary attributes.

Review Change Stack

@netlify

netlify Bot commented May 22, 2026

Copy link
Copy Markdown

Deploy Preview for pno-project-y ready!

Name Link
🔨 Latest commit f1ff63a
🔍 Latest deploy log https://app.netlify.com/projects/pno-project-y/deploys/6a1078cea39c3900085edc6c
😎 Deploy Preview https://deploy-preview-27--pno-project-y.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented May 22, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 702dcab5-64fe-462d-b69d-4ef32454219c

📥 Commits

Reviewing files that changed from the base of the PR and between 5cd0c4c and f1ff63a.

📒 Files selected for processing (2)
  • src/components/git/CommitList.tsx
  • src/components/git/TaskDevelopmentWorkspace.tsx

📝 Walkthrough

Walkthrough

Detects CodeRabbit bot review digests, summarizes actionable/addressed findings, optionally collapses addressed segments in rendered markdown, adds a "needs action" filter and bot-summary UI in the review feed, and styles addressed-finding blocks.

Changes

Bot Review Digest Detection & Conditional Collapsing

Layer / File(s) Summary
Bot review comment detection and summarization
src/lib/git/bot-review-comment-summary.ts
New module exports BotReviewCommentSummary and regex helpers; detects CodeRabbit-style digests, summarizes actionable/addressed/open counts, computes needsAction, aggregates digests, and provides feedEntryNeedsAction.
Markdown preprocessing for collapsible addressed findings
src/lib/git/preprocess-github-markdown.ts
Adds address-detection helpers and collapseAddressedBotFindings; updates preprocessGitHubMarkdown(body, options?) to accept collapseAddressedFindings and wrap addressed sections in <details class="gh-bot-finding-addressed"> when enabled.
HTML sanitization schema for details and summary elements
src/components/git/github-markdown-sanitize.ts
githubMarkdownSanitizeSchema now allows class on details and summary, and keeps open on details.
Markdown body conditional styling for addressed findings
src/components/git/GitHubMarkdownBody.tsx
Adds collapseAddressedFindings prop, forwards it into preprocessing, memoizes on both inputs, and applies emerald-themed styling to <details>/<summary> when className includes gh-bot-finding-addressed.
Review feed item bot summary display
src/components/git/PrReviewFeedItem.tsx
PrReviewFeedItemIssueComment derives botSummary, conditionally styles FeedCard by needsAction, shows badges/“Bot” tag, renders a summary banner with icon and addressed counts, and passes collapseAddressedFindings to markdown rendering. Adds AlertCircle import.
Review feed filtering and action status toggle
src/components/git/TaskPullRequestReviewFeed.tsx
Adds needsActionOnly state; memoizes and filters entries into visibleEntries; updates auto-scroll and empty-state messaging to use visibleEntries; adds "Needs action only" toggle and bot digest summary panel with hidden-item counts.
Commit sorting and workspace memoization
src/components/git/CommitList.tsx, src/components/git/TaskDevelopmentWorkspace.tsx
Adds sortCommitsNewestFirst(commits) and memoizes commits selection in TaskDevelopmentWorkspace, returning a newest-first sorted list.
File tree initial expansion tweak
src/components/git/DiffFileTree.tsx
Switches useFileTree initialExpansion from 1 to "open".

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 I hop through PRs with a curious eye,
I count what's open and fold what's dry.
Green-bordered details hide the past—so neat,
The feed breathes lighter with each folded feat.
Hooray for tidy threads and restful feet!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'PY-46: GitHub Integration Nacharbeiten' is a ticket reference that describes ongoing work related to GitHub integration, and the changeset encompasses exactly that: enhancements to GitHub markdown rendering, bot comment processing, and review feed UI—all directly supporting GitHub integration cleanup/post-work.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch py-46-github-integration-nacharbeiten

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/git/TaskPullRequestReviewFeed.tsx`:
- Around line 139-149: The filter toggle is hidden when
botDigestRollup.digestCount is 0, which prevents users from turning off an
active needsActionOnly filter; change the render condition so the Button (the
"Needs action only" toggle using setNeedsActionOnly and reading needsActionOnly)
is shown when botDigestRollup?.digestCount > 0 OR when needsActionOnly is true.
Keep the existing props (variant, size, className, onClick) and behavior the
same; only update the conditional around the Button to use
(botDigestRollup?.digestCount > 0 || needsActionOnly).

In `@src/lib/git/bot-review-comment-summary.ts`:
- Around line 47-54: The fallback computation for openCount incorrectly
short-circuits to 0 whenever addressedCount > 0 and ignores markers like
"Committable suggestion", so unresolved findings get misclassified; update the
ternary in bot-review-comment-summary.ts so that when actionableCount is null
you first derive a baseSuggestedCount from the comment body (e.g., /Committable
suggestion/i or /Potential issue/i → 1 else 0) and then compute openCount as
Math.max(0, baseSuggestedCount - addressedCount) (referencing the variables
openCount, actionableCount, addressedCount, and body) instead of returning 0
immediately when addressedCount > 0.

In `@src/lib/git/preprocess-github-markdown.ts`:
- Around line 29-31: The current early return in preprocessGithubMarkdown that
checks "if (blocks.length <= 1) { return isAddressedSegment(body) ?
wrapAddressedSegment(body) : body; }" can collapse the entire digest when block
boundaries aren't detected; change this to simply return the original body when
blocks.length <= 1 (i.e., "return body") so we don't wrap the whole message
based on a single addressed marker. Locate the check around "blocks.length <= 1"
in preprocess-github-markdown.ts (functions/identifiers: blocks,
isAddressedSegment, wrapAddressedSegment, body) and replace the conditional wrap
with a plain fallback returning body.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a040b489-dace-492c-a1b2-0b30a571efb4

📥 Commits

Reviewing files that changed from the base of the PR and between 37cd3f0 and de34941.

📒 Files selected for processing (6)
  • src/components/git/GitHubMarkdownBody.tsx
  • src/components/git/PrReviewFeedItem.tsx
  • src/components/git/TaskPullRequestReviewFeed.tsx
  • src/components/git/github-markdown-sanitize.ts
  • src/lib/git/bot-review-comment-summary.ts
  • src/lib/git/preprocess-github-markdown.ts

Comment thread src/components/git/TaskPullRequestReviewFeed.tsx Outdated
Comment thread src/lib/git/bot-review-comment-summary.ts Outdated
Comment thread src/lib/git/preprocess-github-markdown.ts

@coderabbitai coderabbitai Bot 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.

♻️ Duplicate comments (1)
src/lib/git/bot-review-comment-summary.ts (1)

57-62: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Count unresolved fallback signals instead of using a boolean.

Line 57 sets a 1/0 fallback, so digests without an actionable header can undercount remaining findings (and potentially clear needsAction too early) when multiple unresolved markers exist.

💡 Proposed fix
-  const baseSuggestedCount =
-    /Committable suggestion|Potential issue/i.test(body) ? 1 : 0;
+  const baseSuggestedCount = (
+    body.match(/Committable suggestion|Potential issue/gi) ?? []
+  ).length;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/git/bot-review-comment-summary.ts` around lines 57 - 62, The current
fallback uses a boolean 1/0 via baseSuggestedCount which undercounts when
multiple unresolved markers exist; update baseSuggestedCount to count all
occurrences of the fallback signals (e.g., run a global regex match against body
for /Committable suggestion|Potential issue/gi and use the match length or 0)
and keep openCount logic the same (openCount = actionableCount != null ?
Math.max(0, actionableCount - addressedCount) : Math.max(0, baseSuggestedCount -
addressedCount)), referencing baseSuggestedCount, actionableCount,
addressedCount and body to locate and replace the 1/0 fallback with the match
count.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@src/lib/git/bot-review-comment-summary.ts`:
- Around line 57-62: The current fallback uses a boolean 1/0 via
baseSuggestedCount which undercounts when multiple unresolved markers exist;
update baseSuggestedCount to count all occurrences of the fallback signals
(e.g., run a global regex match against body for /Committable
suggestion|Potential issue/gi and use the match length or 0) and keep openCount
logic the same (openCount = actionableCount != null ? Math.max(0,
actionableCount - addressedCount) : Math.max(0, baseSuggestedCount -
addressedCount)), referencing baseSuggestedCount, actionableCount,
addressedCount and body to locate and replace the 1/0 fallback with the match
count.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 78faba5d-fc22-40c4-a73f-14cd6ff7d941

📥 Commits

Reviewing files that changed from the base of the PR and between de34941 and 5cd0c4c.

📒 Files selected for processing (4)
  • src/components/git/DiffFileTree.tsx
  • src/components/git/TaskPullRequestReviewFeed.tsx
  • src/lib/git/bot-review-comment-summary.ts
  • src/lib/git/preprocess-github-markdown.ts

@kaesetoast kaesetoast merged commit ff22c73 into main May 22, 2026
5 checks passed
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.

1 participant