Skip to content

fix: ui in consistencies and linter issues#3979

Merged
chronark merged 1 commit intomainfrom
rollback-ui-inconsistencies
Sep 16, 2025
Merged

fix: ui in consistencies and linter issues#3979
chronark merged 1 commit intomainfrom
rollback-ui-inconsistencies

Conversation

@ogzhanolguncu
Copy link
Contributor

@ogzhanolguncu ogzhanolguncu commented Sep 16, 2025

What does this PR do?

Fixes UI inconsistencies in rollback dialog and linter issues.

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?

  • Make sure everything works as before

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

Summary by CodeRabbit

  • New Features
    • Added signal indicator to Active Deployment and Rollback dialog cards.
    • Added status badges (Active/Preview) and concise ID/commit displays.
  • UI Improvements
    • Revamped Rollback dialog with clearer sections, headers, and spacing.
    • Deployment cards show commit message (when available) and compact branch/commit chips.
  • Performance
    • Improved responsiveness of the deployments table when the active deployment changes.
  • Refactor
    • Modularized rollback dialog into reusable components for clearer presentation.

@changeset-bot
Copy link

changeset-bot bot commented Sep 16, 2025

⚠️ No Changeset found

Latest commit: dcdcbe0

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

@vercel
Copy link

vercel bot commented Sep 16, 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 16, 2025 11:13am
engineering Ready Ready Preview Comment Sep 16, 2025 11:13am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 16, 2025

📝 Walkthrough

Walkthrough

Refactors rollback dialog UI into modular components, introduces optional withSignal prop to StatusIndicator, updates ActiveDeploymentCard to use it, and adjusts DeploymentsList column memo dependencies and formatting. Public API change: StatusIndicator now accepts an optional withSignal boolean.

Changes

Cohort / File(s) Summary
Rollback dialog UI modularization
apps/dashboard/app/(app)/projects/[projectId]/deployments/components/rollback-dialog.tsx
Replaces inline sections with DeploymentSection and DeploymentCard components, adds shortenId and StatusIndicator (withSignal) usage, updates layout/markup, preserves rollback behavior and toasts.
Deployments list memo deps tweak
apps/dashboard/app/(app)/projects/[projectId]/deployments/components/table/deployments-list.tsx
Formatting of type annotations; changes useMemo dependency array to remove deployments and add activeDeploymentId. No API changes.
Active deployment card uses signal
apps/dashboard/app/(app)/projects/[projectId]/details/active-deployment-card/index.tsx
Formats status mapping; renders StatusIndicator with withSignal prop. No signature changes.
StatusIndicator API update
apps/dashboard/app/(app)/projects/[projectId]/details/active-deployment-card/status-indicator.tsx
Adds optional withSignal prop (default false) to control rendering of signal group; updates exported function signature.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

Bug, 🕹️ oss.gg, :joystick: 150 points

Suggested reviewers

  • mcstepp
  • chronark
  • perkinsjr

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description includes the template headings but is incomplete and ambiguous: it does not reference an issue number, the "How should this be tested?" section is overly vague ("Make sure everything works as before"), and the "Type of change" section incorrectly marks every checkbox including "Breaking change"; concrete test steps, expected outcomes, and UI screenshots or a short recording are missing. Please add a linked issue (or state why none is needed), provide explicit step-by-step test instructions and expected results for the rollback dialog UI, update the "Type of change" checkboxes to only the applicable items and clarify whether anything is breaking, and attach screenshots or a short recording of the UI changes while ensuring the checklist accurately reflects the verification performed.
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 is related to the changeset — it references UI fixes and linter issues which align with the rollback dialog and refactor work — but it contains a typo ("in consistencies") and is somewhat generic; making it explicitly reference the rollback dialog would improve clarity for reviewers and history scanning.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch rollback-ui-inconsistencies

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 16, 2025

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

@vercel vercel bot temporarily deployed to Preview – dashboard September 16, 2025 11:13 Inactive
@chronark
Copy link
Collaborator

please add a screenshot for these type of PRs, I have no idea what this even does

@chronark chronark merged commit ae35563 into main Sep 16, 2025
18 of 19 checks passed
@chronark chronark deleted the rollback-ui-inconsistencies branch September 16, 2025 11:16
@ogzhanolguncu
Copy link
Contributor Author

@chronark
image is the PR

image this is the figma version

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: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/dashboard/app/(app)/projects/[projectId]/deployments/components/table/deployments-list.tsx (1)

408-416: Broken row keys: using row.id instead of row.deployment.id.

keyExtractor receives the row shape { deployment, environment }. Using deployment.id (the variable name here is the row) returns undefined, causing unstable/missing React keys.

Apply:

-      keyExtractor={(deployment) => deployment.id}
+      keyExtractor={(row) => row.deployment.id}
🧹 Nitpick comments (5)
apps/dashboard/app/(app)/projects/[projectId]/details/active-deployment-card/status-indicator.tsx (1)

14-35: Ping keyframes reliability + a11y and affordance nits.

  • Ensure @keyframes ping is emitted by your build. Prefer Tailwind’s animate-ping plus per-dot animationDelay to avoid missing keyframes in CSS extraction.
  • The cloud wrapper shows a pointer cursor but is not interactive; drop the pointer to avoid misleading affordance.
  • Mark the decorative signal group aria-hidden.

Apply inside the signal dots:

-              className={cn(
+              className={cn(
                 "absolute inset-0 size-2 rounded-full",
+                "animate-ping",
                 index === 0 && "bg-successA-9 opacity-75",
                 index === 1 && "bg-successA-10 opacity-60",
                 index === 2 && "bg-successA-11 opacity-40",
                 index === 3 && "bg-successA-12 opacity-25",
               )}
               style={{
-                animation: "ping 2s cubic-bezier(0, 0, 0.2, 1) infinite",
-                animationDelay: `${delay}s`,
+                animationDelay: `${delay}s`,
+                animationDuration: "2s",
               }}

Also mark the signal group decorative:

-        <div className="absolute -top-0.5 -right-0.5">
+        <div className="absolute -top-0.5 -right-0.5" aria-hidden="true">

Outside this hunk, remove the pointer cursor on the icon container:

-      <div className="size-5 rounded flex items-center justify-center cursor-pointer border border-grayA-3 transition-all duration-100 bg-grayA-3">
+      <div className="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/active-deployment-card/index.tsx (1)

103-104: Good use of withSignal; tighten surrounding UI details.

  • Badge text color is forced to success even for non-success variants; let the Badge style drive color.
  • Replace “TODO” placeholders with real data.
  • Use author avatar from data instead of a placeholder asset.

Suggested minimal fixes outside this hunk:

-          <Badge variant={statusConfig.variant} className="text-successA-11 font-medium">
+          <Badge variant={statusConfig.variant} className="font-medium">
-            <div className="text-gray-9 text-xs">TODO</div>
+            <div className="text-gray-9 text-xs">
+              {deployment.gitCommitMessage ?? "—"}
+            </div>
-              <img src="TODO" alt="TODO" className="rounded-full size-5" />
+              <img
+                src={deployment.gitCommitAuthorAvatarUrl ?? ""}
+                alt={deployment.gitCommitAuthorName ?? "Author"}
+                className="rounded-full size-5"
+                referrerPolicy="no-referrer"
+                loading="lazy"
+              />
apps/dashboard/app/(app)/projects/[projectId]/deployments/components/rollback-dialog.tsx (3)

125-159: Use shortenId consistently for deployment IDs (avoid manual slicing).

Keeps formatting consistent with commit SHA usage and centralizes rules.

-            <span className="text-xs text-accent-12 font-mono">
-              {`${deployment.id.slice(0, 3)}...${deployment.id.slice(-4)}`}
-            </span>
+            <span className="text-xs text-accent-12 font-mono">
+              {shortenId(deployment.id, { startChars: 4, endChars: 4 })}
+            </span>

44-56: Avoid brittle collection.projects.utils.refetch() hack.

utils.invalidate() should be sufficient. The extra refetch is undocumented and error‑prone.

       toast.success("Rollback completed", {
         description: `Successfully rolled back to deployment ${deployment.id}`,
       });
-      // hack to revalidate
-      try {
-        // @ts-expect-error Their docs say it's here
-        collection.projects.utils.refetch();
-      } catch (error) {
-        console.error("Refetch error:", error);
-      }
 
       onOpenChange(false);

10-25: Prop naming consistency: prefer withSignal (matches StatusIndicator).

Local showSignal works but diverges from the shared component prop, increasing cognitive overhead.

-type DeploymentSectionProps = {
+type DeploymentSectionProps = {
   title: string;
   deployment: Deployment;
   isActive: boolean;
-  showSignal?: boolean;
+  withSignal?: boolean;
 };
 
-const DeploymentSection = ({ title, deployment, isActive, showSignal }: DeploymentSectionProps) => (
+const DeploymentSection = ({ title, deployment, isActive, withSignal }: DeploymentSectionProps) => (
   <div className="space-y-2">
@@
-    <DeploymentCard deployment={deployment} isActive={isActive} showSignal={showSignal} />
+    <DeploymentCard deployment={deployment} isActive={isActive} withSignal={withSignal} />
   </div>
 );

And in usages:

-<DeploymentSection
+<DeploymentSection
   title="Current active deployment"
   deployment={currentDeployment}
   isActive={true}
-  showSignal={true}
+  withSignal
/>

Prop threading:

-type DeploymentCardProps = {
+type DeploymentCardProps = {
   deployment: Deployment;
   isActive: boolean;
-  showSignal?: boolean;
+  withSignal?: boolean;
 };
 
-const DeploymentCard = ({ deployment, isActive, showSignal }: DeploymentCardProps) => (
+const DeploymentCard = ({ deployment, isActive, withSignal }: DeploymentCardProps) => (
@@
-        <StatusIndicator withSignal={showSignal} />
+        <StatusIndicator withSignal={withSignal} />
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c3b875a and dcdcbe0.

📒 Files selected for processing (4)
  • apps/dashboard/app/(app)/projects/[projectId]/deployments/components/rollback-dialog.tsx (2 hunks)
  • apps/dashboard/app/(app)/projects/[projectId]/deployments/components/table/deployments-list.tsx (3 hunks)
  • apps/dashboard/app/(app)/projects/[projectId]/details/active-deployment-card/index.tsx (2 hunks)
  • apps/dashboard/app/(app)/projects/[projectId]/details/active-deployment-card/status-indicator.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: mcstepp
PR: unkeyed/unkey#3952
File: apps/dashboard/app/(app)/projects/[projectId]/deployments/components/rollback-dialog.tsx:70-79
Timestamp: 2025-09-12T17:57:18.305Z
Learning: In the deployment rollback functionality, self-rollback scenarios are prevented at the UI level in the actions menu through the `canRollback` condition which includes `!("active" in deployment && deployment.active)`, making additional checks in the dialog component redundant.
📚 Learning: 2025-07-25T19:09:43.284Z
Learnt from: mcstepp
PR: unkeyed/unkey#3662
File: apps/dashboard/lib/trpc/routers/deployment/list.ts:11-11
Timestamp: 2025-07-25T19:09:43.284Z
Learning: In apps/dashboard/lib/trpc/routers/deployment/list.ts, the listDeployments procedure intentionally queries the versions table rather than a deployments table. The user mcstepp indicated that renaming the table would require a database migration, which was deferred for the current PR focused on UI features.

Applied to files:

  • apps/dashboard/app/(app)/projects/[projectId]/deployments/components/table/deployments-list.tsx
📚 Learning: 2025-09-12T17:57:18.305Z
Learnt from: mcstepp
PR: unkeyed/unkey#3952
File: apps/dashboard/app/(app)/projects/[projectId]/deployments/components/rollback-dialog.tsx:70-79
Timestamp: 2025-09-12T17:57:18.305Z
Learning: In the deployment rollback functionality, self-rollback scenarios are prevented at the UI level in the actions menu through the `canRollback` condition which includes `!("active" in deployment && deployment.active)`, making additional checks in the dialog component redundant.

Applied to files:

  • apps/dashboard/app/(app)/projects/[projectId]/deployments/components/rollback-dialog.tsx
🧬 Code graph analysis (4)
apps/dashboard/app/(app)/projects/[projectId]/details/active-deployment-card/status-indicator.tsx (1)
internal/icons/src/icons/cloud.tsx (1)
  • Cloud (15-38)
apps/dashboard/app/(app)/projects/[projectId]/deployments/components/table/deployments-list.tsx (3)
apps/dashboard/components/virtual-table/types.ts (1)
  • Column (13-24)
apps/dashboard/lib/collections/deployments.ts (1)
  • Deployment (38-38)
apps/dashboard/lib/collections/environments.ts (1)
  • Environment (13-13)
apps/dashboard/app/(app)/projects/[projectId]/details/active-deployment-card/index.tsx (2)
internal/icons/src/icons/circle-warning.tsx (1)
  • CircleWarning (15-42)
apps/dashboard/app/(app)/projects/[projectId]/details/active-deployment-card/status-indicator.tsx (1)
  • StatusIndicator (4-38)
apps/dashboard/app/(app)/projects/[projectId]/deployments/components/rollback-dialog.tsx (3)
go/gen/proto/ctrl/v1/deployment.pb.go (3)
  • Deployment (420-455)
  • Deployment (468-468)
  • Deployment (483-485)
apps/dashboard/app/(app)/projects/[projectId]/details/active-deployment-card/status-indicator.tsx (1)
  • StatusIndicator (4-38)
apps/dashboard/lib/shorten-id.ts (1)
  • shortenId (5-54)
⏰ 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: Build / Build
  • GitHub Check: Test API / API Test Local
  • GitHub Check: Test Go API Local / Test
🔇 Additional comments (7)
apps/dashboard/app/(app)/projects/[projectId]/details/active-deployment-card/index.tsx (1)

34-56: Status mapping refactor is a no-op.

Pure reformat; semantics unchanged.

apps/dashboard/app/(app)/projects/[projectId]/deployments/components/table/deployments-list.tsx (4)

163-166: Types on Column data look good.

Explicit row shape improves readability in render fns.


389-395: Param typing in Action column: good.

Matches the table row shape and ensures props safety.


406-406: useMemo deps: deployments intentionally omitted — verified.

Columns useMemo (lines ~163–172) contains no references to deployments; deployments.data is passed to VirtualTable at line ~410. No change required now — add deployments to the deps if you later read deployments (e.g., counts) inside any column.


229-241: runtimeConfig is required by schema — defensive checks unnecessary. runtimeConfig is defined as a required z.object in apps/dashboard/lib/collections/deployments.ts and is returned by the trpc router (apps/dashboard/lib/trpc/routers/deployment/list.ts); DB schema maps runtime_config as JSON (internal/db/src/schema/deployments.ts). Current direct accesses (regions.reduce, cpus, memory) align with the schema.

Likely an incorrect or invalid review comment.

apps/dashboard/app/(app)/projects/[projectId]/deployments/components/rollback-dialog.tsx (1)

106-116: Modular sections/card: solid cleanup and parity maintained.

The dialog reads cleaner and composes well. No extra self‑rollback checks added—aligned with prior guidance.

apps/dashboard/app/(app)/projects/[projectId]/details/active-deployment-card/status-indicator.tsx (1)

4-8: Public prop added — verified: no non‑JSX invocations found

Search found only the definition and JSX usages in:

  • apps/dashboard/app/(app)/projects/[projectId]/details/active-deployment-card/status-indicator.tsx (definition)
  • apps/dashboard/app/(app)/projects/[projectId]/details/active-deployment-card/index.tsx ()
  • apps/dashboard/app/(app)/projects/[projectId]/details/active-deployment-card/skeleton.tsx ()
  • apps/dashboard/app/(app)/projects/[projectId]/deployments/components/rollback-dialog.tsx ()

No plain function calls (StatusIndicator(...)) or createElement/h(StatusIndicator) usages were found.

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