Speakr is a personal, self-hosted web application designed for transcribing audio recordings
Python
Add incognito mode for session-only transcription processing
Murtaza Nasiraa6c814f09b9
diff --git a/config/env.asr.example b/config/env.asr.exampleindex a7acf932..2e0a8508 100644--- a/config/env.asr.example+++ b/config/env.asr.example@@ -188,6 +188,16 @@ ENABLE_PUBLIC_SHARING=true# Note: Admins can control public sharing permissions per-user in the admin dashboard# even when ENABLE_PUBLIC_SHARING is true+# --- Incognito Mode (HIPAA-friendly) ---+# Enable incognito mode for privacy-sensitive transcriptions+# When enabled, users can upload recordings that are:+# - Processed on the server but NOT saved to the database+# - Stored only in the browser's sessionStorage (lost when tab closes)+# - Audio files are immediately deleted after processing+# Useful for HIPAA compliance or sensitive recordings+# Default: false (feature hidden)+ENABLE_INCOGNITO_MODE=false+# --- Background Processing Queues ---# Separate queues for transcription (slow) and summary (fast) jobs# This prevents slow ASR jobs from blocking quick summary generationdiff --git a/config/env.whisper.example b/config/env.whisper.exampleindex 82903ca1..2ffe81a5 100644--- a/config/env.whisper.example+++ b/config/env.whisper.example@@ -196,6 +196,16 @@ ENABLE_PUBLIC_SHARING=true# Note: Admins can control public sharing permissions per-user in the admin dashboard# even when ENABLE_PUBLIC_SHARING is true+# --- Incognito Mode (HIPAA-friendly) ---+# Enable incognito mode for privacy-sensitive transcriptions+# When enabled, users can upload recordings that are:+# - Processed on the server but NOT saved to the database+# - Stored only in the browser's sessionStorage (lost when tab closes)+# - Audio files are immediately deleted after processing+# Useful for HIPAA compliance or sensitive recordings+# Default: false (feature hidden)+ENABLE_INCOGNITO_MODE=false+# --- Background Processing Queues ---# Separate queues for transcription (slow) and summary (fast) jobs# This prevents slow ASR jobs from blocking quick summary generationdiff --git a/src/api/recordings.py b/src/api/recordings.pyindex 0bddccd7..a21048ea 100644--- a/src/api/recordings.py+++ b/src/api/recordings.py@@ -28,6 +28,9 @@ from src.utils.ffmpeg_utils import FFmpegError, FFmpegNotFoundErrorfrom src.services.speaker import update_speaker_usage, identify_unidentified_speakers_from_textfrom src.services.speaker_embedding_matcher import update_speaker_embeddingfrom src.services.speaker_snippets import create_speaker_snippets++# Incognito mode - disabled by default, enable via environment variable+ENABLE_INCOGNITO_MODE = os.environ.get('ENABLE_INCOGNITO_MODE', 'false').lower() == 'true'from src.services.document import process_markdown_to_docxfrom src.services.llm import client, chat_client, call_llm_completion, call_chat_completion, process_streaming_with_thinking, TokenBudgetExceededfrom src.services.embeddings import process_recording_chunks@@ -2246,6 +2249,264 @@ def upload_file():return jsonify({'error': 'An unexpected error occurred during upload.'}), 500+@recordings_bp.route('/api/recordings/incognito', methods=['POST'])+@login_required+def upload_incognito():+ """+ Process audio in incognito mode - no database storage.+ Returns transcript/summary directly in response.++ This endpoint is designed for HIPAA-friendly transcription where+ audio data is processed but never persisted to the database.+ Results are returned directly and only stored client-side in sessionStorage.+ """+ # Check if incognito mode is enabled+ if not ENABLE_INCOGNITO_MODE:+ return jsonify({'error': 'Incognito mode is not enabled on this server'}), 403++ import tempfile+ from datetime import datetime+ from src.tasks.processing import transcribe_incognito, generate_incognito_summary++ temp_filepath = None++ try:+ if 'file' not in request.files:+ return jsonify({'error': 'No file provided'}), 400++ file = request.files['file']+ if file.filename == '':+ return jsonify({'error': 'No file selected'}), 400++ original_filename = file.filename+ safe_filename = secure_filename(original_filename)++ # Get file size+ file.seek(0, os.SEEK_END)+ file_size = file.tell()+ file.seek(0)++ # Check size limit+ max_content_length = current_app.config.get('MAX_CONTENT_LENGTH')+ if max_content_length and file_size > max_content_length:+ max_size_mb = max_content_length / (1024 * 1024)+ return jsonify({+ 'error': f'File too large. Maximum size is {max_size_mb:.0f} MB.',+ 'max_size_mb': max_size_mb+ }), 413++ # Save to temp file - use secure temp directory+ with tempfile.NamedTemporaryFile(delete=False, suffix=f'_{safe_filename}') as tmp:+ temp_filepath = tmp.name+ file.save(temp_filepath)+ current_app.logger.info(f"[Incognito] Temp file saved: {temp_filepath}")++ # Get optional parameters+ language = request.form.get('language', '') or None+ min_speakers = request.form.get('min_speakers')+ max_speakers = request.form.get('max_speakers')+ auto_summarize = request.form.get('auto_summarize', 'false').lower() == 'true'++ # Convert to int if provided+ if min_speakers:+ try:+ min_speakers = int(min_speakers)+ except (ValueError, TypeError):+ min_speakers = None+ if max_speakers:+ try:+ max_speakers = int(max_speakers)+ except (ValueError, TypeError):+ max_speakers = None++ # Log only metadata - NEVER log content for HIPAA compliance+ current_app.logger.info(f"[Incognito] Processing request from user {current_user.id}: "+ f"filename={original_filename}, size={file_size/1024/1024:.2f}MB, "+ f"language={language}, auto_summarize={auto_summarize}")++ # Perform transcription synchronously (no database operations)+ result = transcribe_incognito(+ filepath=temp_filepath,+ original_filename=original_filename,+ language=language,+ min_speakers=min_speakers,+ max_speakers=max_speakers,+ user=current_user+ )++ if result.get('error'):+ current_app.logger.error(f"[Incognito] Transcription failed: {result['error']}")+ return jsonify({+ 'incognito': True,+ 'error': result['error']+ }), 500++ # Optionally generate summary+ summary = None+ if auto_summarize and result.get('transcription'):+ current_app.logger.info(f"[Incognito] Auto-summarize requested, generating summary...")+ summary = generate_incognito_summary(result['transcription'], current_user)++ # Build response+ # Render markdown to HTML for summary display+ summary_html = None+ if summary:+ summary_html = md_to_html(summary)++ response_data = {+ 'incognito': True,+ 'transcription': result.get('transcription'),+ 'summary': summary,+ 'summary_html': summary_html,+ 'title': result.get('title', 'Incognito Recording'),+ 'audio_duration_seconds': result.get('audio_duration_seconds'),+ 'processing_time_seconds': result.get('processing_time_seconds'),+ 'created_at': datetime.utcnow().isoformat() + 'Z',+ 'original_filename': original_filename,+ 'file_size': file_size+ }++ current_app.logger.info(f"[Incognito] Request completed successfully for user {current_user.id}")++ return jsonify(response_data), 200++ except RequestEntityTooLarge:+ max_size_mb = current_app.config['MAX_CONTENT_LENGTH'] / (1024 * 1024)+ current_app.logger.warning(f"[Incognito] Upload failed: File too large (>{max_size_mb}MB)")+ return jsonify({+ 'incognito': True,+ 'error': f'File too large. Maximum size is {max_size_mb:.0f} MB.',+ 'max_size_mb': max_size_mb+ }), 413++ except Exception as e:+ current_app.logger.error(f"[Incognito] Error during processing: {e}", exc_info=True)+ return jsonify({+ 'incognito': True,+ 'error': 'An unexpected error occurred during processing.'+ }), 500++ finally:+ # CRITICAL: Always delete temp file for HIPAA compliance+ if temp_filepath and os.path.exists(temp_filepath):+ try:+ os.remove(temp_filepath)+ current_app.logger.info(f"[Incognito] Temp file deleted: {temp_filepath}")+ except Exception as cleanup_error:+ current_app.logger.error(f"[Incognito] Failed to delete temp file {temp_filepath}: {cleanup_error}")+++@recordings_bp.route('/api/recordings/incognito/chat', methods=['POST'])+@login_required+def chat_incognito():+ """+ Chat with an incognito recording's transcription.+ Since incognito recordings don't exist in the database, the transcription+ is passed directly in the request.+ """+ # Check if incognito mode is enabled+ if not ENABLE_INCOGNITO_MODE:+ return jsonify({'error': 'Incognito mode is not enabled on this server'}), 403++ from src.tasks.processing import format_transcription_for_llm++ try:+ data = request.json+ if not data:+ return jsonify({'error': 'No data provided'}), 400++ transcription = data.get('transcription')+ user_message = data.get('message')+ message_history = data.get('message_history', [])+ participants = data.get('participants', '')+ notes = data.get('notes', '')++ if not transcription:+ return jsonify({'error': 'No transcription provided'}), 400+ if not user_message:+ return jsonify({'error': 'No message provided'}), 400++ # Check if chat client is available+ if chat_client is None:+ return jsonify({'error': 'Chat service is not available (chat client not configured)'}), 503++ # Prepare the system prompt with the transcription+ user_chat_output_language = current_user.output_language if current_user.is_authenticated else None++ language_instruction = ""+ if user_chat_output_language:+ language_instruction = f"Please provide all your responses in {user_chat_output_language}."++ user_name = current_user.name if current_user.is_authenticated and current_user.name else "User"+ user_title = current_user.job_title if current_user.is_authenticated and current_user.job_title else "a professional"+ user_company = current_user.company if current_user.is_authenticated and current_user.company else "their organization"++ formatted_transcription = format_transcription_for_llm(transcription)++ # Get configurable transcript length limit for chat+ transcript_limit = SystemSetting.get_setting('transcript_length_limit', 30000)+ if transcript_limit == -1:+ chat_transcript = formatted_transcription+ else:+ chat_transcript = formatted_transcription[:transcript_limit]++ system_prompt = f"""You are a professional meeting and audio transcription analyst assisting {user_name}, who is a(n) {user_title} at {user_company}. {language_instruction} Analyze the following meeting information and respond to the specific request.++Following are the meeting participants and their roles:+{participants or "No specific participants information provided."}++Following is the meeting transcript:+<<start transcript>>+{chat_transcript or "No transcript available."}+<<end transcript>>++Additional context and notes about the meeting:+{notes or "none"}++Note: This is an incognito recording - no data is stored on the server.+"""++ # Prepare messages array with system prompt and conversation history+ messages = [{"role": "system", "content": system_prompt}]+ if message_history:+ messages.extend(message_history)+ messages.append({"role": "user", "content": user_message})++ # Get model info+ chat_model = os.environ.get('TEXT_MODEL_NAME', os.environ.get('OPENAI_CHAT_MODEL', 'gpt-4o-mini'))+ user_id = current_user.id++ current_app.logger.info(f"[Incognito Chat] User {user_id} sending message")++ def generate():+ """Stream the chat response."""+ try:+ response = chat_client.chat.completions.create(+ model=chat_model,+ messages=messages,+ temperature=0.7,+ stream=True+ )++ for chunk in response:+ if chunk.choices and len(chunk.choices) > 0:+ delta = chunk.choices[0].delta+ if hasattr(delta, 'content') and delta.content:+ yield f"data: {json.dumps({'content': delta.content})}\n\n"++ yield "data: [DONE]\n\n"++ except Exception as e:+ current_app.logger.error(f"[Incognito Chat] Error during streaming: {e}")+ yield f"data: {json.dumps({'error': str(e)})}\n\n"++ return Response(generate(), mimetype='text/event-stream')++ except Exception as e:+ current_app.logger.error(f"[Incognito Chat] Error: {e}", exc_info=True)+ return jsonify({'error': 'An error occurred during chat'}), 500++# Status Endpointdiff --git a/src/api/system.py b/src/api/system.pyindex 56a8998f..914350b4 100644--- a/src/api/system.py+++ b/src/api/system.py@@ -32,6 +32,7 @@ ENABLE_INTERNAL_SHARING = os.environ.get('ENABLE_INTERNAL_SHARING', 'false').lowUSE_ASR_ENDPOINT = os.environ.get('USE_ASR_ENDPOINT', 'false').lower() == 'true'ENABLE_CHUNKING = os.environ.get('ENABLE_CHUNKING', 'true').lower() == 'true'SHOW_USERNAMES_IN_UI = os.environ.get('SHOW_USERNAMES_IN_UI', 'false').lower() == 'true'+ENABLE_INCOGNITO_MODE = os.environ.get('ENABLE_INCOGNITO_MODE', 'false').lower() == 'true'# Import chunking service (will be set from app)chunking_service = None@@ -234,6 +235,7 @@ def get_config():'show_usernames_in_ui': SHOW_USERNAMES_IN_UI,'can_delete_recordings': can_delete,'users_can_delete_enabled': USERS_CAN_DELETE,+ 'enable_incognito_mode': ENABLE_INCOGNITO_MODE,**chunking_info})except Exception as e:diff --git a/src/tasks/processing.py b/src/tasks/processing.pyindex 6be45e45..fd3c030c 100644--- a/src/tasks/processing.py+++ b/src/tasks/processing.py@@ -2568,3 +2568,293 @@ def transcribe_with_chunking(app_context, recording_id, filepath, filename_for_afinally:# Cleanup is handled by tempfile.TemporaryDirectory context managerpass+++def transcribe_incognito(filepath, original_filename, language=None, min_speakers=None, max_speakers=None, user=None):+ """+ Perform transcription without any database operations.+ Used for Incognito Mode where no data is persisted.++ Args:+ filepath: Path to the audio file+ original_filename: Original filename for logging/processing+ language: Optional language code for transcription+ min_speakers: Optional minimum speakers for diarization+ max_speakers: Optional maximum speakers for diarization+ user: Optional user object for language/diarization preferences++ Returns:+ dict with transcription, title, processing_time, etc.+ """+ import time+ import mimetypes+ from src.services.transcription import get_registry, TranscriptionRequest++ start_time = time.time()+ result = {+ 'transcription': None,+ 'title': 'Incognito Recording',+ 'processing_time_seconds': 0,+ 'audio_duration_seconds': None,+ 'error': None+ }++ try:+ # Get the active connector+ registry = get_registry()+ connector = registry.get_active_connector()++ if not connector:+ raise Exception("No transcription connector available")++ connector_specs = connector.specifications+ connector_name = type(connector).__name__+ current_app.logger.info(f"[Incognito] Using transcription connector: {connector_name}")++ # Determine mime type+ mime_type = mimetypes.guess_type(original_filename)[0] or 'audio/mpeg'++ # Handle video extraction if needed+ actual_filepath = filepath+ actual_filename = original_filename+ actual_content_type = mime_type++ # Check if file is video and needs audio extraction+ try:+ is_video = is_video_file(filepath, timeout=10)+ if is_video:+ current_app.logger.info(f"[Incognito] Video detected, extracting audio...")+ audio_filepath, audio_mime_type = extract_audio_from_video(filepath, cleanup_original=False)+ actual_filepath = audio_filepath+ actual_content_type = audio_mime_type+ actual_filename = os.path.basename(audio_filepath)+ except FFProbeError as e:+ current_app.logger.warning(f"[Incognito] Failed to probe file: {e}")+ # Check by extension+ video_extensions = ['.mp4', '.mov', '.avi', '.mkv', '.webm', '.wmv', '.flv', '.m4v']+ if any(original_filename.lower().endswith(ext) for ext in video_extensions):+ audio_filepath, audio_mime_type = extract_audio_from_video(filepath, cleanup_original=False)+ actual_filepath = audio_filepath+ actual_content_type = audio_mime_type+ actual_filename = os.path.basename(audio_filepath)++ # Convert audio format if needed+ try:+ needs_chunking_check = (+ chunking_service and+ chunking_service.needs_chunking(actual_filepath, False, connector_specs)+ )++ conversion_result = convert_if_needed(+ filepath=actual_filepath,+ original_filename=actual_filename,+ needs_chunking=needs_chunking_check,+ is_asr_endpoint=False,+ delete_original=False,+ connector_specs=connector_specs+ )++ if conversion_result.was_converted:+ current_app.logger.info(f"[Incognito] Audio converted: {conversion_result.original_codec} -> {conversion_result.final_codec}")+ actual_filepath = conversion_result.output_path+ actual_content_type = conversion_result.mime_type+ actual_filename = os.path.basename(conversion_result.output_path)+ except Exception as e:+ current_app.logger.warning(f"[Incognito] Audio conversion check failed: {e}, proceeding with original")++ # Get audio duration if chunking service is available+ if chunking_service:+ try:+ result['audio_duration_seconds'] = int(chunking_service.get_audio_duration(actual_filepath))+ except Exception as e:+ current_app.logger.warning(f"[Incognito] Could not get audio duration: {e}")++ # Determine diarization settings+ should_diarize = connector.supports_diarization++ # Use user's language preference if not explicitly provided+ if language is None and user:+ language = user.transcription_language++ # Check if chunking is needed+ should_chunk = (chunking_service and+ chunking_service.needs_chunking(actual_filepath, False, connector_specs))++ current_app.logger.info(f"[Incognito] Starting transcription: diarize={should_diarize}, language={language}, chunking={should_chunk}")++ if should_chunk:+ # Use chunking for large files+ chunk_result = transcribe_chunks_with_connector(+ connector, actual_filepath, actual_filename, actual_content_type, language,+ diarize=should_diarize+ )++ if hasattr(chunk_result, 'segments') and chunk_result.segments and chunk_result.has_diarization():+ result['transcription'] = chunk_result.to_storage_format()+ else:+ result['transcription'] = chunk_result.text if hasattr(chunk_result, 'text') else chunk_result+ else:+ # Single file transcription+ with open(actual_filepath, 'rb') as audio_file:+ request = TranscriptionRequest(+ audio_file=audio_file,+ filename=actual_filename,+ mime_type=actual_content_type,+ language=language,+ diarize=should_diarize,+ min_speakers=min_speakers,+ max_speakers=max_speakers+ )++ response = connector.transcribe(request)++ if response.segments and response.has_diarization():+ result['transcription'] = response.to_storage_format()+ else:+ result['transcription'] = response.text++ result['processing_time_seconds'] = int(time.time() - start_time)+ current_app.logger.info(f"[Incognito] Transcription completed in {result['processing_time_seconds']}s")++ # Generate a title if we have transcription+ if result['transcription'] and len(result['transcription']) > 10:+ result['title'] = _generate_incognito_title(result['transcription'], user)++ return result++ except Exception as e:+ current_app.logger.error(f"[Incognito] Transcription failed: {str(e)}", exc_info=True)+ result['error'] = str(e)+ result['processing_time_seconds'] = int(time.time() - start_time)+ return result+++def _generate_incognito_title(transcription_text, user=None):+ """Generate a title for incognito recording without database storage."""+ if not client:+ return "Incognito Recording"++ try:+ # Get formatted text for LLM+ formatted_text = format_transcription_for_llm(transcription_text)+ # Limit text for title generation+ limited_text = formatted_text[:5000]++ # Get user language preference+ user_output_language = user.output_language if user else None+ language_directive = f"Please provide the title in {user_output_language}." if user_output_language else ""++ prompt_text = f"""Create a short title for this conversation:++{limited_text}++Requirements:+- Maximum 8 words+- No phrases like "Discussion about" or "Meeting on"+- Just the main topic++{language_directive}++Title:"""++ system_message_content = "You are an AI assistant that generates concise titles for audio transcriptions. Respond only with the title."+ if user_output_language:+ system_message_content += f" Ensure your response is in {user_output_language}."++ # Use call_llm_completion without user_id tracking for incognito+ completion = client.chat.completions.create(+ model=TEXT_MODEL_NAME,+ messages=[+ {"role": "system", "content": system_message_content},+ {"role": "user", "content": prompt_text}+ ],+ temperature=0.7,+ max_tokens=100+ )++ raw_response = completion.choices[0].message.content+ title = clean_llm_response(raw_response) if raw_response else None++ if title and len(title.strip()) > 0:+ return title.strip()++ except Exception as e:+ current_app.logger.warning(f"[Incognito] Title generation failed: {e}")++ return "Incognito Recording"+++def generate_incognito_summary(transcription_text, user=None):+ """Generate a summary for incognito recording without database storage."""+ if not client:+ return None++ try:+ # Get formatted text for LLM+ formatted_text = format_transcription_for_llm(transcription_text)++ # Get configurable transcript length limit+ transcript_limit = SystemSetting.get_setting('transcript_length_limit', 30000)+ if transcript_limit == -1:+ transcript_text = formatted_text+ else:+ transcript_text = formatted_text[:transcript_limit]++ # Get user preferences+ user_output_language = user.output_language if user else None+ user_summary_prompt = user.summary_prompt if user else None++ language_directive = f"IMPORTANT: You MUST provide the summary in {user_output_language}." if user_output_language else ""++ # Determine summarization instructions+ if user_summary_prompt:+ summarization_instructions = user_summary_prompt+ else:+ admin_default_prompt = SystemSetting.get_setting('admin_default_summary_prompt', None)+ if admin_default_prompt:+ summarization_instructions = admin_default_prompt+ else:+ summarization_instructions = """Generate a comprehensive summary that includes the following sections:+- **Key Issues Discussed**: A bulleted list of the main topics+- **Key Decisions Made**: A bulleted list of any decisions reached+- **Action Items**: A bulleted list of tasks assigned, including who is responsible if mentioned"""++ # Build messages+ system_message_content = "You are an AI assistant that generates comprehensive summaries for meeting transcripts. Respond only with the summary in Markdown format."+ if user_output_language:+ system_message_content += f" You MUST generate the entire summary in {user_output_language}."++ prompt_text = f"""Transcription:+\"\"\"+{transcript_text}+\"\"\"++Summarization Instructions:+{summarization_instructions}++{language_directive}"""++ current_app.logger.info(f"[Incognito] Generating summary...")++ # Use client directly without user tracking for incognito+ completion = client.chat.completions.create(+ model=TEXT_MODEL_NAME,+ messages=[+ {"role": "system", "content": system_message_content},+ {"role": "user", "content": prompt_text}+ ],+ temperature=0.5,+ max_tokens=int(os.environ.get("SUMMARY_MAX_TOKENS", "3000"))+ )++ raw_response = completion.choices[0].message.content+ summary = clean_llm_response(raw_response) if raw_response else None++ if summary:+ current_app.logger.info(f"[Incognito] Summary generated: {len(summary)} characters")+ return summary++ except Exception as e:+ current_app.logger.warning(f"[Incognito] Summary generation failed: {e}")++ return Nonediff --git a/static/js/app.modular.js b/static/js/app.modular.jsindex b09d6e80..eceafebc 100644--- a/static/js/app.modular.js+++ b/static/js/app.modular.js@@ -356,6 +356,12 @@ document.addEventListener('DOMContentLoaded', async () => {const currentMediaMetadata = ref(null);const isMediaSessionActive = ref(false);+ // --- Incognito Mode State ---+ const enableIncognitoMode = ref(false); // Server config+ const incognitoMode = ref(false);+ const incognitoRecording = ref(null);+ const incognitoProcessing = ref(false);+// --- Recording Size Monitoring ---const estimatedFileSize = ref(0);const fileSizeWarningShown = ref(false);@@ -637,6 +643,9 @@ document.addEventListener('DOMContentLoaded', async () => {notificationPermission, pushSubscription, appBadgeCount,currentMediaMetadata, isMediaSessionActive,+ // Incognito Mode+ enableIncognitoMode, incognitoMode, incognitoRecording, incognitoProcessing,+// ModalsshowEditModal, showDeleteModal, showEditTagsModal, selectedNewTagId, tagSearchFilter,showReprocessModal, showResetModal, showSpeakerModal, speakerModalTab, showShareModal, showSharesListModal,@@ -2088,6 +2097,7 @@ document.addEventListener('DOMContentLoaded', async () => {enableInternalSharing.value = config.enable_internal_sharing === true;enableArchiveToggle.value = config.enable_archive_toggle === true;showUsernamesInUI.value = config.show_usernames_in_ui === true;+ enableIncognitoMode.value = config.enable_incognito_mode === true;}} catch (error) {console.error('Failed to load config:', error);@@ -2096,6 +2106,11 @@ document.addEventListener('DOMContentLoaded', async () => {// Initialize UI settings from localStorageuiComposable.initializeUI();+ // Load incognito recording from sessionStorage if exists (only if feature is enabled)+ if (enableIncognitoMode.value) {+ uploadComposable.loadIncognitoRecording();+ }+// Initialize audio capabilitiesawait audioComposable.initializeAudio();@@ -2129,13 +2144,20 @@ document.addEventListener('DOMContentLoaded', async () => {// Visibility change handler for wake lockdocument.addEventListener('visibilitychange', audioComposable.handleVisibilityChange);- // Prevent data loss on tab close/refresh during recording+ // Prevent data loss on tab close/refresh during recording or incognito modewindow.addEventListener('beforeunload', (e) => {+ // Check for unsaved recordingif (audioComposable.hasUnsavedRecording()) {e.preventDefault();e.returnValue = ''; // Chrome requires thisreturn 'You have an unsaved recording. Are you sure you want to leave?';}+ // Check for incognito recording that would be lost+ if (uploadComposable.hasIncognitoRecording()) {+ e.preventDefault();+ e.returnValue = ''; // Chrome requires this+ return 'You have an incognito recording that will be lost. Are you sure you want to leave?';+ }});});diff --git a/static/js/modules/composables/chat.js b/static/js/modules/composables/chat.jsindex c653ab9f..f00efa02 100644--- a/static/js/modules/composables/chat.js+++ b/static/js/modules/composables/chat.js@@ -68,15 +68,35 @@ export function useChat(state, utils) {.slice(0, -1).map(msg => ({ role: msg.role, content: msg.content }));- const response = await fetch('/chat', {- method: 'POST',- headers: { 'Content-Type': 'application/json' },- body: JSON.stringify({- recording_id: selectedRecording.value.id,- message: message,- message_history: messageHistory- })- });+ // Check if this is an incognito recording+ const isIncognito = selectedRecording.value.incognito === true;+ let response;++ if (isIncognito) {+ // Use incognito chat endpoint - pass transcription directly+ response = await fetch('/api/recordings/incognito/chat', {+ method: 'POST',+ headers: { 'Content-Type': 'application/json' },+ body: JSON.stringify({+ transcription: selectedRecording.value.transcription,+ participants: selectedRecording.value.participants || '',+ notes: selectedRecording.value.notes || '',+ message: message,+ message_history: messageHistory+ })+ });+ } else {+ // Use regular chat endpoint+ response = await fetch('/chat', {+ method: 'POST',+ headers: { 'Content-Type': 'application/json' },+ body: JSON.stringify({+ recording_id: selectedRecording.value.id,+ message: message,+ message_history: messageHistory+ })+ });+ }if (!response.ok) {const errorData = await response.json();@@ -100,6 +120,10 @@ export function useChat(state, utils) {for (const line of lines) {if (line.startsWith('data: ')) {const jsonStr = line.substring(6);+ // Handle [DONE] marker from incognito endpoint+ if (jsonStr === '[DONE]') {+ return;+ }if (jsonStr) {try {const data = JSON.parse(jsonStr);@@ -130,7 +154,9 @@ export function useChat(state, utils) {scrollChatToBottom();}}- if (data.delta) {+ // Handle both 'delta' (regular) and 'content' (incognito) formats+ const textContent = data.delta || data.content;+ if (textContent) {const shouldScroll = isChatScrolledToBottom();if (isFirstChunk) {@@ -146,7 +172,7 @@ export function useChat(state, utils) {isFirstChunk = false;}- assistantMessage.content += data.delta;+ assistantMessage.content += textContent;assistantMessage.html = marked.parse(assistantMessage.content);if (shouldScroll) {diff --git a/static/js/modules/composables/recordings.js b/static/js/modules/composables/recordings.jsindex 5c872d99..1ba915cb 100644--- a/static/js/modules/composables/recordings.js+++ b/static/js/modules/composables/recordings.js@@ -3,6 +3,8 @@* Handles loading, selecting, filtering, and managing recordings*/+import * as IncognitoStorage from '../db/incognito-storage.js';+export function useRecordings(state, utils, reprocessComposable) {const {recordings, selectedRecording, isLoadingRecordings, isLoadingMore,@@ -13,7 +15,9 @@ export function useRecordings(state, utils, reprocessComposable) {availableTags, availableSpeakers, selectedTagIds, uploadLanguage, uploadMinSpeakers, uploadMaxSpeakers,useAsrEndpoint, connectorSupportsDiarization, globalError, uploadQueue, isProcessingActive, currentView,isMobileScreen, isSidebarCollapsed, isRecording, audioBlobURL,- speakerColorMap+ speakerColorMap,+ // Incognito mode+ incognitoRecording} = state;const { setGlobalError, showToast } = utils;@@ -168,6 +172,18 @@ export function useRecordings(state, utils, reprocessComposable) {}}+ // Check if switching away from incognito recording to a regular recording+ if (incognitoRecording && incognitoRecording.value &&+ selectedRecording.value?.id === 'incognito' &&+ recording?.id !== 'incognito') {+ if (!confirm('Switching to another recording will discard your incognito recording. Continue?')) {+ return;+ }+ // Clear incognito recording+ IncognitoStorage.clearIncognitoRecording();+ incognitoRecording.value = null;+ }+// Reset modal audio state when switching recordingsif (utils.resetModalAudioState) {utils.resetModalAudioState();diff --git a/static/js/modules/composables/transcription.js b/static/js/modules/composables/transcription.jsindex 5bad1c87..d3cf5f20 100644--- a/static/js/modules/composables/transcription.js+++ b/static/js/modules/composables/transcription.js@@ -402,6 +402,24 @@ export function useTranscription(state, utils) {const saveNotes = async (notes) => {if (!selectedRecording.value) return;+ // Handle incognito recordings - save to sessionStorage only+ if (selectedRecording.value.incognito) {+ selectedRecording.value.notes = notes;+ // Update sessionStorage+ try {+ const stored = sessionStorage.getItem('speakr_incognito_recording');+ if (stored) {+ const data = JSON.parse(stored);+ data.notes = notes;+ sessionStorage.setItem('speakr_incognito_recording', JSON.stringify(data));+ }+ } catch (e) {+ console.error('[Incognito] Failed to save notes to sessionStorage:', e);+ }+ showToast('Notes saved (in browser only)', 'fa-check-circle');+ return;+ }+try {const csrfToken = document.querySelector('meta[name="csrf-token"]')?.getAttribute('content');const response = await fetch(`/api/recordings/${selectedRecording.value.id}`, {diff --git a/static/js/modules/composables/upload.js b/static/js/modules/composables/upload.jsindex f6c9a7c6..47127e8f 100644--- a/static/js/modules/composables/upload.js+++ b/static/js/modules/composables/upload.js@@ -4,6 +4,7 @@*/import * as FailedUploads from '../db/failed-uploads.js';+import * as IncognitoStorage from '../db/incognito-storage.js';// Parse error message and return friendly error infofunction getFriendlyError(errorMessage) {@@ -35,7 +36,11 @@ export function useUpload(state, utils) {recordings, selectedRecording, totalRecordings, globalError,selectedTagIds, uploadLanguage, uploadMinSpeakers, uploadMaxSpeakers,useAsrEndpoint, connectorSupportsDiarization, asrLanguage, asrMinSpeakers, asrMaxSpeakers,- dragover, availableTags, uploadTagSearchFilter+ dragover, availableTags, uploadTagSearchFilter,+ // Incognito mode state+ incognitoMode, incognitoRecording, incognitoProcessing,+ // View state+ currentView} = state;const { computed, nextTick, ref } = Vue;@@ -726,6 +731,182 @@ export function useUpload(state, utils) {);});+ // === INCOGNITO MODE FUNCTIONS ===++ /**+ * Upload and process a file in incognito mode.+ * The file is processed synchronously and no data is saved to the database.+ * Results are stored only in sessionStorage.+ */+ const startIncognitoUpload = async () => {+ const pendingFiles = uploadQueue.value.filter(item => item.status === 'queued');+ if (pendingFiles.length === 0) {+ return;+ }++ // Only process the first file for incognito mode+ const fileItem = pendingFiles[0];++ // Check if incognito mode state is available+ if (!incognitoMode || !incognitoProcessing || !incognitoRecording) {+ console.warn('[Incognito] Incognito state not available, falling back to normal upload');+ startUpload();+ return;+ }++ incognitoProcessing.value = true;+ processingMessage.value = 'Processing in incognito mode...';+ processingProgress.value = 10;+ progressPopupMinimized.value = false;+ progressPopupClosed.value = false;++ try {+ const formData = new FormData();+ formData.append('file', fileItem.file);++ // Add ASR options+ const asrOpts = fileItem.asrOptions || {};+ const language = asrOpts.language || uploadLanguage.value;+ const minSpeakers = asrOpts.min_speakers || uploadMinSpeakers.value;+ const maxSpeakers = asrOpts.max_speakers || uploadMaxSpeakers.value;++ if (language) {+ formData.append('language', language);+ }+ if (minSpeakers && minSpeakers !== '') {+ formData.append('min_speakers', minSpeakers.toString());+ }+ if (maxSpeakers && maxSpeakers !== '') {+ formData.append('max_speakers', maxSpeakers.toString());+ }++ // Request auto-summarization+ formData.append('auto_summarize', 'true');++ processingMessage.value = 'Uploading file for incognito processing...';+ processingProgress.value = 20;++ console.log('[Incognito] Uploading file:', fileItem.file.name);++ const response = await fetch('/api/recordings/incognito', {+ method: 'POST',+ body: formData+ });++ processingProgress.value = 50;++ // Parse response+ const contentType = response.headers.get('content-type') || '';+ if (!contentType.includes('application/json')) {+ const text = await response.text();+ const titleMatch = text.match(/<title>([^<]+)<\/title>/i);+ throw new Error(titleMatch?.[1] || `Server error (${response.status})`);+ }++ const data = await response.json();++ if (!response.ok || data.error) {+ throw new Error(data.error || `Processing failed with status ${response.status}`);+ }++ processingProgress.value = 80;+ processingMessage.value = 'Processing complete!';++ // Store result in sessionStorage+ const incognitoData = {+ id: 'incognito',+ incognito: true,+ title: data.title || 'Incognito Recording',+ transcription: data.transcription,+ summary: data.summary,+ summary_html: data.summary_html,+ created_at: data.created_at,+ original_filename: data.original_filename,+ file_size: data.file_size,+ audio_duration_seconds: data.audio_duration_seconds,+ processing_time_seconds: data.processing_time_seconds,+ status: 'COMPLETED'+ };++ IncognitoStorage.saveIncognitoRecording(incognitoData);+ incognitoRecording.value = incognitoData;++ // Remove the processed file from queue+ const index = uploadQueue.value.findIndex(item => item.clientId === fileItem.clientId);+ if (index !== -1) {+ uploadQueue.value.splice(index, 1);+ }++ processingProgress.value = 100;+ processingMessage.value = 'Incognito recording ready!';++ // Auto-select the incognito recording and switch to detail view+ selectedRecording.value = incognitoData;+ currentView.value = 'detail';++ // Show toast+ showToast('Incognito recording processed - data will be lost when tab closes', 'fa-user-secret');++ console.log('[Incognito] Processing complete');++ } catch (error) {+ console.error('[Incognito] Processing failed:', error);+ const friendlyErr = getFriendlyError(error.message);+ setGlobalError(`${friendlyErr.title}: ${friendlyErr.guidance}`);+ fileItem.status = 'failed';+ fileItem.error = error.message;+ } finally {+ incognitoProcessing.value = false;+ processingProgress.value = 0;+ processingMessage.value = '';+ }+ };++ /**+ * Clear the incognito recording with confirmation+ */+ const clearIncognitoRecordingWithConfirm = () => {+ if (incognitoRecording && incognitoRecording.value) {+ if (confirm('This will permanently discard your incognito recording. Continue?')) {+ IncognitoStorage.clearIncognitoRecording();+ incognitoRecording.value = null;+ // If the incognito recording was selected, clear selection+ if (selectedRecording.value?.id === 'incognito') {+ selectedRecording.value = null;+ }+ showToast('Incognito recording discarded', 'fa-trash');+ }+ }+ };++ /**+ * Select the incognito recording for viewing+ */+ const selectIncognitoRecording = () => {+ if (incognitoRecording && incognitoRecording.value) {+ selectedRecording.value = incognitoRecording.value;+ currentView.value = 'detail';+ }+ };++ /**+ * Load incognito recording from sessionStorage on app init+ */+ const loadIncognitoRecording = () => {+ const stored = IncognitoStorage.getIncognitoRecording();+ if (stored && incognitoRecording) {+ incognitoRecording.value = stored;+ console.log('[Incognito] Loaded recording from sessionStorage');+ }+ };++ /**+ * Check if there's an incognito recording (for navigation guards)+ */+ const hasIncognitoRecording = () => {+ return IncognitoStorage.hasIncognitoRecording();+ };+return {handleDragOver,handleDragLeave,@@ -753,6 +934,12 @@ export function useUpload(state, utils) {handleTagDragEnd,handleTagTouchStart,handleTagTouchMove,- handleTagTouchEnd+ handleTagTouchEnd,+ // Incognito mode+ startIncognitoUpload,+ clearIncognitoRecordingWithConfirm,+ selectIncognitoRecording,+ loadIncognitoRecording,+ hasIncognitoRecording};}diff --git a/static/js/modules/db/incognito-storage.js b/static/js/modules/db/incognito-storage.jsnew file mode 100644index 00000000..4f44f6f4--- /dev/null+++ b/static/js/modules/db/incognito-storage.js@@ -0,0 +1,76 @@+/**+ * Incognito Mode storage utilities+ * Uses sessionStorage for temporary storage that auto-clears when tab closes+ */++const INCOGNITO_KEY = 'speakr_incognito_recording';++/**+ * Save incognito recording data to sessionStorage+ * @param {Object} data - Recording data including transcription, summary, title+ */+export function saveIncognitoRecording(data) {+ try {+ sessionStorage.setItem(INCOGNITO_KEY, JSON.stringify(data));+ console.log('[Incognito] Recording saved to sessionStorage');+ } catch (e) {+ console.error('[Incognito] Failed to save recording:', e);+ }+}++/**+ * Get incognito recording data from sessionStorage+ * @returns {Object|null} Recording data or null if not found+ */+export function getIncognitoRecording() {+ try {+ const data = sessionStorage.getItem(INCOGNITO_KEY);+ return data ? JSON.parse(data) : null;+ } catch (e) {+ console.error('[Incognito] Failed to retrieve recording:', e);+ return null;+ }+}++/**+ * Clear incognito recording from sessionStorage+ */+export function clearIncognitoRecording() {+ try {+ sessionStorage.removeItem(INCOGNITO_KEY);+ console.log('[Incognito] Recording cleared from sessionStorage');+ } catch (e) {+ console.error('[Incognito] Failed to clear recording:', e);+ }+}++/**+ * Check if an incognito recording exists+ * @returns {boolean}+ */+export function hasIncognitoRecording() {+ try {+ return sessionStorage.getItem(INCOGNITO_KEY) !== null;+ } catch (e) {+ return false;+ }+}++/**+ * Update specific fields of the incognito recording+ * @param {Object} updates - Fields to update+ */+export function updateIncognitoRecording(updates) {+ try {+ const existing = getIncognitoRecording();+ if (existing) {+ const updated = { ...existing, ...updates };+ saveIncognitoRecording(updated);+ return updated;+ }+ return null;+ } catch (e) {+ console.error('[Incognito] Failed to update recording:', e);+ return null;+ }+}diff --git a/static/js/modules/state/core.js b/static/js/modules/state/core.jsindex a7946b7c..857c0458 100644--- a/static/js/modules/state/core.js+++ b/static/js/modules/state/core.js@@ -47,6 +47,12 @@ export function createCoreState(ref, computed) {const enableArchiveToggle = ref(false);const showUsernamesInUI = ref(false);+ // --- Incognito Mode State ---+ const enableIncognitoMode = ref(false); // Server config - whether feature is available+ const incognitoMode = ref(false); // User toggle - whether to use incognito for current upload+ const incognitoRecording = ref(null);+ const incognitoProcessing = ref(false);+// Tag Selectionconst availableTags = ref([]);const selectedTagIds = ref([]);@@ -135,6 +141,12 @@ export function createCoreState(ref, computed) {filteredRecordings,// Speakers- availableSpeakers+ availableSpeakers,++ // Incognito Mode+ enableIncognitoMode,+ incognitoMode,+ incognitoRecording,+ incognitoProcessing};}diff --git a/templates/components/detail-view.html b/templates/components/detail-view.htmlindex db6358f5..cdd1cb1b 100644--- a/templates/components/detail-view.html+++ b/templates/components/detail-view.html@@ -1,5 +1,27 @@<!-- Detail View Container --><div v-if="currentView === 'detail' && selectedRecording" class="flex-1 flex flex-col overflow-hidden">+ <!-- Incognito Mode Indicator Bar -->+ <div v-if="selectedRecording.incognito" class="bg-gradient-to-r from-violet-500/10 via-purple-500/10 to-violet-500/10 border-b border-violet-300/30 dark:border-violet-500/30 px-4 py-2 flex-shrink-0">+ <div class="flex items-center justify-between gap-4 max-w-4xl mx-auto">+ <div class="flex items-center gap-3">+ <div class="w-7 h-7 rounded-full bg-gradient-to-br from-violet-500 to-purple-600 flex items-center justify-center">+ <i class="fas fa-user-secret text-white text-xs"></i>+ </div>+ <div class="flex items-center gap-2 flex-wrap">+ <span class="text-sm font-medium text-violet-700 dark:text-violet-300">Incognito</span>+ <span class="text-xs text-violet-600/80 dark:text-violet-400/80">+ • Session only • Not saved to account+ </span>+ </div>+ </div>+ <button @click="clearIncognitoRecordingWithConfirm"+ class="flex-shrink-0 px-2.5 py-1 text-xs font-medium text-violet-600 dark:text-violet-400 hover:text-red-600 dark:hover:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded transition-colors"+ title="Discard this recording">+ <i class="fas fa-times"></i>+ </button>+ </div>+ </div>+<!-- Mobile View --><div v-if="isMobile" class="flex flex-col h-full overflow-hidden">{% include 'components/detail/mobile-header.html' %}diff --git a/templates/components/detail/desktop-header.html b/templates/components/detail/desktop-header.htmlindex 10ce3d96..1a8ed62c 100644--- a/templates/components/detail/desktop-header.html+++ b/templates/components/detail/desktop-header.html@@ -41,53 +41,69 @@<!-- Action Buttons --><div class="flex items-center gap-2 ml-4">- <button @click="toggleInbox(selectedRecording)"- class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors"- :class="selectedRecording.is_inbox ? 'text-blue-500' : ''"- :title="selectedRecording.is_inbox ? 'Mark as Read' : 'Move to Inbox'">- <i class="fas fa-inbox"></i>- </button>- <button @click="toggleHighlight(selectedRecording)"- class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors"- :class="selectedRecording.is_highlighted ? 'text-yellow-500' : ''"- :title="selectedRecording.is_highlighted ? 'Remove Highlight' : 'Highlight'">- <i class="fas fa-star"></i>- </button>- <button @click="editRecordingTags(selectedRecording)"- class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors"- :title="t('buttons.editTags')">- <i class="fas fa-tags"></i>- </button>- <button @click="confirmReprocess('transcription', selectedRecording)" v-if="selectedRecording && selectedRecording.can_edit !== false && (selectedRecording.status === 'COMPLETED' || selectedRecording.status === 'FAILED')"- class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors"- :title="useAsrEndpoint ? 'Reprocess with ASR' : 'Reprocess transcription'">- <i class="fas fa-redo-alt"></i>- </button>- <button @click="confirmReprocess('summary', selectedRecording)" v-if="selectedRecording && selectedRecording.can_edit !== false && (selectedRecording.status === 'COMPLETED' || selectedRecording.status === 'FAILED')"- class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors"- :title="t('buttons.reprocessSummary')">- <i class="fas fa-sync-alt"></i>- </button>- <button @click="confirmReset(selectedRecording)" v-if="['PENDING', 'PROCESSING', 'SUMMARIZING', 'FAILED'].includes(selectedRecording.status)"- class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors text-orange-500"- :title="t('buttons.resetStuckProcessing')">- <i class="fas fa-undo"></i>- </button>- <button @click="openSpeakerModal" v-if="processedTranscription.hasDialogue"- class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors"- :title="t('buttons.identifySpeakers')">- <i class="fas fa-user-tag"></i>- </button>- <button v-if="!selectedRecording.is_shared || (selectedRecording.share_info && selectedRecording.share_info.can_reshare)"- @click="openUnifiedShareModal(selectedRecording)"- class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors"- :title="t('buttons.shareRecording')">- <i class="fas fa-share-alt"></i>- </button>- <button v-if="canDeleteRecordings && selectedRecording.can_delete !== false" @click="confirmDelete(selectedRecording)"- class="p-2 rounded-lg hover:bg-[var(--bg-danger-light)] text-[var(--text-danger)] transition-colors">- <i class="fas fa-trash"></i>- </button>+ <!-- Incognito recordings have limited actions -->+ <template v-if="!selectedRecording.incognito">+ <button @click="toggleInbox(selectedRecording)"+ class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors"+ :class="selectedRecording.is_inbox ? 'text-blue-500' : ''"+ :title="selectedRecording.is_inbox ? 'Mark as Read' : 'Move to Inbox'">+ <i class="fas fa-inbox"></i>+ </button>+ <button @click="toggleHighlight(selectedRecording)"+ class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors"+ :class="selectedRecording.is_highlighted ? 'text-yellow-500' : ''"+ :title="selectedRecording.is_highlighted ? 'Remove Highlight' : 'Highlight'">+ <i class="fas fa-star"></i>+ </button>+ <button @click="editRecordingTags(selectedRecording)"+ class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors"+ :title="t('buttons.editTags')">+ <i class="fas fa-tags"></i>+ </button>+ <button @click="confirmReprocess('transcription', selectedRecording)" v-if="selectedRecording && selectedRecording.can_edit !== false && (selectedRecording.status === 'COMPLETED' || selectedRecording.status === 'FAILED')"+ class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors"+ :title="useAsrEndpoint ? 'Reprocess with ASR' : 'Reprocess transcription'">+ <i class="fas fa-redo-alt"></i>+ </button>+ <button @click="confirmReprocess('summary', selectedRecording)" v-if="selectedRecording && selectedRecording.can_edit !== false && (selectedRecording.status === 'COMPLETED' || selectedRecording.status === 'FAILED')"+ class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors"+ :title="t('buttons.reprocessSummary')">+ <i class="fas fa-sync-alt"></i>+ </button>+ <button @click="confirmReset(selectedRecording)" v-if="['PENDING', 'PROCESSING', 'SUMMARIZING', 'FAILED'].includes(selectedRecording.status)"+ class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors text-orange-500"+ :title="t('buttons.resetStuckProcessing')">+ <i class="fas fa-undo"></i>+ </button>+ <button @click="openSpeakerModal" v-if="processedTranscription.hasDialogue"+ class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors"+ :title="t('buttons.identifySpeakers')">+ <i class="fas fa-user-tag"></i>+ </button>+ <button v-if="!selectedRecording.is_shared || (selectedRecording.share_info && selectedRecording.share_info.can_reshare)"+ @click="openUnifiedShareModal(selectedRecording)"+ class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors"+ :title="t('buttons.shareRecording')">+ <i class="fas fa-share-alt"></i>+ </button>+ <button v-if="canDeleteRecordings && selectedRecording.can_delete !== false" @click="confirmDelete(selectedRecording)"+ class="p-2 rounded-lg hover:bg-[var(--bg-danger-light)] text-[var(--text-danger)] transition-colors">+ <i class="fas fa-trash"></i>+ </button>+ </template>++ <!-- Incognito mode: only show discard button -->+ <template v-else>+ <span class="text-xs text-amber-600 dark:text-amber-400 mr-2">+ <i class="fas fa-user-secret mr-1"></i>+ Incognito+ </span>+ <button @click="clearIncognitoRecordingWithConfirm"+ class="p-2 rounded-lg hover:bg-red-100 dark:hover:bg-red-900/30 text-red-600 dark:text-red-400 transition-colors"+ title="Discard incognito recording">+ <i class="fas fa-trash"></i>+ </button>+ </template></div></div>diff --git a/templates/components/detail/mobile-header.html b/templates/components/detail/mobile-header.htmlindex 73e04c17..3dbd2fc3 100644--- a/templates/components/detail/mobile-header.html+++ b/templates/components/detail/mobile-header.html@@ -93,15 +93,31 @@</div><!-- Action Buttons --><div class="flex items-center gap-2 overflow-x-auto pb-2">- <button @click="toggleInbox(selectedRecording)" class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors" :class="selectedRecording.is_inbox ? 'text-blue-500' : ''"><i class="fas fa-inbox"></i></button>- <button @click="toggleHighlight(selectedRecording)" class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors" :class="selectedRecording.is_highlighted ? 'text-yellow-500' : ''"><i class="fas fa-star"></i></button>- <button @click="editRecordingTags(selectedRecording)" class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors"><i class="fas fa-tags"></i></button>- <button @click="confirmReprocess('transcription', selectedRecording)" v-if="selectedRecording && selectedRecording.can_edit !== false && (selectedRecording.status === 'COMPLETED' || selectedRecording.status === 'FAILED')" class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors"><i class="fas fa-redo-alt"></i></button>- <button @click="confirmReprocess('summary', selectedRecording)" v-if="selectedRecording && selectedRecording.can_edit !== false && (selectedRecording.status === 'COMPLETED' || selectedRecording.status === 'FAILED')" class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors"><i class="fas fa-sync-alt"></i></button>- <button @click="confirmReset(selectedRecording)" v-if="['PENDING', 'PROCESSING', 'SUMMARIZING', 'FAILED'].includes(selectedRecording.status)" class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors text-orange-500"><i class="fas fa-undo"></i></button>- <button @click="openSpeakerModal" v-if="processedTranscription.hasDialogue" class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors"><i class="fas fa-user-tag"></i></button>- <button v-if="!selectedRecording.is_shared || (selectedRecording.share_info && selectedRecording.share_info.can_reshare)" @click="openUnifiedShareModal(selectedRecording)" class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors"><i class="fas fa-share-alt"></i></button>- <button v-if="canDeleteRecordings && selectedRecording.can_delete !== false" @click="confirmDelete(selectedRecording)" class="p-2 rounded-lg hover:bg-[var(--bg-danger-light)] text-[var(--text-danger)] transition-colors"><i class="fas fa-trash"></i></button>+ <!-- Incognito recordings have limited actions -->+ <template v-if="!selectedRecording.incognito">+ <button @click="toggleInbox(selectedRecording)" class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors" :class="selectedRecording.is_inbox ? 'text-blue-500' : ''"><i class="fas fa-inbox"></i></button>+ <button @click="toggleHighlight(selectedRecording)" class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors" :class="selectedRecording.is_highlighted ? 'text-yellow-500' : ''"><i class="fas fa-star"></i></button>+ <button @click="editRecordingTags(selectedRecording)" class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors"><i class="fas fa-tags"></i></button>+ <button @click="confirmReprocess('transcription', selectedRecording)" v-if="selectedRecording && selectedRecording.can_edit !== false && (selectedRecording.status === 'COMPLETED' || selectedRecording.status === 'FAILED')" class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors"><i class="fas fa-redo-alt"></i></button>+ <button @click="confirmReprocess('summary', selectedRecording)" v-if="selectedRecording && selectedRecording.can_edit !== false && (selectedRecording.status === 'COMPLETED' || selectedRecording.status === 'FAILED')" class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors"><i class="fas fa-sync-alt"></i></button>+ <button @click="confirmReset(selectedRecording)" v-if="['PENDING', 'PROCESSING', 'SUMMARIZING', 'FAILED'].includes(selectedRecording.status)" class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors text-orange-500"><i class="fas fa-undo"></i></button>+ <button @click="openSpeakerModal" v-if="processedTranscription.hasDialogue" class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors"><i class="fas fa-user-tag"></i></button>+ <button v-if="!selectedRecording.is_shared || (selectedRecording.share_info && selectedRecording.share_info.can_reshare)" @click="openUnifiedShareModal(selectedRecording)" class="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors"><i class="fas fa-share-alt"></i></button>+ <button v-if="canDeleteRecordings && selectedRecording.can_delete !== false" @click="confirmDelete(selectedRecording)" class="p-2 rounded-lg hover:bg-[var(--bg-danger-light)] text-[var(--text-danger)] transition-colors"><i class="fas fa-trash"></i></button>+ </template>++ <!-- Incognito mode: only show discard button -->+ <template v-else>+ <span class="text-xs text-amber-600 dark:text-amber-400 px-2">+ <i class="fas fa-user-secret mr-1"></i>+ Incognito Mode+ </span>+ <button @click="clearIncognitoRecordingWithConfirm"+ class="p-2 rounded-lg hover:bg-red-100 dark:hover:bg-red-900/30 text-red-600 dark:text-red-400 transition-colors"+ title="Discard incognito recording">+ <i class="fas fa-trash"></i>+ </button>+ </template></div></div></div>diff --git a/templates/components/sidebar.html b/templates/components/sidebar.htmlindex a459c8b6..fcb810d9 100644--- a/templates/components/sidebar.html+++ b/templates/components/sidebar.html@@ -247,6 +247,48 @@loadMoreRecordings();}}">++ <!-- Incognito Recording (styled like a regular recording item with a subtle indicator) -->+ <div v-if="enableIncognitoMode && incognitoRecording"+ @click="selectIncognitoRecording"+ :class="[+ 'group mb-3 p-3 rounded-lg cursor-pointer transition-all duration-200',+ selectedRecording?.id === 'incognito'+ ? 'bg-[var(--bg-accent)] border-l-4 border-[var(--border-accent)]'+ : 'bg-[var(--bg-secondary)] hover:bg-[var(--bg-tertiary)] border-l-4 border-transparent hover:border-[var(--border-secondary)]'+ ]">+ <div class="flex items-start justify-between gap-2">+ <div class="flex-1 min-w-0">+ <div class="flex items-center gap-2 mb-1">+ <span class="font-medium text-sm text-[var(--text-primary)] truncate">+ ${ incognitoRecording.title || 'Incognito Recording' }+ </span>+ </div>+ <div class="flex items-center gap-2 flex-wrap">+ <!-- Incognito pill badge (matches tag style with contrasting border) -->+ <span class="inline-flex items-center px-1.5 py-0.5 rounded-md text-xs font-medium bg-violet-500/15 dark:bg-violet-500/25 text-violet-700 dark:text-violet-300 ring-1 ring-violet-400/50 dark:ring-violet-500/50">+ <i class="fas fa-user-secret mr-1" style="font-size: 9px;"></i>+ Incognito+ </span>+ <!-- Duration pill -->+ <span v-if="incognitoRecording.audio_duration_seconds" class="inline-flex items-center px-1.5 py-0.5 rounded text-[10px] text-[var(--text-muted)] bg-[var(--bg-tertiary)]">+ <i class="fas fa-clock mr-1" style="font-size: 8px;"></i>+ ${ Math.floor(incognitoRecording.audio_duration_seconds / 60) }:${ String(incognitoRecording.audio_duration_seconds % 60).padStart(2, '0') }+ </span>+ </div>+ <p class="text-[10px] text-[var(--text-muted)] mt-1.5 opacity-70">+ <i class="fas fa-eye-slash mr-1"></i>+ Session only+ </p>+ </div>+ <button @click.stop="clearIncognitoRecordingWithConfirm"+ class="opacity-0 group-hover:opacity-100 p-1.5 text-[var(--text-muted)] hover:text-red-500 hover:bg-red-500/10 rounded transition-all"+ title="Discard">+ <i class="fas fa-times text-xs"></i>+ </button>+ </div>+ </div>+<div v-if="isLoadingRecordings && recordings.length === 0" class="text-center py-8"><i class="fas fa-spinner fa-spin text-2xl text-[var(--text-muted)]"></i><p class="mt-2 text-[var(--text-muted)]" v-text="t('help.loadingRecordings')"></p>diff --git a/templates/components/upload-view.html b/templates/components/upload-view.htmlindex d408e62b..4cb7c747 100644--- a/templates/components/upload-view.html+++ b/templates/components/upload-view.html@@ -42,12 +42,75 @@</button></div></div>- <!-- Upload Button -->- <button @click="startUpload"- class="w-full mt-2 px-4 py-2.5 bg-[var(--bg-button)] text-[var(--text-button)] rounded-lg hover:bg-[var(--bg-button-hover)] transition-colors flex items-center justify-center gap-2 font-medium text-sm">- <i class="fas fa-cloud-upload-alt"></i>- <span>Upload ${pendingQueueFiles.length} File${pendingQueueFiles.length !== 1 ? 's' : ''}</span>- </button>++ <!-- Incognito Mode Toggle (only shown if feature is enabled via ENABLE_INCOGNITO_MODE env var) -->+ <div v-if="enableIncognitoMode" class="mt-3">+ <button @click="incognitoMode = !incognitoMode"+ :class="[+ 'w-full flex items-center justify-between px-3 py-2.5 rounded-lg border transition-all duration-200',+ incognitoMode+ ? 'bg-gradient-to-r from-violet-500/10 to-purple-500/10 border-violet-400/50 dark:border-violet-500/50'+ : 'bg-[var(--bg-tertiary)] border-[var(--border-secondary)] hover:border-[var(--border-focus)]'+ ]">+ <div class="flex items-center gap-3">+ <div :class="[+ 'w-8 h-8 rounded-full flex items-center justify-center transition-all',+ incognitoMode+ ? 'bg-gradient-to-br from-violet-500 to-purple-600 text-white'+ : 'bg-[var(--bg-secondary)] text-[var(--text-muted)]'+ ]">+ <i class="fas fa-user-secret text-sm"></i>+ </div>+ <div class="text-left">+ <span :class="['text-sm font-medium', incognitoMode ? 'text-violet-700 dark:text-violet-300' : 'text-[var(--text-secondary)]']">+ Incognito Mode+ </span>+ <p v-if="!incognitoMode" class="text-[10px] text-[var(--text-muted)]">+ Process without saving+ </p>+ <p v-else class="text-[10px] text-violet-600 dark:text-violet-400">+ Session only • Not saved to account+ </p>+ </div>+ </div>+ <div :class="[+ 'w-10 h-5 rounded-full relative transition-all duration-200',+ incognitoMode ? 'bg-gradient-to-r from-violet-500 to-purple-500' : 'bg-[var(--bg-secondary)]'+ ]">+ <div :class="[+ 'absolute top-0.5 w-4 h-4 rounded-full bg-white shadow transition-all duration-200',+ incognitoMode ? 'left-5' : 'left-0.5'+ ]"></div>+ </div>+ </button>+ </div>++ <!-- Upload Buttons -->+ <div class="mt-2 space-y-2">+ <!-- Normal Upload Button (when not in incognito mode or feature disabled) -->+ <button v-if="!incognitoMode || !enableIncognitoMode"+ @click="startUpload"+ class="w-full px-4 py-2.5 bg-[var(--bg-button)] text-[var(--text-button)] rounded-lg hover:bg-[var(--bg-button-hover)] transition-colors flex items-center justify-center gap-2 font-medium text-sm">+ <i class="fas fa-cloud-upload-alt"></i>+ <span>Upload ${pendingQueueFiles.length} File${pendingQueueFiles.length !== 1 ? 's' : ''}</span>+ </button>++ <!-- Incognito Upload Button (only when feature enabled and mode selected) -->+ <button v-else-if="enableIncognitoMode && incognitoMode"+ @click="startIncognitoUpload"+ :disabled="incognitoProcessing || pendingQueueFiles.length !== 1"+ class="w-full px-4 py-2.5 bg-gradient-to-r from-violet-500 to-purple-600 text-white rounded-lg hover:from-violet-600 hover:to-purple-700 disabled:opacity-50 disabled:cursor-not-allowed transition-all flex items-center justify-center gap-2 font-medium text-sm shadow-sm">+ <i :class="incognitoProcessing ? 'fas fa-spinner fa-spin' : 'fas fa-user-secret'"></i>+ <span v-if="incognitoProcessing">Processing...</span>+ <span v-else-if="pendingQueueFiles.length !== 1">Select exactly 1 file</span>+ <span v-else>Process in Incognito</span>+ </button>++ <p v-if="enableIncognitoMode && incognitoMode && pendingQueueFiles.length > 1" class="text-xs text-violet-600 dark:text-violet-400 text-center">+ <i class="fas fa-info-circle mr-1"></i>+ Incognito mode supports one file at a time+ </p>+ </div></div><!-- Divider (hidden when files are selected) -->