Skip to content

feat: hide sidebar on login page#413

Merged
wen-placeholder merged 2 commits intojerry609:devfrom
wen-placeholder:dev-wenjing
Mar 17, 2026
Merged

feat: hide sidebar on login page#413
wen-placeholder merged 2 commits intojerry609:devfrom
wen-placeholder:dev-wenjing

Conversation

@wen-placeholder
Copy link
Copy Markdown
Collaborator

@wen-placeholder wen-placeholder commented Mar 17, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Sidebar now hides correctly on login, registration, forgot-password, and agent-board pages.
    • Main content padding now correctly adjusts based on whether the sidebar is shown or hidden.

Copilot AI review requested due to automatic review settings March 17, 2026 08:35
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 17, 2026

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

Project Deployment Actions Updated (UTC)
paper-bot Ready Ready Preview, Comment Mar 17, 2026 8:44am

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the user experience by preventing the sidebar from being displayed on the login page. By introducing specific logic to detect the authentication route, the layout is streamlined, providing a cleaner and more focused interface for users during the login process.

Highlights

  • Login Page Detection: Introduced a new isAuthPage variable to specifically identify the /login route within the LayoutShell component.
  • Conditional Sidebar Rendering: Modified the sidebar's rendering condition to hide it on both agent board focus pages and the newly identified login page, using a combined hideSidebar flag.
  • Main Content Layout Adjustment: Updated the main content area's left padding to dynamically adjust based on whether the sidebar is hidden or visible, ensuring proper layout on all relevant pages.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • web/src/components/layout/LayoutShell.tsx
    • Added isAuthPage boolean to detect the /login route.
    • Introduced hideSidebar boolean to consolidate conditions for hiding the sidebar (agent board focus pages and login page).
    • Updated the conditional rendering of the <aside> element to use the new hideSidebar flag.
    • Modified the main element's className to adjust padding based on the hideSidebar flag.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 17, 2026

📝 Walkthrough

Walkthrough

The layout shell now derives isAuthPage and hideSidebar from the current path; sidebar rendering and main-content padding are controlled by hideSidebar, which hides the sidebar on agent-board and auth pages.

Changes

Cohort / File(s) Summary
Sidebar Visibility Logic
web/src/components/layout/LayoutShell.tsx
Added isAuthPage and hideSidebar derived flags; sidebar render gate and main content padding now use hideSidebar, extending hidden behavior to login/registration/forgot-password pages in addition to agent-board pages.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hop through routes both near and far,
I peek at paths and know just where you are,
If auth or boards call for a quiet side,
I tuck it away and give content more pride. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title clearly and concisely summarizes the main change: hiding the sidebar on the login page, which aligns with the modifications made to LayoutShell.tsx.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

You can enable review details to help with troubleshooting, context usage and more.

Enable the reviews.review_details setting to include review details such as the model used, the time taken for each step and more in the review comments.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces logic to hide the sidebar on the login page. The implementation is straightforward and correct. However, it could be improved to also handle other authentication-related pages, such as /register and /forgot-password, to ensure a consistent user experience across all authentication flows. I have included a specific suggestion to make this logic more comprehensive and maintainable.

const [collapsed, setCollapsed] = useState(true)
const pathname = usePathname()
const isAgentBoardFocusPage = pathname.startsWith("/studio/agent-board/")
const isAuthPage = pathname === "/login"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The current implementation only hides the sidebar on the /login page. It's likely that other authentication-related pages like /register and /forgot-password (which are linked from the login page) should also not display the sidebar. To cover these cases and improve maintainability, you could check if the current path is present in a list of authentication-related paths.

Suggested change
const isAuthPage = pathname === "/login"
const isAuthPage = ["/login", "/register", "/forgot-password"].includes(pathname)

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the main layout shell to suppress the left sidebar on the login route, keeping the login experience focused and uncluttered while preserving existing behavior for the agent board focus view.

Changes:

  • Adds a hideSidebar flag based on route detection (/studio/agent-board/* and /login).
  • Uses hideSidebar to conditionally render the <aside> and to remove the main content left padding when the sidebar is hidden.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +12 to +13
const isAuthPage = pathname === "/login"
const hideSidebar = isAgentBoardFocusPage || isAuthPage
Copy link
Copy Markdown

@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

Caution

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

⚠️ Outside diff range comments (1)
web/src/components/layout/LayoutShell.tsx (1)

12-30: ⚠️ Potential issue | 🟠 Major

Please add/update tests for the new route-based sidebar behavior.

This PR changes visible layout behavior, but no corresponding tests were included. Please add coverage for at least: auth route hides sidebar, non-auth route shows sidebar, and agent-board route still hides sidebar.

As per coding guidelines, "{src,web/src}/**/*.{py,ts,tsx}: If behavior changes, add or update tests".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/src/components/layout/LayoutShell.tsx` around lines 12 - 30, Add unit
tests covering the route-based sidebar visibility introduced in LayoutShell.tsx:
create tests that render LayoutShell with different pathname contexts (use
MemoryRouter/next-router-mock or app router test helpers) and assert the Sidebar
component presence/absence based on isAuthPage and isAgentBoardFocusPage.
Specifically add three tests: when pathname = "/login" assert Sidebar is not
rendered, when pathname = "/" (or another non-auth route) assert Sidebar is
rendered, and when simulating the agent-board focus route (the condition that
makes isAgentBoardFocusPage true) assert Sidebar is not rendered; use
react-testing-library queries to find the Sidebar (by component role, text, or
test-id) and ensure collapsed state tests remain unaffected. Ensure tests live
alongside other LayoutShell tests (or create
web/src/components/layout/LayoutShell.test.tsx) and mock any router or context
hooks used by LayoutShell.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@web/src/components/layout/LayoutShell.tsx`:
- Around line 12-13: isAuthPage currently only checks pathname === "/login",
causing other auth routes to still show sidebar/padding; update the isAuthPage
computation (used by hideSidebar) to detect all auth routes (e.g., "/login",
"/register", "/forgot-password", "/reset-password") by matching pathname against
a set/array or a prefix/regex so any of those paths return true and hideSidebar
behaves consistently across auth pages.

---

Outside diff comments:
In `@web/src/components/layout/LayoutShell.tsx`:
- Around line 12-30: Add unit tests covering the route-based sidebar visibility
introduced in LayoutShell.tsx: create tests that render LayoutShell with
different pathname contexts (use MemoryRouter/next-router-mock or app router
test helpers) and assert the Sidebar component presence/absence based on
isAuthPage and isAgentBoardFocusPage. Specifically add three tests: when
pathname = "/login" assert Sidebar is not rendered, when pathname = "/" (or
another non-auth route) assert Sidebar is rendered, and when simulating the
agent-board focus route (the condition that makes isAgentBoardFocusPage true)
assert Sidebar is not rendered; use react-testing-library queries to find the
Sidebar (by component role, text, or test-id) and ensure collapsed state tests
remain unaffected. Ensure tests live alongside other LayoutShell tests (or
create web/src/components/layout/LayoutShell.test.tsx) and mock any router or
context hooks used by LayoutShell.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4be5ce9d-5d7b-43d5-bcbb-a728dc43d66f

📥 Commits

Reviewing files that changed from the base of the PR and between dc20b30 and c2d8f2e.

📒 Files selected for processing (1)
  • web/src/components/layout/LayoutShell.tsx

Comment on lines +12 to +13
const isAuthPage = pathname === "/login"
const hideSidebar = isAgentBoardFocusPage || isAuthPage
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Expand auth-route detection beyond /login.

isAuthPage only matches /login, so sidebar/padding still appear on other auth pages (e.g. /register, /forgot-password, /reset-password), creating inconsistent auth UX.

Suggested fix
-  const isAuthPage = pathname === "/login"
+  const AUTH_ROUTES = ["/login", "/register", "/forgot-password", "/reset-password"] as const
+  const isAuthPage = AUTH_ROUTES.includes(pathname as (typeof AUTH_ROUTES)[number])
   const hideSidebar = isAgentBoardFocusPage || isAuthPage

As per coding guidelines, "web/src/**/*.{ts,tsx}: Follow established patterns in web/src/ for TypeScript/React code".

📝 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
const isAuthPage = pathname === "/login"
const hideSidebar = isAgentBoardFocusPage || isAuthPage
const AUTH_ROUTES = ["/login", "/register", "/forgot-password", "/reset-password"] as const
const isAuthPage = AUTH_ROUTES.includes(pathname as (typeof AUTH_ROUTES)[number])
const hideSidebar = isAgentBoardFocusPage || isAuthPage
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/src/components/layout/LayoutShell.tsx` around lines 12 - 13, isAuthPage
currently only checks pathname === "/login", causing other auth routes to still
show sidebar/padding; update the isAuthPage computation (used by hideSidebar) to
detect all auth routes (e.g., "/login", "/register", "/forgot-password",
"/reset-password") by matching pathname against a set/array or a prefix/regex so
any of those paths return true and hideSidebar behaves consistently across auth
pages.

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

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

Caution

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

⚠️ Outside diff range comments (1)
web/src/components/layout/LayoutShell.tsx (1)

12-30: ⚠️ Potential issue | 🟠 Major

Add/Update tests for the new route-based layout behavior.

This PR changes visible behavior (sidebar + padding by pathname), but no test updates are included in the provided changes. Please add coverage for auth routes and at least one non-auth route to prevent regressions.

As per coding guidelines, "{src,web/src}/**/*.{py,ts,tsx}: If behavior changes, add or update tests".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/src/components/layout/LayoutShell.tsx` around lines 12 - 30, The
LayoutShell change introduces route-based behavior via isAuthPage and
hideSidebar (driven by pathname) that affects sidebar visibility and main
padding but no tests were added; add/update tests for LayoutShell to cover at
least: (1) an auth route (e.g., "/login" or "/register") asserting the sidebar
is hidden and main does not have md:pl-14/md:pl-56 padding, and (2) a non-auth
route asserting the sidebar is rendered and main receives the correct padding
when collapsed and when expanded. Locate tests referencing LayoutShell or
Sidebar and add component tests (React Testing Library/Jest) that render
LayoutShell with mocked pathname values and check for presence/absence of the
<aside> (Sidebar) and the computed class names on <main> to validate both
behaviors.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@web/src/components/layout/LayoutShell.tsx`:
- Around line 12-30: The LayoutShell change introduces route-based behavior via
isAuthPage and hideSidebar (driven by pathname) that affects sidebar visibility
and main padding but no tests were added; add/update tests for LayoutShell to
cover at least: (1) an auth route (e.g., "/login" or "/register") asserting the
sidebar is hidden and main does not have md:pl-14/md:pl-56 padding, and (2) a
non-auth route asserting the sidebar is rendered and main receives the correct
padding when collapsed and when expanded. Locate tests referencing LayoutShell
or Sidebar and add component tests (React Testing Library/Jest) that render
LayoutShell with mocked pathname values and check for presence/absence of the
<aside> (Sidebar) and the computed class names on <main> to validate both
behaviors.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f33325a8-c853-41e3-829e-a2f11c310ba5

📥 Commits

Reviewing files that changed from the base of the PR and between c2d8f2e and e560dd8.

📒 Files selected for processing (1)
  • web/src/components/layout/LayoutShell.tsx

@wen-placeholder wen-placeholder merged commit d4bd6f1 into jerry609:dev Mar 17, 2026
16 checks passed
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