Commit graph

11 commits

Author SHA1 Message Date
BruceChen
512445cb1d fix: prevent TUI StackOverflowException from excessive log controls
The TUI log view used an ItemsControl with 5000 max entries and no UI
virtualization. Avalonia's composition renderer traverses the entire
visual tree on each frame -- with thousands of TextBlock controls, the
recursive Render/RenderCore calls exceed the thread stack size on
constrained devices (especially ARM where each stack frame is larger
due to ABI differences), causing a StackOverflowException in
ServerCompositionContainerVisual.Render.

Changes:
- Enable VirtualizingStackPanel on the log ItemsControl so Avalonia
  only creates visuals for the rows currently in the viewport.
- Add [Console.General] TUI_Log_Scrollback config option so users can
  control max log lines in TUI mode. Default is 0 (automatic: 3000 on
  x86/x64, 500 on ARM/ARM64).

Made-with: Cursor
2026-04-03 03:17:53 +08:00
BruceChen
eae96a8fbc Cave mode for minimap 2026-03-31 01:28:24 +08:00
BruceChen
871305bd72 Add server status display and protocol version upgrade handling
- Introduced a new `ServerStatusInfo` class to encapsulate server status data including MOTD, player counts, and version information.
- Implemented `ServerStatusDisplay` to format and display server status information in both classic and TUI modes.
- Added protocol version upgrade logic in `ProtocolHandler` to determine the highest supported protocol version for multi-version servers.
- Updated translations to support new server status labels and messages.
- Created `ServerStatusPanelBuilder` for TUI to visually represent server status with player information and connection details.
2026-03-30 01:39:37 +08:00
BruceChen
d427a6e160 Add tooltip service and integrate with MinimapControl
- Introduced TuiTooltipService for managing tooltips across TUI components.
- Updated MinimapControl to utilize the new tooltip service for enhanced entity information display.
- Refactored tooltip rendering logic to improve visibility and interaction based on mouse position.
2026-03-29 19:53:50 +08:00
BruceChen
6631180f8a Minimap support 2026-03-29 19:53:50 +08:00
BruceChen
448e1ef6f5
Merge pull request #3010 from BruceChenQAQ/master
Update Crowdin GitHub Action version in build-and-release.yml
2026-03-28 00:48:31 +08:00
Anon
f6446b198d Implemented effects support, as a command, chat notification and added in TUI mode 2026-03-27 15:47:27 +01:00
BruceChen
4b9e0e93aa Fix: cursor locate at the beginning when pressing Up to view history 2026-03-27 22:47:20 +08:00
BruceChen
ac1d5c37a6 Refactor tab cycling logic in TUI command input handling
- Simplified the condition for disabling tab cycling by checking only for the Tab key.
- Improved clarity in the command key down event handling for better user experience.
2026-03-27 00:30:52 +08:00
BruceChen
b33ee7e4a1 Refactor exit handling and command input in TUI
- Improved the exit process by ensuring the backend shutdown is called after handling offline prompts.
- Enhanced command input history management by encapsulating text setting logic in a dedicated method to prevent event handler interference.
- Adjusted the background color in the color parser for better visibility.
- Increased the sleep duration in the TUI exit guard thread to ensure a smoother shutdown process.
2026-03-27 00:30:52 +08:00
BruceChen
8456e363f5
TUI for MCC (#2976)
* feat: implement interactive TUI inventory viewer

- Added InventoryTui command to open an interactive terminal user interface for inventory management.
- Introduced InventoryApp and InventoryMainView classes for TUI layout and functionality.
- Created InventoryViewModel and SlotViewModel to manage inventory data and display.
- Integrated Consolonia for enhanced console UI experience.
- Updated McClient to support console message handling during TUI operation.

These changes enhance user interaction with inventory management in Minecraft Console Client.

* feat: enhance debugging workflow with mcc-debug.sh and TUI support

- Introduced mcc-debug.sh for streamlined one-step build, server start, and MCC launch.
- Added TUI mode for improved user experience during debugging sessions.
- Updated mcc-env.sh to include new debug helpers and TUI mode functionality.
- Enhanced SKILL.md with detailed instructions for using the new debugging tools and console modes.

These changes significantly improve the debugging process for Minecraft Console Client, making it more efficient and user-friendly.

* feat: introduce TUI console backend and related enhancements

- Added ClassicConsoleBackend and TuiConsoleBackend to support different console I/O modes.
- Implemented IConsoleBackend interface for better abstraction of console operations.
- Enhanced ConsoleIO to utilize the new backend structure for input and output handling.
- Introduced MainTuiView and MccTuiApp for a full-screen TUI experience using Avalonia.
- Updated InventoryTuiHost to manage TUI lifecycle and interactions.

These changes significantly improve the console experience in Minecraft Console Client, providing a more flexible and user-friendly interface.

* refactor: remove InventoryTui command implementation

- Deleted the InventoryTui class, which provided an interactive terminal user interface for inventory management.
- This change simplifies the command structure as part of ongoing improvements to the console experience in Minecraft Console Client.

The removal of this command is aligned with recent enhancements to the console backend and user interface.

* refactor: update InventoryMainView and MainTuiView for improved UI handling

- Changed several fields from readonly to mutable in InventoryMainView to allow for dynamic updates.
- Introduced a new McColorParser class for parsing Minecraft color codes and creating colored text blocks.
- Enhanced MainTuiView to support formatted log lines and improved notification handling.
- Updated chat scrolling behavior to ensure better user experience during text input and log display.

These changes streamline the UI components and enhance the overall console experience in Minecraft Console Client.

* feat: enhance command input handling in MainTuiView

- Updated command input to use event routing for better key handling.
- Added support for Ctrl key shortcuts to improve text manipulation (e.g., word deletion, caret movement).
- Implemented text cleaning on input change to prevent newline characters.
- Improved health and food status bar rendering with a new method for building bar text.

These changes significantly enhance the user experience in the TUI by providing more intuitive command input functionality.

* feat: enhance TUI command suggestion functionality

- Introduced a new CommandSuggestion struct for backend-independent suggestion handling.
- Updated ConsoleIO to streamline suggestion updates for both Classic and TUI backends.
- Enhanced MainTuiView to display command suggestions with improved visibility and interaction.
- Increased the maximum number of displayed suggestions from 6 to 10 for better user experience.

These changes significantly improve the command input experience in the TUI, making it more intuitive and user-friendly.

* feat: enhance offline command autocomplete functionality

- Introduced an OfflineAutocompleteHandler to provide command suggestions for offline commands.
- Added support for tab cycling through suggestions in the TUI.
- Improved command input handling to clear suggestions when necessary and manage user input more effectively.
- Updated TuiConsoleBackend to integrate with the new autocomplete feature.

These changes significantly enhance the user experience by making command input more intuitive and responsive in offline scenarios.

* feat: enhance localization and user feedback in TUI

- Updated various TUI components to utilize localized strings for improved user experience.
- Enhanced debug state output with translated labels for better clarity.
- Improved inventory command help messages with localized text.
- Added new translations for console mode descriptions and inventory viewer prompts.

These changes significantly enhance the usability and accessibility of the TUI in Minecraft Console Client, making it more user-friendly and informative.

* feat: enforce localization for user-facing strings in AGENTS.md

- Added guidelines to ensure all user-facing text, including log messages and error messages, is managed through the translation system.
- Specified the use of `Translations.resx` and `Translations.Designer.cs` for localization, emphasizing the importance of avoiding hardcoded strings in source code.

These changes improve the consistency and accessibility of user-facing content across the application.
2026-03-26 02:08:18 +08:00