diff --git a/src/components/common/ConfirmDelete.vue b/src/components/common/ConfirmDelete.vue index 0769797d..9ab1a627 100644 --- a/src/components/common/ConfirmDelete.vue +++ b/src/components/common/ConfirmDelete.vue @@ -16,12 +16,15 @@
-

Supprimer {{ itemType }} ?

+

{{ title || `Supprimer ${itemType} ?` }}

- Êtes-vous sûr de vouloir supprimer {{ itemName }} ? - Cette action est irréversible et toutes les données associées seront perdues. + +

(); diff --git a/src/style.css b/src/style.css index f3f5a77b..d11329aa 100644 --- a/src/style.css +++ b/src/style.css @@ -58,6 +58,10 @@ body.light { } +html { + overflow-x: hidden; +} + body { overflow-x: hidden; 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 @@ diff --git a/src/views/OrgSpace/components/common/ChatMessage.vue b/src/views/OrgSpace/components/common/ChatMessage.vue index 2f8560ca..37d148b8 100644 --- a/src/views/OrgSpace/components/common/ChatMessage.vue +++ b/src/views/OrgSpace/components/common/ChatMessage.vue @@ -86,7 +86,7 @@
-
+
- +
-
- +
+ {{ file.originalName }} diff --git a/src/views/OrgSpace/components/common/ThreadMessage.vue b/src/views/OrgSpace/components/common/ThreadMessage.vue index 1f191d4c..f6cf87ec 100644 --- a/src/views/OrgSpace/components/common/ThreadMessage.vue +++ b/src/views/OrgSpace/components/common/ThreadMessage.vue @@ -87,7 +87,7 @@ -
+
- +
-
- +
+ {{ file.originalName }} diff --git a/src/views/OrgSpace/components/layouts/SpaceBar.vue b/src/views/OrgSpace/components/layouts/SpaceBar.vue index 7013ace6..acc691c3 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,9 +75,12 @@ const onSpaceOrderChange = async () => { " > -
    +
      - + { /> - + { /> -
      +
      - + { /> - + { /> - + { /> - + { /> - + { /> -
      +
      { @change="onSpaceOrderChange" ghost-class="opacity-50" drag-class="cursor-grabbing" - class="flex flex-col gap-2 w-full" + class="shrink-0 flex flex-col gap-2 w-full" > diff --git a/src/views/OrgSpace/views/Agenda/AgendaView.vue b/src/views/OrgSpace/views/Agenda/AgendaView.vue index 75b865f3..f4baf359 100644 --- a/src/views/OrgSpace/views/Agenda/AgendaView.vue +++ b/src/views/OrgSpace/views/Agenda/AgendaView.vue @@ -38,6 +38,8 @@ @@ -67,7 +69,7 @@ @open-event="openEditModal" @create="onGridCreate" @reschedule="onReschedule" - @navigate="onWeekNavigate" + @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); @@ -219,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); @@ -231,10 +252,16 @@ function computeRangeISO(): { from: string; to: string } { return { from: gridStart.toISOString(), to: gridEnd.toISOString() }; } if (viewMode.value === 'week') { + // La grille affiche une fenêtre glissante bien plus large que 7 jours + // (défilement horizontal fluide, voir WeekGrid.vue) : on charge tout + // ce qu'elle peut atteindre par scroll (±120j, son MAX_HALF) en une + // fois, pour ne jamais avoir besoin de recharger pendant qu'on scroll. + const WEEK_VIEW_FETCH_HALF_DAYS = 120; const start = new Date(cursorDate.value); start.setHours(0, 0, 0, 0); - const end = new Date(start); - end.setDate(end.getDate() + 6); + start.setDate(start.getDate() - WEEK_VIEW_FETCH_HALF_DAYS); + const end = new Date(cursorDate.value); + end.setDate(end.getDate() + WEEK_VIEW_FETCH_HALF_DAYS); end.setHours(23, 59, 59, 999); return { from: start.toISOString(), to: end.toISOString() }; } @@ -273,15 +300,6 @@ function goToday() { cursorDate.value = new Date(); } -// Scroll horizontal (trackpad/molette) en vue semaine — voir WeekGrid.vue. -// Décale la fenêtre glissante de 7 jours d'un jour à la fois (contrairement -// aux boutons précédent/suivant, qui paginent par bloc de 7 jours). -function onWeekNavigate(direction: 1 | -1) { - const d = new Date(cursorDate.value); - d.setDate(d.getDate() + direction); - cursorDate.value = d; -} - function goToDay(date: Date) { cursorDate.value = date; viewMode.value = 'day'; @@ -305,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..5e1b5174 100644 --- a/src/views/OrgSpace/views/Agenda/components/MiniCalendar.vue +++ b/src/views/OrgSpace/views/Agenda/components/MiniCalendar.vue @@ -27,6 +27,16 @@ > {{ day.date.getDate() }} + + +
@@ -38,6 +48,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<{ @@ -85,7 +101,11 @@ const days = computed(() => { const today = new Date(); today.setHours(0, 0, 0, 0); - const selectedIso = isoDay(cursor); + // Le cadre de la semaine (rangeSegments ci-dessous) remplace le simple + // point "jour sélectionné" pendant qu'un range est actif — évite la + // redondance visuelle avec cursorDate qui, lui, reste figé sur le point + // de départ de la navigation (voir AgendaView.vue). + const selectedIso = props.highlightStart ? null : isoDay(cursor); const eventDays = new Set(props.occurrences.map(o => isoDay(new Date(o.startAt)))); @@ -105,6 +125,47 @@ const days = computed(() => { } return list; }); + +// ── Cadre rectangulaire de la semaine affichée dans WeekGrid ──────────── +// La grille mini-calendrier est en CSS Grid 7 colonnes ; on positionne un +// overlay par ligne de grille traversée (grid-row/grid-column), plutôt que +// de teinter chaque jour individuellement — un simple fond par cellule se +// scinde visuellement en 7 carrés séparés (gap entre lignes, coins arrondis +// par bouton) au lieu de former UN rectangle, en plus de casser en deux +// blocs disjoints dès que la fenêtre de 7 jours n'est pas alignée +// lundi-dimanche (le cas général ici, voir WeekGrid.vue::startOfDay). +interface RangeSegment { + row: number; + colStart: number; + colSpan: number; +} + +const rangeSegments = computed(() => { + if (!props.highlightStart || !props.highlightEnd) return []; + const startIso = isoDay(props.highlightStart); + const endIso = isoDay(props.highlightEnd); + const list = days.value; + const startIdx = list.findIndex(d => d.iso === startIso); + const endIdx = list.findIndex(d => d.iso === endIso); + // La semaine visible peut déborder du mois actuellement affiché par le + // mini-calendrier (navigation manuelle du mois, ou scroll qui a + // dépassé la marge de grille) — pas de cadre à dessiner dans ce cas. + if (startIdx === -1 || endIdx === -1) return []; + + const segments: RangeSegment[] = []; + let i = startIdx; + while (i <= endIdx) { + const row = Math.floor(i / 7); + const rowLastIdx = Math.min(row * 7 + 6, endIdx); + segments.push({ + row: row + 1, + colStart: (i % 7) + 1, + colSpan: rowLastIdx - i + 1 + }); + i = rowLastIdx + 1; + } + return segments; +});