Skip to content

Conversation

anmolsinghbhatia
Copy link
Collaborator

@anmolsinghbhatia anmolsinghbhatia commented Aug 8, 2025

Description

This PR includes the following updates:

  • Revamped God Mode branding
  • Fixed Space App spinner logo theme
  • Code refactoring

Type of Change

  • Improvement
  • Code refactoring

Summary by CodeRabbit

  • New Features

    • Introduced a sticky authentication header for improved navigation.
    • Added a reusable form header component for consistent headings and subheadings.
  • Refactor

    • Simplified and restyled authentication and setup forms, improving layout and error messaging.
    • Streamlined layout and page structure by removing decorative and theme-dependent elements.
    • Updated loading and failure views for a cleaner, more focused user experience.
  • Style

    • Removed onboarding-specific color variables from global styles.
    • Adjusted logo and spinner images to better match light and dark themes.

@anmolsinghbhatia anmolsinghbhatia self-assigned this Aug 8, 2025
Copy link
Contributor

coderabbitai bot commented Aug 8, 2025

Walkthrough

This update introduces new AuthHeader and FormHeader components, refactors authentication and onboarding flows in the admin app for simplified structure and updated styling, and removes onboarding-specific CSS variables. Several components are reorganized to use the new headers and flex layouts, with theme-based logo logic inverted for consistency.

Changes

Cohort / File(s) Change Summary
New Header Components
apps/admin/app/(all)/(home)/auth-header.tsx, apps/admin/core/components/instance/form-header.tsx
Added new AuthHeader and FormHeader React components for consistent headers and form headings in authentication flows.
Authentication Flow Refactor
apps/admin/app/(all)/(home)/sign-in-form.tsx, apps/admin/app/(all)/(home)/page.tsx, apps/admin/app/(all)/(home)/layout.tsx
Refactored sign-in, page, and layout components to use new headers, simplified structure, updated styling, and removed onboarding-specific elements.
Instance Setup and Failure UI
apps/admin/core/components/instance/setup-form.tsx, apps/admin/core/components/instance/failure.tsx
Refactored setup and failure components to use new headers, reorganized layout, improved error handling, and updated styling. Failure view now wrapped with MobX observer.
Loading and Logo Spinner Components
apps/admin/core/components/common/logo-spinner.tsx, apps/admin/core/components/instance/loading.tsx, apps/space/core/components/common/logo-spinner.tsx
Inverted theme-based logo logic, simplified loading spinners, and updated responsive image styling.
Minor Text/Style Update
apps/admin/core/components/instance/instance-not-ready.tsx
Changed a single CSS class for text color.
CSS Variable Cleanup
apps/admin/styles/globals.css
Removed all onboarding-related CSS custom properties from global styles.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant AuthHeader
    participant FormHeader
    participant SignInForm
    participant SetupForm
    participant FailureView

    User->>AuthHeader: Loads authentication page
    AuthHeader-->>User: Renders sticky header with logo

    User->>SignInForm: Navigates to sign-in
    SignInForm->>FormHeader: Renders heading/subheading
    SignInForm-->>User: Displays sign-in form

    User->>SetupForm: Navigates to setup
    SetupForm->>AuthHeader: Renders header
    SetupForm->>FormHeader: Renders heading/subheading
    SetupForm-->>User: Displays setup form

    User->>FailureView: Encounter error
    FailureView->>AuthHeader: Renders header
    FailureView-->>User: Displays failure message
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15–20 minutes

Possibly related PRs

  • [WEB-4488] feat: brand revamp #7544: Introduces a similar AuthHeader component in the space app's views, indicating a parallel update for authentication headers across different app areas.

Suggested labels

🌟improvement, 🛠️refactor

Suggested reviewers

  • vamsikrishnamathala
  • sriramveeraghanta

Poem

A header hops onto each page,
With forms that flex and styles that engage.
Old onboarding colors, now out of sight,
New spinners and layouts feel just right.
With every refactor, the UI feels new—
A rabbit’s touch, for a sleeker view! 🐇✨

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat-god-mode-auth-revamp-and-code-refactor

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
🪧 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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
  • 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 src/utils.ts and explain its main purpose.
    • @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 comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai 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

Documentation and Community

  • 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.

Copy link

makeplane bot commented Aug 8, 2025

Pull Request Linked with Plane Work Items

Comment Automatically Generated by Plane

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

🔭 Outside diff range comments (3)
apps/admin/core/components/common/logo-spinner.tsx (1)

1-3: Client component required

This component uses a hook (useTheme) but lacks the "use client" directive.

Apply:

+"use client";
+
 import Image from "next/image";
 import { useTheme } from "next-themes";
 // assets
apps/space/core/components/common/logo-spinner.tsx (1)

11-16: Harden against theme flicker and improve alt/sizes

Mirror the admin fix to avoid spinner swap on mount and improve a11y + responsiveness.

 import { useTheme } from "next-themes";
+import { useEffect, useState } from "react";
 // assets
 import LogoSpinnerDark from "@/public/images/logo-spinner-dark.gif";
 import LogoSpinnerLight from "@/public/images/logo-spinner-light.gif";

 export const LogoSpinner = () => {
-  const { resolvedTheme } = useTheme();
-
-  const logoSrc = resolvedTheme === "dark" ? LogoSpinnerLight : LogoSpinnerDark;
+  const { resolvedTheme } = useTheme();
+  const [mounted, setMounted] = useState(false);
+  useEffect(() => setMounted(true), []);
+  const logoSrc = !mounted
+    ? LogoSpinnerDark
+    : resolvedTheme === "dark"
+    ? LogoSpinnerLight
+    : LogoSpinnerDark;

   return (
     <div className="flex items-center justify-center">
-      <Image src={logoSrc} alt="logo" className="h-6 w-auto sm:h-11" />
+      <Image src={logoSrc} alt="Plane logo spinner" sizes="(min-width: 640px) 44px, 24px" className="h-6 w-auto sm:h-11" />
     </div>
   );
 };
apps/admin/core/components/instance/setup-form.tsx (1)

63-63: Telemetry flag parsing always resolves to true (logic bug)

The || true forces isTelemetryEnabledParam to always be true, even when the query param is "False".

-const isTelemetryEnabledParam = (searchParams.get("is_telemetry_enabled") === "True" ? true : false) || true;
+const rawTelemetry = searchParams.get("is_telemetry_enabled");
+const isTelemetryEnabledParam = rawTelemetry === null ? true : rawTelemetry === "True";
🧹 Nitpick comments (12)
apps/admin/core/components/instance/instance-not-ready.tsx (2)

15-15: Improve alt text for accessibility

Make the alt text descriptive of the image content or use empty alt if purely decorative.

-        <Image src={PlaneTakeOffImage} alt="Plane Logo" />
+        <Image src={PlaneTakeOffImage} alt="Plane taking off illustration" />

3-3: Optional: drop React.FC for simplicity and consistency

React.FC adds little value here and may conflict with implicit children conventions. You can remove the type and import.

-import { FC } from "react";
+// (no FC import)

-export const InstanceNotReady: FC = () => (
+export const InstanceNotReady = () => (

Also applies to: 10-10

apps/admin/core/components/common/logo-spinner.tsx (1)

14-15: Alt text and responsive hint

Use a more descriptive alt and include sizes for better image selection.

-      <Image src={logoSrc} alt="logo" className="h-6 w-auto sm:h-11" />
+      <Image src={logoSrc} alt="Plane logo spinner" sizes="(min-width: 640px) 44px, 24px" className="h-6 w-auto sm:h-11" />
apps/admin/core/components/instance/form-header.tsx (1)

3-7: Improve semantics, flexibility, and typings

  • Use semantic headings for a11y.
  • Allow ReactNode for localization/formatting.
  • Extract props type for readability.
-export const FormHeader = ({ heading, subHeading }: { heading: string; subHeading: string }) => (
-  <div className="flex flex-col gap-1">
-    <span className="text-2xl font-semibold text-custom-text-100 leading-7">{heading}</span>
-    <span className="text-lg font-semibold text-custom-text-400 leading-7">{subHeading}</span>
-  </div>
-);
+type FormHeaderProps = { heading: React.ReactNode; subHeading: React.ReactNode; as?: keyof JSX.IntrinsicElements };
+export const FormHeader = ({ heading, subHeading, as: HeadingTag = "h1" }: FormHeaderProps) => (
+  <div className="flex flex-col gap-1">
+    <HeadingTag className="text-2xl font-semibold text-custom-text-100 leading-7">{heading}</HeadingTag>
+    <p className="text-lg font-semibold text-custom-text-400 leading-7">{subHeading}</p>
+  </div>
+);
apps/admin/app/(all)/(home)/auth-header.tsx (1)

6-11: Use semantic header, add background/z-index, and label the link

Improves a11y and ensures the sticky header doesn’t visually merge with scrolled content.

-export const AuthHeader = () => (
-  <div className="flex items-center justify-between gap-6 w-full flex-shrink-0 sticky top-0">
-    <Link href="/">
-      <PlaneLockup height={20} width={95} className="text-custom-text-100" />
-    </Link>
-  </div>
-);
+export const AuthHeader = () => (
+  <header className="sticky top-0 z-20 w-full flex-shrink-0 bg-custom-background-100 flex items-center justify-between gap-6">
+    <Link href="/" aria-label="Go to home">
+      <PlaneLockup height={20} width={95} className="text-custom-text-100" />
+    </Link>
+  </header>
+);
apps/admin/app/(all)/(home)/layout.tsx (1)

5-7: Prefer dvh/min-h and semantic main

Avoids mobile viewport issues and improves semantics.

-    <div className="relative z-10 flex flex-col items-center w-screen h-screen overflow-hidden overflow-y-auto pt-6 pb-10 px-8">
-      {children}
-    </div>
+    <main className="relative z-10 flex flex-col items-center w-full min-h-dvh overflow-hidden overflow-y-auto pt-6 pb-10 px-8">
+      {children}
+    </main>

If dvh support is a concern, fallback to min-h-screen.

apps/admin/core/components/instance/loading.tsx (1)

10-15: Prevent theme flicker and improve a11y on the loading spinner

resolvedTheme can be undefined briefly; this may flash the wrong spinner. Also add semantic status and a clearer alt.

   export const InstanceLoading = () => {
     const { resolvedTheme } = useTheme();

-  const logoSrc = resolvedTheme === "dark" ? LogoSpinnerLight : LogoSpinnerDark;
+  const isThemeResolved = resolvedTheme === "dark" || resolvedTheme === "light";
+  const logoSrc = resolvedTheme === "dark" ? LogoSpinnerLight : LogoSpinnerDark;

   return (
-    <div className="flex items-center justify-center">
-      <Image src={logoSrc} alt="logo" className="h-6 w-auto sm:h-11" />
+    <div className="flex items-center justify-center" role="status" aria-label="Loading instance">
+      {isThemeResolved && (
+        <Image src={logoSrc} alt="Plane logo spinner" className="h-6 w-auto sm:h-11" />
+      )}
     </div>
   );
apps/admin/core/components/instance/failure.tsx (1)

12-12: Drop unnecessary MobX observer wrapper

This component doesn’t consume observable state. Wrapping with observer adds overhead without benefit.

-import { observer } from "mobx-react";
+// import { observer } from "mobx-react";
...
-export const InstanceFailureView: FC = observer(() => {
+export const InstanceFailureView: FC = () => {
...
-});
+};
apps/admin/app/(all)/(home)/sign-in-form.tsx (3)

13-13: Unify import paths with alias for consistency

Use the alias path like other files to keep imports consistent.

-import { FormHeader } from "../../../core/components/instance/form-header";
+import { FormHeader } from "@/components/instance/form-header";

135-146: Prefer semantic autocomplete and required on email

Use autocomplete tokens and required for better UX and password manager behavior.

   <Input
     className="w-full border border-custom-border-100 !bg-custom-background-100 placeholder:text-custom-text-400"
     id="email"
     name="email"
     type="email"
     inputSize="md"
     placeholder="[email protected]"
     value={formData.email}
     onChange={(e) => handleFormChange("email", e.target.value)}
-    autoComplete="on"
+    autoComplete="email"
+    required
     autoFocus
   />

153-163: Improve password field UX: autocomplete and a11y for toggle

Use autocomplete="current-password" and add accessible labels to the toggle buttons.

   <Input
     className="w-full border border-custom-border-100 !bg-custom-background-100 placeholder:text-custom-text-400"
     id="password"
     name="password"
     type={showPassword ? "text" : "password"}
     inputSize="md"
     placeholder="Enter your password"
     value={formData.password}
     onChange={(e) => handleFormChange("password", e.target.value)}
-    autoComplete="on"
+    autoComplete="current-password"
+    required
   />
   {showPassword ? (
     <button
       type="button"
       className="absolute right-3 top-3.5 flex items-center justify-center text-custom-text-400"
       onClick={() => setShowPassword(false)}
+      aria-label="Hide password"
     >
       <EyeOff className="h-4 w-4" />
     </button>
   ) : (
     <button
       type="button"
       className="absolute right-3 top-3.5 flex items-center justify-center text-custom-text-400"
       onClick={() => setShowPassword(true)}
+      aria-label="Show password"
     >
       <Eye className="h-4 w-4" />
     </button>
   )}

Also applies to: 165-180

apps/admin/core/components/instance/setup-form.tsx (1)

165-175: Use proper autocomplete tokens and required on required fields

Improve autofill and accessibility by using semantic tokens and required on starred fields.

  <Input
...
-  autoComplete="on"
+  autoComplete="given-name"
+  required
...
  <Input
...
-  autoComplete="on"
+  autoComplete="family-name"
+  required
...
  <Input
...
-  autoComplete="on"
+  autoComplete="email"
+  required
...
  <Input
...
-  autoComplete="on"
+  autoComplete="new-password"
+  required
...
  <Input
...
-  onFocus={() => setIsRetryPasswordInputFocused(true)}
-  onBlur={() => setIsRetryPasswordInputFocused(false)}
+  onFocus={() => setIsRetryPasswordInputFocused(true)}
+  onBlur={() => setIsRetryPasswordInputFocused(false)}
+  autoComplete="new-password"
+  required

Also applies to: 173-175, 191-191, 209-210, 249-250, 291-293

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9de5b1a and a5cd37d.

⛔ Files ignored due to path filters (5)
  • apps/admin/public/images/logo-spinner-dark.gif is excluded by !**/*.gif
  • apps/admin/public/images/logo-spinner-light.gif is excluded by !**/*.gif
  • apps/admin/public/plane-logos/black-horizontal-with-blue-logo.png is excluded by !**/*.png
  • apps/admin/public/plane-logos/blue-without-text.png is excluded by !**/*.png
  • apps/admin/public/plane-logos/white-horizontal-with-blue-logo.png is excluded by !**/*.png
📒 Files selected for processing (12)
  • apps/admin/app/(all)/(home)/auth-header.tsx (1 hunks)
  • apps/admin/app/(all)/(home)/layout.tsx (1 hunks)
  • apps/admin/app/(all)/(home)/page.tsx (2 hunks)
  • apps/admin/app/(all)/(home)/sign-in-form.tsx (2 hunks)
  • apps/admin/core/components/common/logo-spinner.tsx (1 hunks)
  • apps/admin/core/components/instance/failure.tsx (2 hunks)
  • apps/admin/core/components/instance/form-header.tsx (1 hunks)
  • apps/admin/core/components/instance/instance-not-ready.tsx (1 hunks)
  • apps/admin/core/components/instance/loading.tsx (1 hunks)
  • apps/admin/core/components/instance/setup-form.tsx (2 hunks)
  • apps/admin/styles/globals.css (0 hunks)
  • apps/space/core/components/common/logo-spinner.tsx (1 hunks)
💤 Files with no reviewable changes (1)
  • apps/admin/styles/globals.css
🧰 Additional context used
🧠 Learnings (5)
📚 Learning: 2025-06-04T16:22:44.344Z
Learnt from: lifeiscontent
PR: makeplane/plane#7164
File: packages/ui/.storybook/main.ts:24-47
Timestamp: 2025-06-04T16:22:44.344Z
Learning: In packages/ui/.storybook/main.ts, the webpackFinal function intentionally overrides the CSS loader strategy by finding and replacing existing CSS rules. This is a temporary workaround for a known upstream issue in Storybook's CSS handling that has been communicated to the Storybook maintainers. The current implementation should not be changed until the upstream issue is resolved.

Applied to files:

  • apps/admin/core/components/instance/instance-not-ready.tsx
  • apps/admin/app/(all)/(home)/page.tsx
📚 Learning: 2024-11-28T07:02:54.664Z
Learnt from: mathalav55
PR: makeplane/plane#6107
File: web/ce/components/workspace-notifications/sidebar/notification-card/options/archive.tsx:11-14
Timestamp: 2024-11-28T07:02:54.664Z
Learning: When components are still located in `core`, it's appropriate for files to import them using `@/components/...`, and the migration to the new import paths is not necessary in such cases.

Applied to files:

  • apps/admin/app/(all)/(home)/layout.tsx
📚 Learning: 2025-05-14T13:16:23.323Z
Learnt from: vamsikrishnamathala
PR: makeplane/plane#7061
File: web/core/components/workspace-notifications/root.tsx:18-18
Timestamp: 2025-05-14T13:16:23.323Z
Learning: In the Plane project codebase, the path alias `@/plane-web` resolves to the `ce` directory, making imports like `@/plane-web/hooks/use-notification-preview` correctly resolve to files in `web/ce/hooks/`.

Applied to files:

  • apps/admin/app/(all)/(home)/auth-header.tsx
📚 Learning: 2025-06-18T09:46:08.566Z
Learnt from: prateekshourya29
PR: makeplane/plane#7188
File: web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/cycles/(list)/header.tsx:40-45
Timestamp: 2025-06-18T09:46:08.566Z
Learning: When reviewing breadcrumb components that accept projectId or similar props, check if empty strings are being passed during loading states, which can result in invalid URLs. The preferred approach is to handle these loading states internally within the component rather than requiring each consumer to manage the loading logic.

Applied to files:

  • apps/admin/app/(all)/(home)/page.tsx
📚 Learning: 2025-07-14T11:22:43.964Z
Learnt from: gakshita
PR: makeplane/plane#7393
File: apps/admin/app/(all)/(dashboard)/email/email-config-form.tsx:104-104
Timestamp: 2025-07-14T11:22:43.964Z
Learning: In the Plane project's SMTP configuration implementation, the email configuration form (email-config-form.tsx) hardcodes ENABLE_SMTP to "1" in form submission because the form is only rendered when SMTP is enabled. The enable/disable functionality is managed at the page level (page.tsx) with a toggle, and the form only handles configuration details when SMTP is already enabled.

Applied to files:

  • apps/admin/app/(all)/(home)/sign-in-form.tsx
  • apps/admin/core/components/instance/setup-form.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). (4)
  • GitHub Check: Build and lint web apps
  • GitHub Check: Build and lint web apps
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Analyze (python)
🔇 Additional comments (5)
apps/admin/core/components/instance/instance-not-ready.tsx (2)

16-16: Token migration LGTM

Switch to text-custom-text-400 aligns with the removal of onboarding-specific tokens. Looks good.


22-26: Avoid nested interactive elements—use router for navigation
To fix the <button> inside <a> a11y violation, drop the Link wrapper and navigate programmatically:

• File apps/admin/core/components/instance/instance-not-ready.tsx

  • At the very top (if not already present), add:
    "use client";
    import { useRouter } from "next/navigation";
  • Inside your component, initialize the router:
    const router = useRouter();
  • Replace the Link/Button block (around lines 22–26):
-        <Link href="/setup/?auth_enabled=0">
-          <Button size="lg" className="w-full">
-            Get started
-          </Button>
-        </Link>
+        <Button
+          size="lg"
+          className="w-full"
+          onClick={() => router.push("/setup/?auth_enabled=0")}
+        >
+          Get started
+        </Button>

Ensure the /setup/?auth_enabled=0 route or page exists in your Next.js app.

apps/admin/core/components/common/logo-spinner.tsx (1)

10-10: Theme inversion looks consistent

The dark theme using the light spinner matches the PR-wide branding change. No functional issues here.

apps/space/core/components/common/logo-spinner.tsx (1)

11-11: Theme inversion acknowledged

Change aligns with admin app for consistent branding.

apps/admin/app/(all)/(home)/page.tsx (1)

20-22: LGTM: simpler, consistent state rendering

The streamlined returns (spinner/failure/setup/sign-in) improve readability and align with the new headers and layouts.

Also applies to: 28-28, 33-33, 37-37

@sriramveeraghanta sriramveeraghanta merged commit d317755 into preview Aug 11, 2025
5 of 9 checks passed
@sriramveeraghanta sriramveeraghanta deleted the feat-god-mode-auth-revamp-and-code-refactor branch August 11, 2025 13:16
@coderabbitai coderabbitai bot mentioned this pull request Sep 2, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants