feat(ide): split Launch Logs console by source with ANSI colors (fixes #11) - #90
Open
Vyacheslav-Tomashevskiy wants to merge 1 commit into
Conversation
…mergeos-bounties#11) Docker/native launch output was one interleaved plain-text stream, and any ANSI SGR color codes from ROS2/colcon/docker output (e.g. colored WARN/ERROR) passed straight through as raw escape bytes instead of rendering as color. - new lappa.ansi module: parses SGR sequences into color/bold-tagged segments (8 base + 8 bright colors), degrades unknown codes to plain text instead of crashing the panel. - Launch Logs tab is now a 3-pane split (All / Docker / Native); the Docker and Native panes render resolved ANSI colors live as events stream in, so it's easy to tell which stream a line came from and see color-coded severity. - kept the original merged plain-text panel untouched for compatibility.
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #11.
The Launch Logs panel was one merged plain-text stream (docker + native events interleaved), and any ANSI SGR color codes coming out of ROS2/colcon/docker (colored WARN/ERROR etc.) passed straight through as raw escape bytes since nothing parsed them.
What changed
lappa.ansimodule: parses SGR escape sequences into color/bold-tagged text segments (8 base + 8 bright colors), degrading unknown/unsupported codes to plain text instead of raising.All streams/Docker/Native) in aQSplitter. The Docker and Native panes render resolved ANSI colors live as events stream in, so you can tell which stream a line is from at a glance and see color-coded severity instead of\x1b[31m...garbage.launch_log) is untouched so nothing that depended on it breaks.Tests
packages/server/tests/test_ansi.py— pure-Python unit tests for the SGR parser (plain text, reset boundaries, bold+color combos, bright vs base color distinction, unknown codes, empty string).packages/server/tests/test_gui_launch_logs.py— added a Qt (offscreen) test that feeds a colored docker-source event and a native event through_apply_launch_logs, then asserts the split panes only carry their own source's text and that the docker pane's[ERROR]text is actually rendered in#f87171(realQTextCharFormatforeground color), not just stripped.pytest packages/server/tests— 170 passed locally (PySide6 6.11.1, Python 3.12).No screenshot attached (no display in this environment beyond Qt offscreen), but the Qt test above exercises the actual rendered
QTextCharFormatcolors, which is a stronger check than a screenshot for this particular feature.