feat: Improve calendar UI and widen desktop layout for collaborative workflows#356
feat: Improve calendar UI and widen desktop layout for collaborative workflows#356ngoiyaeric wants to merge 1 commit into
Conversation
…workflows - Widen desktop chat/calendar area from 50% to 60% width - Reduce desktop map area from 50% to 40% width - Remove max-width constraint from calendar notepad (now uses full width) - Add visual feedback to calendar icon when active (desktop and mobile) These changes improve the user experience for collaborative geospatial workflows by providing more horizontal space for: - Survey requirements and detailed planning - Multiple collaborator tags and mentions - Location context and future event planning - Better information density and readability The calendar icon now highlights with an accent background when the calendar is open, providing clear visual feedback to users about the current state. All existing functionality is preserved, including: - 7-day sliding date window navigation - Location tagging with MapPin button - Map integration (flyTo functionality) - Chat context integration - Mobile responsive layout (unchanged) Files modified: - components/chat.tsx: Desktop layout width adjustments (60/40 split) - components/calendar-notepad.tsx: Full width usage - components/header.tsx: Calendar icon active state (desktop) - components/mobile-icons-bar.tsx: Calendar icon active state (mobile)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Manus AI seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
WalkthroughCalendar and chat layout refinements applied: calendar container now spans full width instead of constrained, desktop chat panes redistributed (content 1/2 → 3/5, right panel 1/2 → 2/5), and calendar open state now visually indicated via accent background styling on relevant buttons. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ 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 |
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
There was a problem hiding this comment.
Overall the layout and visual state changes look aligned with the PR goals. Two improvements are important: expose the calendar button’s toggle state with aria-pressed and dynamic labels, and add min-w-0 to the left column to prevent horizontal overflow with the now w-full notepad. Optionally, apply text-accent-foreground when using bg-accent on a ghost button for better contrast. No functional regressions spotted beyond these concerns.
Additional notes (1)
- Maintainability |
components/header.tsx:41-43
The calendar toggle button implementation now exists in both desktop and mobile with slightly different patterns (different conditional class approaches). This duplication can drift over time. Extracting a small sharedCalendarToggleButtoncomponent would centralize logic (active styling, aria attributes) and reduce maintenance.
Summary of changes
- Widened the desktop split in
components/chat.tsxfromw-1/2vsw-1/2tow-3/5(content) andw-2/5(map). - Expanded
components/calendar-notepad.tsxcontainer from a centeredmax-w-2xlto full-widthw-full. - Added calendar active-state styling to desktop (
components/header.tsx) usingbg-accentwhen open. - Added calendar active-state styling to mobile (
components/mobile-icons-bar.tsx) usingbg-accentwhen open.
| <Button variant="ghost" size="icon" onClick={toggleCalendar} title="Open Calendar" className={cn(isCalendarOpen && "bg-accent")}> | ||
| <CalendarDays className="h-[1.2rem] w-[1.2rem]" /> | ||
| </Button> |
There was a problem hiding this comment.
Good call adding an active visual state. However, the button should expose its toggle state to assistive tech and be labeled accurately when open/closed. Consider adding aria-pressed, an aria-label, and a dynamic title. Also, when using bg-accent, you may need text-accent-foreground for proper contrast with the ghost variant.
This improves accessibility and clarity without affecting the visual design intent.
Suggestion
Update the button to reflect toggle state and improve contrast:
<Button
variant="ghost"
size="icon"
onClick={toggleCalendar}
title={isCalendarOpen ? "Close Calendar" : "Open Calendar"}
aria-pressed={isCalendarOpen}
aria-label={isCalendarOpen ? "Close calendar" : "Open calendar"}
className={cn(isCalendarOpen && "bg-accent text-accent-foreground")}
>
<CalendarDays className="h-[1.2rem] w-[1.2rem]" />
</Button>Reply with "@CharlieHelps yes please" if you'd like me to add a commit with this suggestion.
| <div className="flex justify-start items-start"> | ||
| {/* This is the new div for scrolling */} | ||
| <div className="w-1/2 flex flex-col space-y-3 md:space-y-4 px-8 sm:px-12 pt-12 md:pt-14 pb-4 h-[calc(100vh-0.5in)] overflow-y-auto"> | ||
| <div className="w-3/5 flex flex-col space-y-3 md:space-y-4 px-8 sm:px-12 pt-12 md:pt-14 pb-4 h-[calc(100vh-0.5in)] overflow-y-auto"> |
There was a problem hiding this comment.
With the right pane fixed at w-2/5, increasing the left column to w-3/5 is reasonable. However, flex items without min-w-0 can cause unexpected horizontal overflow when their children use w-full (as the notepad now does). Adding min-w-0 to the left column prevents long content from forcing overflow and improves layout stability across browsers.
Suggestion
Add min-w-0 to the left column:
<div className="w-3/5 min-w-0 flex flex-col space-y-3 md:space-y-4 px-8 sm:px-12 pt-12 md:pt-14 pb-4 h-[calc(100vh-0.5in)] overflow-y-auto">Reply with "@CharlieHelps yes please" if you'd like me to add a commit with this change.
| <Button variant="ghost" size="icon" onClick={toggleCalendar} title="Open Calendar" className={isCalendarOpen ? "bg-accent" : ""}> | ||
| <CalendarDays className="h-[1.2rem] w-[1.2rem] transition-all rotate-0 scale-100" /> | ||
| </Button> |
There was a problem hiding this comment.
Nice active-state addition. Similar to desktop, the button should communicate its state for accessibility and label accuracy. Add aria-pressed and dynamic title/aria-label. You can keep the existing class toggle; no need to introduce a utility.
Suggestion
Improve accessibility and labeling:
<Button
variant="ghost"
size="icon"
onClick={toggleCalendar}
title={isCalendarOpen ? "Close Calendar" : "Open Calendar"}
aria-pressed={isCalendarOpen}
aria-label={isCalendarOpen ? "Close calendar" : "Open calendar"}
className={isCalendarOpen ? "bg-accent" : undefined}
>
<CalendarDays className="h-[1.2rem] w-[1.2rem] transition-all rotate-0 scale-100" />
</Button>Reply with "@CharlieHelps yes please" if you'd like me to add a commit with this suggestion.
There was a problem hiding this comment.
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)
components/calendar-notepad.tsx (1)
1-3: Remove duplicate "use client" directive.The file contains two "use client" directives (lines 1 and 3). Next.js requires only one directive at the top of the file.
Apply this diff to remove the duplicate:
"use client" -"use client" - import type React from "react"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (4)
components/calendar-notepad.tsx(1 hunks)components/chat.tsx(2 hunks)components/header.tsx(2 hunks)components/mobile-icons-bar.tsx(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
components/header.tsx (2)
components/calendar-toggle-context.tsx (1)
useCalendarToggle(12-18)lib/utils/index.ts (1)
cn(11-13)
components/mobile-icons-bar.tsx (1)
components/calendar-toggle-context.tsx (1)
useCalendarToggle(12-18)
🔇 Additional comments (3)
components/calendar-notepad.tsx (1)
94-94: LGTM! Full-width calendar layout improves collaborative workflows.Removing the
max-w-2xlconstraint allows the calendar notepad to utilize the full available width, which aligns perfectly with the PR objective to provide more space for survey requirements and detailed planning.components/chat.tsx (1)
123-123: LGTM! Desktop layout proportions adjusted correctly.The 60/40 split (3/5 for content, 2/5 for map) provides more horizontal space for the chat and calendar areas as intended. The math is correct and the implementation is clean.
Also applies to: 142-142
components/header.tsx (1)
20-20: LGTM! Calendar active state styling implemented correctly.The use of
isCalendarOpenstate with thecn()helper provides clean visual feedback when the calendar is open. The implementation follows best practices for conditional className logic.Also applies to: 41-41
| const [, setMessages] = useUIState<typeof AI>() | ||
| const { clearChat } = useActions() | ||
| const { toggleCalendar } = useCalendarToggle() | ||
| const { toggleCalendar, isCalendarOpen } = useCalendarToggle() |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Consider using cn() helper for consistency with header.tsx.
The active state styling works correctly, but header.tsx uses the cn() utility for the same pattern. Using cn() consistently across both components improves maintainability and better handles multiple conditional classes.
Apply this diff to align with the pattern in header.tsx:
- <Button variant="ghost" size="icon" onClick={toggleCalendar} title="Open Calendar" className={isCalendarOpen ? "bg-accent" : ""}>
+ <Button variant="ghost" size="icon" onClick={toggleCalendar} title="Open Calendar" className={cn(isCalendarOpen && "bg-accent")}>
<CalendarDays className="h-[1.2rem] w-[1.2rem] transition-all rotate-0 scale-100" />
</Button>You'll also need to import cn at the top of the file:
import { cn } from '@/lib/utils'Also applies to: 45-45
🤖 Prompt for AI Agents
In components/mobile-icons-bar.tsx around lines 29 and 45, replace the current
conditional class concatenation for the calendar active state with the cn()
helper for consistency with header.tsx; import cn from '@/lib/utils' at the top
of the file, then wrap the class list in cn(...) using conditional parameters
(e.g., { 'active-class': isCalendarOpen }, common classes) so multiple
conditional classes are handled cleanly and maintainably.
User description
Summary
This PR improves the calendar functionality and desktop UI layout to better support collaborative geospatial workflows.
Changes Made
1. Desktop Layout Width Adjustment
2. Calendar Notepad Full Width
max-w-2xlconstraintw-fullto use the full available width3. Calendar Icon Visual Feedback
bg-accentbackgroundUse Case Alignment
These changes support the intended use case for calendar-centric collaborative geospatial workflows:
Files Modified
components/chat.tsx: Desktop layout width adjustments (60/40 split)components/calendar-notepad.tsx: Full width usagecomponents/header.tsx: Calendar icon active state (desktop)components/mobile-icons-bar.tsx: Calendar icon active state (mobile)Testing
Impact
Screenshots
The desktop UI now provides significantly more space for:
PR Type
Enhancement
Description
Widen desktop chat/calendar area from 50% to 60% width
Reduce desktop map area from 50% to 40% width
Remove max-width constraint from calendar notepad
Add visual feedback to calendar icon when active
Diagram Walkthrough
File Walkthrough
calendar-notepad.tsx
Remove max-width constraint from calendar notepadcomponents/calendar-notepad.tsx
max-w-2xl mx-autowidth constraintw-fullfor full available widthchat.tsx
Adjust desktop layout width split ratiocomponents/chat.tsx
w-1/2tow-3/5(50% to 60%)w-1/2tow-2/5(50% to 40%)header.tsx
Add active state styling to calendar iconcomponents/header.tsx
isCalendarOpenstate fromuseCalendarTogglehookbg-accentclass to calendar button when activemobile-icons-bar.tsx
Add active state styling to mobile calendar iconcomponents/mobile-icons-bar.tsx
isCalendarOpenstate fromuseCalendarTogglehookbg-accentclass to calendar button when activeSummary by CodeRabbit