- {{ $p((notif.msg as any)?.sender?.name) }}
+ {{ (notif.msg as any)?.isWebhook ? ((notif.msg as any)?.webhookName || 'Webhook') : $p((notif.msg as any)?.sender?.name) }}
APP
@@ -316,7 +316,7 @@ const getNativeNotificationContext = (notif: Notification): NativeNotifContext |
switch (notif.type) {
case 'notif:msg': {
const msg = notif.msg as any;
- const name = formatName(msg?.sender?.name);
+ const name = msg?.isWebhook ? (msg?.webhookName || 'Webhook') : formatName(msg?.sender?.name);
const body = msg?.embeds?.length > 0 ? msg.embeds[0].title : msg?.content;
return {
key: `msg:${msg?.threadId}`,
diff --git a/src/components/peer/CallControls.vue b/src/components/peer/CallControls.vue
index e8c59fec..38275fea 100644
--- a/src/components/peer/CallControls.vue
+++ b/src/components/peer/CallControls.vue
@@ -1,57 +1,163 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+ Partage d'écran
+
+
+ {{ k }}
+
+
+ {{ fr }} fps
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+ Caméra
+
+
+ Par défaut
+ {{ d.label || 'Caméra' }}
+
+
+
+ {{ k }}
+
+
+ {{ fr }} fps
+
+
+
+
+ {{ mode.label }}
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+ Microphone
+
+ {{ d.label || 'Microphone' }}
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+ Enceinte
+
+ {{ d.label || 'Enceinte' }}
+
+
+
+ {{ supportsSinkId
+ ? "Aucune enceinte détectée."
+ : "Votre navigateur ne permet pas de choisir l'enceinte de sortie (non supporté par Firefox/Safari — essayez Chrome ou Edge)." }}
+
+
+
+
@@ -60,7 +166,7 @@
@@ -71,6 +177,19 @@
+
+
diff --git a/src/components/windows/Window.vue b/src/components/windows/Window.vue
index b383c854..c5004818 100644
--- a/src/components/windows/Window.vue
+++ b/src/components/windows/Window.vue
@@ -4,9 +4,10 @@
-
@@ -56,10 +57,17 @@
import { onMounted, onUnmounted } from 'vue';
-defineProps<{
+// Teleporté à body comme Popup.vue — sans z-index explicite de l'appelant,
+// rien ne garantit l'ordre d'empilement entre une Window et une Popup
+// ouverte depuis un contexte différent (ex: FileViewer ouvert depuis la
+// popup de détail d'une tâche a besoin de passer devant elle).
+const props = withDefaults(defineProps<{
isOpen: boolean;
hideCloseBtn?: boolean;
-}>();
+ zIndex?: number;
+}>(), {
+ zIndex: 100
+});
const emit = defineEmits(['close']);
diff --git a/src/composables/useLiveKit.ts b/src/composables/useLiveKit.ts
index 75119c96..9b8dd260 100644
--- a/src/composables/useLiveKit.ts
+++ b/src/composables/useLiveKit.ts
@@ -1,17 +1,22 @@
-import { ref, shallowRef } from 'vue';
+import { ref, reactive, shallowRef } from 'vue';
import {
Room,
RoomEvent,
RemoteTrack,
Track,
Participant,
- ExternalE2EEKeyProvider
+ ExternalE2EEKeyProvider,
+ VideoPresets,
+ ScreenSharePresets,
+ type VideoCaptureOptions,
+ type ScreenShareCaptureOptions
} from 'livekit-client';
import { openedOrg } from '@/assets/var';
import { decryptThreadKeyWithRsa, privateKey } from '@/assets/utils/crypto';
import E2EEWorker from '../../node_modules/livekit-client/dist/livekit-client.e2ee.worker.js?worker&url';
import useWSocket from './useWSocket';
import { useToast } from './useToast';
+import sfetch from '@/assets/utils/sfetch';
import type { OrgMember } from '@/types/types';
@@ -28,6 +33,48 @@ const isDeafened = ref
(false);
const keyProvider = new ExternalE2EEKeyProvider();
let intentionalDisconnect = false;
+// ── Volume local par participant (0-200%) ───────────────────────────────
+// Un natif plafonne à 100% (el.volume max = 1) : pour permettre un
+// boost au-delà, chaque flux audio distant est routé à travers un GainNode
+// Web Audio plutôt que de compter sur el.volume.
+const VOLUMES_STORAGE_KEY = 'synco:voiceVolumes';
+let audioCtx: AudioContext | null = null;
+const gainNodes = new Map();
+const participantVolumes = reactive>(new Map());
+
+function loadStoredVolumes(): Record {
+ try {
+ const raw = localStorage.getItem(VOLUMES_STORAGE_KEY);
+ return raw ? JSON.parse(raw) : {};
+ } catch {
+ return {};
+ }
+}
+
+function persistVolumes() {
+ try {
+ const obj: Record = {};
+ participantVolumes.forEach((v, k) => { obj[k] = v; });
+ localStorage.setItem(VOLUMES_STORAGE_KEY, JSON.stringify(obj));
+ } catch {
+ // localStorage indisponible (navigation privée, quota) : préférence non persistée, sans impact fonctionnel
+ }
+}
+
+function getStoredVolume(identity: string): number {
+ if (participantVolumes.has(identity)) return participantVolumes.get(identity)!;
+ const stored = loadStoredVolumes()[identity];
+ const vol = typeof stored === 'number' ? stored : 100;
+ participantVolumes.set(identity, vol);
+ return vol;
+}
+
+function getAudioContext(): AudioContext {
+ if (!audioCtx) audioCtx = new AudioContext();
+ if (audioCtx.state === 'suspended') audioCtx.resume().catch(() => {});
+ return audioCtx;
+}
+
/**
* Unwraps the room's E2EE media key from the RSA-OAEP-encrypted blob the
@@ -116,10 +163,24 @@ function useLiveKit()
const newRoom = new Room({
adaptiveStream: true,
dynacast: true,
- e2ee: e2eeOptions
+ e2ee: e2eeOptions,
+ // Simulcast : publie plusieurs couches de qualité (caméra ET partage
+ // d'écran) — le SFU ne transmet à chaque spectateur que la couche
+ // adaptée à sa bande passante réelle (combiné à adaptiveStream/dynacast
+ // ci-dessus), ce qui évite les lags dus à une connexion faible chez un
+ // participant sans dégrader tout le monde.
+ publishDefaults: {
+ simulcast: true,
+ videoSimulcastLayers: [VideoPresets.h180, VideoPresets.h360, VideoPresets.h720],
+ screenShareSimulcastLayers: [ScreenSharePresets.h360fps15, ScreenSharePresets.h720fps15],
+ }
});
const handleSync = () => {
+ // Un mute forcé côté serveur (modération) ne déclenche que TrackMuted,
+ // pas LocalTrackPublished/Unpublished : sans ce resync ici, le bouton
+ // micro local resterait affiché "actif" après un mute distant.
+ syncLocalState();
allParticipants.value = [newRoom.localParticipant, ...Array.from(newRoom.remoteParticipants.values())];
broadcastUpdate(threadId, spaceId);
};
@@ -163,6 +224,8 @@ function useLiveKit()
allParticipants.value = [];
audioTracks.value.clear();
videoTracks.value.clear();
+ gainNodes.forEach(g => g.disconnect());
+ gainNodes.clear();
if (!intentionalDisconnect) {
useToast().show("Connexion au salon vocal perdue", "error");
@@ -175,7 +238,24 @@ function useLiveKit()
if (track.kind === Track.Kind.Audio)
{
const el = track.attach();
- el.muted = isDeafened.value;
+ // Routage via un GainNode Web Audio (cf. déclarations en tête de fichier) :
+ // permet un volume par-participant jusqu'à 200%, ce qu'un
+ // natif (max 100%) ne permet pas. Le gain porte aussi l'assourdissement
+ // (deafen) — plus fiable que el.muted une fois l'élément capturé par
+ // createMediaElementSource sur certains navigateurs.
+ try {
+ const ctx = getAudioContext();
+ const source = ctx.createMediaElementSource(el);
+ const gain = ctx.createGain();
+ const vol = getStoredVolume(participant.identity);
+ gain.gain.value = isDeafened.value ? 0 : vol / 100;
+ source.connect(gain);
+ gain.connect(ctx.destination);
+ gainNodes.set(participant.identity, gain);
+ } catch (e) {
+ console.error('[LiveKit Audio] Impossible de router le flux via Web Audio:', e);
+ el.muted = isDeafened.value;
+ }
audioTracks.value.set(participant.identity, track);
}
else
@@ -189,7 +269,11 @@ function useLiveKit()
newRoom.on(RoomEvent.TrackUnsubscribed, (track, pub, participant) => {
track.detach();
- if (track.kind === Track.Kind.Audio) audioTracks.value.delete(participant.identity);
+ if (track.kind === Track.Kind.Audio) {
+ audioTracks.value.delete(participant.identity);
+ gainNodes.get(participant.identity)?.disconnect();
+ gainNodes.delete(participant.identity);
+ }
else videoTracks.value.delete(`${participant.identity}-${pub.source}`);
handleSync();
});
@@ -198,8 +282,18 @@ function useLiveKit()
await newRoom.connect(url, token);
room.value = newRoom;
isConnected.value = true;
- await newRoom.localParticipant.setMicrophoneEnabled(true);
-
+
+ const { getVoicePrefs } = await import('@/assets/utils/voicePrefs');
+ const prefs = getVoicePrefs();
+ await newRoom.localParticipant.setMicrophoneEnabled(true, prefs.micDeviceId ? { deviceId: prefs.micDeviceId } : undefined);
+
+ // Périphérique de sortie audio choisi dans les réglages, appliqué dès la
+ // connexion — échoue silencieusement si le device a disparu depuis
+ // (débranché) : on reste alors sur le device par défaut du navigateur.
+ if (prefs.speakerDeviceId) {
+ try { await newRoom.switchActiveDevice('audiooutput', prefs.speakerDeviceId); } catch { /* device indisponible */ }
+ }
+
// Broadcast decrypted profile info to guests/others via LiveKit metadata
const { user, member } = await import('@/assets/var');
@@ -237,6 +331,8 @@ function useLiveKit()
allParticipants.value = [];
audioTracks.value.clear();
videoTracks.value.clear();
+ gainNodes.forEach(g => g.disconnect());
+ gainNodes.clear();
}
@@ -251,12 +347,13 @@ function useLiveKit()
isMicEnabled,
isScreenShareEnabled,
isDeafened,
+ participantVolumes,
getWSData,
connectToRoom,
leaveRoom,
- toggleCamera: async (en: boolean) => {
+ toggleCamera: async (en: boolean, captureOptions?: VideoCaptureOptions) => {
if (!room.value) return;
- await room.value.localParticipant.setCameraEnabled(en);
+ await room.value.localParticipant.setCameraEnabled(en, captureOptions);
isCameraEnabled.value = en;
},
toggleMicrophone: async (en: boolean) => {
@@ -264,17 +361,52 @@ function useLiveKit()
await room.value.localParticipant.setMicrophoneEnabled(en);
isMicEnabled.value = en;
},
- toggleScreenShare: async (en: boolean) => {
+ toggleScreenShare: async (en: boolean, captureOptions?: ScreenShareCaptureOptions) => {
if (!room.value) return;
- await room.value.localParticipant.setScreenShareEnabled(en);
+ await room.value.localParticipant.setScreenShareEnabled(en, captureOptions);
isScreenShareEnabled.value = en;
},
toggleDeafen: (en: boolean) => {
isDeafened.value = en;
- audioTracks.value.forEach(track => {
- track.attachedElements.forEach(el => {
- el.muted = en;
- });
+ gainNodes.forEach((gain, identity) => {
+ gain.gain.value = en ? 0 : getStoredVolume(identity) / 100;
+ });
+ },
+
+ /** Volume local (0-200%) appliqué au flux d'un participant distant — jamais envoyé au serveur. */
+ setParticipantVolume: (identity: string, pct: number) => {
+ const clamped = Math.min(200, Math.max(0, Math.round(pct)));
+ participantVolumes.set(identity, clamped);
+ persistVolumes();
+ const gain = gainNodes.get(identity);
+ if (gain && !isDeafened.value) gain.gain.value = clamped / 100;
+ },
+
+ /** Change le périphérique micro/caméra/enceinte actif sans republier (API native LiveKit). */
+ switchDevice: async (kind: MediaDeviceKind, deviceId: string) => {
+ if (!room.value) return;
+ await room.value.switchActiveDevice(kind, deviceId);
+ },
+
+ /** Applique une nouvelle résolution/framerate à une track vidéo locale déjà publiée, sans republier. */
+ applyVideoQuality: async (source: Track.Source.Camera | Track.Source.ScreenShare, options: VideoCaptureOptions) => {
+ if (!room.value) return;
+ const pub = room.value.localParticipant.getTrackPublication(source);
+ await pub?.videoTrack?.restartTrack(options);
+ },
+
+ /** Force la coupure/réactivation du micro d'un autre participant (nécessite VOICE_MUTE_OTHERS). */
+ muteParticipant: async (threadId: string, identity: string, muted: boolean) => {
+ return sfetch(`/api/livekit/rooms/${threadId}/participants/${identity}/mute`, {
+ method: 'POST',
+ body: JSON.stringify({ muted }),
+ });
+ },
+
+ /** Expulse un participant du salon vocal (nécessite VOICE_DISCONNECT). */
+ disconnectParticipant: async (threadId: string, identity: string) => {
+ return sfetch(`/api/livekit/rooms/${threadId}/participants/${identity}`, {
+ method: 'DELETE',
});
}
};
diff --git a/src/config/permissions.config.ts b/src/config/permissions.config.ts
index 43ff0948..4a3605bf 100644
--- a/src/config/permissions.config.ts
+++ b/src/config/permissions.config.ts
@@ -50,6 +50,10 @@ export const PERMISSION_REGISTRY = {
TASK_STATUS_LOWER: { label: 'Statut (Rôles Inférieurs)', icon: 'bi-check', description: 'Modifier le statut des tâches créées par des rôles inférieurs' },
TASK_SUBTASK_LOWER: { label: 'Sous-tâches (Rôles Inférieurs)', icon: 'bi-diagram-3', description: 'Créer des sous-tâches sur les tâches de rôles inférieurs' },
+ // Salons vocaux
+ VOICE_MUTE_OTHERS: { label: 'Couper le micro des autres', icon: 'bi-mic-mute', description: "Forcer la coupure du micro d'un participant en salon vocal" },
+ VOICE_DISCONNECT: { label: "Expulser d'un salon vocal", icon: 'bi-telephone-x', description: "Déconnecter un participant d'un salon vocal" },
+
} as const;
export type Permission = keyof typeof PERMISSION_REGISTRY;
diff --git a/src/style.css b/src/style.css
index 92e33b15..5f350526 100644
--- a/src/style.css
+++ b/src/style.css
@@ -647,4 +647,65 @@ button.tab:not(.active) {
.page-lock-leave-to {
opacity: 0;
transform: scale(0.95);
+}
+
+
+/* Révélation de l'UI juste après le déverrouillage de la session (App.vue) :
+ application directe d'une animation CSS @keyframes plutôt que des classes
+ de Vue — une animation se rejoue automatiquement à chaque
+ fois que le navigateur insère un nouvel élément portant cette classe
+ (v-if/v-else créent bien un nouveau nœud à chaque bascule), sans dépendre
+ du timing d'accrochage rAF de ni de ses classes -enter-from
+ / -enter-active, qui peuvent être invisibles si l'état "avant" et l'état
+ "après" se résolvent dans le même tick. */
+@keyframes app-reveal-in {
+ from {
+ opacity: 0;
+ transform: scale(0.97) translateY(10px);
+ }
+ to {
+ opacity: 1;
+ transform: scale(1) translateY(0);
+ }
+}
+
+.animate-app-reveal {
+ animation: app-reveal-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
+}
+
+/* Barre latérale (SpaceBar) : glissement depuis la gauche plutôt qu'un
+ scale/fade générique — plus adapté à un élément qui vit sur le bord de
+ l'écran, et surtout beaucoup plus reconnaissable à l'oeil pour vérifier
+ que l'animation se déclenche bien. */
+@keyframes sidebar-reveal-in {
+ from {
+ opacity: 0;
+ transform: translateX(-16px);
+ }
+ to {
+ opacity: 1;
+ transform: translateX(0);
+ }
+}
+
+.animate-sidebar-reveal {
+ animation: sidebar-reveal-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
+}
+
+/* Petit signe de la main sur l'emoji 👋 du message d'accueil (OrgHome.vue) —
+ pivote depuis le poignet (transform-origin bas-droite), démarre une fois
+ le titre déjà apparu (délai) plutôt qu'en même temps que le fade-in. */
+@keyframes wave {
+ 0%, 100% { transform: rotate(0deg); }
+ 10% { transform: rotate(14deg); }
+ 20% { transform: rotate(-8deg); }
+ 30% { transform: rotate(14deg); }
+ 40% { transform: rotate(-4deg); }
+ 50% { transform: rotate(10deg); }
+ 60% { transform: rotate(0deg); }
+}
+
+.animate-wave {
+ transform-origin: 70% 70%;
+ animation: wave 1.4s ease-in-out 0.5s 1;
}
\ No newline at end of file
diff --git a/src/types/types.ts b/src/types/types.ts
index 29c1de30..9bce32a6 100644
--- a/src/types/types.ts
+++ b/src/types/types.ts
@@ -144,7 +144,7 @@ export interface MessageReaction {
export interface Message {
id: string;
threadId: string;
- senderId: string;
+ senderId: string | null;
replyToId: string | null;
transferId: string | null;
content: string;
@@ -157,14 +157,15 @@ export interface Message {
sender?: User;
files?: StoredFile[];
-
+
replyMessage?: Message | null;
replies?: Message[];
transferMessage?: Message | null;
transferredIn?: Message[];
-
+
isWebhook?: boolean;
webhookId?: string | null;
+ webhookCreatorId?: string | null;
webhookName?: string | null;
webhookAvatar?: string | null;
embeds?: any[];
diff --git a/src/views/OrgSpace/OrgLayout.vue b/src/views/OrgSpace/OrgLayout.vue
index a9102de2..9ae32981 100644
--- a/src/views/OrgSpace/OrgLayout.vue
+++ b/src/views/OrgSpace/OrgLayout.vue
@@ -1,6 +1,6 @@
@@ -171,17 +198,16 @@ function dueInfo(task: Task): { text: string; color: string } {
font-size: 0.8rem;
}
-.dash-row {
- width: 100%;
- display: flex;
- align-items: center;
- gap: 0.65rem;
- padding: 0.5rem 0.6rem;
- border-radius: 0.75rem;
- text-align: left;
- transition: background-color 0.15s;
-}
-.dash-row:hover {
- background: rgba(255, 255, 255, 0.04);
+.dash-new-pill {
+ font-size: 0.6rem;
+ font-weight: 700;
+ text-transform: uppercase;
+ letter-spacing: 0.03em;
+ padding: 0.05rem 0.45rem;
+ border-radius: 999px;
+ background: var(--primary);
+ color: var(--white);
+ white-space: nowrap;
+ flex-shrink: 0;
}
diff --git a/src/views/OrgSpace/components/SpaceTasks/TaskCard.vue b/src/views/OrgSpace/components/SpaceTasks/TaskCard.vue
index 77aca4f7..5b860762 100644
--- a/src/views/OrgSpace/components/SpaceTasks/TaskCard.vue
+++ b/src/views/OrgSpace/components/SpaceTasks/TaskCard.vue
@@ -14,8 +14,21 @@
-
-
+
+
+
+ {{ tag.name }}
+
+
+ +{{ task.tags.length - 3 }}
+
+
+
+
@@ -29,9 +42,15 @@
-
-
- {{ task.subtasks.filter((st: any) => st.status === 'DONE').length }}/{{ task.subtasks.length }}
+
+
+
+ {{ task._count.attachments }}
+
+
+
+ {{ task.subtasks.filter((st: any) => st.status === 'DONE').length }}/{{ task.subtasks.length }}
+
@@ -62,9 +81,11 @@
diff --git a/src/views/OrgSpace/components/layouts/SpaceBar.vue b/src/views/OrgSpace/components/layouts/SpaceBar.vue
index acc691c3..e5555558 100644
--- a/src/views/OrgSpace/components/layouts/SpaceBar.vue
+++ b/src/views/OrgSpace/components/layouts/SpaceBar.vue
@@ -72,6 +72,7 @@ const onSpaceOrderChange = async () => {
class="
h-full min-w-17 bg-(--bg)
flex justify-start items-center flex-col pt-2.5
+ animate-sidebar-reveal
"
>
diff --git a/src/views/OrgSpace/components/layouts/UserCard.vue b/src/views/OrgSpace/components/layouts/UserCard.vue
index b6c0bc85..8c94ae21 100644
--- a/src/views/OrgSpace/components/layouts/UserCard.vue
+++ b/src/views/OrgSpace/components/layouts/UserCard.vue
@@ -111,7 +111,7 @@
-
+
-
-
+
En ligne — {{ members.filter(member => member.user?.data.status !== 'offline').length }}
diff --git a/src/views/OrgSpace/components/popup/FileViewer.vue b/src/views/OrgSpace/components/popup/FileViewer.vue
index b32f1807..474d857f 100644
--- a/src/views/OrgSpace/components/popup/FileViewer.vue
+++ b/src/views/OrgSpace/components/popup/FileViewer.vue
@@ -1,5 +1,5 @@
-
+
@@ -11,8 +11,24 @@
-
+
+ Aperçu
+
+
+ Édition
+
+
+
Enregistrer
-
-
+
+
+
+
+
-
+
Modifications non enregistrées
Vous avez des modifications non enregistrées sur {{ file.originalName }} .
@@ -161,8 +181,9 @@ import sfetch from '@/assets/utils/sfetch';
import Window from '@/components/windows/Window.vue';
import ConfirmDelete from '@/components/common/ConfirmDelete.vue';
import Popup from '@/components/Popup.vue';
+import MarkdownDocumentPreview from './MarkdownDocumentPreview.vue';
import { getWorkspaceKey } from '@/assets/utils/workspaceCrypto';
-import { decryptFileLocal } from '@/assets/utils/crypto';
+import { decryptFileLocal, encryptFileLocal } from '@/assets/utils/crypto';
import { VueMonacoEditor, loader } from '@guolao/vue-monaco-editor';
import * as monaco from 'monaco-editor';
@@ -212,7 +233,7 @@ const getMonacoLanguage = (mimeType: string, filename: string) => {
if (ext === 'rb') return 'ruby';
if (ext === 'sh' || mimeType === 'application/x-sh') return 'shell';
if (ext === 'sql' || mimeType.includes('sql')) return 'sql';
- if (ext === 'md') return 'markdown';
+ if (ext === 'md' || ext === 'markdown') return 'markdown';
return 'plaintext';
};
@@ -233,6 +254,7 @@ const showUnsavedConfirm = ref(false);
const fileContent = ref('');
const originalFileContent = ref('');
+const viewMode = ref<'edit' | 'preview'>('preview');
const e2eeObjectUrl = ref(null);
@@ -247,9 +269,9 @@ const isImage = computed(() => props.file.mimeType.startsWith('image/'));
const isPdf = computed(() => props.file.mimeType === 'application/pdf');
const isTextFile = computed(() => {
const mime = props.file.mimeType;
- return mime.startsWith('text/') ||
- mime === 'application/json' ||
- mime === 'application/xml' ||
+ return mime.startsWith('text/') ||
+ mime === 'application/json' ||
+ mime === 'application/xml' ||
mime === 'application/javascript' ||
mime === 'application/x-sh' ||
mime.includes('sql');
@@ -258,6 +280,11 @@ const isTextFile = computed(() => {
const fileExtension = computed(() => {
return props.file.originalName.split('.').pop()?.toLowerCase() || '';
});
+
+// Détection par extension, pas par mimeType : des .md déjà en base avant ce
+// fix peuvent avoir un mimeType incorrect (application/octet-stream) — on ne
+// veut pas dépendre de ça pour les reconnaître.
+const isMarkdown = computed(() => ['md', 'markdown'].includes(fileExtension.value));
const isOfficeFile = computed(() => {
const ext = fileExtension.value;
return ['docx', 'doc', 'xlsx', 'xls', 'pptx', 'ppt', 'csv', 'txt', 'rtf'].includes(ext);
@@ -353,7 +380,11 @@ const disableE2EE = async () => {
toast.show('Chiffrement désactivé, chargement de l\'éditeur...', 'success');
props.file.isE2EE = false;
emit('updated', newMeta);
- await loadOnlyOfficeConfig();
+ if (isMarkdown.value) {
+ await fetchTextContent();
+ } else {
+ await loadOnlyOfficeConfig();
+ }
} else {
const err = await updateRes.json();
toast.show(err.error || 'Erreur lors de la désactivation.', 'error');
@@ -380,7 +411,7 @@ const handleError = () => {
};
const fetchTextContent = async () => {
- if (!isTextFile.value) return;
+ if (!isTextFile.value && !isMarkdown.value) return;
isLoading.value = true;
try {
const res = await sfetch(`/api/cdn/download/${props.file.id}`);
@@ -434,17 +465,42 @@ const loadE2EEPreview = async () => {
const saveContent = async () => {
if (fileContent.value === originalFileContent.value) return;
-
+
isSaving.value = true;
try {
- const res = await sfetch(`/api/cdn/content/${props.file.id}`, {
- method: 'PUT',
- headers: {
- 'Content-Type': 'text/plain'
- },
- body: fileContent.value
- });
-
+ let res: Response;
+
+ if (props.file.isE2EE) {
+ // Le contenu ne doit jamais transiter en clair vers le serveur : on le
+ // rechiffre côté client (nouvelle DEK + IV, comme à l'upload) avant
+ // envoi, via la route binaire dédiée aux fichiers déjà E2EE.
+ if (!props.file.workspaceId) {
+ throw new Error("Fichier E2EE sans espace de travail associé : sauvegarde impossible.");
+ }
+ const { key: spaceKey, version } = await getWorkspaceKey(props.file.workspaceId);
+ const plainBuffer = await new Blob([fileContent.value]).arrayBuffer();
+ const { encryptedBlob, encryptedFileKey, iv } = await encryptFileLocal(plainBuffer, spaceKey);
+
+ const formData = new FormData();
+ formData.append('file', encryptedBlob, props.file.originalName);
+ formData.append('iv', iv);
+ formData.append('encryptedFileKey', encryptedFileKey);
+ formData.append('keyVersion', String(version));
+
+ res = await sfetch(`/api/cdn/content-e2ee/${props.file.id}`, {
+ method: 'PUT',
+ body: formData
+ });
+ } else {
+ res = await sfetch(`/api/cdn/content/${props.file.id}`, {
+ method: 'PUT',
+ headers: {
+ 'Content-Type': 'text/plain'
+ },
+ body: fileContent.value
+ });
+ }
+
if (res.ok) {
const updatedMetadata = await res.json();
originalFileContent.value = fileContent.value;
@@ -485,7 +541,9 @@ watch(() => props.isOpen, async (isOpen) => {
e2eeObjectUrl.value = null;
onlyOfficeConfig.value = null;
- if (props.file.isE2EE && !isTextFile.value && (isImage.value || isPdf.value)) {
+ if (isMarkdown.value) {
+ fetchTextContent();
+ } else if (props.file.isE2EE && !isTextFile.value && (isImage.value || isPdf.value)) {
loadE2EEPreview();
} else if (isOfficeFile.value && onlyOfficeEnabled.value && !props.file.isE2EE) {
await loadOnlyOfficeConfig();
@@ -507,7 +565,9 @@ watch(() => props.isOpen, async (isOpen) => {
onMounted(async () => {
if (props.isOpen) {
isLoading.value = true;
- if (props.file.isE2EE && !isTextFile.value && (isImage.value || isPdf.value)) {
+ if (isMarkdown.value) {
+ fetchTextContent();
+ } else if (props.file.isE2EE && !isTextFile.value && (isImage.value || isPdf.value)) {
loadE2EEPreview();
} else if (isOfficeFile.value && onlyOfficeEnabled.value && !props.file.isE2EE) {
await loadOnlyOfficeConfig();
@@ -521,7 +581,7 @@ onMounted(async () => {
});
const closeViewer = () => {
- if (isTextFile.value && fileContent.value !== originalFileContent.value) {
+ if ((isTextFile.value || isMarkdown.value) && fileContent.value !== originalFileContent.value) {
showUnsavedConfirm.value = true;
} else {
emit('close');
diff --git a/src/views/OrgSpace/components/popup/MarkdownDocumentPreview.vue b/src/views/OrgSpace/components/popup/MarkdownDocumentPreview.vue
new file mode 100644
index 00000000..977fb738
--- /dev/null
+++ b/src/views/OrgSpace/components/popup/MarkdownDocumentPreview.vue
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
diff --git a/src/views/OrgSpace/components/popup/SpaceSearchModal.vue b/src/views/OrgSpace/components/popup/SpaceSearchModal.vue
index aaa3f036..db99d945 100644
--- a/src/views/OrgSpace/components/popup/SpaceSearchModal.vue
+++ b/src/views/OrgSpace/components/popup/SpaceSearchModal.vue
@@ -91,18 +91,18 @@
/>
-
diff --git a/src/views/OrgSpace/components/popup/TaskDetailsModal.vue b/src/views/OrgSpace/components/popup/TaskDetailsModal.vue
index 41efd95a..27781930 100644
--- a/src/views/OrgSpace/components/popup/TaskDetailsModal.vue
+++ b/src/views/OrgSpace/components/popup/TaskDetailsModal.vue
@@ -161,9 +161,10 @@
-
+
@@ -460,6 +461,25 @@ const resolveAllAttachmentPreviews = () => {
(props.task?.attachments || []).forEach(resolveAttachmentPreview);
};
+// `props.task` vient souvent d'une liste/Kanban qui ne charge qu'un
+// _count.attachments (pas les pièces jointes elles-mêmes, cf. tasksService.ts)
+// — sans ce refetch, la popup pouvait ne jamais afficher de pièce jointe pour
+// une tâche ouverte depuis le Kanban, même juste après en avoir ajouté une.
+const refreshTaskAttachments = async () => {
+ if (!props.task) return;
+ try {
+ const res = await sfetch(`/api/tasks/${route.params.orgId}/tasks/${props.task.id}`);
+ if (!res.ok) return;
+ const fullTask = await res.json();
+ if (!props.task || props.task.id !== fullTask.id) return; // la tâche a changé entre-temps
+ props.task.attachments = fullTask.attachments;
+ props.task.linkedFiles = fullTask.linkedFiles;
+ resolveAllAttachmentPreviews();
+ } catch (e) {
+ console.error('[TaskDetailsModal] Failed to refresh task attachments', e);
+ }
+};
+
const uploadAttachments = async (files: File[]) => {
if (!props.task) return;
uploadingImage.value = true;
@@ -727,6 +747,7 @@ watch(() => props.isOpen, async (newVal) => {
activeSection.value = null;
saveStatus.value = 'idle';
resolveAllAttachmentPreviews();
+ refreshTaskAttachments();
await nextTick();
initializing = false;
// "Renommer" depuis le menu contextuel : ouvre directement le titre en édition.
diff --git a/src/views/OrgSpace/views/Agenda/components/DayGrid.vue b/src/views/OrgSpace/views/Agenda/components/DayGrid.vue
index c5ef7a7e..e0fe5032 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.stop="emit('open-event', occ)"
+ @click="emit('open-event', occ)"
/>
@@ -42,9 +42,9 @@
:class="{ 'is-event-dragging': eventDrag?.occ.occurrenceKey === occ.occurrenceKey }"
:style="eventStyle(occ)"
>
-
-
-
+
+
+
@@ -278,6 +278,14 @@ interface EventDragState {
}
const eventDrag = ref
(null);
+// Glisser en attente de confirmation : tant qu'on n'a pas dépassé le seuil de
+// mouvement, on ne touche pas à `eventDrag` (donc pas de classe
+// is-event-dragging / pointer-events:none) — sinon un simple clic sans
+// déplacement fait disparaître la cible du clic natif qui suit juste après
+// (le mouseup/click est alors hit-testé sur l'élément derrière), et
+// @click="emit('open-event', occ)" ne se déclenche jamais.
+let pendingDrag: EventDragState | null = null;
+const DRAG_CONFIRM_PX = 4;
function minutesOfDay(d: Date): number {
return d.getHours() * 60 + d.getMinutes();
@@ -291,7 +299,7 @@ function startEventDrag(e: PointerEvent, occ: OccurrenceInstance, mode: EventDra
const start = new Date(occ.startAt);
const end = new Date(occ.endAt);
- eventDrag.value = {
+ pendingDrag = {
occ,
mode,
pointerStartY: e.clientY,
@@ -305,8 +313,14 @@ function startEventDrag(e: PointerEvent, occ: OccurrenceInstance, mode: EventDra
}
function onEventDragMove(e: PointerEvent) {
- if (!eventDrag.value) return;
- const d = eventDrag.value;
+ if (!eventDrag.value && !pendingDrag) return;
+
+ if (!eventDrag.value) {
+ if (Math.abs(e.clientY - pendingDrag!.pointerStartY) < DRAG_CONFIRM_PX) return;
+ eventDrag.value = pendingDrag;
+ }
+
+ const d = eventDrag.value!;
const deltaMin = snap((e.clientY - d.pointerStartY) / rowHeight * 60);
if (d.mode === 'move') {
@@ -328,6 +342,7 @@ function onEventDragMove(e: PointerEvent) {
function onEventDragEnd() {
window.removeEventListener('pointermove', onEventDragMove);
window.removeEventListener('pointerup', onEventDragEnd);
+ pendingDrag = null;
if (!eventDrag.value) return;
const d = eventDrag.value;
diff --git a/src/views/OrgSpace/views/Agenda/components/EventPanel.vue b/src/views/OrgSpace/views/Agenda/components/EventPanel.vue
index a9249e81..9bb4744a 100644
--- a/src/views/OrgSpace/views/Agenda/components/EventPanel.vue
+++ b/src/views/OrgSpace/views/Agenda/components/EventPanel.vue
@@ -1,10 +1,22 @@
-
+
-