-
Notifications
You must be signed in to change notification settings - Fork 3
Created functionality for sidebar (diffbar) using the logic of the … #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?
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
…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.
baseRef to Version if a PR exist for that branch
Created a sidebar for the changes called Diffbar. It's main purpose is to show changes in the API on projects connected to Framna Docs.
It uses most of the same logic as the projectlist-sidebar to keep consistency in the project.
Divided DiffContent in several component, also trying to keep consistency by using a setup simular to the projectlist.
Description
Diffbar:
'const res = await fetch(
/api/diff/${project.owner}/${project.name}/${specification.id}?from=${fromBranch}&to=${toBranch});'UPS!
Some logic still missing. As of now it shows all the changes and differences between the two chosen branches, not just the new changes from main to the chosen branch
Motivation and Context
Seeing changes in the API
Screenshots (if appropriate):
Types of changes