-
Notifications
You must be signed in to change notification settings - Fork 2
Diff sidebar #607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Diff sidebar #607
Conversation
…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
There was a problem hiding this 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 executeoasdiffand return JSON changelog - Extended data model to include
baseRefproperty 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.
src/features/sidebar/view/internal/diffbar/components/PopulatedDiffList.tsx
Outdated
Show resolved
Hide resolved
src/features/sidebar/view/internal/diffbar/components/DiffList.tsx
Outdated
Show resolved
Hide resolved
src/features/sidebar/view/internal/diffbar/components/DiffHeader.tsx
Outdated
Show resolved
Hide resolved
src/features/sidebar/view/internal/diffbar/components/DiffDialog.tsx
Outdated
Show resolved
Hide resolved
- 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
There was a problem hiding this 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.
|
@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. |
|
@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. |
Co-authored-by: ulrikandersen <[email protected]>
Co-authored-by: ulrikandersen <[email protected]>
Validate GitHub URL origin in OasDiffCalculator
Co-authored-by: Copilot <[email protected]>
|
@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. |
Co-authored-by: ulrikandersen <[email protected]>
Co-authored-by: ulrikandersen <[email protected]>
# 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.
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
oasdifftool 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
main, one todevelop), 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