feat: add MR/issue grouping view to approval dashboard#8
Merged
Conversation
Add comprehensive design document for grouping approvals by their originating MR or issue in the approval dashboard. The spec covers backend source metadata extraction, frontend grouping logic, tabbed diff viewer with combined view, and batch approval workflow with individual review mode. Key features: - Group related approvals (spec, roborev, response) by source - Tabbed diff viewer showing all changes in one place - Batch approve/reject with "Review Individually" toggle - Backward compatible with existing executions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add comprehensive 18-task implementation plan for the grouped approval view. Covers backend source metadata extraction, frontend grouping/diff aggregation, UI components, testing, and integration. Each task broken into 2-5 minute steps with actual code, test commands, and expected outputs. Follows TDD with frequent commits. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add SourceMetadata model with source_url, source_type, and source_identifier fields to support grouping approvals by their originating MR or issue. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add _extract_source_metadata helper to derive source URL, type, and identifier from task metadata. Include in all app.pause() calls for grouping support. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix bug in _parse_task_body: issue tasks now correctly set issue_number
and issue_url instead of mr_number and mr_url (line 946-947)
- Move _extract_source_metadata to module level to make it testable
- Add comprehensive unit tests for _extract_source_metadata covering:
- MR comment case with mr_number and mr_url
- Issue case with issue_number and issue_url
- Fallback construction cases (mr_number/issue_number without URL)
- Edge case with no source data at all
- Fix process_task to use source_url variable instead of context.get("mr_url")
when calling publish_changes, ensuring issue_url is used for issue tasks
- Apply ruff formatting to fix long line wrapping violations
All unit tests pass (143 passed). Fixes code quality issues identified
in review of commit dda6e2d.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add sourceUrl, sourceType, sourceIdentifier to ApprovalContext. Add GroupedApproval and DiffTab interfaces for grouping view. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add extractSourceMetadata helper to parse source URL/type/identifier from pause context (new) or approval_request_url (fallback for old executions). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix GitLab nested group URL regex to support paths like gitlab.com/group/subgroup/project/-/merge_requests/123 - Add explicit null check for source_type in primary extraction path - Add validation for source_identifier format with fallback to URL parsing - Extract regex patterns as constants for better maintainability - Add JSDoc documentation for extractSourceMetadata function Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add groupApprovalsBySource function to group approvals by sourceIdentifier and sort by most recent activity. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add aggregateDiffs function to combine diffs from multiple approvals with separators and tab metadata, including truncation for large diffs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Verify groupApprovalsBySource correctly groups by source identifier, sorts by most recent activity, and tracks latest timestamp. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Verify aggregateDiffs combines diffs with separators, truncates large diffs, creates correct tab metadata, and handles missing diffs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wrap useApprovals with grouping logic, memoized to avoid recomputation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add mutation hook for batch approval submission with parallel requests and result tracking. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add tabbed interface for viewing combined and individual diffs. Reuses existing DiffViewer component for rendering. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add card component for displaying grouped approvals with batch actions, tabbed diff viewer, and expandable individual approval list. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add list container for grouped approval cards with empty state and ungrouped section for approvals without source metadata. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 'By Source' as first tab, wire up useGroupedApprovals hook and GroupedApprovalList component. Set as default active tab. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add basic E2E tests verifying 'By Source' tab structure and UI elements. Full integration tests require mocked AgentField data. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add documentation for grouped approval view features. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
770d924 to
9a7f207
Compare
Resolved conflicts by: - Adopting main's simplified two-gate approval workflow (spec + review) - Adding source metadata extraction to both approval pauses - Maintaining backward compatibility with source URL/type/identifier Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add "By Source" tab to the approval dashboard that groups related approvals by their originating MR or issue. This allows engineers to review all work from a single MR/issue in one place, see all diffs together via a tabbed viewer, and batch approve/reject with an option to review individually.
Changes
Backend
SourceMetadatamodel tond/schemas.pyapp.pause()callsFrontend
GroupedApprovalandDiffTabinterfacesgroupApprovalsBySource()andaggregateDiffs()functionsuseGroupedApprovals()anduseGroupedApprovalSubmit()for data fetching and batch submissionTabbedDiffViewer- Combined + individual diff tabsGroupedApprovalCard- Displays grouped approvals with batch actionsGroupedApprovalList- Container with empty/ungrouped statesFeatures
✅ Source Grouping: Approvals grouped by originating MR/issue
✅ Tabbed Diff Viewer: Combined diff + individual tabs for each execution
✅ Batch Approval: Approve/reject all with single click
✅ Individual Review Mode: Mix decisions within a group
✅ Backward Compatible: Fallback parsing for old executions without metadata
Test Results
Screenshots
The "By Source" tab is now the default view, grouping all approvals by their originating MR or issue:
Documentation
docs/superpowers/specs/2026-05-30-mr-issue-grouping-design.mddocs/superpowers/plans/2026-05-30-mr-issue-grouping-plan.md🤖 Generated with Claude Code