From fd340d3b69ce188df3251c0150140dfb9bf347d1 Mon Sep 17 00:00:00 2001 From: mister_papaye Date: Tue, 15 Sep 2026 18:26:05 +0200 Subject: [PATCH 01/18] =?UTF-8?q?S=C3=A9parer=20les=20fournisseurs=20IA=20?= =?UTF-8?q?locaux=20et=20cloud=20dans=20les=20param=C3=A8tres=20org?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Deux sections distinctes (Local/Auto-hébergé vs API Cloud) au lieu d'une grille unique mélangeant WebGPU/Passerelle/Custom avec OpenAI/Gemini/Mistral. Co-Authored-By: Claude Sonnet 5 --- .../views/settings/views/AISettings.vue | 48 ++++++++++++++----- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/src/views/OrgSpace/views/settings/views/AISettings.vue b/src/views/OrgSpace/views/settings/views/AISettings.vue index 9cb2c98f..33171637 100644 --- a/src/views/OrgSpace/views/settings/views/AISettings.vue +++ b/src/views/OrgSpace/views/settings/views/AISettings.vue @@ -24,15 +24,38 @@
-

Fournisseur IA

- +

Local / Auto-hébergé

+ +
+ +
+
+ +
+

Fournisseurs API Cloud

+
-
From bf0e2b3e456102bff9298345fdcb16d9c638a609 Mon Sep 17 00:00:00 2001 From: mister_papaye Date: Tue, 15 Sep 2026 18:33:26 +0200 Subject: [PATCH 04/18] fix(agenda): true native smooth infinite horizontal scroll in week view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous approach intercepted wheel events and jumped cursorDate by a day at a time, re-rendering the whole 7-day grid on every step — inherently choppy, not the fluid scroll asked for. WeekGrid.vue now renders a rolling buffer of consecutive day columns (±45 days around cursorDate initially, growing by 30-day chunks as the user approaches either edge, capped at ±120 days) inside a single native-scrolling element (time-grid-body, overflow: auto on both axes) — no JS drives the motion at all, it's plain browser momentum scroll. The day-name header and all-day row mirror body's scrollLeft (they have overflow: hidden, just enough to accept a programmatic scrollLeft) so all three stay aligned; the hour-label gutter and the two header gutters use position: sticky so they stay pinned during horizontal scroll while still scrolling vertically with the body. Prepending days on left-edge extension compensates scrollLeft in the same tick so already-visible content never jumps. cursorDate itself is only ever changed by explicit navigation (prev/next/today) — WeekGrid recenters and rescrolls when it changes, but scrolling itself never touches it, so there's no feedback loop and no refetching while scrolling. AgendaView.vue's computeRangeISO fetches ±120 days up front for week mode (matching WeekGrid's max buffer) so extending the buffer while scrolling never needs new data. Co-Authored-By: Claude Sonnet 5 --- .../OrgSpace/views/Agenda/AgendaView.vue | 20 +- .../views/Agenda/components/WeekGrid.vue | 218 +++++++++++++----- 2 files changed, 171 insertions(+), 67 deletions(-) diff --git a/src/views/OrgSpace/views/Agenda/AgendaView.vue b/src/views/OrgSpace/views/Agenda/AgendaView.vue index 75b865f3..25b1b6d0 100644 --- a/src/views/OrgSpace/views/Agenda/AgendaView.vue +++ b/src/views/OrgSpace/views/Agenda/AgendaView.vue @@ -67,7 +67,6 @@ @open-event="openEditModal" @create="onGridCreate" @reschedule="onReschedule" - @navigate="onWeekNavigate" /> -
-
-
+
+
+
{{ day.weekdayLabel }} {{ day.date.getDate() }}
-
-
Journée
-
+
+
Journée
+
-
-
+
+
{{ String(h).padStart(2, '0') }}:00
@@ -37,7 +44,7 @@ :key="'col-' + day.iso" class="time-grid-day-col" :data-iso="day.iso" - :style="{ height: rowHeight * 24 + 'px' }" + :style="{ height: rowHeight * 24 + 'px', width: dayWidth + 'px' }" @mousedown="onPointerDown($event, day)" >
@@ -81,7 +88,7 @@ From 41e03e0731eba2c580ecf2cdb5f543fb95024afa Mon Sep 17 00:00:00 2001 From: mister_papaye Date: Tue, 15 Sep 2026 18:44:21 +0200 Subject: [PATCH 08/18] Add folder creation to the archived tasks panel Lets users create a folder (backed by the existing TodoList model, scoped to the current space) directly from the archived tasks panel. Drag-and-drop assignment comes next. --- .../components/popup/ArchivedTasksPanel.vue | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/src/views/OrgSpace/components/popup/ArchivedTasksPanel.vue b/src/views/OrgSpace/components/popup/ArchivedTasksPanel.vue index 577123d3..8d7f3d9e 100644 --- a/src/views/OrgSpace/components/popup/ArchivedTasksPanel.vue +++ b/src/views/OrgSpace/components/popup/ArchivedTasksPanel.vue @@ -60,6 +60,47 @@
+
+ Dossiers + + {{ folder.title }} + + +
+ + + + +
+
@@ -224,6 +265,33 @@ const loadFolders = async () => { } }; +const showNewFolder = ref(false); +const newFolderTitle = ref(''); +const creatingFolder = ref(false); + +const createFolder = async () => { + const title = newFolderTitle.value.trim(); + if (!title || creatingFolder.value) return; + + creatingFolder.value = true; + try { + const res = await sfetch(`/api/tasks/${props.orgId}/lists`, { + method: 'POST', + body: JSON.stringify({ title, spaceId: props.spaceId || null }) + }); + if (!res.ok) throw new Error(); + const list = await res.json(); + folders.value.push({ id: list.id, title: list.title }); + newFolderTitle.value = ''; + showNewFolder.value = false; + toast.show('Dossier créé', 'success'); + } catch (e) { + toast.show('Erreur lors de la création du dossier', 'error'); + } finally { + creatingFolder.value = false; + } +}; + const restore = async (task: Task) => { pendingId.value = task.id; try { From 9be827e20a6fb734aa10c7fda323bebb991aa6e1 Mon Sep 17 00:00:00 2001 From: mister_papaye Date: Tue, 15 Sep 2026 18:44:56 +0200 Subject: [PATCH 09/18] Enable drag-and-drop of archived tasks into folders Archived task cards are now draggable; dropping one onto a folder chip (or the "Sans dossier" chip to unassign) moves it via the existing todoListId update path. Cards show their assigned folder inline. --- .../components/popup/ArchivedTasksPanel.vue | 67 +++++++++++++++++-- 1 file changed, 63 insertions(+), 4 deletions(-) diff --git a/src/views/OrgSpace/components/popup/ArchivedTasksPanel.vue b/src/views/OrgSpace/components/popup/ArchivedTasksPanel.vue index 8d7f3d9e..b8dabb09 100644 --- a/src/views/OrgSpace/components/popup/ArchivedTasksPanel.vue +++ b/src/views/OrgSpace/components/popup/ArchivedTasksPanel.vue @@ -62,9 +62,22 @@
Dossiers + + Sans dossier + {{ folder.title }} @@ -112,12 +125,19 @@

{{ task.title }}

-

- Archivée le {{ formatDate(task.archivedAt) }} +

+ Archivée le {{ formatDate(task.archivedAt) }} + + {{ task.todoList.title }} +

@@ -268,6 +288,45 @@ const loadFolders = async () => { const showNewFolder = ref(false); const newFolderTitle = ref(''); const creatingFolder = ref(false); +const draggedTaskId = ref(null); +const dragOverFolderId = ref(null); + +const onTaskDragStart = (e: DragEvent, task: Task) => { + draggedTaskId.value = task.id; + if (e.dataTransfer) { + e.dataTransfer.effectAllowed = 'move'; + e.dataTransfer.setData('text/plain', task.id); + } +}; + +const onTaskDragEnd = () => { + draggedTaskId.value = null; + dragOverFolderId.value = null; +}; + +const assignToFolder = async (task: Task, folderId: string | null) => { + if ((task.todoListId || null) === folderId) return; + try { + const res = await sfetch(`/api/tasks/${props.orgId}/tasks/${task.id}`, { + method: 'PUT', + body: JSON.stringify({ todoListId: folderId }) + }); + if (!res.ok) throw new Error(); + const updated = await res.json(); + const idx = archivedTasks.value.findIndex(t => t.id === task.id); + if (idx !== -1) archivedTasks.value[idx] = updated; + toast.show(folderId ? 'Tâche déplacée dans le dossier' : 'Tâche retirée du dossier', 'success'); + } catch (e) { + toast.show('Erreur lors du déplacement', 'error'); + } +}; + +const onDropOnFolder = (e: DragEvent, folderId: string | null) => { + dragOverFolderId.value = null; + const taskId = e.dataTransfer?.getData('text/plain') || draggedTaskId.value; + const task = archivedTasks.value.find(t => t.id === taskId); + if (task) assignToFolder(task, folderId); +}; const createFolder = async () => { const title = newFolderTitle.value.trim(); From 880bdc9cc888492a2685ed73f4893f667bbb441f Mon Sep 17 00:00:00 2001 From: mister_papaye Date: Tue, 15 Sep 2026 18:45:58 +0200 Subject: [PATCH 10/18] fix: make admin panel content scroll (root App shell clips the page) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit App.vue's root element is `h-[100dvh] overflow-hidden` for the whole app, so no route can ever get a document-level scrollbar — the page itself is physically incapable of scrolling. AdminPanel.vue used min-h-screen expecting normal page scroll, so any content taller than the viewport was just silently clipped, not scrollable. Switched it to the pattern this app's shell actually requires: h-full flex column, nav shrink-0, and
as its own flex-1 min-h-0 overflow-y-auto region so the users/orgs quota views scroll internally. Co-Authored-By: Claude Sonnet 5 --- src/views/AdminPanel.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/views/AdminPanel.vue b/src/views/AdminPanel.vue index a1d24fd6..20634ae6 100644 --- a/src/views/AdminPanel.vue +++ b/src/views/AdminPanel.vue @@ -1,8 +1,8 @@ From e1ef1863cf1b3eab5815eaab325c2d19eb8531fd Mon Sep 17 00:00:00 2001 From: mister_papaye Date: Tue, 15 Sep 2026 18:50:09 +0200 Subject: [PATCH 11/18] fix: SpaceBar icon rail scrolls and stops colliding with the floating user card SpaceBar's
    had no overflow-y-auto, so once there are enough workspace icons to exceed the viewport height they just overflowed past the rail's bottom edge instead of scrolling - visually running into/behind UserCard.vue, which floats absolutely positioned at bottom-left over that same rail. ThreadsBar.vue already solves this exact problem: UserCard tracks its own height into the shared userCardHeight ref (ResizeObserver in UserCard.vue) and scrollable bars reserve that as paddingBottom so their last item never ends up under the floating card. SpaceBar just hadn't adopted that pattern yet - applied it here (plus overflow-y-auto on the loading-skeleton list for consistency). Co-Authored-By: Claude Sonnet 5 --- src/views/OrgSpace/components/layouts/SpaceBar.vue | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/views/OrgSpace/components/layouts/SpaceBar.vue b/src/views/OrgSpace/components/layouts/SpaceBar.vue index 7013ace6..83626012 100644 --- a/src/views/OrgSpace/components/layouts/SpaceBar.vue +++ b/src/views/OrgSpace/components/layouts/SpaceBar.vue @@ -3,7 +3,7 @@ import SpaceBarBTN from '../common/SpaceBarBTN.vue'; import { useRoute, useRouter } from 'vue-router'; import CreateNewSpace from '../popup/CreateNewSpace.vue'; -import { openedOrg, todoEnabled, aiEnabled, agendaEnabled, user } from '@/assets/var'; +import { openedOrg, todoEnabled, aiEnabled, agendaEnabled, user, userCardHeight } from '@/assets/var'; import { useNotification } from '@/composables/useNotification'; import draggable from 'vuedraggable'; import { ref, watch } from 'vue'; @@ -75,7 +75,10 @@ const onSpaceOrderChange = async () => { " > -
      +
        { " > -
          +
            Date: Tue, 15 Sep 2026 18:52:16 +0200 Subject: [PATCH 12/18] feat(agenda): mini-calendar week band, touch support, no popup on mobile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MiniCalendar shows a range "band" (rounded at the ends, flat between) for the currently visible week in week view instead of a plain selected-day dot, and tracks live as the week view scrolls: WeekGrid emits a debounced 'visible-range-change' (settle-based, never touches cursorDate/refetching) that AgendaView mirrors into both the header period label and MiniCalendar's new highlightStart/highlightEnd props. WeekGrid.vue and DayGrid.vue: creating an event by dragging to select a duration, and resizing/moving an existing event by dragging its handles, were mousedown/mousemove/mouseup-only — these don't fire during a touch drag, so neither worked on mobile at all. Resize/move handles now use Pointer Events (pointerdown/pointermove/pointerup, mouse behaves identically through the same path) with touch-action: none and a larger hit target under `@media (pointer: coarse)` — safe to enable touch there since they're small dedicated targets, unlike the empty grid background, which needs to remain scrollable. Dragging to select a range on empty grid space is disabled on mobile instead (would fight the grid's native scroll) in favor of a plain tap that creates a 30-min default event, resized afterward via the handles. Fixed a bubbling bug this surfaced: an EventChip's un-stopped click was reaching the parent day-column/all-day-cell's own click-to-create handler, so opening an event would *also* create a new one right under it — pre-existing on the all-day row (any device), newly relevant now that WeekGrid/DayGrid's day columns listen for click too. AgendaView.vue's onGridCreate opens the full EventPanel directly on mobile instead of the small anchored EventQuickCreate popover, whose fixed 300px width and edge-clamped positioning don't work well on a narrow viewport — EventPanel is already a full-width slide-in there. Co-Authored-By: Claude Sonnet 5 --- .../OrgSpace/views/Agenda/AgendaView.vue | 40 ++++++- .../views/Agenda/components/DayGrid.vue | 57 ++++++++-- .../views/Agenda/components/MiniCalendar.vue | 51 ++++++++- .../views/Agenda/components/WeekGrid.vue | 105 ++++++++++++++---- 4 files changed, 216 insertions(+), 37 deletions(-) diff --git a/src/views/OrgSpace/views/Agenda/AgendaView.vue b/src/views/OrgSpace/views/Agenda/AgendaView.vue index 25b1b6d0..f4baf359 100644 --- a/src/views/OrgSpace/views/Agenda/AgendaView.vue +++ b/src/views/OrgSpace/views/Agenda/AgendaView.vue @@ -38,6 +38,8 @@ @@ -67,6 +69,7 @@ @open-event="openEditModal" @create="onGridCreate" @reschedule="onReschedule" + @visible-range-change="onWeekVisibleRangeChange" /> (null); +function onWeekVisibleRangeChange(start: Date) { + weekVisibleStart.value = start; +} +const weekWindowStart = computed(() => weekVisibleStart.value || cursorDate.value); + const periodLabel = computed(() => { if (viewMode.value === 'month') { return cursorDate.value.toLocaleDateString('fr-FR', { month: 'long', year: 'numeric' }); } if (viewMode.value === 'week') { - // Fenêtre glissante de 7 jours à partir du curseur (pas calée sur - // lundi-dimanche, voir WeekGrid.vue::startOfWindow). - const start = new Date(cursorDate.value); + // Fenêtre glissante de 7 jours (pas calée sur lundi-dimanche, voir + // WeekGrid.vue::startOfDay), suit la position réellement visible. + const start = new Date(weekWindowStart.value); start.setHours(0, 0, 0, 0); const end = new Date(start); end.setDate(end.getDate() + 6); @@ -218,6 +232,14 @@ const periodLabel = computed(() => { return cursorDate.value.toLocaleDateString('fr-FR', { weekday: 'long', day: 'numeric', month: 'long', year: 'numeric' }); }); +const weekHighlightStart = computed(() => (viewMode.value === 'week' ? weekWindowStart.value : null)); +const weekHighlightEnd = computed(() => { + if (viewMode.value !== 'week') return null; + const end = new Date(weekWindowStart.value); + end.setDate(end.getDate() + 6); + return end; +}); + function computeRangeISO(): { from: string; to: string } { if (viewMode.value === 'month') { const monthStart = new Date(cursorDate.value.getFullYear(), cursorDate.value.getMonth(), 1); @@ -301,6 +323,16 @@ const quickCreateAnchor = ref<{ x: number; y: number } | null>(null); function onGridCreate(range: Range & { clientX?: number; clientY?: number }) { const r = { start: range.start, end: range.end, allDay: !!range.allDay }; + + // Le popover flottant ancré au point de clic n'a pas de bon sens sur un + // petit écran (marges trop courtes, positionnement anecdotique au + // toucher) — le panneau plein écran est directement la meilleure + // option, pas besoin d'une étape intermédiaire. + if (isLittleScreen.value) { + openCreatePanel(r); + return; + } + quickCreateRange.value = r; selectionRange.value = r; quickCreateAnchor.value = (range.clientX != null && range.clientY != null) diff --git a/src/views/OrgSpace/views/Agenda/components/DayGrid.vue b/src/views/OrgSpace/views/Agenda/components/DayGrid.vue index 7daaf209..c5ef7a7e 100644 --- a/src/views/OrgSpace/views/Agenda/components/DayGrid.vue +++ b/src/views/OrgSpace/views/Agenda/components/DayGrid.vue @@ -16,7 +16,7 @@ :key="occ.occurrenceKey" :occurrence="occ" compact - @click="emit('open-event', occ)" + @click.stop="emit('open-event', occ)" />
@@ -31,6 +31,7 @@ class="time-grid-day-col" :style="{ height: rowHeight * 24 + 'px' }" @mousedown="onPointerDown" + @click="onDayTapCreate" >
@@ -41,9 +42,9 @@ :class="{ 'is-event-dragging': eventDrag?.occ.occurrenceKey === occ.occurrenceKey }" :style="eventStyle(occ)" > -
- -
+
+ +
@@ -64,6 +65,7 @@ import { computed, ref } from 'vue'; import EventChip from './EventChip.vue'; import { isTaskDeadlineOccurrence, type OccurrenceInstance } from '@/types/agenda'; +import { isLittleScreen } from '@/assets/var'; const props = defineProps<{ cursorDate: Date; @@ -187,6 +189,9 @@ function snap(minutes: number): number { function onPointerDown(e: MouseEvent) { if (e.button !== 0) return; + // Sur mobile, glisser sur une zone vide entre en conflit avec le scroll + // vertical natif — pas de sélection par glisser là, voir onDayTapCreate. + if (isLittleScreen.value) return; const target = e.currentTarget as HTMLElement; const rect = target.getBoundingClientRect(); const y = e.clientY - rect.top; @@ -242,6 +247,23 @@ function emitCreate(start: Date, end: Date, allDay: boolean, e: MouseEvent) { emit('create', { start, end, allDay, clientX: e.clientX, clientY: e.clientY }); } +// Sur mobile, un tap crée directement un créneau de 30 min à l'heure +// tapée — pas de glisser pour choisir la durée (conflit avec le scroll +// vertical). Ajuster la durée se fait ensuite via les poignées de +// redimensionnement (voir startEventDrag, en pointer events). +function onDayTapCreate(e: MouseEvent) { + if (!isLittleScreen.value) return; + const target = e.currentTarget as HTMLElement; + const rect = target.getBoundingClientRect(); + const y = e.clientY - rect.top; + const startMinutes = snap(pxToMinutes(y)); + + const start = new Date(props.cursorDate); + start.setHours(0, startMinutes, 0, 0); + const end = new Date(start.getTime() + 30 * 60000); + emit('create', { start, end, clientX: e.clientX, clientY: e.clientY }); +} + // ── Déplacement / redimensionnement d'un événement existant ─────────── type EventDragMode = 'move' | 'resize-top' | 'resize-bottom'; @@ -261,8 +283,11 @@ function minutesOfDay(d: Date): number { return d.getHours() * 60 + d.getMinutes(); } -function startEventDrag(e: MouseEvent, occ: OccurrenceInstance, mode: EventDragMode) { - if (e.button !== 0) return; +// En Pointer Events (pas mousedown/mousemove/mouseup) : ces poignées sont de +// petites cibles dédiées (voir touch-action: none en CSS), donc activer le +// tactile ici ne rentre pas en conflit avec le scroll de la grille. +function startEventDrag(e: PointerEvent, occ: OccurrenceInstance, mode: EventDragMode) { + if (e.button !== 0 && e.pointerType === 'mouse') return; const start = new Date(occ.startAt); const end = new Date(occ.endAt); @@ -275,11 +300,11 @@ function startEventDrag(e: MouseEvent, occ: OccurrenceInstance, mode: EventDragM currentStartMin: minutesOfDay(start), currentEndMin: minutesOfDay(end) }; - window.addEventListener('mousemove', onEventDragMove); - window.addEventListener('mouseup', onEventDragEnd); + window.addEventListener('pointermove', onEventDragMove); + window.addEventListener('pointerup', onEventDragEnd); } -function onEventDragMove(e: MouseEvent) { +function onEventDragMove(e: PointerEvent) { if (!eventDrag.value) return; const d = eventDrag.value; const deltaMin = snap((e.clientY - d.pointerStartY) / rowHeight * 60); @@ -301,8 +326,8 @@ function onEventDragMove(e: MouseEvent) { } function onEventDragEnd() { - window.removeEventListener('mousemove', onEventDragMove); - window.removeEventListener('mouseup', onEventDragEnd); + window.removeEventListener('pointermove', onEventDragMove); + window.removeEventListener('pointerup', onEventDragEnd); if (!eventDrag.value) return; const d = eventDrag.value; @@ -445,6 +470,7 @@ const eventDragLabel = computed(() => { overflow: visible; cursor: grab; z-index: 1; + touch-action: none; } .time-grid-event.is-event-dragging { @@ -459,10 +485,19 @@ const eventDragLabel = computed(() => { height: 6px; cursor: ns-resize; z-index: 3; + touch-action: none; } .time-grid-resize-handle.top { top: -2px; } .time-grid-resize-handle.bottom { bottom: -2px; } +@media (pointer: coarse) { + .time-grid-resize-handle { + height: 16px; + } + .time-grid-resize-handle.top { top: -8px; } + .time-grid-resize-handle.bottom { bottom: -8px; } +} + .time-grid-drag-ghost { position: absolute; left: 4px; diff --git a/src/views/OrgSpace/views/Agenda/components/MiniCalendar.vue b/src/views/OrgSpace/views/Agenda/components/MiniCalendar.vue index 56a86b2f..43fa42b0 100644 --- a/src/views/OrgSpace/views/Agenda/components/MiniCalendar.vue +++ b/src/views/OrgSpace/views/Agenda/components/MiniCalendar.vue @@ -21,7 +21,12 @@ 'is-other-month': !day.inMonth, 'is-today': day.isToday, 'is-selected': day.isSelected, - 'has-events': day.hasEvents + 'has-events': day.hasEvents, + 'is-in-range': day.rangePosition !== null, + 'is-range-single': day.rangePosition === 'single', + 'is-range-start': day.rangePosition === 'start', + 'is-range-middle': day.rangePosition === 'middle', + 'is-range-end': day.rangePosition === 'end' }" @click="emit('pick-day', day.date)" > @@ -38,6 +43,12 @@ import type { OccurrenceInstance } from '@/types/agenda'; const props = defineProps<{ cursorDate: Date; occurrences: OccurrenceInstance[]; + // Semaine actuellement visible dans WeekGrid (fenêtre glissante, pas + // forcément lundi-dimanche) — affichée comme un bandeau plutôt qu'un + // simple jour sélectionné, et mise à jour en direct pendant le scroll + // (voir AgendaView.vue). Absent/null en mode mois ou jour. + highlightStart?: Date | null; + highlightEnd?: Date | null; }>(); const emit = defineEmits<{ @@ -64,6 +75,8 @@ function isoDay(d: Date): string { const monthLabel = computed(() => props.cursorDate.toLocaleDateString('fr-FR', { month: 'long', year: 'numeric' })); +type RangePosition = 'single' | 'start' | 'middle' | 'end' | null; + interface MiniDay { date: Date; iso: string; @@ -71,6 +84,7 @@ interface MiniDay { isToday: boolean; isSelected: boolean; hasEvents: boolean; + rangePosition: RangePosition; } const days = computed(() => { @@ -87,19 +101,36 @@ const days = computed(() => { today.setHours(0, 0, 0, 0); const selectedIso = isoDay(cursor); + // Le bandeau de semaine remplace le simple point "jour sélectionné" — + // évite l'incohérence visuelle une fois que le bandeau a défilé + // ailleurs pendant que cursorDate (figé, voir AgendaView.vue) reste sur + // le point de départ. + const rangeStartIso = props.highlightStart ? isoDay(props.highlightStart) : null; + const rangeEndIso = props.highlightEnd ? isoDay(props.highlightEnd) : null; + const eventDays = new Set(props.occurrences.map(o => isoDay(new Date(o.startAt)))); const list: MiniDay[] = []; const ptr = new Date(gridStart); while (ptr.getTime() <= gridEnd.getTime()) { const iso = isoDay(ptr); + + let rangePosition: RangePosition = null; + if (rangeStartIso && rangeEndIso && iso >= rangeStartIso && iso <= rangeEndIso) { + if (rangeStartIso === rangeEndIso) rangePosition = 'single'; + else if (iso === rangeStartIso) rangePosition = 'start'; + else if (iso === rangeEndIso) rangePosition = 'end'; + else rangePosition = 'middle'; + } + list.push({ date: new Date(ptr), iso, inMonth: ptr.getMonth() === cursor.getMonth(), isToday: ptr.getTime() === today.getTime(), - isSelected: iso === selectedIso, - hasEvents: eventDays.has(iso) + isSelected: !rangeStartIso && iso === selectedIso, + hasEvents: eventDays.has(iso), + rangePosition }); ptr.setDate(ptr.getDate() + 1); } @@ -187,6 +218,20 @@ const days = computed(() => { color: white; } +.mini-cal-day.is-in-range { + background: color-mix(in srgb, var(--primary) 22%, transparent); + border-radius: 0; +} +.mini-cal-day.is-range-single { + border-radius: 999px; +} +.mini-cal-day.is-range-start { + border-radius: 999px 0 0 999px; +} +.mini-cal-day.is-range-end { + border-radius: 0 999px 999px 0; +} + .mini-cal-day.has-events:not(.is-selected)::after { content: ''; position: absolute; diff --git a/src/views/OrgSpace/views/Agenda/components/WeekGrid.vue b/src/views/OrgSpace/views/Agenda/components/WeekGrid.vue index 0c0c0c47..24367ddf 100644 --- a/src/views/OrgSpace/views/Agenda/components/WeekGrid.vue +++ b/src/views/OrgSpace/views/Agenda/components/WeekGrid.vue @@ -28,7 +28,7 @@ :key="occ.occurrenceKey" :occurrence="occ" compact - @click="emit('open-event', occ)" + @click.stop="emit('open-event', occ)" />
@@ -46,6 +46,7 @@ :data-iso="day.iso" :style="{ height: rowHeight * 24 + 'px', width: dayWidth + 'px' }" @mousedown="onPointerDown($event, day)" + @click="onDayTapCreate($event, day)" >
@@ -56,9 +57,9 @@ :class="{ 'is-event-dragging': eventDrag?.occ.occurrenceKey === occ.occurrenceKey }" :style="eventStyle(occ, day)" > -
- -
+
+ +
(); const ROW_HEIGHT = 48; @@ -180,11 +185,15 @@ onMounted(() => { measureDayWidth(); }); if (bodyEl.value) resizeObserver.observe(bodyEl.value); - nextTick(scrollToCenter); + nextTick(() => { + scrollToCenter(); + emitVisibleRangeChange(); + }); }); onUnmounted(() => { resizeObserver?.disconnect(); + if (settleTimer) clearTimeout(settleTimer); }); // Un changement de cursorDate (bouton précédent/suivant, "Aujourd'hui", @@ -194,21 +203,41 @@ onUnmounted(() => { // rechargement de données pendant qu'on scroll. watch(() => props.cursorDate, (newDate) => { resetBuffer(newDate); - nextTick(scrollToCenter); + nextTick(() => { + scrollToCenter(); + emitVisibleRangeChange(); + }); }); let rafScheduled = false; +let settleTimer: ReturnType | null = null; +const VISIBLE_RANGE_SETTLE_MS = 180; + function onBodyScroll() { if (!bodyEl.value) return; if (headerEl.value) headerEl.value.scrollLeft = bodyEl.value.scrollLeft; if (alldayEl.value) alldayEl.value.scrollLeft = bodyEl.value.scrollLeft; - if (rafScheduled) return; - rafScheduled = true; - requestAnimationFrame(() => { - rafScheduled = false; - maybeExtendBuffer(); - }); + if (!rafScheduled) { + rafScheduled = true; + requestAnimationFrame(() => { + rafScheduled = false; + maybeExtendBuffer(); + }); + } + + // Débattu : purement pour tenir le bandeau du MiniCalendar à jour sans + // spammer l'émission à chaque pixel scrollé. + if (settleTimer) clearTimeout(settleTimer); + settleTimer = setTimeout(emitVisibleRangeChange, VISIBLE_RANGE_SETTLE_MS); +} + +function emitVisibleRangeChange() { + if (!bodyEl.value || dayWidth.value <= 0) return; + const leftIndex = Math.round(bodyEl.value.scrollLeft / dayWidth.value); + const visibleStart = new Date(bufferStart.value); + visibleStart.setDate(visibleStart.getDate() + leftIndex); + emit('visible-range-change', visibleStart); } function maybeExtendBuffer() { @@ -389,6 +418,10 @@ function snap(minutes: number): number { function onPointerDown(e: MouseEvent, day: DayColumn) { if (e.button !== 0) return; + // Sur mobile, glisser sur une zone vide entre en conflit avec le scroll + // natif (horizontal ET vertical) — pas de sélection par glisser là, + // voir onDayTapCreate (simple tap) plus bas. + if (isLittleScreen.value) return; const target = e.currentTarget as HTMLElement; const rect = target.getBoundingClientRect(); const y = e.clientY - rect.top; @@ -482,6 +515,22 @@ function emitCreate(start: Date, end: Date, allDay: boolean, e: MouseEvent) { emit('create', { start, end, allDay, clientX: e.clientX, clientY: e.clientY }); } +// Sur mobile, un tap crée directement un créneau de 30 min à l'heure +// tapée — pas de glisser pour choisir la durée (conflit avec le scroll, +// voir onPointerDown ci-dessus). Ajuster la durée se fait ensuite via les +// poignées de redimensionnement (voir startEventDrag, en pointer events). +function onDayTapCreate(e: MouseEvent, day: DayColumn) { + if (!isLittleScreen.value) return; + const target = e.currentTarget as HTMLElement; + const rect = target.getBoundingClientRect(); + const y = e.clientY - rect.top; + const startMinutes = snap(pxToMinutes(y)); + + const start = combineDateAndMinutes(day.date, startMinutes); + const end = new Date(start.getTime() + 30 * 60000); + emit('create', { start, end, clientX: e.clientX, clientY: e.clientY }); +} + function allDayDate(date: Date): Date { const d = new Date(date); d.setHours(0, 0, 0, 0); @@ -515,8 +564,12 @@ function minutesOfDay(d: Date): number { return d.getHours() * 60 + d.getMinutes(); } -function startEventDrag(e: MouseEvent, occ: OccurrenceInstance, mode: EventDragMode) { - if (e.button !== 0) return; +// En Pointer Events (pas mousedown/mousemove/mouseup) : ces poignées sont de +// petites cibles dédiées (voir touch-action: none en CSS), donc activer le +// tactile ici ne rentre pas en conflit avec le scroll de la grille — au +// contraire d'un glisser sur une zone vide (voir onPointerDown/onDayTapCreate). +function startEventDrag(e: PointerEvent, occ: OccurrenceInstance, mode: EventDragMode) { + if (e.button !== 0 && e.pointerType === 'mouse') return; const start = new Date(occ.startAt); const end = new Date(occ.endAt); const iso = isoDay(start); @@ -532,11 +585,11 @@ function startEventDrag(e: MouseEvent, occ: OccurrenceInstance, mode: EventDragM currentEndMin: minutesOfDay(end), currentIso: iso }; - window.addEventListener('mousemove', onEventDragMove); - window.addEventListener('mouseup', onEventDragEnd); + window.addEventListener('pointermove', onEventDragMove); + window.addEventListener('pointerup', onEventDragEnd); } -function onEventDragMove(e: MouseEvent) { +function onEventDragMove(e: PointerEvent) { if (!eventDrag.value) return; const d = eventDrag.value; const deltaMin = snap((e.clientY - d.pointerStartY) / rowHeight * 60); @@ -562,8 +615,8 @@ function onEventDragMove(e: MouseEvent) { } function onEventDragEnd() { - window.removeEventListener('mousemove', onEventDragMove); - window.removeEventListener('mouseup', onEventDragEnd); + window.removeEventListener('pointermove', onEventDragMove); + window.removeEventListener('pointerup', onEventDragEnd); if (!eventDrag.value) return; const d = eventDrag.value; @@ -720,6 +773,9 @@ const eventDragLabel = computed(() => { overflow: visible; cursor: grab; z-index: 1; + /* Poignée de déplacement tactile dédiée (voir startEventDrag en Pointer + Events) — ne doit jamais être interprétée comme un geste de scroll. */ + touch-action: none; } .time-grid-event.is-event-dragging { @@ -734,10 +790,21 @@ const eventDragLabel = computed(() => { height: 6px; cursor: ns-resize; z-index: 3; + touch-action: none; } .time-grid-resize-handle.top { top: -2px; } .time-grid-resize-handle.bottom { bottom: -2px; } +/* Cible tactile plus généreuse sur pointeur "grossier" (doigt) — 6px est + jouable à la souris mais quasi impossible à attraper précisément au doigt. */ +@media (pointer: coarse) { + .time-grid-resize-handle { + height: 16px; + } + .time-grid-resize-handle.top { top: -8px; } + .time-grid-resize-handle.bottom { bottom: -8px; } +} + .time-grid-drag-ghost { position: absolute; left: 2px; From 07757767920b4acaa1f5a0c7345d67b629798446 Mon Sep 17 00:00:00 2001 From: mister_papaye Date: Tue, 15 Sep 2026 18:56:32 +0200 Subject: [PATCH 13/18] fix: stop SpaceBar dividers/icons from shrinking, and outrank UserCard's z-index Divider
lines were disappearing:
    is a height-bound flex-col (h-full) with overflow-y-auto, but none of its children had shrink-0, so once content exceeded the available height the flex algorithm shrank every child to try to fit before any real overflow occurred. The icon buttons have real glyph content resisting collapse, but the near-empty
    (just h-0.5) has almost no min-content floor, so it got squeezed toward zero height first. Added shrink-0 to the dividers and to every icon wrapper (RouterLinks, the draggable spaces list) so the list genuinely overflows and scrolls instead of silently squishing its thinnest children. Icons rendering above UserCard: SpaceBarBTN's unread badge (z-20) and hover tooltip (z-50) are positioned descendants with an explicit z-index, while UserCard had none (z-index: auto). Neither SpaceBar's