Skip to content

feat(desktop): Review パネル強化 — Actions ステップ・コメント展開・ファイルジャンプ#27

Merged
MocA-Love merged 3 commits intomainfrom
feat/desktop-enhanced-review-panel
Mar 30, 2026
Merged

feat(desktop): Review パネル強化 — Actions ステップ・コメント展開・ファイルジャンプ#27
MocA-Love merged 3 commits intomainfrom
feat/desktop-enhanced-review-panel

Conversation

@MocA-Love
Copy link
Copy Markdown
Owner

@MocA-Love MocA-Love commented Mar 30, 2026

Summary

  • GitHub Actions チェックを展開してジョブ内ステップの進捗をリアルタイム表示(15秒ポーリング)
  • レビューコメントをクリックで展開し、Markdown レンダリングされた全文を表示
  • GitHub Alerts (> [!NOTE], > [!TIP], > [!IMPORTANT], > [!WARNING], > [!CAUTION]) の色付き表示に対応
  • HTMLコメント(CodeRabbit 内部データ等)を自動除去してクリーンに表示
  • コメントのファイルパス+行番号からエディタの該当行にジャンプ

Test plan

  • Review タブで Checks セクションのチェック名横の矢印をクリックし、ステップ一覧が展開されることを確認
  • pending 中のステップにスピナーが表示されることを確認
  • Comments セクションのコメントをクリックし、全文が Markdown レンダリングされて展開されることを確認
  • CodeRabbit のコメントで <!-- --> 内の内部データが非表示になっていることを確認
  • > [!NOTE] 等の GitHub Alerts が色付きブロックで表示されることを確認
  • ファイルパス+行番号付きコメントの青いリンクをクリックし、エディタで該当行が開くことを確認
  • 展開したコメントを再度クリックで折りたためることを確認

Summary by CodeRabbit

  • New Features
    • Review panel now displays detailed GitHub Actions job step progress and completion status when you expand checks
    • Review comments now render with full Markdown support, including GitHub-style Alerts with callout boxes
    • Click on a comment's file path and line number to navigate directly to that specific location in the code editor

- GitHub Actionsのチェックを展開してジョブ内ステップの進捗を表示
- レビューコメントをクリックで展開し、Markdownレンダリングされた全文を表示
- コメントのファイルパス+行番号からエディタの該当行にジャンプ
- GitHub Alerts (NOTE/TIP/IMPORTANT/WARNING/CAUTION) の色付き表示に対応
- HTMLコメント(CodeRabbit内部データ等)を自動除去
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 30, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 48795360-241a-42c4-aa2f-7e6dbedd4a89

📥 Commits

Reviewing files that changed from the base of the PR and between e83162e and 2f34e6f.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (13)
  • README.md
  • apps/desktop/package.json
  • apps/desktop/src/lib/trpc/routers/workspaces/procedures/git-status.ts
  • apps/desktop/src/lib/trpc/routers/workspaces/utils/github/github.ts
  • apps/desktop/src/lib/trpc/routers/workspaces/utils/github/index.ts
  • apps/desktop/src/lib/trpc/routers/workspaces/utils/github/types.ts
  • apps/desktop/src/renderer/globals.css
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/ChangesView.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/ReviewPanel/ReviewPanel.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/ReviewPanel/components/CheckSteps/CheckSteps.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/ReviewPanel/components/CheckSteps/index.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/ReviewPanel/utils.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/index.tsx

📝 Walkthrough

Walkthrough

This PR enhances the Review panel by adding GitHub Actions check job step visualization with progress indicators and expandable review comments with full Markdown rendering, including GitHub alerts support. It introduces backend TRPC procedures for fetching job steps, GitHub API utilities, frontend React components, and styling.

Changes

Cohort / File(s) Summary
Documentation
README.md
Added "Review パネル強化" entry documenting expanded Review panel functionality: in-job step progress visualization, full Markdown rendering with GitHub alerts, and file path + line number navigation.
Dependencies
apps/desktop/package.json
Added remark-github-blockquote-alert (^2.1.0) dependency for GitHub-style alert block rendering in Markdown.
Backend TRPC Procedure
apps/desktop/src/lib/trpc/routers/workspaces/procedures/git-status.ts
Introduced new getCheckJobSteps public query procedure that accepts workspaceId and detailsUrl, resolves repo paths (with fallback to mainRepoPath for branch workspaces), and fetches job step details via GitHub API.
GitHub Utilities - Types
apps/desktop/src/lib/trpc/routers/workspaces/utils/github/types.ts
Added Zod schemas GHJobStepSchema and GHJobResponseSchema with inferred TypeScript types to validate GitHub Actions job and step response structures, including status, conclusion, and timestamps.
GitHub Utilities - Implementation
apps/desktop/src/lib/trpc/routers/workspaces/utils/github/github.ts
Added JobStepInfo interface and fetchCheckJobSteps async function that parses GitHub details URLs, executes gh api calls, validates responses, and normalizes step metadata (name, status, conclusion, number).
GitHub Utilities - Exports
apps/desktop/src/lib/trpc/routers/workspaces/utils/github/index.ts
Re-exported fetchCheckJobSteps to make it available through the module's public API.
Frontend Styling
apps/desktop/src/renderer/globals.css
Added comprehensive CSS for .review-comment-body: Markdown element styling (paragraphs, headings, lists, code, blockquotes, tables, images) and GitHub-style alert theming with per-type border colors and title layouts.
Review Panel - Check Steps Component
apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/ReviewPanel/components/CheckSteps/*
Created new CheckSteps component that fetches and renders GitHub Actions job steps with status icons, progress indicators (spinning animation for in-progress), and 15-second refresh interval.
Review Panel - Main Component
apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/ReviewPanel/ReviewPanel.tsx
Extended ReviewPanel to support collapsible checks (with expandable job steps) and collapsible comments (with one-line preview when collapsed and full Markdown rendering when expanded); added onOpenFile callback for file navigation; integrated ReactMarkdown with remark-gfm and remark-alert plugins; added HTML comment stripping.
Review Panel - Utilities
apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/ReviewPanel/utils.ts
Added stripHtmlComments utility function to remove HTML comment blocks and normalize excessive newlines before Markdown rendering.
Integration - ChangesView
apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/ChangesView.tsx
Added optional onOpenFileAtLine callback prop and forwarded it to ReviewPanel as onOpenFile to enable file navigation from review comments.
Integration - RightSidebar
apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/index.tsx
Implemented handleOpenFileAtLine callback to open file viewer at a specified line and wired it into ChangesView via onOpenFileAtLine prop.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ReviewPanel
    participant Browser as Browser TRPC
    participant Server as TRPC Server
    participant GitHub as GitHub CLI

    User->>ReviewPanel: Expand check row
    activate ReviewPanel
    ReviewPanel->>Browser: Call electronTrpc.workspaces.getCheckJobSteps
    deactivate ReviewPanel
    
    activate Browser
    Browser->>Server: getCheckJobSteps({workspaceId, detailsUrl})
    deactivate Browser
    
    activate Server
    Server->>Server: Extract jobId & nwo from detailsUrl
    Server->>GitHub: gh api repos/{nwo}/actions/jobs/{jobId}
    activate GitHub
    GitHub-->>Server: Job response with steps array
    deactivate GitHub
    Server->>Server: Parse & validate response schema
    Server->>Server: Map steps to JobStepInfo[]
    Server-->>Browser: steps array
    deactivate Server
    
    activate Browser
    Browser-->>ReviewPanel: steps data via useQuery
    deactivate Browser
    
    activate ReviewPanel
    ReviewPanel->>ReviewPanel: Render CheckSteps component
    ReviewPanel->>ReviewPanel: Display each step with icon/status
    ReviewPanel->>ReviewPanel: Animate spinning icon if in_progress
    deactivate ReviewPanel
    
    ReviewPanel-->>User: Visualized job steps
Loading
sequenceDiagram
    participant User
    participant ReviewPanel
    participant Markdown as ReactMarkdown

    User->>ReviewPanel: Expand review comment
    activate ReviewPanel
    ReviewPanel->>ReviewPanel: Toggle expanded state for comment
    deactivate ReviewPanel
    
    activate ReviewPanel
    ReviewPanel->>ReviewPanel: stripHtmlComments(comment.body)
    ReviewPanel->>Markdown: Render with remark-gfm + remark-alert
    activate Markdown
    Markdown->>Markdown: Parse GitHub Markdown syntax
    Markdown->>Markdown: Convert alerts (note/warning/danger) to HTML
    Markdown-->>ReviewPanel: Rendered HTML
    deactivate Markdown
    ReviewPanel->>ReviewPanel: Display file:line navigation button
    deactivate ReviewPanel
    
    User->>ReviewPanel: Click file:line button
    activate ReviewPanel
    ReviewPanel->>ReviewPanel: onOpenFile(comment.path, comment.line)
    ReviewPanel-->>User: File opens at line in editor
    deactivate ReviewPanel
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 Hops with delight at checks now shown,
Steps spinning bright, their progress known,
Comments unfold with markdown's gleam,
GitHub alerts dance in a rendered dream,
File paths click true—review's supreme!

✨ 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 feat/desktop-enhanced-review-panel

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@MocA-Love MocA-Love self-assigned this Mar 30, 2026
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