Skip to content

feat: Improve calendar UI and widen desktop layout for collaborative workflows#356

Closed
ngoiyaeric wants to merge 1 commit into
mainfrom
feature/calendar-ui-improvements
Closed

feat: Improve calendar UI and widen desktop layout for collaborative workflows#356
ngoiyaeric wants to merge 1 commit into
mainfrom
feature/calendar-ui-improvements

Conversation

@ngoiyaeric
Copy link
Copy Markdown
Collaborator

@ngoiyaeric ngoiyaeric commented Nov 5, 2025

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

  • Chat/Calendar area: Widened from 50% to 60% width
  • Map area: Reduced from 50% to 40% width
  • Provides 20% more horizontal space for collaborative context

2. Calendar Notepad Full Width

  • Removed max-w-2xl constraint
  • Changed to w-full to use the full available width
  • Better display of survey requirements and detailed planning

3. Calendar Icon Visual Feedback

  • Added active state highlighting with bg-accent background
  • Clear visual indication when calendar is open
  • Consistent across desktop and mobile

Use Case Alignment

These changes support the intended use case for calendar-centric collaborative geospatial workflows:

  • Users add time-sensitive context about geospatial work
  • Collaborate asynchronously with team members
  • Tag locations and collaborators
  • Set reminders for future events (e.g., municipal land divisions)
  • More space for survey requirements and detailed notes

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)

Testing

  • Desktop layout shows 60/40 split
  • Calendar notepad uses full width
  • Calendar icon highlights when active (desktop)
  • Calendar icon highlights when active (mobile)
  • All existing functionality preserved
  • Mobile layout unchanged

Impact

  • No breaking changes
  • No new dependencies
  • Zero performance impact (CSS-only changes)
  • Backward compatible

Screenshots

The desktop UI now provides significantly more space for:

  • Survey requirements and detailed planning
  • Multiple collaborator tags and mentions
  • Location context and future event planning
  • Better information density and readability

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

flowchart LR
  A["Desktop Layout"] -->|"Adjust widths"| B["Chat/Calendar: 50% → 60%"]
  A -->|"Adjust widths"| C["Map: 50% → 40%"]
  D["Calendar Notepad"] -->|"Remove constraint"| E["max-w-2xl → w-full"]
  F["Calendar Icon"] -->|"Add active state"| G["bg-accent highlight"]
Loading

File Walkthrough

Relevant files
Enhancement
calendar-notepad.tsx
Remove max-width constraint from calendar notepad               

components/calendar-notepad.tsx

  • Removed max-w-2xl mx-auto width constraint
  • Changed to w-full for full available width
  • Allows calendar notepad to expand and utilize desktop space
+1/-1     
chat.tsx
Adjust desktop layout width split ratio                                   

components/chat.tsx

  • Changed chat/calendar container width from w-1/2 to w-3/5 (50% to 60%)
  • Changed map container width from w-1/2 to w-2/5 (50% to 40%)
  • Provides 20% more horizontal space for collaborative context
+2/-2     
header.tsx
Add active state styling to calendar icon                               

components/header.tsx

  • Extract isCalendarOpen state from useCalendarToggle hook
  • Add conditional bg-accent class to calendar button when active
  • Provides visual feedback for calendar open state on desktop
+2/-2     
mobile-icons-bar.tsx
Add active state styling to mobile calendar icon                 

components/mobile-icons-bar.tsx

  • Extract isCalendarOpen state from useCalendarToggle hook
  • Add conditional bg-accent class to calendar button when active
  • Provides visual feedback for calendar open state on mobile
+2/-2     

Summary by CodeRabbit

  • Style
    • Calendar notepad now spans full available width for improved space utilization.
    • Adjusted chat layout proportions to allocate more space to the main content area.
    • Calendar button now visually highlights when the calendar is open for better UI feedback.

…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)
@charliecreates charliecreates Bot requested a review from CharlieHelps November 5, 2025 05:08
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Nov 5, 2025

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

Project Deployment Preview Comments Updated (UTC)
qcx Ready Ready Preview Comment Nov 5, 2025 5:09am

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


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.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 5, 2025

Walkthrough

Calendar 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

Cohort / File(s) Summary
Layout & Container Styling
components/calendar-notepad.tsx
Root container className changed from "max-w-2xl mx-auto" to "w-full", removing max-width constraint and centering behavior
Chat Pane Width Redistribution
components/chat.tsx
Desktop layout proportions adjusted: main content container width increased from 1/2 to 3/5, right-side panel width decreased from 1/2 to 2/5
Calendar State Visual Indication
components/header.tsx, components/mobile-icons-bar.tsx
Both components now consume isCalendarOpen from useCalendarToggle hook and conditionally apply "bg-accent" className to Calendar button when calendar is open

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review layout proportion changes in chat.tsx for responsive balance and consistency with calendar notepad full-width adjustment
  • Verify calendar open state styling correctly applies across both desktop header and mobile icons bar components
  • Confirm hook consumption pattern matches useCalendarToggle hook signature from upstream changes

Possibly related PRs

Suggested labels

Review effort 3/5

Poem

🐰 A calendar spreads full and wide,
Chat panes dance to a new divide,
Open or closed, the buttons now glow,
Layout harmony starts to flow!
Hop along, the design's refined! 🎨

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: calendar UI improvements (active state visual feedback) and desktop layout widening (60/40 split) for collaborative workflows.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/calendar-ui-improvements

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.

@qodo-code-review
Copy link
Copy Markdown
Contributor

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review
Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Use cn utility for consistency

To improve consistency with header.tsx, replace the ternary operator with the cn
utility function for conditionally applying the bg-accent class.

components/mobile-icons-bar.tsx [45-47]

-<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>
  • Apply / Chat
Suggestion importance[1-10]: 5

__

Why: The suggestion correctly identifies an inconsistency with header.tsx and proposes using the cn utility for conditional classes, which improves code consistency and maintainability.

Low
  • More

Copy link
Copy Markdown

@charliecreates charliecreates Bot left a comment

Choose a reason for hiding this comment

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

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 shared CalendarToggleButton component would centralize logic (active styling, aria attributes) and reduce maintenance.
Summary of changes
  • Widened the desktop split in components/chat.tsx from w-1/2 vs w-1/2 to w-3/5 (content) and w-2/5 (map).
  • Expanded components/calendar-notepad.tsx container from a centered max-w-2xl to full-width w-full.
  • Added calendar active-state styling to desktop (components/header.tsx) using bg-accent when open.
  • Added calendar active-state styling to mobile (components/mobile-icons-bar.tsx) using bg-accent when open.

Comment thread components/header.tsx
Comment on lines +41 to 43
<Button variant="ghost" size="icon" onClick={toggleCalendar} title="Open Calendar" className={cn(isCalendarOpen && "bg-accent")}>
<CalendarDays className="h-[1.2rem] w-[1.2rem]" />
</Button>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread components/chat.tsx
<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">
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment on lines +45 to 47
<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>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@charliecreates charliecreates Bot removed the request for review from CharlieHelps November 5, 2025 05:10
Copy link
Copy Markdown
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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0bef919 and c1bae8a.

📒 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-2xl constraint 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 isCalendarOpen state with the cn() 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()
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.

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

@ngoiyaeric ngoiyaeric closed this Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants