[
https://issues.apache.org/jira/browse/CAMEL-24395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18122044#comment-18122044
]
Claus Ibsen commented on CAMEL-24395:
-------------------------------------
_Claude Code on behalf of davsclaus_
PR: https://github.com/apache/camel/pull/27296
Scope narrowed to what users notice when switching modes:
* F4 opens the editor on the same screen as the view (same top line, cursor on
the selected line), instead of scrolling the cursor to two thirds down.
* Esc and F5 (save and close) select the cursor line in the view and keep the
top line. Before, Esc went back to the line selected before editing, and F5
went back to the top of the file.
Rendering the view through the editor's TextArea as well (one rendering path)
is not done. The route dump formats and rendered Markdown are not editable
text, so view mode keeps its own path for those anyway, and edit mode carries
code assist, the AI edit replay, and the diff and problem overlays. The column
where code starts was already the same in both modes.
> camel-tui: Unify view and edit mode rendering to use a single TextArea-based
> path
> ---------------------------------------------------------------------------------
>
> Key: CAMEL-24395
> URL: https://issues.apache.org/jira/browse/CAMEL-24395
> Project: Camel
> Issue Type: Improvement
> Components: camel-jbang
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Major
>
> The Source tab has two separate rendering paths for view mode (Paragraph
> widget + custom line rendering) and edit mode (TextArea widget + post-render
> overlays). This causes:
> - Duplicated logic for line numbers, syntax highlighting, cursor marker, doc
> panel, scroll
> - Visual shifts when switching between view and edit mode (F4) because the
> two renderers have slightly different layout math
> - Scroll position not preserved across mode switches
> The proposed fix: always render using TextArea (even in view mode as
> read-only). One rendering path, one scroll system, seamless F4 transitions.
> Features that need migration from the Paragraph-based view renderer:
> - Format cycling (YAML/Java/XML route dump)
> - Jump links (crosshair arrows to linked routes)
> - Markdown toggle for .md files
> - Horizontal scroll (scrollX)
> - Deprecated line scanning
> - Plain mode (borderless for copy/paste)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)