**Motivations :**
- WebAuthn window not appearing due to button visibility issues
- Add debug logging to troubleshoot authentication flow
- Ensure authentication button is clearly visible to user
- Improve user experience with better styling and feedback
**Modifications :**
- Added inline styles to authentication button for better visibility
- Added comprehensive debug logging to track button creation and click events
- Improved button styling with centered layout and clear visual hierarchy
- Added error handling for missing DOM elements
- Enhanced user feedback with clear instructions
**Pages affectées :**
- src/pages/home/home.ts: Enhanced button visibility and debug logging
**Motivations :**
- WebAuthn requires user gesture (click) to work properly
- Fix WebAssembly serialization error 'invalid type: sequence, expected a map'
- Provide clear UI for user to trigger WebAuthn authentication
- Ensure proper error handling for authentication failures
**Modifications :**
- Added authentication button in home.ts that requires user click for WebAuthn
- Fixed WebAssembly members parameter to pass object map instead of array
- Added CSS styles for authentication button with hover effects
- Improved error handling and user feedback for authentication process
- Maintained user interaction requirement for WebAuthn security
**Pages affectées :**
- src/pages/home/home.ts: Added user interaction button for WebAuthn
- src/services/service.ts: Fixed WebAssembly serialization to use object map
- src/4nk.css: Added authentication button styles with responsive design
**Motivations :**
- Remove the manual 'Authenticate with Browser' button that was reappearing
- Restore automatic WebAuthn authentication flow as requested by user
- Ensure seamless user experience without manual intervention
**Modifications :**
- Removed dynamic button creation in sp-address.utils.ts onCreateButtonClick()
- Changed WebAuthn flow from manual button click to automatic trigger
- Updated status message from 'Click to authenticate' to 'Authenticating with browser...'
- Simplified WebAuthn authentication to be automatic without user gesture requirement
**Pages affectées :**
- src/utils/sp-address.utils.ts: Removed manual button creation and restored auto WebAuthn
**Motivations :**
- WebAssembly expects array (sequence) but was receiving object (map) for members parameter
- Error: 'invalid type: map, expected a sequence at line 1 column 86'
**Modifications :**
- Convert getAllMembers() object to array using Object.values() before passing to WebAssembly
- Fixed in createProcess, createPrdUpdate, createResponsePrd, validateState, parseCipher, parseNewTx, requestData
- Added debug logging for members array length
**Pages affectées :**
- src/services/service.ts
**Motivations :**
- User wants clearer message when authentication is pending
- Instead of 'Authentication failed', indicate that we're waiting for user validation
**Modifications :**
- Changed error message from '❌ Authentication failed' to '⏳ Waiting for user to validate secure key access...'
- Changed color from error-color to info-color to be less alarming
- Message is now in English as requested
**Pages affectées :**
- src/pages/home/home.ts
**Motivations :**
- Process display is not needed at this stage and clutters the interface
- User feedback indicates it's ugly and unnecessary
**Modifications :**
- Removed displayExistingProcesses() function calls from handleMainPairing()
- Removed displayExistingProcesses() function calls from initHomePage()
- Deleted the entire displayExistingProcesses() function
- Simplified interface to focus on core pairing functionality
**Pages affectées :**
- src/pages/home/home.ts
**Motivations :**
- Interface was lagging when adding processes one by one
- Need to display all processes at once in a simple format
**Modifications :**
- Changed from adding processes one by one to building all messages first
- Display all processes in a single div with pre-line formatting
- Use simple text concatenation instead of DOM manipulation loops
**Pages affectées :**
- src/pages/home/home.ts
**Motivations :**
- User wants each process displayed as a separate message, not all together
- Each process should be added individually to the status field
**Modifications :**
- Changed from joining all messages to displaying each process individually
- Each process is added as a separate line with <br> tag
- Messages are accumulated in the status field one by one
**Pages affectées :**
- src/pages/home/home.ts
**Motivations :**
- User wants simple text messages, one per line, not complex UI
- Simplify the process display to basic text format
**Modifications :**
- Changed from complex HTML cards to simple text messages
- Each process displayed as one line of text with basic info
- Messages joined with newlines and displayed in monospace font
- Removed complex styling and containers
**Pages affectées :**
- src/pages/home/home.ts
**Motivations :**
- User wants to see each retrieved process displayed as a message in the status field
- Need to show process information after authentication or initialization
**Modifications :**
- Added displayExistingProcesses() function to fetch and display processes
- Modified handleMainPairing() to call displayExistingProcesses() after authentication
- Modified initHomePage() to display processes even if authentication fails
- Each process shows: ID (truncated), states count, members count, last update
- Processes displayed in scrollable container with styled cards
**Pages affectées :**
- src/pages/home/home.ts
**Motivations :**
- Application initializes but doesn't display anything after service initialization
- Need to identify where navigation fails in the router flow
**Modifications :**
- Added debug logs to navigate() function to track path processing
- Added debug logs to handleLocation() function to track route handling
- Added debug logs to home route processing to track component creation
- Added debug logs to navigation completion in init() function
**Pages affectées :**
- src/router.ts
**Motivations :**
- Fix blank page after account deletion
- Ensure home page is properly initialized when navigating to home
- Add proper initialization call after login-4nk-component creation
**Modifications :**
- Added initHomePage() call after login-4nk-component is added to DOM
- Added error handling for home page initialization
- Added debug logs to track initialization process
**Pages affectées :**
- src/router.ts - Added home page initialization in handleLocation
**Motivations :**
- Fix misleading 'Authentication completed successfully' message
- Ensure WebAuthn is actually triggered, not just pairing process
- Provide accurate status messages for WebAuthn operations
**Modifications :**
- Import secureCredentialsService directly in handleMainPairing
- Check for existing credentials and trigger appropriate WebAuthn flow
- Separate status messages for credential decryption vs creation
- Only show success message after actual WebAuthn completion
**Pages affectées :**
- src/pages/home/home.ts - Fixed WebAuthn triggering logic
**Motivations :**
- Fix TypeError: process.states is not iterable error
- Ensure process.states is an array before iteration
- Prevent runtime errors during handshake processing
**Modifications :**
- Added Array.isArray() check before iterating over process.states
- Added warning log when process.states is not an array
- Continue to next process if states is not iterable
**Pages affectées :**
- src/services/service.ts - Fixed process.states iteration safety
**Motivations :**
- Fix JSON parsing error in parseNewTx method
- Fix process.states iteration error in handleHandshakeMsg
- Add debugging for WASM serialization issues
- Improve error handling for malformed data structures
**Modifications :**
- Fixed parseNewTx to handle both string and object inputs
- Added Array.isArray check for process.states before iteration
- Added debug logging for members data in createProcess
- Enhanced error handling for WebSocket message processing
**Pages affectées :**
- src/services/service.ts - Fixed parsing and iteration errors
**Motivations :**
- Simplify user experience with single authentication flow
- Remove confusing mode selection interface
- Hide 4 words display (will be used later in interface)
- Direct WebAuthn authentication for both new and existing pairings
**Modifications :**
- Replaced mode selection with single pairing interface
- Added logic to detect existing credentials vs new pairing
- Removed 4 words display from pairing process
- Simplified HTML structure with single main interface
- Updated JavaScript logic for direct WebAuthn flow
**Pages affectées :**
- src/pages/home/home.html - Simplified to single interface
- src/pages/home/home.ts - Added direct WebAuthn flow logic
- src/utils/sp-address.utils.ts - Removed 4 words display
**Motivations :**
- Improve user experience with clear role selection
- Add intuitive interface to choose between creator and joiner modes
- Provide easy navigation between modes
**Modifications :**
- Added mode selection screen with two main buttons
- Added back buttons to return to mode selection
- Enhanced CSS styling for mode buttons and navigation
- Added JavaScript logic for mode switching
**Pages affectées :**
- src/pages/home/home.html - Added mode selection interface
- src/pages/home/home.ts - Added mode selection logic
- src/4nk.css - Added styling for mode selection and back buttons
**Motivations :**
- Fix 'Waiting for relays to be ready...' issue by properly waiting for relay spAddress
- Prevent unnecessary iframe creation when application runs in full page mode
- Improve relay address validation logic
**Modifications :**
- Enhanced createProcess to properly wait for relay spAddress before proceeding
- Added better relay address validation with non-empty string check
- Conditional iframe initialization only when running in iframe context
- Added debug logging for available relays when address not found
**Pages affectées :**
- src/services/service.ts - Relay readiness logic
- src/pages/home/home.ts - Conditional iframe initialization
- Ajouter le filtrage des messages Pass:: et PassClientScriptReady
- Améliorer les logs de debugging pour l'initialisation de la page d'accueil
- Éviter le spam de logs des gestionnaires de mots de passe
- Faciliter le diagnostic des problèmes d'initialisation
- Supprimer l'appel à initEssentialFunctions (fonction supprimée)
- Ajouter le support pour le message IFRAME_READY
- Améliorer les logs de validation WebSocket pour le debugging
- Résoudre les erreurs ReferenceError et Unknown message type
- Déplacer le filtrage des messages d'extension avant le logging
- Éviter les logs en boucle des messages react-devtools-content-script
- Améliorer la performance en filtrant d'abord, puis en loggant
🚀 OPTIMISATIONS PERFORMANCE:
- Connexions WebSocket parallélisées (au lieu de séquentielles)
- Timeout handshake réduit de 10s à 3s
- Gestion d'erreur améliorée pour continuer même sans handshake
- Un seul relay suffit pour démarrer
🗑️ NETTOYAGE:
- Suppression du dossier /pages/process (entierement commenté)
- Redirection process -> account
- Suppression des références inutiles dans router.ts
🚨 EXPORT CRITIQUE D'AUTOVALIDATION:
- Nouveau bouton rouge 'Export Critique (Clé Privée)'
- Triple confirmation pour sécurité
- Export de la clé privée pour signature sans interaction
- Avertissements de sécurité multiples
- Fichier JSON avec instructions de sécurité
📊 RÉSULTATS:
- Initialisation plus rapide (connexions parallèles)
- Moins de blocages (timeout réduit)
- Fonctionnalité critique pour cas d'urgence
- Code plus propre (suppression du code mort)
- Suppression du dossier /components/qrcode-scanner/
- Suppression des imports QrScannerComponent dans home.ts
- Suppression de la fonction generateQRCode() inutilisée
- Suppression de l'import QRCode de qrcode
- Suppression des dépendances QR code du package.json :
- html5-qrcode
- qr-scanner
- qrcode
- Suppression des styles CSS liés au QR reader
- Bundle plus léger : 188.07 kB vs 269.32 kB (-30%)
- Build fonctionnel après nettoyage
- Suppression de account.ts (1588 lignes de code mort)
- Suppression de account-component.ts (obsolète)
- Suppression de decs.d.ts (déclarations inutiles)
- Suppression du dossier mock-account/ (mocks non utilisés)
- Nettoyage des imports dans main.ts et router.ts
- Suppression des références aux composants obsolètes
- Code plus propre et maintenable
- Modification du router pour ne pas injecter le header sur la page account
- Page account utilise maintenant tout l'espace disponible
- Design modale complet sans header parasite
- CSS optimisé pour une expérience full-screen
- Nouveau composant DeviceManagementComponent avec interface ergonomique
- Suppression du header, design modale avec glassmorphism
- Boutons Import/Export intégrés de façon ergonomique
- Affichage des 4 mots du device actuel avec copie
- Gestion des devices appairés avec ajout/suppression
- Validation des 4 mots pour l'ajout de nouveaux devices
- Boutons Sauvegarder/Annuler pour les modifications
- Protection : impossible de supprimer le dernier device
- Interface responsive avec design moderne
- Intégration des fonctions d'import/export existantes
- Suppression du message 'You are creating a new pairing session' redondant
- Suppression de l'appel à populateMemberSelect() qui cherchait un élément inexistant
- Interface plus épurée et sans erreurs de console
- Spinner global pendant l'initialisation des services (service.ts)
- Spinner pour l'initialisation de la page d'accueil (home.ts)
- Amélioration du feedback utilisateur pendant les phases d'attente
- Design glassmorphism cohérent avec l'interface existante
- Messages informatifs pour guider l'utilisateur
- Gestion d'erreurs avec masquage automatique des spinners
- Remplacement du QR code par un système de 4 mots
- Interface unifiée avec détection automatique créateur/joiner
- Amélioration UX avec feedback en temps réel
- Design moderne glassmorphism avec animations
- Validation intelligente des 4 mots pour le joiner
- Status de progression détaillé pour les deux flux
- Redirection automatique vers /account après pairing
- Styles CSS améliorés avec variables et responsive design
- Gestion d'erreurs et messages utilisateur clairs
- Fonctionnalité de copie des 4 mots pour le créateur