AladiaDocs

Planner v2

The new planner behind the planner-v2 flag: editions (running academic years), edition courses, planner permissions, week Gantt with the day opened by the hour.

Status: phase 1 with editions (23/10/2026), flag planner-v2 on for Accademia Leonardo only. User guide: Planner. Paths relative to backend/ and web-next/.

Flag and scope

FeatureFlags.PLANNER_V2 (libs/common/src/common/enum/feature-flags.enum.ts), evaluated on the workspace and sent to the web as plannerV2 in the entitlements. components/planner/planner-gate.tsx opens PlannerV2App whenever the flag is on, in every workspace, the personal one included; without the flag the current planner stays. The /planner/editions and /planner/courses routes answer 404 when the flag is off. In the personal workspace the owner is the holder of the context: editions are academic_years with organizationId = the owner's profile id (plannerOwnerOf), planner links use the context personal:<profileId> (plannerContextOf), the shared draft and the publish jobs use 'personal' + the edition id (plannerDraftContextOf), the owner has every planner ability, and the planner flags (course-editions) are evaluated on the profile (plannerFlagContextOf, profileIds rule). Migrations: scripts/migrations/2026-10-planner-v2.js (flag, permissions) and 2026-10-planner-v2-editions.js (per-edition indexes).

Planner permissions

The planner is a workspace resource (libs/core/src/core/iam/entity/planner.entity.ts, ResourceType.PLANNER):

PermissionAllows
planner.readseeing the planner: editions, courses and lessons
planner.updatecreating editions, adding and removing courses and preparing changes in the shared draft (also "New lesson"), changing the chapter rule
planner.publishpublishing the shared draft and undoing a publication within 24 hours

The migration grants them to Admin; the Owner inherits them; they can be granted to custom roles from Settings › Roles. GET /planner/editions also returns canEdit and canPublish for the interface. Without planner.read the web shows "You have no access to the Planner"; without planner.update and with no edition, "The planner is not ready yet".

Editions

The whole planner lives inside an edition: an academic year (academic_years, libs/common/src/common/models/microservices/calendar/academic-year.model.ts) with name, dates, holidays and closures. No new model:

  • a planner edition is born running (CreateYearDto.activate: status active, publishedAt), without preparation or "Publish the year" (that flow stays for preparing the next year);
  • several running editions can coexist (e.g. "Year 2026/27" and "Summer courses 2027"); the edition choice lives only in the planner selector. With the flag the sidebar does not show the year selector and Courses, Home, Calendar and Assignments do not filter by year (lib/use-academic-year.ts): courses outside the editions stay visible. Without the flag everything as before (with several running years the default is "All current ones", ACTIVE_YEARS);
  • list for the planner: running and in preparation, first the one containing today, then the future ones, then the past ones (plannerEditionsOf in libs/common/src/common/planner/planner-courses.ts).
RoutePermissionWhat it does
GET /planner/editionsplanner.readthe editions, with canEdit and canPublish
GET /planner/editions/defaultsplanner.updatetimezone, holidays and closures of the academy
POST /planner/editionsplanner.updatecreates a running edition (name, dates, holidays, closures)

Edition courses

Adding a course to an edition (POST /planner/courses with editionId and courseIds, live courses of the context only):

  1. ACADEMIC_YEARS.PLANNER_EDITION_JOIN (calendar, AcademicYearsService.joinEdition) picks an existing cycle of the course touching the edition period: the one containing its start, otherwise the one with the largest overlap (editionCycleOf). The cycle joins the year courses (joined) with its calendar (CycleEngineService.existingCycleCalendar). Nothing changes on the course: no new cycle, no lesson, no version, no setting (it does not go through CourseEditionsService.ensure, which would mark the cycle ownContent, change open enrollment and create a draft version). A course without cycles in the period answers planner-course-no-cycle-in-edition and stays out: a new cycle with the edition dates waits for Sigid's decision (risk analysis of 23/10).
  2. The link is stored in planner_courses (calendar): contextId, editionId, courseId, cycleId, calendarId, origin; unique on context + edition + course.

Edition lessons are read from the cycle calendar (the link calendarId). A course that fails to join does not stop the others: it comes back in failed. Removing a course (DELETE /planner/courses/:courseId?editionId=) only deletes the link: the course and its cycle stay. The cycle used keeps its dates: the planner does not change them.

Two groups in the column: "Created in the planner" (courses of the system space "Planner", type planner, coming with phase 6) and "From the spaces".

Shared draft (phase 3)

Sigid's decision (23/10, boards 6.4 and 6.4b): one draft per edition, the same for everyone. It is the usual draft (planner_drafts, apps/calendar/src/app/planner-drafts/planner-drafts.service.ts) keyed by the edition: contextId + editionId with profileId = 'shared'. The current planner stays on GET/PUT/DELETE /planner/draft, personal.

RoutePermissionWhat it does
GET /planner/editions/:editionId/draftplanner.readops, revision, contributors (who touched the draft and when, newest first)
PUT /planner/editions/:editionId/draftplanner.updatesaves the whole list at the revision read (409 planner-draft-stale if someone saved meanwhile)
DELETE /planner/editions/:editionId/draftplanner.updateDiscard: all changes, of everyone
POST /planner/editions/:editionId/publishplanner.publishpublishes the saved draft at the revision seen; notifyStudents on by default
GET /planner/editions/:editionId/publish/latest, …/publish/:jobIdplanner.readthe latest publication of the edition (by anyone) and its progress
POST /planner/editions/:editionId/publish/:jobId/undoplanner.publishundo within 24 hours
PATCH /planner/editions/:editionId/chapter-ruleplanner.update"Chapters…": chapter rule of the chosen courses of the edition
  • Every op carries by and byAt, written by the server on save (stampDraftAuthors) for new or changed ops; unchanged ops keep their signature.
  • Publishing reuses the job of the current planner (PlannerPublishService, planner_publish_jobs with editionId) with one lock per edition; at the end only the applied ops leave the draft. One notice per person, undo for 24 hours.

"New lesson" in the draft

Op create (DraftCreateOp): calendarIds (first = main, the others get the same convergent lesson), name, start/end, repeat (weekdays and until), subject, roomSource, address, books (first lesson pages). It becomes real only when published. Publishing checks UPDATE on every calendar and the books, then uses the usual creation (EventsService.createEvent); closed days are skipped by the calendar. Notice: "new lessons in the calendar", once per student (field created). Undo deletes the whole series in all courses.

Automatic chapters (phase 3)

Course rule course.settings.chapterRule: week, month, period (a single chapter as long as the edition cycle); logic in libs/common/src/common/planner/chapter-rule.ts. A lesson without a covering chapter gets the rule's chapter (chapter.auto = { rule, key }), clipped between existing chapters; without a rule nothing changes. The first published "New lesson" sets month on courses without a rule. A chapter edited by hand loses auto; an empty auto chapter is deleted. "Chapters…" changes the rule for new lessons: existing automatic chapters are not redistributed yet.

Closures

Sigid's decision (26/10): in the planner the source of truth for closures is the edition; closures set on a single course calendar stay valid.

  • Closed days of a course in the planner = edition holidays and closures (academic_years.holidays, academic_years.closures) ∪ the course calendar's own closures (source: 'own' in closedDays, e.g. a course that stops for an internship). Closures inherited from the academy calendar (source: 'inherited') and the course calendar holidays do not count on their own.
  • Grid: an edition closed day hatches the whole column, like a non-working day of the working hours (header, rows and open day). A course's own closure hatches only the cells of its row, with the tooltip "Chiusura del corso: «title»"; if the day is closed for everyone nothing changes. web-next/lib/planner-v2-closures.ts (courseClosedDaysOf, test planner-v2-closures.test.mjs).
  • Conflicts: Planner v2 sends editionId to POST /calendars/events/conflicts; "Closed day" uses the same union (plannerClosedDaysOf in libs/common/src/common/planner/planner-conflicts.ts; on the same day the edition title wins). Without editionId (planner v1, courses outside the planner) nothing changes.
  • Hours: the counters count every lesson, also on a closed day (it is an anomaly, not a removed lesson).
  • Suggestions from the academy: in Settings › Closures and in the creation form, below the list, the academy calendar closures that fall within the edition dates and are not already covered by the edition ("Vacanze di Natale · dal calendario dell'accademia", academySuggestionsOf). "Aggiungi all'edizione" copies it into the list; it applies after "Save" ("Start" in the form). After saving, the week reloads lessons and conflicts.
RoutePermissionWhat it does
GET /planner/editions/:editionId/closuresplanner.readcourses: own closures of the edition course calendars; academy: academy calendar closures (suggestions)
GET /planner/editions/defaultsplanner.updatealso academyClosures (creation form suggestions)

Calendar service messages: ACADEMIC_YEARS.planner-edition-closed-days (edition closed days) and ACADEMIC_YEARS.planner-closures. At publication, lesson creation still checks the course calendar closed days (with inherited closures): unchanged.

Edition settings (board 7.4)

Sigid's decision (23/10): chapters and working hours are set on the edition, not on the courses. Courses inherit them; a course changes only as an exception. Pure rules in libs/common/src/common/planner/edition-settings.ts (tests tests/unit/planner-edition-settings.spec.ts).

  • Chapters: academic_years.chapterRule = month (also when missing), week, period or none (no automatic chapters). The course exception lives on the link, planner_courses.chapterRule. The rule that applies to each course is copied to course.settings.chapterRule, read by the course service when lessons are created (none creates no chapters): when the edition rule changes, when an exception is set, when a course joins the edition. Existing chapters are never touched.
  • Working hours: academic_years.workingHours = { days: [1..7] (1 = Monday), from, to, perDay: [{ day, from, to }] }; missing = no working hours (no hatching, no warnings).
  • Migration scripts/migrations/2026-10-planner-chapter-rule-overrides.js: a linked course whose rule differs from its edition's keeps it as an exception.
  • Archived editions ("Close and archive the edition", ACADEMIC_YEARS.CLOSE_YEAR) are listed last, read-only: edits, draft saves, publishing and chapter changes answer 409 planner-edition-archived.
  • GET /planner/editions returns draft.changes and draft.contributors per edition (status line of the selector).
RoutePermissionWhat it does
PATCH /planner/editions/:editionIdplanner.updatealso chapterRule and workingHours (null removes it)
PATCH /planner/editions/:editionId/chapter-ruleplanner.updaterule = inherit ("Like the year") or a different rule for these courses
POST /planner/editions/:editionId/closeplanner.publish"Close and archive the edition"

Web page

In components/planner/v2/:

  • planner-v2-app.tsx: editions (mandatory entry, "Edition" selector with "+ New edition"), then for the chosen edition the column, week, empty state and dialogs; the choice is remembered in this browser;
  • planner-v2-edition-form.tsx: the single content of every edition creation: EditionDialogHeader (icon, title, explanation) and EditionPeriodStrip (period with months and hatched closures), name, dates, public holidays, suggested Christmas and Easter, "+ Closure", teaching days (Mon-Fri);
  • planner-v2-empty.tsx: the blurred fake planner (PlannerV2Backdrop) behind the entry and the empty state;
  • planner-v2-gantt.tsx: fixed course column and horizontal windowed Gantt; open day 8–20 with the current-time line under the lessons; days outside the edition in grey;
  • planner-v2-add-dialog.tsx, planner-v2-lesson.tsx, planner-v2-agenda.tsx (phone, “List” view);
  • planner-v2-edition-menu.tsx (board 7.0): edition selector with status and status line; each edition's "⋯": Settings…, Closures…, Dates…, Prepare the next one (coming), PDF summary (coming), Close and archive (with confirmation); archived editions open read-only;
  • planner-v2-edition-settings.tsx (board 7.4): one "Settings" dialog with four collapsible rows (Dates, Closures, Chapters, Hours); it replaces "Edit edition" and the closures dialog of the Year view;
  • planner-v2-chapters-dialog.tsx: "Chapters · N courses": "Like the year" or a different rule; the course row shows "chapters: by week" only for exceptions;
  • working hours in the week (lib/planner-v2-hours.ts): the open day starts at the working hours, off hours are hatched in every row, non-working days hatched; dragging and "New lesson" warn (you can proceed).

Pure rules in lib/planner-v2.ts (test lib/planner-v2.test.mjs): edition proposals, Easter, holidays in the period, teaching days, strip, week windows, reading lessons under 100 rows. Staging page: /dev/planner-v2-stage (?state=welcome, ?state=empty), previews only.

Phase 2: reading, states, Year

Reading lessons. The week uses the usual search (POST /calendars/events/search) with two new fields, sent only by the planner:

  • exactCalendars: true: the requested calendars are read as they are (CalendarVisibilityService.searchableBy(viewer, { allVersions })). Without it, for a course with several versions the search keeps one calendar per course and cycle, and for managers it picks the draft version one: the published calendar attached to the planner was silently dropped and the week stayed empty (Leonardo, 23/10: Inglese B1, Liceo Classico and Liceo Scientifico have a draft version). Who can read what does not change.
  • cycles: [{ calendarId, cycleId }]: in the calendar of a course with several cycles only the lessons of the edition cycle (planner_courses.cycleId) remain. The cycle of a lesson is read from its course lecture (lecture.cycles[]: cycle id and event; otherwise the date), in the gateway (PlannerCycleScopeService, rules in libs/common/src/common/planner/planner-lessons.ts, test tests/unit/planner-lessons.spec.ts). A lesson that cannot be read stays.

The same two fields apply to POST /calendars/events/conflicts. In the column and in the Year view a course's dates are those of the attached cycle (editionCourseDatesOf).

States (board 6.12), computed in the web app (lessonStatusOf in lib/planner-v2.ts) from existing fields:

StateFrom
suspendedsuspend
moved away / moved hereisRescheduled + rescheduledDate / originalDate different from the start
live, heldroomStatus === 'live', ended before now
recorded (parts and duration), video processingrecordingCount, recordingSeconds, processingRecordings (new in the preview, from the room like hasRecording)
no videoheld, not suspended or moved, no video and nothing processing
shared, substitutionconvergentCalendarIds, substitution
in conflictPOST /calendars/events/conflicts (all kinds except empty-week)
in draftedition draft operations (GET /planner/draft?editionId=)

Not in the data yet, so not shown: recording "not expected" (recordingWaived, phase 7), "make-up of …" (pointer to the suspended event, phase 4), "to delete" (draft delete op, phase 4).

Status menu and Teacher filter (6.12, 6.13): filters with this week's counts (a shared lesson counts once), legend in the menu; the Teacher filter uses the hours of the Workload rule (workloadOf in lib/planner.ts, the substitute instead of the teacher).

Summary: GET /planner/lessons/series?editionId=&calendarId=&eventId= (planner.read, edition calendars only) counts the series (recurringId) within the edition period: held, to do, suspended or moved, with the rule (frequency). Microservice: CALENDARS.PLANNER_LESSON_SERIES, PlannerLessonsService.

Year view (planner-v2-year.tsx): Gantt by month, hatched closures, today; "Choose start and end" goes to builder › Versions. PATCH /planner/editions/:editionId (planner.update) changes name, dates and the whole closure list (ACADEMIC_YEARS.UPDATE); course cycle dates do not change. In the closures dialog, a new closure over lessons already created shows the count (search of the edition calendars) and only "Keep them": "Suspend them" and "Suspend and propose make-ups" come with the extended draft (phase 4).

Open day (phases 2d-2e): one single scroll. The open day has all its hours in line in the same scroll as the days (openDayFit, 110 to 120 px per hour); the two days before and the day after stay pinned to the edges (sticky inside the open day's group, pinnedDays) and unpin when the day leaves the view; the open day name stays put after them. “Today” and opening the page scroll to one hour before now (when now falls between the first and the last lesson) or before the first lesson (openDayAnchor, openDayScrollLeft). Days open and close with a 250 ms animation (none with reduced motion), lessons and hours fade in right after. Today's column has a light background and a highlighted date, collapsed or open. The week loads only inside the edition (clampWindowToEdition). The current-time line is a segment in each row, in the lessons' coordinates. The box is as tall as its rows; selecting courses does not reorder them.

Year view (phase 2e): GET /planner/courses/summary?editionId= (planner.read) returns for each course lessons, minutes, shared lessons and days with lessons of the attached cycle (suspended and moved excluded; CALENDARS.PLANNER_YEAR_ROWS + PlannerCycleScopeService + yearSummaryOf). The bar shows “N lessons · N h”, “⇄ N shared”, “start → end” and one tick per week with lessons; when short, texts shrink (yearBarParts) and stay in the tooltip. Today: thicker line and a “today · 23 Oct” chip in the header.

Long view: corner and month/week bands (lib/planner-v2-bands.ts): above the days two bands, months and weeks numbered from the edition start (W1 = week of the first day), each with its hours; the first of the month has a marked line across the grid; clicking a month or a week scrolls there. The corner above the course column describes the open day when it is in view, otherwise the first visible day on the left: month and year with hours, “Week N · 26 Oct – 1 Nov” with hours, “Tue 27 · open 11–21” with the day's hours (hours in view, between the pinned days) and “Courses · 6 · 4 with lessons” (column courses with at least one lesson in the corner's week). Corner and bands update while scrolling without React renders (texts written only when they change, the changed value flashes for 600 ms, data-current on the corner's month and week). Inside the hours the open day name becomes the “‹ Tuesday 27 October” pill (data-day-inside): click = back to the start of the day; at the start a click closes it as before. Pinned days: in the header they also cover the two bands (the band slides under them like the hours) and each shows there the segment of its own month and week (pinnedBandRun: neighbouring days with the same month or week make one segment; “Oct” / “W6”, with the hours when the segment spans at least two days; same month-start line and same click as the bands); the month or week label stays visible right after them (--planner-pin-left). Hours: GET /planner/courses/hours?editionId= (planner.read, dayHoursOf) returns minutes per day (shared lessons once, suspended and moved excluded, like totalMinutesOf) and the courses with lessons; in weeks already loaded the page lessons with the shared draft count (like the day chips), elsewhere the server count plus new draft lessons. On the phone the same Gantt in a compact version (see Phone); in the “List” view one line above the agenda with month and week and their hours.

Live: the lesson room stays live outside lesson time too (Leonardo, every lesson): a lesson is live only when the room is live and now is between 15 minutes before the start and the end. Cells: conflicts do not colour them (the dot on the block and the "In conflict" filter stay); a future day is neutral except for suspensions, substitutions and moves.

Recurrences, subject hours and workloads as items of the course ⋯ menu come in later phases.

Phase 3 web page

In components/planner/v2/ (pure rules in lib/planner-v2-draft.ts): planner-v2-draft.tsx (useEditionDraft and the top "Shared draft" bar with avatars, changes, Discard, Publish; without planner.publish the lock and who to contact), planner-v2-new-lesson.tsx (the "New lesson" side panel, non-modal), planner-v2-chapters-dialog.tsx ("Chapters…"), and drag-to-create in planner-v2-gantt.tsx (open day, selected rows, 15-minute snap, 30-minute minimum, red where a lesson exists, Esc cancels, Enter from the keyboard, never on touch, closed days or the past). New lessons in the draft are dashed blocks.

Phase 4: actions on existing lessons, in the draft

Boards 6.0, 6.1, 6.3, 6.3b, 6.5, 6.7, 6.11, 6.12. Everything goes into the edition's shared draft and becomes real with “Publish and notify”: one notice per person with all changes, “Undo” for 24 hours. Lessons that already started (held, recorded) never change, neither when applying nor when undoing.

New draft operations (libs/common/.../planner/planner-draft.ts, tests tests/unit/planner-lesson-actions.spec.ts):

OperationFieldsApplied with
editchanges / previous (dates, title, subject, room, teacher), target, scope, appliesToEVENTS.UPDATE with updateEventTarget = target (the calendar rewrites only unfinished lessons); the teacher joins as event Editor, the previous one leaves
suspendreasonCode (teacher absent, health, personal, technical, unspecified, other), reason (justification, staff only), target, recoveryEVENTS.SUSPEND (no per-lesson notice) for each lesson not started nor suspended; the make-up is a new lesson (EventsService.createEvent) with the suspended lesson's title, subject, room and courses
deletetarget, scopeEVENTS.DELETE one lesson at a time, only those not started, each snapshotted first
periodaction (suspend/delete), calendarIds, from, tothe lessons of the chosen courses in the period (CALENDARS.PLANNER_LESSONS_IN_PERIOD): a fully chosen convergence changes once in all courses, a partial one only in the chosen courses

Every lesson operation has target (cascade from here on, all whole series; missing = this one), seriesId (for the preview) and notify: false when “Notify the students” is off. The draft keeps one action per lesson (edit, suspension or deletion: the last wins).

Undo within 24 hours: edits are written back (changed fields only); suspended lessons are resumed one by one and the make-up is removed; deleted lessons come back as new lessons in the same courses (builder content does not come back). Notice fields teacher, deleted, recovery added.

Web page (components/planner/v2/, pure rules in lib/planner-v2-actions.ts): quick actions in the lesson summary (Edit, Suspend, ⋯ Delete, planner.update, lessons not started yet); planner-v2-lesson-panel.tsx side bar with the same scope choices, conflicts in red before adding, make-up slots free for courses and teacher; grid preview (moved with “was here”, to suspend, to delete, make-up), also while the panel is being filled in.

Phase 4B, over a period (planner-v2-period-panels.tsx): Substitute (6.6) from the summary, from “Assign a substitute” in the suspension or from the selected-courses bar: from… to…, which courses, who steps in (avatar, “free in N of M”, weekly hours), grading hand-over; one substitute per subject (or level) for the whole period, courses in courseIds. Suspend… / Delete… from the selected-courses bar: period operation.

Phase 4C, some courses only (editing a convergent lesson with 3+ courses): on publish CALENDARS.PLANNER_SPLIT_SHARED (PlannerSplitService) moves the chosen courses to a new event shared among them (new room, members and substitutions copied), for each not-started lesson of the series when it applies from here on or to the whole series; then the edit goes to the new event “in all courses”. The others stay on the previous lesson. Undo writes the previous values back on the split lesson, which stays split.

“Write in the course channel” and “Notify the teacher” are not there yet for suspensions and deletions: the publish notice goes to students.

Join the lesson (lesson popup)

Whoever sees the planner (planner.read: academy Owner and Admin, custom roles) joins a lesson's live room from the summary, for upcoming and live lessons. The phase comes from the schedule (lessonRoomPhaseOf in lib/planner-v2.ts), not from roomStatus, which stays live as soon as the room exists:

  • upcoming: “in 40 min / in 2 days” chip and “Enter the room” (secondary);
  • live: “LIVE · 55'” chip, progress bar from start to end with “5' left”, “As an observer” (on by default: you join with microphone and camera off) and “Join the lesson” (filled);
  • ended or suspended (moved too): no entry; draft lessons have no room.

It opens the usual waiting room in a new tab, /meet/e/:calendarId/:eventId?from=planner&edition=…[&observer=1]: with from=planner the lesson and the token come from GET /planner/lessons/room and GET /planner/lessons/room/auth (flag planner-v2, planner.read, only calendars of courses in the active context's edition, otherwise 404). Event members join with their role; non-members join as guest: no host powers, no member created; locked members stay out. observer=1 starts the waiting room with microphone and camera off (MeetLobby startMuted): not an invisible observer, the person shows among the participants. A lesson with an external link (roomSource google-meet) opens the link in a new tab.

Next phase: connected participants and recording state in the popup (LivekitService.getActiveRoomMembers and hasRecordingEgress exist, but presence is only exposed to hosts and co-hosts today).

Seasons and quarters, daylight saving time in the corner

Seasons (flag planner-seasons, same audience as planner-v2, scripts/migrations/2026-10-planner-seasons.js): decoration only, the grid does not move by a pixel. The corner shows the season illustration underneath, the text on a glass panel as wide as needed (never truncated) and, below it, the DST line on the left and the “Q1 Autumn” chip on the right; the month band has a gradient and a motif, with month and hours on a glass pill preceded by the quarter; the card has a radial tint (a single multiply ::before, never over popovers, menus, dialogs, side panel or selection bar). School-year quarters: Sep-Oct-Nov Q1 Autumn, Dec-Jan-Feb Q2 Winter, Mar-Apr-May Q3 Spring, Jun-Jul-Aug Q4 Summer; in the southern hemisphere (edition holiday country or, without one, its timezone) the season shifts by two, the quarter stays. The corner's day decides the season: the Gantt writes data-season on its frame only when it changes, 300 ms transition (none with prefers-reduced-motion). Dark theme: tint without multiply (season colour at 14% fading out), illustration at 35%, dark glass. Phone: no illustration or glass, the tint stays and the corner shows the “Q4” chip; in the List view the chip next to the month. Everyone can turn them off for themselves in Status › Show seasons (per person, in the browser). Code: lib/planner-v2-seasons.ts, assets in web-next/public/seasons/.

Phone (below 768 px): the same Gantt as on desktop, compact, not a separate app. The toolbar is one row: Year|Week, ‹ “26 Oct – 1 Nov” ›, Today and the ⋯ with the rest (Edition, which opens the usual editions list; Teacher; Status; Courses; Show seasons; “Day list”, the former agenda as a secondary view). The Gantt goes full width and scrolls with the finger (native scrolling, no handler blocking the swipe; corner and bands are written while scrolling as on desktop). 120 px course column (112 below 375): colour bar and name on two lines, tapping the name opens the course menu with Select instead of the checkbox (the selection bar stays at the bottom). Corner: month, week (“W9”) and open day with hours, ☾/☀ and the quarter chip; no year, range or course count. Open day hours from 96 px up (110 on desktop), ONE pinned day before (two on desktop) and the day after, closures, DST chip and bands. Tapping a lesson opens the summary in the centred dialog (with “Join the lesson”); Edit, New lesson, Substitute and Period are the usual side panels at full width, with the X. “+ New lesson” in the bottom bar. The same compact Gantt also shows when the frame is narrower than 480 px (tablet with the sidebar open). Code: compact in planner-v2-gantt.tsx, phoneHeader in planner-v2-app.tsx.

Daylight saving time in the corner (always, also without seasons): below the corner rows “☾ Standard time · change Sun 28 Mar” or “☀ Daylight saving time · change Sun 31 Oct”, from the edition timezone with the same rule as the clock-change chip (dstRegimeOf in lib/planner-v2-dst.ts). Only if the timezone has DST; if the next change falls outside the edition, the regime shows without a date. Clicking the date scrolls the view to that day. With seasons the line sits below the glass next to the chip and, to fit, reads “☾ Standard time · Sun 28 Mar” (the word “change” is in the date tooltip).

Editions F5: the planner creates and detaches editions

Behind the course-editions flag (Leonardo); off, the planner is the one from before. Plan: EDIZIONI_CORSO_PIANO.md › 5 and decisions 1, 2, 9 of 27/10.

  • Add course: GET /planner/courses/available brings for each live course the join outcome (attach: an edition of the course entirely within the year, it keeps its dates; new: new edition with the year's dates, name = year title, copy of the Main edition or empty; already). POST /planner/courses accepts choices: [{courseId, start, name, copyFrom}]. Rules in libs/common/src/common/planner/planner-editions.ts (plannerJoinOutcomeOf); in the calendar app joinEditionF5 creates the edition with CREATE_COURSE_EDITION and the cycle calendar; new editions are "Reserved".
  • Planner calendar: plannerLink.calendarOwner = planner. Writes from calendars/:id/events and lesson dates from the builder answer 409 edition-calendar-owned-by-planner (PlannerEditionsService.assertBuilderWritable, EditionCalendarOwnerService).
  • Detach from Planner: DELETE /planner/courses/:id with the flag runs PLANNER_EDITION_LEAVE (leaves the year) and sets calendarOwner back to builder. Lessons and dates stay.
  • Create course: GET /planner/space gives the planner system space (hidden, created on first request, no SPACE_CREATED); the web creates the course there (internal, year dates) and adds it: a single edition, already attached.
  • Convergences: on publish splitCreatesByEditions splits a new convergent lesson into the stretches of the course editions (parts id#n); a stretch with one course is a normal lesson. In the Gantt the row outside the course edition is hatched ("Outside the course edition").
  • Publish: "Notify students" checkbox; with publishEditions the gateway first publishes the never-published course page and the draft editions of the courses touched by the draft (F4 chains), then the lessons. Outcome in editions[].
  • Open the builder opens ?edition= on the course edition in the planner.
  • Tests: backend/tests/unit/planner-editions-f5.spec.ts (in-memory Mongo), web-next/lib/planner-v2-editions.test.mjs.

On this page