Skip to content

Conversation

@JivusAyrus
Copy link
Member

@JivusAyrus JivusAyrus commented Sep 2, 2025

Summary by CodeRabbit

  • New Features
    • Dismissible “Cosmo Connect is here!” popup added to the dashboard side navigation (visible on large screens).
    • Highlights “A new way to unify your API ecosystem” with an external Learn More link that opens in a new tab.
    • Dismissal is remembered across sessions so the popup won’t reappear once closed.
    • Compact styling with gradient border, dark background, and decorative graphic for visual emphasis.

Checklist

  • I have discussed my proposed changes in an issue and have received approval to proceed.
  • I have followed the coding standards of the project.
  • Tests or benchmarks have been added or updated.
  • Documentation has been updated on https://github.com/wundergraph/cosmo-docs.
  • I have read the Contributors Guide.
image

@coderabbitai
Copy link

coderabbitai bot commented Sep 2, 2025

Walkthrough

Adds a dismissible "New Features" popup component, a localStorage-backed hook to persist its dismissal, and renders the popup inside the SideNav on large screens; also adds relative positioning to the aside and minor non-functional formatting tweaks.

Changes

Cohort / File(s) Summary of changes
New popup component
studio/src/components/dashboard/NewFeaturesPopup.tsx
Adds default-exported React component rendering a compact styled popup (title, description, external link, close button, decorative SVG). Uses Tailwind classes and calls setDisablePopup("true") on close; renders nothing when disabled.
Dismiss-state hook
studio/src/hooks/use-new-features-popup-disabled.ts
Adds useNewFeaturesPopupDisabled() hook returning [isPopupDisabled, setDisablePopup], syncing a boolean with localStorage key dismissNewFeaturesPopup (stored as string "true"/"false").
SideNav integration & layout tweak
studio/src/components/layout/sidenav.tsx
Imports and renders NewFeaturesPopup anchored bottom-left on large screens; adds relative to the aside container and applies minor className formatting/reordering (no behavior change).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 5a919c0 and 510fea4.

📒 Files selected for processing (1)
  • studio/src/components/layout/sidenav.tsx (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • studio/src/components/layout/sidenav.tsx
⏰ 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_test
  • GitHub Check: build_push_image
  • GitHub Check: Analyze (go)
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the studio label Sep 2, 2025
Copy link

@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: 2

🧹 Nitpick comments (6)
studio/src/hooks/use-new-features-popup-disabled.ts (2)

4-15: Expose a boolean setter (avoid leaking stringly-typed storage API).

Return a boolean setter and encapsulate the string conversion internally. This prevents accidental misuse and simplifies consumers.

Apply:

-import { Dispatch, SetStateAction, useEffect, useState } from "react";
+import { Dispatch, SetStateAction, useCallback, useEffect, useState } from "react";
@@
-export function useNewFeaturesPopupDisabled(): [boolean, Dispatch<SetStateAction<string>>] {
-  const [isPopupDisabled, setIsPopupDisabled] = useState(true);
-  const [isPopupDisabledOnClient, setDisablePopup] = useLocalStorage(
-    "dismissNewFeaturesPopup",
-    "false",
-  );
+const STORAGE_KEY = "dismissNewFeaturesPopup:v1";
+
+export function useNewFeaturesPopupDisabled(): [boolean, Dispatch<SetStateAction<boolean>>] {
+  const [isPopupDisabled, setIsPopupDisabled] = useState(true);
+  const [stored, setStored] = useLocalStorage(STORAGE_KEY, "false");
@@
-  useEffect(() => {
-    setIsPopupDisabled(isPopupDisabledOnClient === "true");
-  }, [isPopupDisabledOnClient]);
+  useEffect(() => {
+    setIsPopupDisabled(stored === "true");
+  }, [stored]);
 
-  return [isPopupDisabled, setDisablePopup];
+  const setPopupDisabled: Dispatch<SetStateAction<boolean>> = useCallback((next) => {
+    setStored((prev) => {
+      const prevBool = prev === "true";
+      const nextBool = typeof next === "function" ? (next as (p: boolean) => boolean)(prevBool) : next;
+      return nextBool ? "true" : "false";
+    });
+  }, [setStored]);
+
+  return [isPopupDisabled, setPopupDisabled];
 }

6-9: Version the storage key to allow future re-showing.

A versioned key (e.g., “:v1”) lets you re-announce future features without migrating existing users’ state.

studio/src/components/layout/sidenav.tsx (1)

29-29: Load the popup lazily on the client to avoid hydration pitfalls and trim SSR bundle.

The popup depends on localStorage; dynamic import with ssr: false prevents SSR mismatches and reduces server payload.

-import NewFeaturesPopup from "../dashboard/NewFeaturesPopup";
+import dynamic from "next/dynamic";
+const NewFeaturesPopup = dynamic(() => import("../dashboard/NewFeaturesPopup"), { ssr: false });
studio/src/components/dashboard/NewFeaturesPopup.tsx (3)

31-37: Make the close button accessible and discoverable without hover.

Add an accessible name and reveal on keyboard focus.

-            <Button
+            <Button
               variant="ghost"
               size="icon"
-              className="h-4 w-4 cursor-pointer text-white/50 opacity-0 transition-all duration-300 group-hover:opacity-100"
+              className="h-4 w-4 cursor-pointer text-white/50 opacity-0 transition-all duration-300 group-hover:opacity-100 focus-visible:opacity-100"
+              aria-label="Close new features popup"
               onClick={handleClosePopup}
             >

46-53: Harden external link target and improve a11y hint.

Include noopener and an aria-label to indicate a new tab.

-        <Link
+        <Link
           href="https://wundergraph.com/connect"
           target="_blank"
-          rel="noreferrer"
+          rel="noreferrer noopener"
           className="flex items-center gap-x-1 text-sm font-medium text-white hover:underline"
+          aria-label="Learn more about Cosmo Connect (opens in a new tab)"
         >

22-22: Theme consistency.

Avoid hard-coded hex background; prefer a token (e.g., bg-card) to respect themes.

-      <div className="relative z-10 flex h-full w-full flex-col items-start justify-center gap-4 rounded-lg bg-[#15121C] p-3">
+      <div className="relative z-10 flex h-full w-full flex-col items-start justify-center gap-4 rounded-lg bg-card p-3">
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 2e58668 and 5a919c0.

📒 Files selected for processing (3)
  • studio/src/components/dashboard/NewFeaturesPopup.tsx (1 hunks)
  • studio/src/components/layout/sidenav.tsx (4 hunks)
  • studio/src/hooks/use-new-features-popup-disabled.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
studio/src/components/layout/sidenav.tsx (2)
studio/src/lib/utils.ts (1)
  • cn (6-8)
studio/src/components/dashboard/NewFeaturesPopup.tsx (1)
  • NewFeaturesPopup (8-204)
studio/src/components/dashboard/NewFeaturesPopup.tsx (2)
studio/src/hooks/use-new-features-popup-disabled.ts (1)
  • useNewFeaturesPopupDisabled (4-16)
studio/src/components/ui/link.tsx (1)
  • Link (5-16)
⏰ 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_test
  • GitHub Check: build_push_image
  • GitHub Check: Analyze (go)

Copy link
Contributor

@StarpTech StarpTech left a comment

Choose a reason for hiding this comment

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

LGTM

@JivusAyrus JivusAyrus merged commit fb0c48f into main Sep 3, 2025
10 checks passed
@JivusAyrus JivusAyrus deleted the suvij/eng-8043-add-dashboard-popup-component-to-the-studio branch September 3, 2025 16:06
@coderabbitai coderabbitai bot mentioned this pull request Sep 9, 2025
5 tasks
@Noroth Noroth mentioned this pull request Sep 30, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants