mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
735be20b26de48ff39363aa1c7b455feccc943a9
4 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
afa7da3ae5 |
Fixes #4078 - Implement automatic URL detection with OSC 8 hyperlinks at driver level (#4340)
* Initial plan * Enable VT processing in WindowsOutput to support hyperlink detection Co-authored-by: tig <585482+tig@users.noreply.github.com> * Address code review feedback - track VT enablement and add error handling Co-authored-by: tig <585482+tig@users.noreply.github.com> * Revert VT processing changes - investigating actual root cause Co-authored-by: tig <585482+tig@users.noreply.github.com> * Implement OSC 8 hyperlink support in Attribute and OutputBase Co-authored-by: tig <585482+tig@users.noreply.github.com> * Implement automatic URL detection with OSC 8 at driver level Co-authored-by: tig <585482+tig@users.noreply.github.com> * Fix OSC 8 URL wrapping to handle ANSI escape sequences properly Co-authored-by: tig <585482+tig@users.noreply.github.com> * Update newinv2.md Terminal.Gui v2 introduces a reimagined architecture, removing redundant and overly complex code from v1. Key changes include: - Added TrueColor support with 24-bit RGB handling. - Introduced modular adornments framework (Margin, Border, Padding). - Enhanced Unicode and wide character support for internationalization. - Simplified API with centralized navigation and modern .NET standards. - Added built-in scrolling via `Viewport` and improved `ScrollBar`. - Introduced new views (Bar, CharMap, ColorPicker, etc.) and enhanced existing ones. - Added `ConfigurationManager` for customizable themes and settings. - Improved visual fidelity with `LineCanvas`, gradients, and borders. - Introduced logging, metrics, and Sixel image support. - Enhanced keyboard and mouse APIs for better interaction handling. - Ensured AOT compatibility for simplified deployment. These changes modernize the library, improve usability, and expand its capabilities for terminal-based applications. * Remove automatic URL detection - reverting to clean state Co-authored-by: tig <585482+tig@users.noreply.github.com> * Revamp View.md documentation for clarity and depth Comprehensively restructured and enhanced the `View.md` documentation for the `Terminal.Gui` library to improve usability and completeness. - Added a Table of Contents for easier navigation. - Rewrote the "View Hierarchy" section to clarify terminology and key properties, with links to relevant API references. - Expanded "View Composition" and "Core Concepts" sections with detailed explanations of layers, adornments, and scrolling. - Detailed the "View Lifecycle" with step-by-step processes and code examples for initialization, layout, drawing, input handling, and disposal. - Reorganized and expanded the "Subsystems" section, covering commands, input handling, layout, drawing, navigation, and scrolling. - Updated the "Modal Views" section with examples for dialogs, wizards, and modal view types. - Introduced a "Common View Patterns" section with practical examples for creating custom views, adding subviews, and implementing scrolling. - Added an "Advanced Topics" section covering diagnostics, view states, and shadow effects. - Included numerous inline code examples to illustrate key concepts. - Concluded with a "See Also" section linking to related deep-dive documentation. These changes significantly improve the structure, clarity, and accessibility of the documentation, making it easier for developers to understand and use the library effectively. * Restore working automatic URL detection with fix for URLs containing ANSI sequences Co-authored-by: tig <585482+tig@users.noreply.github.com> * Fix URL regex to handle underscores and trailing punctuation + add comprehensive tests Co-authored-by: tig <585482+tig@users.noreply.github.com> * Update and expand Configuration Management documentation The document title was updated to "Configuration Management Deep Dive" to reflect its expanded scope. A new Table of Contents was added for improved navigation. The introduction and "Overview" sections were rewritten to provide a clearer explanation of the `ConfigurationManager` class and its key features. New sections were added, including "Getting Started," "Themes and Schemes," "Defining Configuration Properties," "Events," and "Best Practices." These sections provide detailed explanations, examples, and recommendations for using the `ConfigurationManager` effectively. The "Configuration Scopes" and "Configuration Locations and Precedence" sections were restructured and expanded with detailed explanations, diagrams, and examples. Advanced topics such as JSON error handling, runtime configuration, and file system watching were introduced. The document now includes several new examples, such as theme switching and custom application settings, along with references to related topics and UICatalog examples. The content was reorganized for clarity, with redundant sections removed. * Refactor and expand Arrangement system documentation Updated the title to "View Arrangement Deep Dive" and added a Table of Contents for better navigation. Expanded the "Overview" section and restructured "Arrangement Modes" with detailed examples. Added new sections for "Arrange Mode (Interactive)," "Movable Views," "Resizable Views," and "Creating Resizable Splitters," with practical code samples. Enhanced "Tiled vs Overlapped Layouts" and "Modal Views" sections, and introduced "Runnable Views" to explain non-modal behavior. Expanded the "Examples" section with multiple use cases and added advanced topics like Z-order management and arrangement events. Updated `arrangement-lexicon.md` with API links for key terms. Improved formatting and consistency throughout the document to enhance clarity and usability. * Update CONTRIBUTING.md references and add critical note Updated the reference to `CONTRIBUTING.md` to use a relative path (`../CONTRIBUTING.md`) for accurate resolution. Enhanced instructions for AI agents, including CoPilot and Cursor, to strictly follow the updated guidelines. Added a **CRITICAL** note requiring CoPilot to internalize and adhere to the guidelines, including when operating in Agent mode. * Refactor URL handling and add OSC 8 hyperlink support Replaced `UrlRegex` with the new `Osc8UrlLinker` utility to handle URL detection and wrapping with OSC 8 hyperlink sequences, improving modularity and maintainability. Updated `OutputBase` to use `Osc8UrlLinker.WrapOsc8` for URL processing and removed legacy `WrapUrlsWithHyperlinks` logic. Added the `Osc8UrlLinker` class with robust URL parsing, support for allowed schemes, and handling of edge cases like trailing punctuation and ANSI escape sequences. Improved performance with efficient `StringBuilder` usage. Enhanced `AnimationScenario` to ensure URLs with underscores are drawn correctly. Improved code readability by renaming constants, simplifying nullable handling, and updating documentation. Replaced legacy `UrlDetectionTests` with `Osc8UrlLinkerTests`, covering standalone URLs, URLs in text, multiple URLs, and edge cases. Verified hyperlink wrapping correctness and visible content integrity. Updated `Terminal.sln.ToDo.DotSettings` to disable auto-opening of the Stack Trace Explorer. Cleaned up unused code, enabled nullable reference types, and improved XML documentation formatting. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tig <585482+tig@users.noreply.github.com> Co-authored-by: Tig <tig@users.noreply.github.com> |
||
|
|
aef88ad4bb |
Fixes #4332 - Refactor test infrastructure to use modern ApplicationImpl.Coordinator instead of legacy MainLoop (#4335)
* Initial plan * Refactor tests to use modern ApplicationImpl.Coordinator architecture instead of legacy Application.RunIteration Co-authored-by: tig <585482+tig@users.noreply.github.com> * Changes before error encountered Co-authored-by: tig <585482+tig@users.noreply.github.com> * Replace Application.RunIteration implementation to use modern ApplicationImpl.Coordinator architecture Co-authored-by: tig <585482+tig@users.noreply.github.com> * Simplify Application.RunIteration to directly delegate to ApplicationImpl.Coordinator without legacy infrastructure Co-authored-by: tig <585482+tig@users.noreply.github.com> * Update multitasking.md documentation to use Application.AddTimeout/RemoveTimeout instead of deprecated Application.MainLoop methods Co-authored-by: tig <585482+tig@users.noreply.github.com> * Refactor contribution guidelines and documentation - Consolidated all contribution-related instructions into `CONTRIBUTING.md` as the single source of truth. - Updated `copilot-instructions.md` and `AGENTS.md` to reference `CONTRIBUTING.md`. - Enhanced build, test, and CI/CD workflow documentation. - Updated repository structure documentation in `README.md` and `CONTRIBUTING.md`. - Reinforced coding conventions and streamlined testing requirements. - Documented GitHub Actions workflows and provided local CI replication steps. - Refined API documentation requirements and PR guidelines. - Simplified `.sln` file and removed redundant content. - Updated links to point to the latest documentation resources. * Revamp bug report template for clarity and detail Updated the bug report template to improve structure, readability, and comprehensiveness: - Specified "Terminal.Gui" in the `about` section. - Replaced bold headings with Markdown heading syntax. - Enhanced "To Reproduce" with placeholders for code and behavior details. - Added an "Environment" section to collect OS, terminal, PowerShell, .NET, and `Terminal.Gui` version details. - Expanded "Screenshots" to include GIFs and terminal output instructions. - Removed outdated "Desktop" and "Smartphone" sections, consolidating relevant details. - Improved "Additional Context" with prompts for consistency, prior behavior, and error messages. - Streamlined "For Maintainers" instructions for setting project and milestone. These changes aim to make bug reports more actionable and easier to reproduce. * Remove [Obsolete] attribute and pragma warnings from Application.RunIteration - method now uses modern architecture internally Co-authored-by: tig <585482+tig@users.noreply.github.com> * Refactor Application.Run.cs for clarity and cleanup Removed debug assertions and unused/commented-out code to simplify logic and improve maintainability. Renamed `forceDraw` to `forceRedraw` in `LayoutAndDraw` for better clarity. Removed the internal `OnNotifyStopRunState` method and its associated logic, indicating a refactor of the stop notification mechanism. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Tig <tig@users.noreply.github.com> Co-authored-by: tig <585482+tig@users.noreply.github.com> |
||
|
|
4974343e74 |
Fixes #4317 - Refactor Application.Mouse for decoupling and parallelism (#4318)
* Initial plan * Refactor Application.Mouse - Create IMouse interface and Mouse implementation Co-authored-by: tig <585482+tig@users.noreply.github.com> * Add enhanced documentation for Application.Mouse property Co-authored-by: tig <585482+tig@users.noreply.github.com> * Add parallelizable unit tests for IMouse interface Co-authored-by: tig <585482+tig@users.noreply.github.com> * Refactor Application.Mouse for decoupling and parallelism Co-authored-by: tig <585482+tig@users.noreply.github.com> * Move HandleMouseGrab method to IMouseGrabHandler interface Co-authored-by: tig <585482+tig@users.noreply.github.com> * Add parallelizable tests for IMouse and IMouseGrabHandler interfaces Co-authored-by: tig <585482+tig@users.noreply.github.com> * Add MouseEventRoutingTests - 27 parallelizable tests for View mouse event handling Co-authored-by: tig <585482+tig@users.noreply.github.com> * Fix terminology: Replace parent/child with superView/subView in MouseEventRoutingTests Co-authored-by: tig <585482+tig@users.noreply.github.com> * Fix coding standards: Use explicit types and target-typed new() in test files Co-authored-by: tig <585482+tig@users.noreply.github.com> * Update coding standards documentation with explicit var and target-typed new() guidance Co-authored-by: tig <585482+tig@users.noreply.github.com> * Refactor Application classes and improve maintainability Refactored `Sixel` property to be immutable, enhancing thread safety. Cleaned up `ApplicationImpl` by removing redundant fields, restructuring methods (`CreateDriver`, `CreateSubcomponents`), and improving exception handling. Updated `Run<T>` and `Shutdown` methods for consistency. Standardized logging/debugging messages and fixed formatting issues. Reorganized `IApplication` interface, added detailed XML documentation, and grouped related methods logically. Performed general code cleanup, including fixing typos, improving readability, and removing legacy/unnecessary code to reduce technical debt. * Code cleanup * Remove unreferenced LayoutAndDraw method from ApplicationImpl * Code cleanup and TODOs - Updated namespaces to reflect the new structure. - Added `Driver`, `Force16Colors`, and `ForceDriver` properties. - Introduced `Sixel` collection for sixel image management. - Added lifecycle methods: `GetDriverTypes`, `Shutdown`, and events. - Refactored `Init` to support legacy and modern drivers. - Improved driver event handling and screen abstraction. - Updated `Run` method to align with the application lifecycle. - Simplified `IConsoleDriver` documentation. - Removed redundant methods and improved code readability. * Refactor LayoutAndDraw logic for better encapsulation Refactored `Application.Run` to delegate `LayoutAndDraw` to `ApplicationImpl.Instance.LayoutAndDraw`, improving separation of concerns. Renamed `forceDraw` to `forceRedraw` for clarity and moved `LayoutAndDraw` implementation to `ApplicationImpl`. Added a new `LayoutAndDraw` method in `ApplicationImpl` to handle layout and drawing, including managing `TopLevels`, handling active popovers, and refreshing the screen. Updated the `IApplication` interface to reflect the new method and improved its documentation. Implemented `RequestStop` in `ApplicationImpl` and fixed formatting inconsistencies in `Run<T>`. Added TODOs for future refactoring to encapsulate `Top` and `TopLevels` into an `IViewHierarchy` and move certain properties to `IApplication`. * Refactor ApplicationImpl to enhance mouse and keyboard support Added a new `Mouse` property to the `ApplicationImpl` class, replacing its previous declaration, to improve mouse functionality. Updated `MouseGrabHandler` to initialize with a default instance of `MouseGrabHandler`. Added comments to ensure the preservation of existing keyboard settings (`QuitKey`, `ArrangeKey`, `NextTabKey`) for backward compatibility. These changes enhance clarity, functionality, and maintainability of the class. * Merge IMouseGrabHandler into IMouse - consolidate mouse handling into single interface Co-authored-by: tig <585482+tig@users.noreply.github.com> * Rename Mouse to MouseImpl and Keyboard to KeyboardImpl for consistency Co-authored-by: tig <585482+tig@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tig <585482+tig@users.noreply.github.com> Co-authored-by: Tig <tig@users.noreply.github.com> |
||
|
|
4b193ecb0d |
Add onboarding instructions for Copilot and other AI coding agents (#4314)
* Initial plan * Add copilot-instructions.md and .cursorrules for AI agents Co-authored-by: tig <585482+tig@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tig <585482+tig@users.noreply.github.com> |