davsclaus opened a new pull request, #28234:
URL: https://github.com/apache/camel/pull/28234

   Stacked on #28220. CAMEL-25892 brought the body types each step of a route 
has been reached with to the Routes and Diagram tabs of the Camel TUI. This is 
its third view, the source view of the Source tab (CAMEL-25897):
   
   - **At the end of the line of each step**: its body types, dimmed and lined 
up, cut to the room there is (`ByteArrayInputStreamCache`, `⚠ LinkedHashMap | 
InputStreamCache`).
   - **A ⚠ in the gutter** of a step reached with bodies of more than one kind 
(null, payload, data or collection), whose types are in the warning color: its 
body depends on the path a message takes.
   - **The quick documentation of the line** lists all the types, and for a mix 
of kinds says why it needs attention.
   
   
![Source](https://raw.githubusercontent.com/apache/camel/8a4c917d63390d9dfd6bc2eee16526e27682e47a/docs/user-manual/modules/ROOT/images/jbang/camel-tui-source-body-types.png)
   
   **Only for the version of the file that runs.** The facts of a line hold 
only while the view has the file as the integration runs it. #28220 added the 
run state of the open file. The live run data is dimmed, and the body types are 
left out:
   - while the integration does not run the file as saved: saved after it 
loaded the file, reloading, or the reload failed;
   - right after a save in the editor, until the next refresh knows the state 
again.
   
   The issue asked to keep the body types of the routes an edit did not change, 
by their checksums. The TUI cannot compute the checksums of an edited YAML or 
XML file without loading it with Camel, which runs parts of it and needs the 
components (see #28220). So the view leaves them all out until the integration 
runs the file. In dev mode that is about a second after a save, and they come 
back as messages reach the new steps.
   
   **How**
   - `LiveRunLines` collects the body types of the steps on each line with the 
live run data. A line is mixed when one of its steps was reached with more than 
one kind. Two steps on one line that each have a kind of their own do not make 
it mixed.
   - `SourceLiveColumn` draws the gutter mark and the types after the code, and 
gives the quick documentation entry. `SourceViewer` only calls it, and stays 
within its size limit.
   
   **Tests**
   - `SourceBodyTypesTest`:
     - the types at the end of the step lines, lined up, and the ⚠ in the 
gutter only on the mixed step;
     - cut to a narrow view;
     - none in plain mode;
     - none, with the live data dimmed and no runtime failure offered to fix, 
while the integration runs another version;
     - the quick documentation;
     - the steps of one line together;
     - a save in the editor hides them until the next refresh.
   - The camel-jbang-plugin-tui suite: 2223 tests pass.
   - Checked live with an integration in dev mode whose choice marshals in one 
branch:
     - the four steps after the choice have the ⚠ and their two kinds;
     - after an edit, the body types go away while the integration reloads, and 
come back with the new steps.
   
   Docs: the Source help page, and the Source Editor and Diagram pages of the 
manual, with the screenshot.
   
   _Claude Code on behalf of davsclaus_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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