Repository navigation
feat: add interactive dashboard preview component with sidebar and panels - #15
Conversation
…nels - Implemented DashboardPreview component with animated entrance and panel switching. - Created sidebar navigation for different panels: Dashboard, Shared, and All Projects. - Developed VariablesPanel, SharedPanel, and ProjectsPanel for displaying respective content. - Added mock data for environment variables, projects, and shared secrets. - Introduced staggered animations for panel transitions and element visibility. - Enhanced styles with new CSS animations for a smooth user experience.
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 51 minutes and 23 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughA comprehensive dashboard preview UI system was added to the landing page, featuring multiple content panels (variables, shared secrets, projects), sidebar navigation, staggered entrance animations triggered by viewport intersection, and new CSS animation classes. Configuration and documentation were also updated. Changes
Sequence DiagramsequenceDiagram
participant Page as Landing Page
participant Observer as Intersection Observer
participant Preview as DashboardPreview
participant Desktop as DesktopPreview
participant Sidebar as Sidebar
participant Panel as Active Panel<br/>(Dashboard/Shared/Projects)
Page->>Preview: Render DashboardPreview
Preview->>Observer: Set up viewport observer (threshold 0.1)
Page->>Page: User scrolls into view
Observer->>Preview: Container becomes visible
Preview->>Preview: Set isVisible=true
Preview->>Preview: Schedule stagger reset after 1400ms
Preview->>Desktop: Render with isVisible, activePanel, stagger
Desktop->>Sidebar: Render with visibility & panel state
Desktop->>Panel: Render active panel (Dashboard/Shared/Projects)
Panel->>Panel: Apply staggered animations via stagger(i)<br/>→ animationDelay: 400 + i*100 ms
Sidebar->>Sidebar: User clicks navigation item
Sidebar->>Desktop: onPanelChange(newPanelId)
Desktop->>Panel: Re-render new active panel
Panel->>Panel: Apply animations with updated stagger
Note over Preview: After 1400ms:<br/>stagger returns 0ms delay
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 12
🧹 Nitpick comments (1)
src/components/dashboard-preview/index.tsx (1)
1-9: Use alias imports and add the exported return type.This new component uses relative imports for
srcmodules and leaves the exported component return type implicit.🛠️ Proposed fix
import { useCallback, useEffect, useRef, useState } from "react"; -import { Sidebar } from "./sidebar"; -import { VariablesPanel } from "./variables-panel"; -import { SharedPanel } from "./shared-panel"; -import { ProjectsPanel } from "./projects-panel"; +import type { JSX } from "react"; + +import { ProjectsPanel } from "@/components/dashboard-preview/projects-panel"; +import { SharedPanel } from "@/components/dashboard-preview/shared-panel"; +import { Sidebar } from "@/components/dashboard-preview/sidebar"; +import { VariablesPanel } from "@/components/dashboard-preview/variables-panel"; import type { PreviewPanelId } from "@/lib/types"; @@ /** Animated, interactive dashboard preview for the landing page hero section. */ -export function DashboardPreview() { +export function DashboardPreview(): JSX.Element {As per coding guidelines, use
@/path alias for src imports, group imports external packages before internal modules, and prefer explicit return types for exported functions.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/dashboard-preview/index.tsx` around lines 1 - 9, Replace the relative src imports with alias imports using "@/..." for internal modules and reorder imports so external packages (react) come first and internal components (Sidebar, VariablesPanel, SharedPanel, ProjectsPanel, PreviewPanelId) follow; also add an explicit exported return type to the DashboardPreview function (e.g., : JSX.Element) to make the return type explicit. Ensure you update import paths for Sidebar, VariablesPanel, SharedPanel, ProjectsPanel and the PreviewPanelId type to use the "@/..." alias and keep the function signature as export function DashboardPreview(): JSX.Element { ... }.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/components/dashboard-preview.tsx`:
- Around line 183-188: The render targets for the panels are swapped: when
activePanel === "dashboard" it renders AllProjectsPanel and when activePanel ===
"allProjects" it renders DashboardPanel; update the conditional JSX so
"dashboard" renders DashboardPanel and "allProjects" renders AllProjectsPanel,
keeping the existing props (isVisible and stagger) passed to the components
(references: AllProjectsPanel, DashboardPanel, SharedPanel, activePanel,
isVisible, stagger).
- Around line 527-552: The typing effect useEffect currently only clears
startDelay on unmount, leaving nested timers running; modify the effect to track
and clear all timers (startDelay, typeInterval, the 2nd setTimeout for erase
start, and eraseInterval) on cleanup by storing their IDs in refs or outer-scope
variables and calling clearTimeout/clearInterval for each when the component
unmounts or isVisible becomes false; update the effect that references
fullSearchText and setSearchText so it clears typeInterval and eraseInterval and
cancels the erase-start timeout to fully stop the typing/erasing sequence.
- Around line 690-697: The reveal button currently uses tabIndex={-1} which
removes it from keyboard focus; remove that prop so it remains
keyboard-accessible, and add an accessible label and state by including a
dynamic aria-label (e.g., aria-label={isRevealed ? "Hide value" : "Reveal
value"}) and aria-pressed={isRevealed} on the <button> that calls
toggleReveal(i) (the same element rendering Eye/EyeOff); keep the existing title
but ensure the button remains a native <button> so keyboard activation works
out-of-the-box.
- Line 104: Remove the standalone DashboardPreview component file that declares
the local PanelId and monolithic component; delete the export function
DashboardPreview and its containing file so imports like
"@/components/dashboard-preview" unambiguously resolve to the modular
implementation under the directory variant; ensure code now uses the shared
PreviewPanelId type (from `@/lib/types.ts`) and the modular components (sidebar,
variables-panel, shared-panel, projects-panel) referenced by the index.tsx
version remain in place; after deletion, run a quick import check in
src/routes/index.tsx to confirm it resolves to the directory-based component.
In `@src/components/dashboard-preview/index.tsx`:
- Around line 16-32: The effect in the component's useEffect that observes
containerRef.current starts a setTimeout to flip hasAnimatedRef.current after
1400ms but never clears that timer on unmount; capture the timeout id when
calling setTimeout inside the IntersectionObserver callback (where
setIsVisible(true) is called) and store it in a local variable (e.g.,
timeoutId), then clear it in the effect cleanup (alongside obs.disconnect())
using clearTimeout(timeoutId) to avoid running the callback after unmount;
reference useEffect, containerRef, hasAnimatedRef, setIsVisible, and the
IntersectionObserver/obs when making the change.
In `@src/components/dashboard-preview/projects-panel.tsx`:
- Around line 15-18: Update the panel header text from "Dashboard" to "All
Projects" in the ProjectsPanel component: locate the h3 element with className
"text-base font-bold leading-tight" inside
src/components/dashboard-preview/projects-panel.tsx (or the ProjectsPanel
functional component) and change its inner text to "All Projects" so the header
matches the selected tab.
In `@src/components/dashboard-preview/shared-panel.tsx`:
- Around line 74-76: The icon is currently a non-functional,
removed-from-tab-order <button> around the MoreHorizontal icon which is
inaccessible; either render it as a non-interactive decorative element (replace
the <button> with a <span> or <div> and remove tabIndex, e.g. <span
aria-hidden="true" className="text-muted-foreground/40 justify-self-end">
<MoreHorizontal .../> </span>) or if you intend it to open a menu later keep the
<button> but make it an actual control by adding type="button", a descriptive
aria-label (e.g. aria-label="More options"), and proper keyboard/click handlers
in the component that will be used to toggle the menu (target the existing
<button> element wrapping the MoreHorizontal icon).
In `@src/components/dashboard-preview/sidebar.tsx`:
- Around line 55-63: The sidebar buttons only convey selection visually; update
the button rendered in the map (the element using key={item.label}, onClick={()
=> onPanelChange(item.panelId)}, and style={stagger(i)}) to expose the state to
assistive tech by adding semantic attributes: set aria-pressed={activePanel ===
item.panelId} (so screen readers know it's a pressed/toggle state) and
aria-current={activePanel === item.panelId ? "true" : undefined} (to indicate
the current navigation item), leaving the existing onPanelChange and visual
classes intact.
In `@src/components/dashboard-preview/variables-panel.tsx`:
- Around line 151-159: The reveal toggle currently removes keyboard focus with
tabIndex={-1} making toggleReveal inaccessible; change the reveal button (the
element rendering Eye/EyeOff and calling toggleReveal) to be keyboard-focusable
(remove tabIndex or set to 0) and provide an accessible name via title or
aria-label (e.g., "Reveal value" / "Hide value") so keyboard users can activate
it; for the trailing menu icon button that has no behavior, render it as
decorative instead of an interactive control (e.g., use a non-interactive
element with aria-hidden="true" or add an accessible label and real onClick/role
if it should open a menu) so only true controls are keyboard-focusable and
properly labelled.
In `@src/lib/types.ts`:
- Around line 100-103: The type declaration PreviewSidebarItem uses
React.ComponentType without importing React; add a type-only import and use it
directly to satisfy strict TS mode: import type { ComponentType } from 'react',
then change the icon's type from React.ComponentType<{ className?: string }> to
ComponentType<{ className?: string }>. Ensure the import is a top-level
type-only import (import type ...) and update the PreviewSidebarItem interface
accordingly.
In `@src/styles.css`:
- Around line 252-313: Add a prefers-reduced-motion override so users who
request reduced motion don't see entrance, decrypt-flash, or cursor-blink
animations: create an `@media` (prefers-reduced-motion: reduce) block that targets
.dshb-fade-in.dshb-animate, .dshb-slide-in-left.dshb-animate, .dshb-decrypt and
.dshb-cursor-blink and disable animations (set animation: none) and force the
end-state (e.g., opacity: 1 and transform: translateY(0) / translateX(0) for the
slide/fade classes) so elements render statically while preserving visual
layout.
In `@TODO.md`:
- Around line 34-36: Update the TODO list item wording to correct spelling and
grammar: change "admin panel" to "Admin panel" (capitalize), rewrite "the
tutorial (step 1 always missing due to sidebar being closed)" to "Tutorial —
step 1 is missing when the sidebar is closed" for clarity, and fix "sidebar
doesnt closes when we naviagte to one route to other" to "Sidebar doesn't close
when navigating between routes"; ensure consistent punctuation and
capitalization across the list.
---
Nitpick comments:
In `@src/components/dashboard-preview/index.tsx`:
- Around line 1-9: Replace the relative src imports with alias imports using
"@/..." for internal modules and reorder imports so external packages (react)
come first and internal components (Sidebar, VariablesPanel, SharedPanel,
ProjectsPanel, PreviewPanelId) follow; also add an explicit exported return type
to the DashboardPreview function (e.g., : JSX.Element) to make the return type
explicit. Ensure you update import paths for Sidebar, VariablesPanel,
SharedPanel, ProjectsPanel and the PreviewPanelId type to use the "@/..." alias
and keep the function signature as export function DashboardPreview():
JSX.Element { ... }.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 31138148-940e-4e24-827b-7eacc371e33c
📒 Files selected for processing (12)
.prettierignoreTODO.mdsrc/components/dashboard-preview.tsxsrc/components/dashboard-preview/index.tsxsrc/components/dashboard-preview/projects-panel.tsxsrc/components/dashboard-preview/shared-panel.tsxsrc/components/dashboard-preview/sidebar.tsxsrc/components/dashboard-preview/variables-panel.tsxsrc/lib/preview-data.tssrc/lib/types.tssrc/routes/index.tsxsrc/styles.css
| export interface PreviewSidebarItem { | ||
| icon: React.ComponentType<{ className?: string }>; | ||
| label: string; | ||
| panelId: PreviewPanelId; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Find React type namespace references that may need explicit imports.
# Expectation after the fix: no unqualified React.ComponentType usage remains in src/lib/types.ts.
rg -nP '\bReact\.ComponentType\b' src/lib/types.tsRepository: pantharshit007/tijori
Length of output: 121
🏁 Script executed:
head -30 src/lib/types.tsRepository: pantharshit007/tijori
Length of output: 740
🏁 Script executed:
rg -nP '\bReact\.' src/lib/types.tsRepository: pantharshit007/tijori
Length of output: 121
🏁 Script executed:
sed -n '95,115p' src/lib/types.tsRepository: pantharshit007/tijori
Length of output: 546
🏁 Script executed:
rg -n 'import.*React' src/lib/types.tsRepository: pantharshit007/tijori
Length of output: 47
🏁 Script executed:
wc -l src/lib/types.tsRepository: pantharshit007/tijori
Length of output: 85
🏁 Script executed:
rg -n 'React' src/lib/types.tsRepository: pantharshit007/tijori
Length of output: 121
🏁 Script executed:
cat -n src/lib/types.ts | head -20Repository: pantharshit007/tijori
Length of output: 677
🏁 Script executed:
cat -n src/lib/types.ts | grep -A5 -B5 "React.ComponentType"Repository: pantharshit007/tijori
Length of output: 486
Import the React component type explicitly.
React.ComponentType is referenced without importing React, violating strict TypeScript mode and the requirement to use import type for type-only imports.
🛠️ Proposed fix
+import type { ComponentType } from "react";
import type { Tier } from "./role-limits";
import type { Id } from "../../convex/_generated/dataModel";
export interface PreviewSidebarItem {
- icon: React.ComponentType<{ className?: string }>;
+ icon: ComponentType<{ className?: string }>;
label: string;
panelId: PreviewPanelId;
}📝 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.
| export interface PreviewSidebarItem { | |
| icon: React.ComponentType<{ className?: string }>; | |
| label: string; | |
| panelId: PreviewPanelId; | |
| import type { ComponentType } from "react"; | |
| import type { Tier } from "./role-limits"; | |
| import type { Id } from "../../convex/_generated/dataModel"; | |
| export interface PreviewSidebarItem { | |
| icon: ComponentType<{ className?: string }>; | |
| label: string; | |
| panelId: PreviewPanelId; | |
| } |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/lib/types.ts` around lines 100 - 103, The type declaration
PreviewSidebarItem uses React.ComponentType without importing React; add a
type-only import and use it directly to satisfy strict TS mode: import type {
ComponentType } from 'react', then change the icon's type from
React.ComponentType<{ className?: string }> to ComponentType<{ className?:
string }>. Ensure the import is a top-level type-only import (import type ...)
and update the PreviewSidebarItem interface accordingly.
There was a problem hiding this comment.
@pantharshit007, understood — I'll note that for future reviews.
(╥_╥)
✏️ Learnings added
Learnt from: pantharshit007
Repo: pantharshit007/tijori PR: 15
File: src/lib/types.ts:100-103
Timestamp: 2026-04-23T21:33:38.689Z
Learning: In `src/lib/types.ts` of pantharshit007/tijori, the `PreviewSidebarItem` interface intentionally uses `React.ComponentType` without an explicit React import. The maintainer prefers to keep it as-is and does not want a separate `import type { ComponentType } from "react"` added.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
🧠 Learnings used
Learnt from: CR
Repo: pantharshit007/tijori PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-01T14:33:50.174Z
Learning: Applies to **/*.{ts,tsx} : Define shared types in `src/lib/types.ts`
Learnt from: CR
Repo: pantharshit007/tijori PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-01T14:33:50.174Z
Learning: Applies to **/*.{ts,tsx} : Use `import type` for type-only imports
Learnt from: CR
Repo: pantharshit007/tijori PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-01T14:33:50.174Z
Learning: Applies to src/components/**/*.tsx : In React components, organize code in order: imports, types/interfaces, component definition with hooks first, then event handlers, then render logic
Learnt from: CR
Repo: pantharshit007/tijori PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-01T14:33:50.174Z
Learning: Applies to src/components/**/*.tsx : Use PascalCase for React component file names and exports
Learnt from: CR
Repo: pantharshit007/tijori PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-01T14:33:50.174Z
Learning: Applies to **/*.{ts,tsx} : Strict TypeScript mode enabled - No implicit any, strict null checks
Learnt from: CR
Repo: pantharshit007/tijori PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-01T14:33:50.174Z
Learning: Applies to **/*.{ts,tsx} : Prefer explicit return types for exported functions
Learnt from: CR
Repo: pantharshit007/tijori PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-01T14:33:50.174Z
Learning: Applies to **/*.{ts,tsx} : Use `@/` path alias for src imports: `import { Button } from "@/components/ui/button"`
Learnt from: CR
Repo: pantharshit007/tijori PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-01T14:33:50.174Z
Learning: Applies to **/*.{ts,tsx} : Use PascalCase for type and interface names
Learnt from: CR
Repo: pantharshit007/tijori PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-01T14:33:50.174Z
Learning: Applies to src/**/*.tsx : Add title attribute to Button components from `@/components/ui/button`
| - admin panel | ||
| - the tutorial (step 1 always missing due to sidebar being closed) | ||
| - sidebar doesnt closes when we naviagte to one route to other |
There was a problem hiding this comment.
Fix the TODO wording typo.
Line 36 has a few spelling/grammar issues.
📝 Proposed wording fix
- - sidebar doesnt closes when we naviagte to one route to other
+ - sidebar doesn't close when we navigate from one route to another📝 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.
| - admin panel | |
| - the tutorial (step 1 always missing due to sidebar being closed) | |
| - sidebar doesnt closes when we naviagte to one route to other | |
| - admin panel | |
| - the tutorial (step 1 always missing due to sidebar being closed) | |
| - sidebar doesn't close when we navigate from one route to another |
🧰 Tools
🪛 LanguageTool
[grammar] ~36-~36: Ensure spelling is correct
Context: ...osed) - sidebar doesnt closes when we naviagte to one route to other ---
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~36-~36: Ensure spelling is correct
Context: ...closes when we naviagte to one route to other ---
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@TODO.md` around lines 34 - 36, Update the TODO list item wording to correct
spelling and grammar: change "admin panel" to "Admin panel" (capitalize),
rewrite "the tutorial (step 1 always missing due to sidebar being closed)" to
"Tutorial — step 1 is missing when the sidebar is closed" for clarity, and fix
"sidebar doesnt closes when we naviagte to one route to other" to "Sidebar
doesn't close when navigating between routes"; ensure consistent punctuation and
capitalization across the list.
There was a problem hiding this comment.
@pantharshit007 Understood, no problem! 👍
( (
. . )
o_-_o
- Bump version in package.json from 0.0.15 to 0.0.16. - Remove old dashboard-preview component and its related files. - Create new DashboardPreview component that integrates MobilePreview and DesktopPreview. - Implement DesktopPreview to handle different panels (VariablesPanel, SharedPanel, ProjectsPanel). - Add MobilePreview for mobile-specific layout. - Adjust ProjectsPanel to display project cards in a 3-column layout. - Update VariablesPanel to modify width of name and environment display. - Update import paths in routes/index.tsx to reflect new component structure.
Summary
Summary by CodeRabbit
Release Notes
New Features
Chores
Checklist
Additional Information