atiaomar1978-hub commented on code in PR #25514:
URL: https://github.com/apache/camel/pull/25514#discussion_r3792927120


##########
docs/user-manual/modules/ROOT/pages/camel-jbang-tui.adoc:
##########
@@ -892,6 +892,19 @@ https://asciinema.org/[Asciinema] `.cast` recording:
 camel tui --record=demo.tape
 ----
 
+The `.cast` file is written next to the tape, with the `.tape` suffix replaced 
by `.cast`.
+Recording is headless: the TUI is driven entirely by the tape rather than by 
your terminal,
+so no keyboard input is read and nothing is drawn on screen.
+
+The recorded terminal is 200x50 by default, which is wider than a 
documentation page can
+display. Use `--record-size` to record at a size that fits, and `--record-fps` 
or
+`--record-duration` to control the capture rate and the cut-off:
+
+[source,bash]
+----
+camel tui --record=demo.tape --record-size=160x44 --record-fps=15

Review Comment:
   **Blocking — documented CLI path does not work via `TuiCommand`**
   
   This example documents `camel tui --record=demo.tape --record-size=160x44 
--record-fps=15`, but the default `camel tui` entry point is `TuiCommand` (via 
`TuiPlugin`), not `CamelMonitor` directly.
   
   `TuiCommand` only declares/forwards `--record`; the new `--record-size`, 
`--record-fps`, and `--record-duration` options exist only on `CamelMonitor`. 
Users following this doc get `Unknown option` today.
   
   Please add the three options to `TuiCommand` and forward them in `doCall()` 
(same pattern as `--refresh` / `--theme`). That file is outside this diff but 
is required for the documented UX to work.



##########
dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/CamelMonitor.java:
##########
@@ -212,12 +250,13 @@ public Integer doCall() throws Exception {
         if (record != null) {
             Path tapeFile = Path.of(record);
             Path castFile = Path.of(record.replaceAll("\\.tape$", "") + 
".cast");
+            int[] size = parseRecordSize(recordSize);
             System.setProperty("tamboui.record", 
castFile.toAbsolutePath().toString());
             System.setProperty("tamboui.record.config", 
tapeFile.toAbsolutePath().toString());
-            System.setProperty("tamboui.record.width", "200");
-            System.setProperty("tamboui.record.height", "50");
-            System.setProperty("tamboui.record.duration", "120000");
-            System.setProperty("tamboui.record.fps", "10");
+            System.setProperty("tamboui.record.width", 
String.valueOf(size[0]));
+            System.setProperty("tamboui.record.height", 
String.valueOf(size[1]));
+            System.setProperty("tamboui.record.duration", 
String.valueOf(recordDuration));
+            System.setProperty("tamboui.record.fps", 
String.valueOf(recordFps));

Review Comment:
   **Medium — recording system properties are never cleared**
   
   These six `tamboui.record*` properties are set at session start but the 
`finally` block (~679) tears down shell/MCP/web without clearing them. With the 
new `applyRecording()` path, any later TUI backend creation in the same JVM 
still sees recording enabled via `RecordingConfig.isEnabled()`.
   
   Consider clearing all `tamboui.record*` keys in `finally` (mirror the test 
`@AfterEach` cleanup), especially important for `--web` where multiple sessions 
share one process.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to