Skip to content

Bugfix/issue 27/sidebar button padding small width#34

Closed
urjitc wants to merge 4 commits into
mainfrom
bugfix/issue-27/sidebar-button-padding-small-width
Closed

Bugfix/issue 27/sidebar button padding small width#34
urjitc wants to merge 4 commits into
mainfrom
bugfix/issue-27/sidebar-button-padding-small-width

Conversation

@urjitc

@urjitc urjitc commented Jan 17, 2026

Copy link
Copy Markdown
Member

Fixes #27


Important

Change default redirect from /dashboard to /home and update related components and routes accordingly.

  • Behavior:
    • Change default redirect from /dashboard to /home in page.tsx of auth/[path], guest-setup, onboarding, and share/[id].
    • Update proxy.ts to redirect authenticated users from root to /home.
  • Components:
    • Add HomePage component in home/page.tsx with SEO and DashboardShell.
    • Modify WorkspacePage in dashboard/[slug]/page.tsx to include SEO and DashboardShell.
    • Remove SEO from DashboardPage in dashboard/page.tsx and export DashboardShell.
  • UI Adjustments:
    • Remove shrink-0 class from AppChatHeader and SidebarTrigger in sidebar.tsx.
    • Update Navbar and WorkspaceSidebar links to point to /home instead of /dashboard.

This description was created by Ellipsis for 5aac0f2. You can customize this summary. It will automatically update as commits are pushed.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added a new home page with SEO metadata and integrated dashboard layout.
  • Navigation Updates

    • Changed primary navigation endpoints from dashboard to home across the application, including post-authentication flows, shared workspaces, and sidebar navigation.
    • Updated authentication redirect behavior to prioritize onboarding flow by default.
  • Style

    • Refined sidebar control layout styling.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel

vercel Bot commented Jan 17, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Review Updated (UTC)
thinkexv2 Ready Ready Preview, Comment Jan 17, 2026 7:13pm

@coderabbitai

coderabbitai Bot commented Jan 17, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The pull request systematically redirects default navigation paths from /dashboard to /home across the application. Changes include updating page exports in the dashboard layer, creating a new home page with SEO metadata, adjusting conditional redirect logic in auth flows, and updating sidebar and navigation component links.

Changes

Cohort / File(s) Summary
Dashboard & Page Structure
src/app/dashboard/page.tsx, src/app/dashboard/[slug]/page.tsx
Default page export now redirects to /home instead of rendering dashboard shell. DashboardPage, SidebarCoordinator, AnonymousSessionHandler, and DashboardShell are now exported for reuse. Workspace dashboard page imports and renders DashboardShell with SEO metadata.
New Home Page
src/app/home/page.tsx
New page created that composes HomePage with SEO metadata (title, description, keywords, url, canonical) and DashboardShell component.
Auth & Redirect Logic
src/app/auth/[path]/page.tsx, src/app/onboarding/page.tsx, src/app/share/[id]/page.tsx, src/proxy.ts, src/app/guest-setup/page.tsx
Default redirect path changed from /dashboard to /home in multiple scenarios: auth redirect fallback, post-onboarding navigation, share modal closure, proxy authenticated root access, and workspace creation fallback. Onboarding now excludes /home URLs from external redirect precedence.
Navigation Components
src/components/landing/Navbar.tsx, src/components/workspace-canvas/WorkspaceSidebar.tsx, src/components/workspace/SharedWorkspaceModal.tsx
Navigation links and modal close handlers updated to route to /home instead of /dashboard.
UI & Layout Adjustments
src/components/ui/sidebar.tsx, src/components/chat/AppChatHeader.tsx
SidebarTrigger button now includes shrink-0 class to prevent flex shrinking; removed shrink-0 from SidebarTrigger in AppChatHeader.
Workspace Context
src/contexts/WorkspaceContext.tsx
Workspace deletion with no remaining workspaces now redirects to /home instead of /dashboard.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 Dashboard dreams fade to home sweet home,
Navigation paths now gently roam,
From onboarding through sharing flows,
To sidebar where the home link glows! 🏠✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR includes substantial out-of-scope changes: a new /home route, multiple dashboard-to-home redirects across numerous files, and onboarding logic changes unrelated to Issue #27. Extract the dashboard-to-home redirect changes and home route implementation into a separate PR; keep only the sidebar padding fixes (AppChatHeader.tsx and sidebar.tsx) for this issue.
Docstring Coverage ⚠️ Warning Docstring coverage is 41.18% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 describes the main fix: addressing sidebar button padding issues at small widths by adding the shrink-0 class.
Linked Issues check ✅ Passed The PR successfully addresses Issue #27 by adding shrink-0 class to SidebarTrigger in AppChatHeader and the sidebar component to prevent padding loss at small widths.

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

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud

Copy link
Copy Markdown

@ellipsis-dev ellipsis-dev Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed everything up to 5aac0f2 in 1 minute and 19 seconds. Click for details.
  • Reviewed 316 lines of code in 14 files
  • Skipped 0 files when reviewing.
  • Skipped posting 6 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. src/components/chat/AppChatHeader.tsx:212
  • Draft comment:
    Removed 'shrink-0' class from the chat header button. Confirm this removal is intentional and that it does not negatively affect layout consistency compared to similar buttons (e.g. in the sidebar).
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
2. src/components/ui/sidebar.tsx:267
  • Draft comment:
    The addition of 'shrink-0' to the SidebarTrigger button is a clear fix for preventing padding collapse at small widths (issue #27). Verify across breakpoints that the button retains its intended size.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the PR author to verify the behavior across breakpoints, which is against the rules. It doesn't provide a specific suggestion or point out a clear issue with the code.
3. src/proxy.ts:21
  • Draft comment:
    Redirect URLs have been updated from '/dashboard' to '/home'. Ensure that this rebranding is consistent across all routes and that no legacy route issues remain.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the PR author to ensure consistency across all routes and to check for legacy route issues. This falls under asking the author to double-check things, which is not allowed according to the rules.
4. src/contexts/WorkspaceContext.tsx:130
  • Draft comment:
    On workspace deletion, the fallback redirect now points to '/home'. Confirm that this provides a smooth user experience when no workspaces remain.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
5. src/components/workspace/SharedWorkspaceModal.tsx:150
  • Draft comment:
    The modal's onOpenChange handler now navigates to '/home' when closing. Verify that this navigation fits the intended user flow and does not cause disorientation.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 40% <= threshold 50% The comment is asking the PR author to verify if the navigation to /home on modal close is intended and fits the user flow. This is a request for confirmation of intention, which is against the rules. However, it does point out a potential issue with user experience, which could be useful. I need to decide if the comment is more about asking for confirmation or if it provides a useful suggestion.
6. src/app/dashboard/page.tsx:505
  • Draft comment:
    The dashboard page now immediately redirects using router.replace('/home'). Confirm that this redirection does not cause a flash of an empty state and that the user session/context loads as expected.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the author to confirm the behavior of a redirection change. It does not provide a specific suggestion or point out a clear issue with the code. It violates the rule against asking the author to confirm behavior.

Workflow ID: wflow_BqbWCUpfHHrMUW3N

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@greptile-apps

greptile-apps Bot commented Jan 17, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes the sidebar button padding issue at small widths by adding shrink-0 to the SidebarTrigger component, ensuring consistent button sizing. Additionally, it includes a major routing refactor that migrates the application from /dashboard to /home as the primary landing route for authenticated users.

Key Changes:

  • Fixed SidebarTrigger losing padding by adding shrink-0 class to prevent flex shrinking
  • Removed redundant shrink-0 from AppChatHeader usage (now handled by component)
  • Created new /home route that renders DashboardShell with home-specific SEO
  • Updated /dashboard to redirect to /home while preserving backward compatibility
  • Updated all navigation links, redirects, and fallback routes throughout the application to use /home

Note: The PR scope extends beyond the stated issue #27 (sidebar button padding fix). It includes significant routing refactoring across 14 files. While the changes appear consistent and well-executed, bundling a UI bugfix with a major routing migration in a single PR titled "Bugfix/issue 27/sidebar button padding small width" may make it harder to track, revert, or understand the full scope of changes.

Confidence Score: 4/5

  • This PR is safe to merge with minor concerns about scope
  • The code changes are well-implemented and consistent. The sidebar button fix correctly addresses the padding issue. The routing refactor is comprehensive and updates all relevant locations. Score is 4 instead of 5 due to: (1) significant scope creep beyond the stated bugfix, bundling multiple features in one PR; (2) the PR title/description doesn't reflect the full extent of changes
  • No files require special attention - all changes are straightforward and consistent

Important Files Changed

Filename Overview
src/components/ui/sidebar.tsx Added shrink-0 to SidebarTrigger to fix padding loss at small widths - correct implementation
src/app/home/page.tsx New home route created, renders DashboardShell with home-specific SEO
src/app/dashboard/page.tsx Refactored to export DashboardShell; default export now redirects to /home
src/proxy.ts Updated middleware redirects from /dashboard to /home for authenticated users

Sequence Diagram

sequenceDiagram
    participant User
    participant Browser
    participant Middleware
    participant OldDashboard as /dashboard
    participant NewHome as /home
    
    Note over User,NewHome: Root Access by Authenticated User
    User->>Browser: Navigate to /
    Browser->>Middleware: Request /
    Middleware->>NewHome: Redirect to /home
    NewHome-->>User: Render DashboardShell
    
    Note over User,NewHome: Backward Compatibility
    User->>Browser: Navigate to /dashboard
    Browser->>OldDashboard: Request /dashboard
    OldDashboard->>NewHome: useEffect redirect to /home
    NewHome-->>User: Render DashboardShell
    
    Note over User,NewHome: Workspace Access
    User->>Browser: Navigate to /dashboard/workspace-slug
    Browser->>OldDashboard: Request /dashboard/[slug]
    OldDashboard-->>User: Render DashboardShell directly
Loading

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@src/app/dashboard/`[slug]/page.tsx:
- Around line 11-17: The SEO component currently hardcodes url and canonical to
"/dashboard"; update the page to supply the dynamic slug so URLs point to
/dashboard/[slug]. Either make this a server component and read the slug from
the route params passed into the default page component (use params.slug) and
pass the computed url/canonical to the SEO component, or implement/export an
async generateMetadata({params}) that returns metadata using params.slug and
ensure the SEO component receives those values; update references to the SEO
component in page.tsx to use the constructed workspaceUrl (e.g.,
`https://thinkex.app/dashboard/${slug}`) instead of the static "/dashboard".

In `@src/app/share/`[id]/page.tsx:
- Around line 170-174: Update the inline comment inside the handleModalClose
function to reflect the actual redirect target: replace "Redirect to dashboard
when modal is closed without importing" with a comment that says the modal
redirects to "/home" (e.g., "Redirect to /home when modal is closed without
importing") near the router.push("/home") call.
🧹 Nitpick comments (3)
src/app/guest-setup/page.tsx (1)

23-68: Consider adding session to the dependency array or documenting the intentional omission.

The useEffect references session from the outer scope but has an empty dependency array. While the hasStartedRef guard prevents re-execution, ESLint's exhaustive-deps rule would flag this. If intentional, consider adding a suppression comment to clarify.

src/app/dashboard/page.tsx (1)

502-510: Consider using Next.js redirect() for faster navigation.

The client-side redirect via useEffect causes a brief render of null before navigating. Since the /dashboard route should always redirect to /home, a server-side approach would provide a faster redirect without the client-side JavaScript execution.

You could convert this to a Server Component or create a separate server-side redirect file:

♻️ Proposed server-side redirect approach

Create src/app/dashboard/page.tsx as a Server Component with redirect:

import { redirect } from "next/navigation";

export default function Page() {
  redirect("/home");
}

Then move the current client components (DashboardPage, DashboardShell, etc.) to a separate file like src/app/dashboard/DashboardComponents.tsx.

src/app/home/page.tsx (1)

7-13: Centralize canonical/base URL instead of hardcoding.

Hardcoding https://thinkex.app can break staging/custom domains or future domain changes. Prefer a config-driven base URL to build url and canonical.

Comment on lines +11 to +17
<SEO
title="Dashboard"
description="Manage your workspaces, create new projects, and organize knowledge effortlessly in your ThinkEx dashboard."
keywords="dashboard, workspace management, AI workspace, productivity tools"
url="https://thinkex.app/dashboard"
canonical="https://thinkex.app/dashboard"
/>

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 | 🟡 Minor

SEO metadata has hardcoded URLs that don't reflect the dynamic slug.

The url and canonical props point to /dashboard rather than the actual workspace URL /dashboard/[slug]. This could negatively impact SEO for individual workspaces.

🐛 Suggested fix for dynamic SEO

Consider making the page a server component with dynamic metadata, or pass the slug to generate the correct URL:

 export default function WorkspacePage({ params }: { params: Promise<{ slug: string }> }) {
+  const { slug } = await params;
   return (
     <>
       <SEO
         title="Dashboard"
         description="Manage your workspaces..."
         keywords="dashboard, workspace management..."
-        url="https://thinkex.app/dashboard"
-        canonical="https://thinkex.app/dashboard"
+        url={`https://thinkex.app/dashboard/${slug}`}
+        canonical={`https://thinkex.app/dashboard/${slug}`}
       />
       <DashboardShell />
     </>
   );
 }
🤖 Prompt for AI Agents
In `@src/app/dashboard/`[slug]/page.tsx around lines 11 - 17, The SEO component
currently hardcodes url and canonical to "/dashboard"; update the page to supply
the dynamic slug so URLs point to /dashboard/[slug]. Either make this a server
component and read the slug from the route params passed into the default page
component (use params.slug) and pass the computed url/canonical to the SEO
component, or implement/export an async generateMetadata({params}) that returns
metadata using params.slug and ensure the SEO component receives those values;
update references to the SEO component in page.tsx to use the constructed
workspaceUrl (e.g., `https://thinkex.app/dashboard/${slug}`) instead of the
static "/dashboard".

Comment on lines 170 to 174
const handleModalClose = (open: boolean) => {
if (!open) {
// Redirect to dashboard when modal is closed without importing
router.push("/dashboard");
router.push("/home");
}

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 | 🟡 Minor

Update the inline comment to match the new redirect target.

The comment still says “dashboard” but the code now routes to /home.

📝 Suggested edit
-        // Redirect to dashboard when modal is closed without importing
+        // Redirect to home when modal is closed without importing
📝 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 handleModalClose = (open: boolean) => {
if (!open) {
// Redirect to dashboard when modal is closed without importing
router.push("/dashboard");
router.push("/home");
}
const handleModalClose = (open: boolean) => {
if (!open) {
// Redirect to home when modal is closed without importing
router.push("/home");
}
🤖 Prompt for AI Agents
In `@src/app/share/`[id]/page.tsx around lines 170 - 174, Update the inline
comment inside the handleModalClose function to reflect the actual redirect
target: replace "Redirect to dashboard when modal is closed without importing"
with a comment that says the modal redirects to "/home" (e.g., "Redirect to
/home when modal is closed without importing") near the router.push("/home")
call.

@urjitc urjitc closed this Jan 17, 2026
@urjitc
urjitc deleted the bugfix/issue-27/sidebar-button-padding-small-width branch January 17, 2026 19:16
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Dev Board Jan 17, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

2 issues found across 14 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="src/app/dashboard/page.tsx">

<violation number="1" location="src/app/dashboard/page.tsx:506">
P2: Client-side redirect means `/dashboard` still ships and hydrates the full dashboard bundle before navigating, leaving a blank screen and unnecessary payload. Consider moving the redirect to a lightweight server route/config so the redirect happens before client JS loads.</violation>
</file>

<file name="src/app/dashboard/[slug]/page.tsx">

<violation number="1" location="src/app/dashboard/[slug]/page.tsx:15">
P2: The dynamic workspace page now emits a fixed canonical/URL for "/dashboard" instead of including the current slug. This makes every workspace page share the same canonical metadata, which is incorrect for per-workspace routes. Pass the slug from params and build the URL/canonical with it.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

const router = useRouter();

useEffect(() => {
router.replace("/home");

@cubic-dev-ai cubic-dev-ai Bot Jan 17, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: Client-side redirect means /dashboard still ships and hydrates the full dashboard bundle before navigating, leaving a blank screen and unnecessary payload. Consider moving the redirect to a lightweight server route/config so the redirect happens before client JS loads.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/app/dashboard/page.tsx, line 506:

<comment>Client-side redirect means `/dashboard` still ships and hydrates the full dashboard bundle before navigating, leaving a blank screen and unnecessary payload. Consider moving the redirect to a lightweight server route/config so the redirect happens before client JS loads.</comment>

<file context>
@@ -506,3 +498,13 @@ export default function Page() {
+  const router = useRouter();
+
+  useEffect(() => {
+    router.replace("/home");
+  }, [router]);
+
</file context>
Fix with Cubic

title="Dashboard"
description="Manage your workspaces, create new projects, and organize knowledge effortlessly in your ThinkEx dashboard."
keywords="dashboard, workspace management, AI workspace, productivity tools"
url="https://thinkex.app/dashboard"

@cubic-dev-ai cubic-dev-ai Bot Jan 17, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: The dynamic workspace page now emits a fixed canonical/URL for "/dashboard" instead of including the current slug. This makes every workspace page share the same canonical metadata, which is incorrect for per-workspace routes. Pass the slug from params and build the URL/canonical with it.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/app/dashboard/[slug]/page.tsx, line 15:

<comment>The dynamic workspace page now emits a fixed canonical/URL for "/dashboard" instead of including the current slug. This makes every workspace page share the same canonical metadata, which is incorrect for per-workspace routes. Pass the slug from params and build the URL/canonical with it.</comment>

<file context>
@@ -1,10 +1,22 @@
+        title="Dashboard"
+        description="Manage your workspaces, create new projects, and organize knowledge effortlessly in your ThinkEx dashboard."
+        keywords="dashboard, workspace management, AI workspace, productivity tools"
+        url="https://thinkex.app/dashboard"
+        canonical="https://thinkex.app/dashboard"
+      />
</file context>
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

The sidebar button in the workspace header loses its internal padding when the workspace has a small width

1 participant