Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b93d543
Created functionality for sidebar (diffbar) - Using the logic of the …
oscarlund121 Oct 20, 2025
53358e7
CoPilot review updates
oscarlund121 Oct 21, 2025
dfc5c95
Import update:
oscarlund121 Oct 21, 2025
59b3a3d
diffwidth marked as unused
oscarlund121 Oct 21, 2025
bf99297
Various improvements to the diff view
ulrikandersen Nov 20, 2025
4f7bdab
Merge branch 'develop' into openapi-diff
ulrikandersen Nov 20, 2025
d89b9e1
Fixes build errors
ulrikandersen Nov 20, 2025
994c9a7
Fixes
ulrikandersen Nov 20, 2025
53a978d
Install oasdiff in Docker
ulrikandersen Nov 20, 2025
7a925a3
Add instructuons for oasdiff
ulrikandersen Nov 20, 2025
1d6494e
Ensure diff sidebar is closed by default
ulrikandersen Nov 20, 2025
e3f37ea
Fetch PRs for all repos in one query
ulrikandersen Nov 20, 2025
35da9c6
Disable diff button if diff cannot be determined
ulrikandersen Nov 20, 2025
134687d
Tooltip text was inverted
ulrikandersen Nov 20, 2025
dee68f8
Initial plan
Copilot Nov 20, 2025
a0096bb
Add URL validation for GitHub domains in OasDiffCalculator
Copilot Nov 20, 2025
93dba46
Use IGitHubClient interface instead of concrete class
Copilot Nov 20, 2025
ebc4979
Merge pull request #620 from shapehq/copilot/sub-pr-607
ulrikandersen Nov 20, 2025
a0de56f
Update src/features/sidebar/data/useDiff.ts
ulrikandersen Nov 20, 2025
af121ce
Initial plan
Copilot Nov 20, 2025
2724866
Use change.id as React key instead of array index
Copilot Nov 20, 2025
ec558d3
Update pull request query to only fetch OPEN states
ulrikandersen Nov 20, 2025
0f09ea9
Remove unnecessary React imports from multiple components
ulrikandersen Nov 20, 2025
edfb8e6
Remove semicolons
ulrikandersen Nov 20, 2025
9bb6004
Fix issue in SpacedList
ulrikandersen Nov 20, 2025
87f82f3
Remove unused border
ulrikandersen Nov 20, 2025
0f6711a
Fix linting error
ulrikandersen Nov 20, 2025
084883c
Refactor GitHubRepositoryDataSource for improved readability and cons…
ulrikandersen Nov 20, 2025
8c68abe
Refactor ClientSplitView for consistency and readability
ulrikandersen Nov 20, 2025
0ad48be
Refactor SecondarySplitHeader for improved readability and consistency
ulrikandersen Nov 20, 2025
a76b31c
Resolve merge conflicts with openapi-diff base branch
Copilot Nov 20, 2025
a2e5999
Merge branch 'openapi-diff' into copilot/sub-pr-607
Copilot Nov 20, 2025
850bd84
Merge pull request #622 from shapehq/copilot/sub-pr-607
ulrikandersen Nov 20, 2025
3cb312d
feat: add PR comparison context and new file detection to OpenAPI dif…
ulrikandersen Nov 21, 2025
21dea16
chore: fix linting errors - remove unused variables and escape apostr…
ulrikandersen Nov 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
"@types/node": "^24.0.8",
"@types/nprogress": "^0.2.3",
"@types/pg": "^8.15.2",
"@typescript-eslint/eslint-plugin": "^8.35.1",
"@types/react": "^19.1.9",
"@types/react-dom": "^19.1.7",
"@typescript-eslint/eslint-plugin": "^8.35.1",
"@typescript-eslint/parser": "^8.31.1",
"eslint": "^9.30.0",
"eslint-config-next": "^15.3.4",
Expand Down
56 changes: 56 additions & 0 deletions src/app/api/diff/[owner]/[repository]/[...path]/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { NextRequest, NextResponse } from "next/server"
import { session, userGitHubClient } from "@/composition"
import { makeUnauthenticatedAPIErrorResponse } from "@/common"
import { execSync } from "child_process"

interface GetDiffParams {
owner: string
repository: string
path: [string]
}

export async function GET(req: NextRequest, { params }: { params: Promise<GetDiffParams> }) {
const isAuthenticated = await session.getIsAuthenticated()
if (!isAuthenticated) {
return makeUnauthenticatedAPIErrorResponse()
}

const { path: paramsPath, owner, repository } = await params
const path = paramsPath.join("/")

const fromRef = req.nextUrl.searchParams.get("from")
const toRef = req.nextUrl.searchParams.get("to")

if (!fromRef || !toRef) {
return NextResponse.json({ error: "Missing from/to parameters" }, { status: 400 })
}

const fullRepositoryName = repository + "-openapi"

const spec1 = await userGitHubClient.getRepositoryContent({
repositoryOwner: owner,
repositoryName: fullRepositoryName,
path: path,
ref: fromRef
})

const spec2 = await userGitHubClient.getRepositoryContent({
repositoryOwner: owner,
repositoryName: fullRepositoryName,
path: path,
ref: toRef
})

const result = execSync(`oasdiff changelog --format json "${spec1.downloadURL}" "${spec2.downloadURL}"`, { encoding: 'utf8' })

console.log(result)


const diffData = JSON.parse(result)

return NextResponse.json({
from: fromRef,
to: toRef,
changes: diffData
})
}
22 changes: 15 additions & 7 deletions src/common/ui/SpacedList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,21 @@ const SpacedList = ({
}) => {
return (
<List disablePadding sx={{ ...sx }}>
{React.Children.map(children, (child, idx) => (
<Box sx={{
marginBottom: idx < React.Children.count(children) - 1 ? itemSpacing : 0
}}>
{child}
</Box>
))}
{React.Children.map(children, (child, idx) => {
const baseKey = (child as any)?.key ?? "idx";
const key = `${String(baseKey)}-${idx}`;
return (
<Box
key={key}
sx={{
marginBottom:
idx < React.Children.count(children) - 1 ? itemSpacing : 0,
}}
>
{child}
</Box>
);
})}
</List>
)
}
Expand Down
3 changes: 2 additions & 1 deletion src/features/projects/data/GitHubProjectDataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ export default class GitHubProjectDataSource implements IProjectDataSource {
name: ref.name,
specifications: specifications,
url: `https://github.com/${ownerName}/${repositoryName}/tree/${ref.name}`,
isDefault: isDefaultRef || false
isDefault: isDefaultRef || false,
baseRef: ref.baseRef,
}
}

Expand Down
Loading
Loading