Skip to content

Hide terminal and improve running instance controls - #23

Merged
tristanpoland merged 4 commits into
mainfrom
copilot/fix-22
Aug 31, 2025
Merged

tristanpoland merged 4 commits into
mainfrom
copilot/fix-22

Conversation

Copilot AI commented Aug 31, 2025 •

Copy link
Copy Markdown
Contributor

This PR implements comprehensive instance control improvements that provide users with better control over terminal visibility and running instance management.

Features Added

🎯 Hide Terminal by Default

Instances can now launch without automatically showing the terminal window. This is controlled by a new "Follow Logs" setting in each instance's configuration, providing a cleaner UI for users who don't need to monitor logs constantly.

🔄 Play → Stop Button Swap

When an instance is running, the Play button intelligently transforms into a Stop button with visual feedback:

  • Running instances display a green "Running" badge
  • Hover shows a red Stop button instead of Play
  • Stop action requires confirmation to prevent accidental termination

⚙️ Follow Logs Option in Settings

Added a new toggle in the instance settings General tab that controls log-following behavior:

  • Enabled: Logs open automatically and follow real-time output when launched
  • Disabled: Instance launches silently without opening terminal (default)
  • Setting is per-instance, allowing customization for different use cases

🖥️ Real-time Log Console

Created a new InstanceLogsModal component with professional features:

  • Live log streaming with color-coded levels (INFO, WARN, ERROR, DEBUG)
  • Auto-scroll with pause/resume controls
  • Log download functionality
  • Performance optimized (keeps last 1000 entries)
  • Stop button integration for running instances

🛠️ Backend Process Management

Enhanced the Rust backend with proper process lifecycle management:

  • Cross-platform process termination (Windows: taskkill, Unix: kill)
  • Global instance tracking with thread-safe HashMap
  • New commands: stop_instance, get_running_instances, is_instance_running
  • Automatic cleanup on process termination

Technical Implementation

Frontend Changes:

  • Enhanced MinecraftInstance type with followLogs, status: 'running', and processId fields
  • Updated InstanceCard component with conditional Play/Stop rendering
  • Added StopInstanceModal for confirmation dialogs
  • Comprehensive state management in useInstances hook
  • Event-driven architecture for real-time log streaming

Backend Changes:

  • Process tracking infrastructure in instances.rs
  • Cross-platform process termination utilities
  • Enhanced launch command to track process IDs
  • Proper error handling and cleanup

User Experience

The implementation follows the exact flow described in the issue:

  1. Launch instance → Terminal stays hidden unless "Follow Logs" is enabled
  2. Play button changes to Stop → User clicks Stop → Confirmation modal → Instance stops if confirmed
  3. Settings modal contains toggle for "Follow Logs" for each specific instance

This provides both power users with the log monitoring they need and casual users with a cleaner, less cluttered interface.

Fixes #22.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 3 commits August 31, 2025 01:40
Co-authored-by: tristanpoland <34868944+tristanpoland@users.noreply.github.com>
Co-authored-by: tristanpoland <34868944+tristanpoland@users.noreply.github.com>
…tegration

Co-authored-by: tristanpoland <34868944+tristanpoland@users.noreply.github.com>
Copilot AI changed the title [WIP] Hide terminal and improve running instance controls Hide terminal and improve running instance controls Aug 31, 2025
Copilot AI requested a review from tristanpoland August 31, 2025 01:55
@tristanpoland
tristanpoland marked this pull request as ready for review August 31, 2025 02:18
@tristanpoland
tristanpoland merged commit 0b14ad9 into main Aug 31, 2025
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hide terminal and improve running instance controls

2 participants