Skip to content

feat: add openapi changes indicator#4021

Closed
ogzhanolguncu wants to merge 5 commits intomainfrom
deploy-openapi-diff-indicator
Closed

feat: add openapi changes indicator#4021
ogzhanolguncu wants to merge 5 commits intomainfrom
deploy-openapi-diff-indicator

Conversation

@ogzhanolguncu
Copy link
Contributor

What does this PR do?

This PR adds OpenAPI changes indicator to active deployment details to project details UI.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Chore (refactoring code, technical debt, workflow improvements)
  • Enhancement (small improvements)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How should this be tested?

  • Nothing to test just a visual change

Checklist

Required

  • Filled out the "How to test" section in this PR
  • Read Contributing Guide
  • Self-reviewed my own code
  • Commented on my code in hard-to-understand areas
  • Ran pnpm build
  • Ran pnpm fmt
  • Checked for warnings, there are none
  • Removed all console.logs
  • Merged the latest changes from main onto my branch with git pull origin main
  • My changes don't cause any responsiveness issues

Appreciated

  • If a UI change was made: Added a screen recording or screenshots to this PR
  • Updated the Unkey Docs if changes were necessary
image

@changeset-bot
Copy link

changeset-bot bot commented Sep 24, 2025

⚠️ No Changeset found

Latest commit: 102611d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 24, 2025

Warning

Rate limit exceeded

@ogzhanolguncu has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 22 minutes and 33 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between f9ed794 and 102611d.

📒 Files selected for processing (2)
  • apps/dashboard/app/(app)/projects/[projectId]/details/active-deployment-card/status-indicator.tsx (1 hunks)
  • apps/dashboard/app/(app)/projects/[projectId]/details/project-details-expandables/sections.tsx (3 hunks)
📝 Walkthrough

Walkthrough

Introduces a className prop and props type to StatusIndicator, makes DetailRow icon/label nullable with conditional rendering, adds live domains retrieval via useLiveQuery to project details and renders dynamic domain links and tooltip, and adds a new “OpenAPI changes” detail section leveraging StatusIndicator and layout adjustments.

Changes

Cohort / File(s) Summary
StatusIndicator props and styling
apps/dashboard/app/(app)/projects/[projectId]/details/active-deployment-card/status-indicator.tsx
Adds StatusIndicatorProps with optional withSignal and className; updates function signature; threads className to root element by merging via cn; removes an inline biome-ignore comment.
Detail row nullability and conditional rendering
apps/dashboard/app/(app)/projects/[projectId]/details/project-details-expandables/detail-section.tsx
Makes icon and label nullable; adds early return when both are missing; conditionally renders icon and label blocks when present; children can span width without icon/label.
Dynamic domains in project details
apps/dashboard/app/(app)/projects/[projectId]/details/project-details-expandables/index.tsx
Uses useLiveQuery to fetch domains by project?.liveDeploymentId; replaces static labels with project name; renders first domain link with truncation; tooltip lists remaining domains and counts them; adjusts minor layout classes.
New “OpenAPI changes” section
apps/dashboard/app/(app)/projects/[projectId]/details/project-details-expandables/sections.tsx
Imports ArrowRight and StatusIndicator; updates DetailItem types to nullable icon/label; adds exported “OpenAPI changes” section with comparative layout using two StatusIndicators and ArrowRight; existing “Active deployment” section retained.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant UI as Project Details UI
  participant Hook as useLiveQuery(domains)
  participant API as Domains Store

  User->>UI: Navigate to Project Details
  UI->>Hook: subscribe(project?.liveDeploymentId)
  Hook->>API: query domains by liveDeploymentId
  API-->>Hook: domains[]
  Hook-->>UI: { project, domains }
  UI->>UI: Render project name
  UI->>UI: Render first domain link (domains[0])
  alt Additional domains
    UI->>UI: Show tooltip with domains[1..]
  else No additional domains
    UI->>UI: No tooltip
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

🕹️ oss.gg, :joystick: 150 points

Suggested reviewers

  • perkinsjr
  • mcstepp
  • chronark

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description includes the main template sections but omits the required 'Fixes #' reference and deeper context or dependencies. It also provides only a minimal testing note and leaves all required checklist items unchecked. Please add the appropriate issue reference under a 'Fixes #' line and ensure the description includes motivation, context, and any dependencies. Provide concrete test steps for verifying the visual change and complete all required checklist items such as running builds, formatting, and self-review.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly conveys the main feature being introduced by this changeset, namely the addition of an OpenAPI changes indicator. It follows conventional commit style and is clear enough for a teammate reviewing history to understand the core change.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@vercel
Copy link

vercel bot commented Sep 24, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
dashboard Ready Ready Preview Comment Sep 25, 2025 10:36am
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
engineering Ignored Ignored Preview Sep 25, 2025 10:36am

@vercel vercel bot temporarily deployed to Preview – dashboard September 24, 2025 13:19 Inactive
@vercel vercel bot temporarily deployed to Preview – dashboard September 25, 2025 10:28 Inactive
@ogzhanolguncu ogzhanolguncu marked this pull request as ready for review September 25, 2025 10:29
@github-actions
Copy link
Contributor

Thank you for following the naming conventions for pull request titles! 🙏

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (4)
apps/dashboard/app/(app)/projects/[projectId]/details/active-deployment-card/status-indicator.tsx (2)

9-17: Clarify which element className targets (container vs indicator).

className is applied to the inner indicator, not the root container (relative). This is easy to misread and can surprise consumers who try to move/position the whole component. Consider renaming to indicatorClassName and optionally adding containerClassName for the outer div.


12-17: Remove “cursor-pointer” or wire up interactivity and accessibility.

There’s no click handler; the cursor suggests interactivity. Either remove it or add onClick, role="button", and keyboard handling.

-          "size-5 rounded flex items-center justify-center cursor-pointer border border-grayA-3 transition-all duration-100 bg-grayA-3",
+          "size-5 rounded flex items-center justify-center border border-grayA-3 transition-all duration-100 bg-grayA-3",
apps/dashboard/app/(app)/projects/[projectId]/details/project-details-expandables/detail-section.tsx (1)

53-61: Avoid unstable keys when label can be null.

key={${item.label}-${index}} becomes "null-<index>" for unlabeled rows and may collide. Fallback to index (or add a stable id on items).

-          <DetailRow
-            key={`${item.label}-${index}`}
+          <DetailRow
+            key={item.label ? `${item.label}-${index}` : `row-${index}`}
             icon={item.icon}
             label={item.label}
             alignment={item.alignment}
           >
apps/dashboard/app/(app)/projects/[projectId]/details/project-details-expandables/index.tsx (1)

128-150: Defensive rendering and UX polish for additional domains.

  • With the default domains = [], this is safe, but consider hiding the badge when there are no extra domains.
-                    <InfoTooltip
+                    {domains.length > 1 && (
+                      <InfoTooltip
                       position={{
                         side: "bottom",
                       }}
                       content={
                         <div className="space-y-1 z-40">
                           {domains.slice(1).map((d) => (
                             <div
                               key={d.domain}
                               className="text-xs font-medium flex items-center gap-1.5"
                             >
                               <div className="w-1 h-1 bg-gray-8 rounded-full" />
                               <a
                                 href={`https://${d.domain}`}
                                 target="_blank"
                                 rel="noopener noreferrer"
                                 className="hover:underline truncate max-w-[270px]"
                               >
                                 {d.domain}
                               </a>
                             </div>
                           ))}
                         </div>
                       }
                     >
                       <div className="rounded-full px-1.5 py-0.5 bg-grayA-3 text-gray-12 text-xs leading-[18px] font-mono tabular-nums">
                         +{domains.slice(1).length}
                       </div>
-                    </InfoTooltip>
+                    </InfoTooltip>
+                    )}

Ensure design expects the badge to hide when there are no additional domains.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7df1c17 and f9ed794.

📒 Files selected for processing (4)
  • apps/dashboard/app/(app)/projects/[projectId]/details/active-deployment-card/status-indicator.tsx (1 hunks)
  • apps/dashboard/app/(app)/projects/[projectId]/details/project-details-expandables/detail-section.tsx (1 hunks)
  • apps/dashboard/app/(app)/projects/[projectId]/details/project-details-expandables/index.tsx (2 hunks)
  • apps/dashboard/app/(app)/projects/[projectId]/details/project-details-expandables/sections.tsx (3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-22T12:06:14.204Z
Learnt from: ogzhanolguncu
PR: unkeyed/unkey#3833
File: apps/dashboard/components/navigation/sidebar/app-sidebar/components/nav-items/nested-nav-item.tsx:56-65
Timestamp: 2025-08-22T12:06:14.204Z
Learning: In the navigation sidebar components, ReactNode labels are only used for "More" labels (load more buttons), while regular navigation items use string labels. This means type guards like `typeof item.label === "string"` are still valid for most navigation logic since ReactNode usage is limited to specific load-more functionality.

Applied to files:

  • apps/dashboard/app/(app)/projects/[projectId]/details/project-details-expandables/detail-section.tsx
🧬 Code graph analysis (2)
apps/dashboard/app/(app)/projects/[projectId]/details/project-details-expandables/index.tsx (1)
internal/db/src/schema/domains.ts (1)
  • domains (4-36)
apps/dashboard/app/(app)/projects/[projectId]/details/project-details-expandables/sections.tsx (2)
apps/dashboard/app/(app)/projects/[projectId]/details/active-deployment-card/status-indicator.tsx (1)
  • StatusIndicator (9-43)
internal/icons/src/icons/arrow-right.tsx (1)
  • ArrowRight (15-48)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Test API / API Test Local
  • GitHub Check: Test Go API Local / Test
  • GitHub Check: Build / Build
🔇 Additional comments (5)
apps/dashboard/app/(app)/projects/[projectId]/details/project-details-expandables/detail-section.tsx (3)

5-7: Nullable icon/label props: LGTM.

Allows richer rows and matches new OpenAPI changes section.


14-21: Early return for icon/label-less rows: LGTM.

Good layout handling when only children are provided.


26-31: Conditional rendering reads cleanly.

This avoids empty containers when icon/label are absent.

apps/dashboard/app/(app)/projects/[projectId]/details/project-details-expandables/sections.tsx (1)

24-26: DetailItem type nullability: LGTM.

Matches the new usage patterns.

apps/dashboard/app/(app)/projects/[projectId]/details/project-details-expandables/index.tsx (1)

38-44: Verify eq(..., project?.liveDeploymentId) with undefined.

If eq serializes undefined, it might produce an invalid condition. If supported, gate the query until the id exists; otherwise, the domains = [] default mitigates UI errors.

@chronark
Copy link
Collaborator

CleanShot 2025-09-29 at 17 37 56@2x

can we fix this edge case?

@ogzhanolguncu
Copy link
Contributor Author

@chronark don't mind that part. I have another PR which replaces all the dummy data including git and that domain part, and in that PR that issue is already handled. I'll make it ready by tomorrow.

@ogzhanolguncu
Copy link
Contributor Author

I'll merge this after this. #4034, because of the issues we had here addressed in that PR

@chronark
Copy link
Collaborator

chronark commented Oct 1, 2025

so do we merge this now? @ogzhanolguncu
if yes, we need to clean up the conflicts

@ogzhanolguncu
Copy link
Contributor Author

this one is dead I move code to another PR

@chronark chronark deleted the deploy-openapi-diff-indicator branch November 5, 2025 12:46
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.

2 participants