Skip to content

Conversation

HarshMN2345
Copy link
Member

@HarshMN2345 HarshMN2345 commented Sep 15, 2025

What does this PR do?

(Provide a description of what this PR does.)

Test Plan

image image

Related PRs and Issues

(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)

Have you read the Contributing Guidelines on issues?

yes

Summary by CodeRabbit

  • New Features

    • Streamlined onboarding: header and footer are now hidden across all onboarding routes for a focused, full-screen experience.
  • Bug Fixes

    • Fixed inconsistent header behavior when opening the onboarding wizard; the header only toggles if it was initially visible, preventing unexpected layout shifts.

Copy link

appwrite bot commented Sep 15, 2025

Console

Project ID: 688b7bf400350cbd60e9

Sites (2)
Site Status Logs Preview QR
 console-qa
688b7cf6003b1842c9dc
Ready Ready View Logs Preview URL QR Code
 console-cloud
688b7c18002b9b871a8f
Ready Ready View Logs Preview URL QR Code

Note

Appwrite has a Discord community with over 16 000 members.

Copy link
Contributor

coderabbitai bot commented Sep 15, 2025

Walkthrough

The shell subscription for isNewWizardStatusOpen was changed to a guarded inversion: it now flips showHeader only when showHeader is currently truthy (avoiding updates when false). In the console layout, header and footer suppression was broadened from the single path /console/onboarding/create-project to any route under /console/onboarding. Other layout behavior and public signatures remain unchanged.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title accurately and concisely describes the primary change: hiding navigation UI during onboarding. The diffs broaden the onboarding route check to '/console/onboarding' so header/footer are suppressed for onboarding paths and shell.svelte applies a guarded update to avoid re-showing the header during the onboarding animation.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-SER-389-Nav-bar-during-onboarding-animation

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.

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

🧹 Nitpick comments (2)
src/lib/layout/shell.svelte (1)

126-131: Replace imperative header toggle with a derived flag to avoid prop overrides and unsubscribe leaks

The current subscription mutates the showHeader prop and never unsubscribes. Prefer a derived reactive flag that respects the parent prop and hides the header only while the wizard is open.

Apply this diff here:

-    let initialShowHeader = showHeader;
-    isNewWizardStatusOpen.subscribe((value) => {
-        if (initialShowHeader) {
-            showHeader = !value;
-        }
-    });
+    // Honor parent-controlled visibility; additionally hide while wizard is open
+    $: headerVisible = showHeader && !$isNewWizardStatusOpen;

Then update template usages (outside this hunk) to use headerVisible:

-    class:no-header={!showHeader}
+    class:no-header={!headerVisible}
...
-    {#if showHeader}
+    {#if headerVisible}
src/routes/(console)/+layout.svelte (1)

342-343: Make the onboarding route check precise and DRY

Minor: compute a single isOnboardingRoute and reuse it for header/footer (and optionally side nav). Using a path-anchored regex avoids accidental matches (e.g., /console/onboarding-legacy).

Suggested changes:

In the <script> block:

const isOnboardingRoute = /^\/console\/onboarding(?:\/|$)/.test(page.url.pathname);

In the Shell props:

-    showHeader={!page.url.pathname.includes('/console/onboarding')}
-    showFooter={!page.url.pathname.includes('/console/onboarding')}
+    showHeader={!isOnboardingRoute}
+    showFooter={!isOnboardingRoute}

If you intentionally want to catch suffixed variants like /console/onboarding-legacy, keep the current includes check.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e9cb44c and 7c7ba1f.

📒 Files selected for processing (2)
  • src/lib/layout/shell.svelte (1 hunks)
  • src/routes/(console)/+layout.svelte (1 hunks)
⏰ 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). (2)
  • GitHub Check: e2e
  • GitHub Check: build

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7c7ba1f and e8ff176.

📒 Files selected for processing (1)
  • src/lib/layout/shell.svelte (1 hunks)
⏰ 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). (2)
  • GitHub Check: e2e
  • GitHub Check: build

Comment on lines +126 to +130
isNewWizardStatusOpen.subscribe((value) => {
if (showHeader) {
showHeader = !value;
}
});
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Guarded inversion can leave the header hidden after the wizard closes; derive visibility instead of mutating the prop.

When the wizard opens, showHeader is set to false, but when it closes (value === false) this block does nothing if showHeader is already false. On non-onboarding routes (where the parent doesn’t re-drive showHeader), the header can remain hidden until a route change. This also introduces an avoidable manual subscription that isn’t unsubscribed.

Apply this diff to remove the manual subscription:

-    isNewWizardStatusOpen.subscribe((value) => {
-        if (showHeader) {
-            showHeader = !value;
-        }
-    });
+    // Removed: use a derived reactive flag instead (see below).

Then, introduce a derived flag and use it in markup (outside this hunk):

@@
     // reactive blocks
@@
+    // Drive header visibility from parent intent AND wizard state; no local prop mutation.
+    $: effectiveShowHeader = showHeader && !$isNewWizardStatusOpen;
@@
-    class:no-header={!showHeader}
+    class:no-header={!effectiveShowHeader}
@@
-    {#if showHeader}
+    {#if effectiveShowHeader}

Why: avoids sticky state, prevents flicker on onboarding routes (parent still passes showHeader=false), and removes the untracked subscription.

Verification (quick manual):

  • Navigate to any non-onboarding page, open and close the new wizard: header should reappear immediately after close.
  • Navigate within /console/onboarding/**: header should remain hidden throughout, regardless of wizard open/close.

🏁 Script executed:

#!/bin/bash
set -euo pipefail
FILE="src/lib/layout/shell.svelte"
echo "PWD: $(pwd)"
if [ -f "$FILE" ]; then
  echo "== File exists: $FILE =="
  echo "== Grep for relevant symbols (context 3) =="
  rg -n -C3 'isNewWizardStatusOpen|\$isNewWizardStatusOpen|showHeader|class:no-header' "$FILE" || true
  echo "== Showing file (first 400 lines) =="
  sed -n '1,400p' "$FILE" || true
else
  echo "File not found: $FILE"
  echo "== Searching repo for symbols =="
  rg -n -C3 'isNewWizardStatusOpen|\$isNewWizardStatusOpen|showHeader|class:no-header' || true
fi

Length of output: 11750


Derive header visibility instead of mutating the exported prop

Manual subscription at src/lib/layout/shell.svelte (lines ~126-130) mutates the exported showHeader and is never unsubscribed — this can leave the header hidden after the wizard closes. Remove the subscription and drive visibility from the parent prop + wizard store.

Apply these changes:

@@
-    isNewWizardStatusOpen.subscribe((value) => {
-        if (showHeader) {
-            showHeader = !value;
-        }
-    });
+    // Removed manual subscription; header visibility is derived instead.

Add a derived reactive flag and use it in markup:

@@
     // reactive blocks
@@
+    // Drive header visibility from parent intent AND wizard state; no local prop mutation.
+    $: effectiveShowHeader = showHeader && !$isNewWizardStatusOpen;
@@
-    class:no-header={!showHeader}
+    class:no-header={!effectiveShowHeader}
@@
-    {#if showHeader}
+    {#if effectiveShowHeader}

src/lib/layout/shell.svelte: fix required at the subscription (≈lines 126-130) and the header markup (class/no-header + {#if showHeader}).

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
isNewWizardStatusOpen.subscribe((value) => {
if (showHeader) {
showHeader = !value;
}
});
// Removed manual subscription; header visibility is derived instead.
// Drive header visibility from parent intent AND wizard state; no local prop mutation.
$: effectiveShowHeader = showHeader && !$isNewWizardStatusOpen;
class:no-header={!effectiveShowHeader}
{#if effectiveShowHeader}

Comment on lines +342 to +343
showHeader={!page.url.pathname.includes('/console/onboarding')}
showFooter={!page.url.pathname.includes('/console/onboarding')}
Copy link
Member

Choose a reason for hiding this comment

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

can be exported to a var since its the same check.

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