@@ -377,7 +377,7 @@ The application has two main pages:
377377 - **game.log**: Game-specific logging
378378 - **everything.log**: Combined comprehensive logging
379379 - **players/p1/player.log, players/p2/player.log**: Individual player logs for each player
380- - Each log foldout includes a "Copy path" button and has its own scroll container with max-height of 500px for large logs
380+ - Each log foldout includes "Copy path" and "Download" buttons and has its own scroll container with max-height of 500px for large logs
381381 - Logs are displayed in a dedicated section with proper styling and scrollbars
382382
383383#### Analysis Section
@@ -482,6 +482,31 @@ The trajectory template displays:
482482
483483**Content Preview**: Long message content (>5 lines) shows a preview with expand/collapse functionality to keep the interface manageable.
484484
485+ ## Download Functionality
486+
487+ The trajectory viewer provides download capabilities for all files that have "Copy path" buttons (except the current folder path):
488+
489+ ### Download Locations
490+
491+ * **Tournament and Game Logs**: All log files in the Overview section (tournament.log, game.log, everything.log, player logs)
492+ * **Metadata Files**: The metadata.json file in the Setup section
493+ * **Trajectory Files**: Individual trajectory files (.traj.json) in the Rounds section
494+
495+ ### Implementation Details
496+
497+ * **Download Buttons**: Each "Copy path" button (except current folder) is accompanied by a "Download" button with a download icon
498+ * **Server Endpoint**: `GET /download-file?path=<file_path>` serves files with proper security checks
499+ * **Security**: Files must exist within the logs directory, be actual files (not directories), and be accessible
500+ * **File Naming**: Downloaded files retain their original names
501+ * **JavaScript**: Download functionality is handled by `downloadFile()` function in `clipboard.js`
502+ * **User Feedback**: Download buttons show success/error states similar to copy buttons
503+
504+ ### Button Styling
505+
506+ * **Download buttons** use the same styling as copy buttons but with download icon (`bi-download`)
507+ * **Button classes**: `.download-btn` and `.download-btn-small` for consistent styling
508+ * **Placement**: Download buttons appear immediately after their corresponding copy path buttons
509+
485510## Multi-Select Actions Specification
486511
487512The game picker includes four batch operations for selected game folders, accessible via the action dropdown:
0 commit comments