Skip to content

calendar, add planning view for mobiles#173

Merged
mitch10593 merged 2 commits intomainfrom
feature/112-calendar-on-mobile-needs-to-be-refactored
Mar 12, 2026
Merged

calendar, add planning view for mobiles#173
mitch10593 merged 2 commits intomainfrom
feature/112-calendar-on-mobile-needs-to-be-refactored

Conversation

@mitch10593
Copy link
Copy Markdown
Contributor

@mitch10593 mitch10593 commented Mar 12, 2026

Summary by Sourcery

Improve calendar and event interfaces with a mobile-friendly planning view and responsive layout adjustments.

New Features:

  • Set a weekly list planning view as the default calendar view on mobile while keeping the monthly grid on larger screens.

Enhancements:

  • Make FullCalendar toolbar and typography responsive on small screens for better usability.
  • Expose the weekly list view as an additional option in the calendar toolbar on desktop.
  • Improve layout responsiveness in event detail and edit views, including header actions, date fields, and checkbox groups.
  • Ensure wide tables (ATO and participation choices) are horizontally scrollable on smaller screens.

Build:

  • Add the FullCalendar list plugin dependency to support the new planning view.

Documentation:

  • Update changelog to mention the new mobile planning view for the calendar.

@mitch10593 mitch10593 added this to the 2.1 milestone Mar 12, 2026
@mitch10593 mitch10593 self-assigned this Mar 12, 2026
@mitch10593 mitch10593 linked an issue Mar 12, 2026 that may be closed by this pull request
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Mar 12, 2026

Reviewer's Guide

Implements a mobile-friendly planning view for the calendar by using FullCalendar's list view on small screens, adds responsive CSS and layout tweaks across calendar- and event-related views, and wires in the list plugin dependency plus changelog entry.

Flow diagram for calendar view selection based on device size

flowchart TD
  Start["Load CalendarView component"] --> GetWidth["Read window.innerWidth"]
  GetWidth --> CheckMobile{"Is width < 640px?"}
  CheckMobile -->|Yes| SetIsMobileTrue["Set isMobile = true"]
  CheckMobile -->|No| SetIsMobileFalse["Set isMobile = false"]

  SetIsMobileTrue --> MobileOptions["Compute calendarOptions for mobile"]
  SetIsMobileFalse --> DesktopOptions["Compute calendarOptions for desktop"]

  MobileOptions --> MobileInitialView["initialView = listWeek"]
  MobileOptions --> MobileToolbar["headerToolbar = { left: prev,next; center: title; right: listWeek,dayGridMonth }"]

  DesktopOptions --> DesktopInitialView["initialView = dayGridMonth"]
  DesktopOptions --> DesktopToolbar["headerToolbar = { left: prev,next today; center: title; right: dayGridMonth,timeGridWeek,timeGridDay,listWeek }"]

  MobileInitialView --> RenderCalendar["Render FullCalendar with computed options"]
  DesktopInitialView --> RenderCalendar
Loading

File-Level Changes

Change Details Files
Make event detail layout more responsive and mobile-friendly.
  • Switch event header container to a column layout on small screens with row layout from the sm breakpoint, adding vertical spacing between sections.
  • Allow the edit action button group to wrap onto multiple lines with gaps instead of fixed horizontal spacing, improving behavior on narrow widths.
  • Wrap the ATO table in a horizontally scrollable container to avoid layout breaking on small screens.
  • Wrap the detailed participation choices table in a horizontally scrollable container while preserving existing table structure and logic.
frontend/src/views/EventDetailView.vue
Introduce a mobile-focused planning view and responsive toolbar for the calendar using FullCalendar list view.
  • Import the FullCalendar list plugin and register it in the calendar plugins array.
  • Determine a boolean isMobile from window.innerWidth < 640 to decide the initial calendar view and toolbar layout.
  • Set initialView to 'listWeek' on mobile and keep 'dayGridMonth' on larger screens.
  • Configure headerToolbar conditionally: compact prev/next and listWeek/dayGridMonth toggle on mobile; keep existing controls and add listWeek as an additional option on desktop.
  • Shorten the calendar "Créer un événement" button label on very small screens via Tailwind responsive visibility classes.
frontend/src/views/CalendarView.vue
Improve responsiveness of the event edit form layout.
  • Change date fields grid from fixed two columns to a single column on mobile and two columns from the sm breakpoint.
  • Allow simulator/ATO checkboxes row to wrap with horizontal and vertical gaps instead of fixed spacing.
  • Allow "Réservé aux" restriction checkboxes row to wrap with responsive gaps for better readability on small screens.
frontend/src/views/EventEditView.vue
Add mobile-specific FullCalendar styling overrides.
  • Define a max-width: 640px media query for FullCalendar to wrap the toolbar with spacing, reduce font sizes, and center the title on its own row.
  • Reduce button padding and font size for FullCalendar toolbar buttons on small screens.
  • Reduce the minimum height of the daygrid events area and increase the event dot border width for better visual compactness on mobile.
  • Set a smaller base font size for the calendar on small screens to fit more content.
frontend/src/assets/css/main.css
Declare the new FullCalendar list plugin dependency and document the feature.
  • Add @fullcalendar/list to frontend/package.json dependencies (and lockfile).
  • Add a CHANGELOG entry describing the new calendar planning (list) view as default for mobile.
frontend/package.json
frontend/package-lock.json
CHANGELOG.md

Assessment against linked issues

Issue Objective Addressed Explanation
#112 Refactor the calendar view so that it becomes usable on mobile (e.g., via a mobile-friendly layout or planning/list view rather than the existing unusable layout).
#112 Improve the calendar’s responsive behavior and controls on small screens so navigation, toolbar, and text are appropriately sized and usable on smartphones.

Possibly linked issues

  • #(not specified): PR adds a mobile planning view and responsive tweaks directly addressing the calendar’s unusable mobile experience described in issue.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 2 issues, and left some high level feedback:

  • The isMobile constant in CalendarView.vue is computed once from window.innerWidth at module evaluation time, which will not react to viewport resizes and can break in SSR/test environments; consider moving this into a reactive ref inside setup (with a resize listener) and guarding access to window.
  • You now hardcode the 640px breakpoint both in Tailwind utility usage (sm:) and in custom CSS/media queries; it may be worth centralizing this breakpoint value or leveraging Tailwind’s generated classes to avoid divergence if the design system changes.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `isMobile` constant in `CalendarView.vue` is computed once from `window.innerWidth` at module evaluation time, which will not react to viewport resizes and can break in SSR/test environments; consider moving this into a reactive `ref` inside `setup` (with a `resize` listener) and guarding access to `window`.
- You now hardcode the `640px` breakpoint both in Tailwind utility usage (`sm:`) and in custom CSS/media queries; it may be worth centralizing this breakpoint value or leveraging Tailwind’s generated classes to avoid divergence if the design system changes.

## Individual Comments

### Comment 1
<location path="frontend/src/views/CalendarView.vue" line_range="42-48" />
<code_context>
   }))
 )

+const isMobile = window.innerWidth < 640
+
 const calendarOptions = computed(() => ({
-  plugins: [dayGridPlugin, timeGridPlugin, interactionPlugin],
-  initialView: 'dayGridMonth' as const,
+  plugins: [dayGridPlugin, timeGridPlugin, listPlugin, interactionPlugin],
+  initialView: isMobile ? 'listWeek' : 'dayGridMonth',
   locale: frLocale,
-  headerToolbar: {
-    left: 'prev,next today',
-    center: 'title',
-    right: 'dayGridMonth,timeGridWeek,timeGridDay',
-  },
+  headerToolbar: isMobile
+    ? { left: 'prev,next', center: 'title', right: 'listWeek,dayGridMonth' }
+    : { left: 'prev,next today', center: 'title', right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek' },
</code_context>
<issue_to_address>
**issue (bug_risk):** Using `window.innerWidth` at module scope and a non-reactive `isMobile` flag can cause SSR issues and prevent the calendar from adapting on resize/orientation changes.

Because `isMobile` is computed once at module load:
- SSR will fail when `window` is accessed.
- On the client, the calendar view will never update when the viewport changes (resize/rotation), so users can stay in `listWeek` or `dayGridMonth` even after crossing the `sm` breakpoint.

Consider either:
1. Making `isMobile` reactive (e.g. a `ref` updated via a `resize` listener or a shared breakpoint composable) and using that in `calendarOptions`.
2. Using FullCalendar’s `windowResize` callback or `views`/`responsive` options to switch between `listWeek` and `dayGridMonth` based on the current width.

Both avoid SSR crashes and keep the layout in sync with the viewport.
</issue_to_address>

### Comment 2
<location path="CHANGELOG.md" line_range="12" />
<code_context>
 - ADDED admin - track files sizes
 - ADDED login/logout notifications
 - FIXED system - customer deploy stack name
+- ADDED clandar - planning view (default for mobile)
</code_context>
<issue_to_address>
**issue (typo):** Possible typo: "clandar" should likely be "calendar".

This changelog entry misspells "calendar" as "clandar"; please correct it for consistency with the Calendar view files.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +42 to +48
const isMobile = window.innerWidth < 640

const calendarOptions = computed(() => ({
plugins: [dayGridPlugin, timeGridPlugin, interactionPlugin],
initialView: 'dayGridMonth' as const,
plugins: [dayGridPlugin, timeGridPlugin, listPlugin, interactionPlugin],
initialView: isMobile ? 'listWeek' : 'dayGridMonth',
locale: frLocale,
headerToolbar: {
left: 'prev,next today',
center: 'title',
right: 'dayGridMonth,timeGridWeek,timeGridDay',
},
headerToolbar: isMobile
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.

issue (bug_risk): Using window.innerWidth at module scope and a non-reactive isMobile flag can cause SSR issues and prevent the calendar from adapting on resize/orientation changes.

Because isMobile is computed once at module load:

  • SSR will fail when window is accessed.
  • On the client, the calendar view will never update when the viewport changes (resize/rotation), so users can stay in listWeek or dayGridMonth even after crossing the sm breakpoint.

Consider either:

  1. Making isMobile reactive (e.g. a ref updated via a resize listener or a shared breakpoint composable) and using that in calendarOptions.
  2. Using FullCalendar’s windowResize callback or views/responsive options to switch between listWeek and dayGridMonth based on the current width.

Both avoid SSR crashes and keep the layout in sync with the viewport.

CHANGELOG.md Outdated
- ADDED admin - track files sizes
- ADDED login/logout notifications
- FIXED system - customer deploy stack name
- ADDED clandar - planning view (default for mobile)
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.

issue (typo): Possible typo: "clandar" should likely be "calendar".

This changelog entry misspells "calendar" as "clandar"; please correct it for consistency with the Calendar view files.

@mitch10593 mitch10593 force-pushed the feature/112-calendar-on-mobile-needs-to-be-refactored branch from 92d5daf to f2c9a04 Compare March 12, 2026 12:10
@mitch10593 mitch10593 merged commit 9ac9bae into main Mar 12, 2026
3 checks passed
@mitch10593 mitch10593 deleted the feature/112-calendar-on-mobile-needs-to-be-refactored branch March 12, 2026 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

calendar on mobile needs to be refactored

1 participant