Skip to content

Conversation

@oscarlund121
Copy link
Contributor

@oscarlund121 oscarlund121 commented Oct 21, 2025

Description

This pull request introduces a new OpenAPI specification diff feature, enabling the calculation and retrieval of differences between two versions of an OpenAPI spec.

Leverages the external oasdiff tool for changelog generation. The tool must be installed in the runtime environment.

In order to generate the diff the merge-base for the selected branch is calculated. The calculation is based on the pull request open for that branch. If the branch has no pull request attached no diff is available.

Known limitations

  1. If a branch has multiple PRs targeting different base branches (e.g., one to main, one to develop), the diff shown will be against whichever PR was processed last. To support this case we could add a dropdown to select which base it should compare against.

Motivation and Context

Prior to this feature it could be difficult for the user to determine what has actually changed when reviewing a requested change to a spec.

Screenshots (if appropriate):

Skaermoptagelse.2025-11-21.kl.11.21.41.mov

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

…projectlist-sidebar.

Created diff/route.ts to handle GET, run oasdiff and return JSON.

Created DiffContent.tsx - fetches the data, compares the branches and show the data.
- Finds the fromBranch based of baseRef and toBranch is chosen based id
- Handles if same branch is chosen in to and from - non comparable
- Components to display data.

baseRef to Version if a PR exist for that branch
Copilot AI review requested due to automatic review settings October 21, 2025 08:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a new "Diffbar" sidebar feature that displays API changes between branches by comparing OpenAPI specifications using oasdiff. The functionality mirrors the existing project list sidebar architecture for consistency.

Key Changes:

  • Added a tertiary sidebar (Diffbar) with toggle functionality via Cmd/Ctrl+K keyboard shortcut
  • Created API endpoint /api/diff/[owner]/[repository]/[...path] to execute oasdiff and return JSON changelog
  • Extended data model to include baseRef property for tracking PR base branches

Reviewed Changes

Copilot reviewed 21 out of 23 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
src/features/sidebar/view/internal/tertiary/Container.tsx New container component for the diff sidebar
src/features/sidebar/view/internal/secondary/Container.tsx Updated to support offset/transitions for the diff sidebar
src/features/sidebar/view/internal/diffbar/components/*.tsx Components for rendering diff lists, items, dialogs, and headers
src/features/sidebar/view/internal/diffbar/DiffContent.tsx Main logic for fetching and displaying API diffs
src/features/sidebar/view/internal/ClientSplitView.tsx Integration of diff sidebar with keyboard shortcut
src/features/sidebar/view/SplitView.tsx Added DiffContent to the split view
src/features/sidebar/view/SecondarySplitHeader.tsx Added toggle button for diff sidebar
src/features/sidebar/data/useDiffbarOpen.ts Hook for managing diff sidebar open state
src/features/projects/domain/*.ts Added baseRef property to version and repository types
src/features/projects/data/*.ts Extended GraphQL queries to fetch PR base references
src/app/api/diff/[owner]/[repository]/[...path]/route.ts API endpoint executing oasdiff to compare specs
package.json Reordered dependencies (no functional change)

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

- verision logic updated and moved into the second useEffect, so that dependencies can be added without getting errors when fetching data.

Otherwise it's typesafety updates
@oscarlund121 oscarlund121 changed the title Created functionality for sidebar (diffbar) - Using the logic of the … Created functionality for sidebar (diffbar) using the logic of the … Oct 21, 2025
@ulrikandersen ulrikandersen changed the title Created functionality for sidebar (diffbar) using the logic of the … Diff sidebar Nov 2, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 34 out of 35 changed files in this pull request and generated 16 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI commented Nov 20, 2025

@ulrikandersen I've opened a new pull request, #620, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link

Copilot AI commented Nov 20, 2025

@ulrikandersen I've opened a new pull request, #621, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link

Copilot AI commented Nov 20, 2025

@ulrikandersen I've opened a new pull request, #622, to work on those changes. Once the pull request is ready, I'll request review from you.

@ulrikandersen ulrikandersen removed their request for review November 20, 2025 14:11
Copilot AI and others added 9 commits November 20, 2025 15:08
# Conflicts:
#	src/features/sidebar/view/internal/diffbar/components/DiffList.tsx
#	src/features/sidebar/view/internal/diffbar/components/PopulatedDiffList.tsx
Use change.id as React key instead of array index
…f viewer

- Display base branch and commit OID with clickable GitHub PR link in diff sidebar
- Detect and show message when spec file is new (doesn't exist on base branch)
- Fix infinite render loop by properly encoding URLs with spaces in filenames
- Add PR number to GraphQL queries and pass through data models
- Show comparison info for all branches with open PRs
Replace Box component with MuiDrawer for the right sidebar to match
the left sidebar's implementation. Both sidebars now use identical
patterns: persistent/temporary variants, fixed width, and margin-based
content shifting for open/close transitions.
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.

3 participants