Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/calendar-notepad.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export function CalendarNotepad({ chatId }: CalendarNotepadProps) {
};

return (
<div data-testid="calendar-notepad" className="bg-card text-card-foreground shadow-lg rounded-lg p-4 max-w-2xl mx-auto my-4 border">
<div data-testid="calendar-notepad" className="bg-card text-card-foreground shadow-lg rounded-lg p-4 w-full my-4 border">
<div className="flex items-center justify-between mb-4">
<button
onClick={() => setDateOffset(dateOffset - 7)}
Expand Down
4 changes: 2 additions & 2 deletions components/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export function Chat({ id }: ChatProps) {
<HeaderSearchButton />
<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.

{isCalendarOpen ? (
<CalendarNotepad chatId={id} />
) : (
Expand All @@ -139,7 +139,7 @@ export function Chat({ id }: ChatProps) {
)}
</div>
<div
className="w-1/2 p-4 fixed h-[calc(100vh-0.5in)] top-0 right-0 mt-[0.5in]"
className="w-2/5 p-4 fixed h-[calc(100vh-0.5in)] top-0 right-0 mt-[0.5in]"
style={{ zIndex: 10 }} // Added z-index
>
{activeView ? <SettingsView /> : <Mapbox />}
Expand Down
4 changes: 2 additions & 2 deletions components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { MapToggle } from './map-toggle'
import { ProfileToggle } from './profile-toggle'

export const Header = () => {
const { toggleCalendar } = useCalendarToggle()
const { toggleCalendar, isCalendarOpen } = useCalendarToggle()
return (
<header className="fixed w-full p-1 md:p-2 flex justify-between items-center z-10 backdrop-blur md:backdrop-blur-none bg-background/80 md:bg-transparent">
<div>
Expand All @@ -38,7 +38,7 @@ export const Header = () => {

<MapToggle />

<Button variant="ghost" size="icon" onClick={toggleCalendar} title="Open Calendar">
<Button variant="ghost" size="icon" onClick={toggleCalendar} title="Open Calendar" className={cn(isCalendarOpen && "bg-accent")}>
<CalendarDays className="h-[1.2rem] w-[1.2rem]" />
</Button>
Comment on lines +41 to 43
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.


Expand Down
4 changes: 2 additions & 2 deletions components/mobile-icons-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface MobileIconsBarProps {
export const MobileIconsBar: React.FC<MobileIconsBarProps> = ({ onAttachmentClick }) => {
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.


const handleNewChat = async () => {
setMessages([])
Expand All @@ -42,7 +42,7 @@ export const MobileIconsBar: React.FC<MobileIconsBarProps> = ({ onAttachmentClic
<CircleUserRound className="h-[1.2rem] w-[1.2rem]" />
</Button>
<MapToggle />
<Button variant="ghost" size="icon" onClick={toggleCalendar} title="Open Calendar">
<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>
Comment on lines +45 to 47
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.

<Button variant="ghost" size="icon">
Expand Down