Skip to content

feat(ide): split Launch Logs console by source with ANSI colors (fixes #11) - #90

Open
Vyacheslav-Tomashevskiy wants to merge 1 commit into
mergeos-bounties:masterfrom
Vyacheslav-Tomashevskiy:fix/split-terminal-ansi-colors
Open

feat(ide): split Launch Logs console by source with ANSI colors (fixes #11)#90
Vyacheslav-Tomashevskiy wants to merge 1 commit into
mergeos-bounties:masterfrom
Vyacheslav-Tomashevskiy:fix/split-terminal-ansi-colors

Conversation

@Vyacheslav-Tomashevskiy

Copy link
Copy Markdown

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

  • New lappa.ansi module: 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.
  • Launch Logs tab is now a 3-pane split (All streams / Docker / Native) in a QSplitter. 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.
  • The original merged plain-text panel (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 (real QTextCharFormat foreground color), not just stripped.
  • Full suite: 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 QTextCharFormat colors, which is a stronger check than a screenshot for this particular feature.

…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.
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.

[50 MRG] IDE: split terminal with ANSI log colors

1 participant