Skip to content

TUI: add p/P keys to start/stop/suspend/resume routes#23264

Merged
davsclaus merged 2 commits into
mainfrom
fix/camel-tui-routes
May 17, 2026
Merged

TUI: add p/P keys to start/stop/suspend/resume routes#23264
davsclaus merged 2 commits into
mainfrom
fix/camel-tui-routes

Conversation

@davsclaus
Copy link
Copy Markdown
Contributor

Summary

  • On the Routes tab, p toggles start/stop and P toggles suspend/resume for the currently selected route. The footer shows context-sensitive hints based on route state:
    • Started → p=stop, P=suspend
    • Suspended → p=start, P=resume
    • Stopped → p=start
  • On the Overview tab, p toggles start/stop all routes for the selected integration (stopAllRoutes / startAllRoutes). The footer hint updates dynamically: p=stop when routes are running, p=start when all stopped.
  • Reuses the existing action file protocol ({"action":"route","id":"<id>","command":"start|stop|suspend|resume"}), with id=* for the all-routes Overview action.

Test plan

  • Start a Camel integration with multiple routes
  • Open TUI and go to Routes tab, select a route
  • Press p — route stops; footer switches to p=start
  • Press p again — route starts; footer switches back to p=stop
  • Press P on a started route — route suspends; footer shows P=resume
  • Press P again — route resumes
  • Switch to Overview tab, select an integration
  • Press p — all routes stop; footer shows p=start
  • Press p again — all routes start; footer shows p=stop

Claude Code on behalf of Claus Ibsen

🤖 Generated with Claude Code

On the Routes tab, p toggles start/stop and P toggles suspend/resume
for the selected route. The footer shows context-sensitive hints based
on the current route state (p=stop/P=suspend when started,
p=start/P=resume when suspended, p=start when stopped).

On the Overview tab, p toggles start/stop all routes for the selected
integration using stopAllRoutes/startAllRoutes. The footer hint updates
dynamically (p=stop when routes are running, p=start when all stopped).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions github-actions Bot added the dsl label May 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 17, 2026

🧪 CI tested the following changed modules:

  • dsl/camel-jbang/camel-jbang-plugin-tui
All tested modules (2 modules)
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: Launcher :: Container

⚙️ View full build and test results

Three bottlenecks were causing the log tab to lag 30+ seconds behind
when DEBUG-level logging produced a high volume of lines:

1. readLogFile re-read the last 1 MB from disk on every 100 ms refresh,
   re-split the full string and re-ran fixControlChars on all 5000 lines.
   Replaced with readNewLogLines which tracks logFilePos and reads only
   the bytes appended since the last call, using a logLineBuffer to handle
   partial lines at the read boundary.

2. applyLogFilters re-ran the log regex on all 5000 entries every refresh.
   Now only newly read raw lines are parsed and appended to the persistent
   mutableFilteredEntries list, published atomically via the volatile field.

3. renderLog rebuilt all 5000 Line objects via ansiToLine on every render
   frame, then handed all 5000 lines to Paragraph which iterated them on
   every frame to apply scroll. Now a cachedLogLines list is rebuilt only
   when filteredLogEntries changes or logHScroll changes; Paragraph is
   given only the visible window (~30 lines) so it no longer iterates the
   full entry list per frame.

Also added l key on the Log tab to open a log-level selector popup
(ERROR/WARN/INFO/DEBUG/TRACE) and shows the current root log level in
the Log tab block title.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@davsclaus davsclaus merged commit 9a6d993 into main May 17, 2026
6 checks passed
@davsclaus davsclaus deleted the fix/camel-tui-routes branch May 17, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant