You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "atiaomar1978-hub (via GitHub)" <gi...@apache.org> on 2026/08/09 04:20:52 UTC
[PR] CAMEL-24374: Add Ctrl+G go-to-node popup in TUI Source editor [camel]
atiaomar1978-hub opened a new pull request, #25411:
URL: https://github.com/apache/camel/pull/25411
## Summary
_AI-generated on behalf of the operator._
Implements [CAMEL-24374](https://issues.apache.org/jira/browse/CAMEL-24374): **Ctrl+G** in the Camel TUI Source tab opens an expanded “Go to Node” popup showing routes and their individual processors/EIPs in a tree structure. The existing **`g`** shortcut remains unchanged for quick route-level navigation.
## Changes
| File | Purpose |
|------|---------|
| `YamlRouteNodeScanner.java` | Scans Camel YAML source files; builds route headers + navigable processor/EIP entries |
| `GotoSourceNodePopup.java` | Fuzzy-filterable tree popup (route headers + indented processors) |
| `SourceTab.java` | Wires **Ctrl+G**, footer hint, help text, node index builder |
| `SourceViewer.java` | `goToLine()` positions edit cursor in edit mode; `isDirty()` guard for cross-file goto |
## Behaviour
- **`g`** — existing route-only popup (unchanged)
- **Ctrl+G** — expanded popup with route + processor nodes; works in view and edit mode
- Selecting an entry jumps to the corresponding source line (cross-file supported)
- Cross-file navigation is blocked when the edit buffer has unsaved changes (same guard as file-list open)
## Testing
```bash
./mvnw -pl dsl/camel-jbang/camel-jbang-plugin-tui test \
-Dtest=YamlRouteNodeScannerTest,GotoSourceNodePopupTest,SourceViewerGoToLineTest
```
All 16 tests pass.
## Review
Bugbot and Grok reviews were run on the changeset; findings were addressed in commit `d5170133`. See PR comment for full review details.
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-24374: Add Ctrl+G go-to-node popup in TUI Source editor [camel]
Posted by "atiaomar1978-hub (via GitHub)" <gi...@apache.org>.
atiaomar1978-hub commented on PR #25411:
URL: https://github.com/apache/camel/pull/25411#issuecomment-5232347756
Thanks @gnodet for the review — addressed the follow-up items in commit 3fccd279:
1. **FQCNs → imports** (`GotoSourceNodePopup.java`): replaced inline `dev.tamboui.style.Color` and `DiagramColors` FQCNs with proper imports, matching project conventions.
2. **Dirty-buffer UX** (`SourceTab.java`): when cross-file navigation is blocked because the edit buffer has unsaved changes, the TUI now shows a notification: *"Save or discard edits before navigating to another file"* instead of silently no-op'ing.
**Tests** (all green locally):
```bash
./mvnw -pl dsl/camel-jbang/camel-jbang-plugin-tui test \
-Dtest=YamlRouteNodeScannerTest,GotoSourceNodePopupTest,SourceViewerGoToLineTest
```
The disk re-read on each Ctrl+G (`buildSourceNodeIndex()`) is left as-is for now — noted as a future optimization if needed.
_AI-generated comment on behalf of atiaomar1978-hub_
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-24374: Add Ctrl+G go-to-node popup in TUI Source editor [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #25411:
URL: https://github.com/apache/camel/pull/25411#issuecomment-5230469712
:star2: Thank you for your contribution to the Apache Camel project! :star2:
:robot: CI automation will test this PR automatically.
:camel: 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](https://camel.apache.org/community/team/#committers) have access to the summary.
:warning: Be careful when sharing logs. Review their contents before sharing them publicly.
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-24374: Add Ctrl+G go-to-node popup in TUI Source editor [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #25411:
URL: https://github.com/apache/camel/pull/25411
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-24374: Add Ctrl+G go-to-node popup in TUI Source editor [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #25411:
URL: https://github.com/apache/camel/pull/25411#issuecomment-5230533550
<!-- ci-tested-modules -->
:test_tube: **CI tested the following changed modules:**
- `dsl/camel-jbang/camel-jbang-plugin-tui`
---
<details><summary>:microscope: Scalpel shadow comparison — Scalpel: 2 tested, 1 compile-only — current: 2 all tested</summary>
[Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected **3 affected modules** (current approach: 2).
<details><summary>:warning: Modules only in Scalpel (1)</summary>
- `camel-launcher`
</details>
**Skip-tests mode would test 2 modules** (1 direct + 1 downstream), **skip tests for 1** (generated code, meta-modules)
<details><summary>Modules Scalpel would test (2)</summary>
- `camel-jbang-plugin-tui`
- `camel-launcher-container`
</details>
<details><summary>Modules with tests skipped (1)</summary>
- `camel-launcher`
</details>
> :information_source: Shadow mode — Scalpel observes but does not affect test execution. [Learn more](https://github.com/maveniverse/scalpel)
</details>
<details><summary>All tested modules (3 modules)</summary>
- Camel :: JBang :: Plugin :: TUI
- Camel :: Launcher
- Camel :: Launcher :: Container
</details>
---
:gear: [View full build and test results](https://github.com/apache/camel/actions/runs/31294366687)
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-24374: Add Ctrl+G go-to-node popup in TUI Source editor [camel]
Posted by "atiaomar1978-hub (via GitHub)" <gi...@apache.org>.
atiaomar1978-hub commented on PR #25411:
URL: https://github.com/apache/camel/pull/25411#issuecomment-5229737511
## Bugbot & Grok Review Report
_AI-generated review on behalf of the operator._
Full automated review was performed on the changeset before merge. **All must-fix items were addressed** in commit `d5170133bf4`.
---
### Verdict
Implementation matches [CAMEL-24374](https://issues.apache.org/jira/browse/CAMEL-24374). Feature shape is correct: **Ctrl+G** opens a tree-style node navigator; **`g`** remains for route-only goto. Test coverage is solid for the core paths (16 unit tests, all green).
---
## Bugbot Findings
### Must-fix (all fixed in `d5170133`)
| # | Severity | Finding | Fix |
|---|----------|---------|-----|
| 1 | **High** | Processor-level `id:` lines overwrote `currentRouteId`, mis-attributing later nodes and breaking filter grouping | Route ids are only read **before** the route header is emitted; processor ids are ignored |
| 2 | **High** | New `- from:` block did not reset `currentRouteId`, leaking the previous route's id | Reset only on top-level `- from:` (not nested `from:` under `- route:`) |
| 3 | **Medium** | After a route, top-level YAML (`- beans:`, REST verbs, etc.) was indexed as processors | Route scope ends when dedented past the active route indent |
| 4 | **Medium** | `routeKey` used `filePath + routeId`, collapsing duplicate route ids in one file during filter | Grouping key is now `filePath + routeFromLine` (unique per route instance) |
---
## Grok Findings
### Must-fix (all fixed in `d5170133`)
| # | Finding | Fix |
|---|---------|-----|
| 1 | Processor `id:` overwrote route id and polluted labels (`myLog` instead of `hello`) | Scoped route id reads; labels prefer `message`/`constant` over `id` |
| 2 | Route id leaked across subsequent `- from:` routes | Clear `currentRouteId` only on top-level `- from:` |
| 3 | Filter `routeKey` collapsed distinct routes sharing an id | `routeFromLine` propagated to all entries |
| 4 | Ctrl+G cross-file goto could discard unsaved edits via `loadFile()` | `openFileAt()` returns early when `sourceViewer.isEditMode() && sourceViewer.isDirty()` |
### Should-fix (partially addressed / deferred)
| # | Finding | Status |
|---|---------|--------|
| 5 | Tree is flat (always `indent=1`) | **Partially fixed** — indent now scales with YAML depth; full EIP nesting (choice/when) deferred |
| 6 | Block `to`/`toD` showed as type `uri` | **Fixed** — parent endpoint EIP tracked; `uri:` lines show `[to]` etc. |
| 7 | Index reads disk; dirty buffer line mapping wrong in edit mode | **Deferred** — same limitation as existing `g` goto; follow-up if needed |
| 8 | `buildNodeLabel` walked into nested children | **Mitigated** — searches descendants but prefers descriptive props |
| 9 | Tests didn't cover failure modes | **Fixed** — added tests for processor id, multi-route reset, beans exclusion, duplicate id filter |
| 10 | Redundant structural filter logic | Accepted — kept for clarity |
### Nice-to-have (deferred)
- Unify route parsing with `SourceTab.scanYamlRoutes`
- Real nested tree for choice/when/doTry blocks
- Remove FQCNs in `GotoSourceNodePopup` render (matches existing `GotoNodePopup` pattern)
- Scan edit buffer instead of disk when in edit mode
---
## What Looks Good (Grok)
- Ctrl+G vs `g` separation and footer/help text wiring
- Popup UX mirrors `GotoRoutePopup` / `GotoNodePopup` (filter, paging, scrollbar)
- `SourceViewer.goToLine()` edit-mode cursor positioning
- Inline `to`/`toD`/`setHeader` scanning; multi-route files work with unique ids
---
## Test Coverage
```bash
./mvnw -pl dsl/camel-jbang/camel-jbang-plugin-tui test \
-Dtest=YamlRouteNodeScannerTest,GotoSourceNodePopupTest,SourceViewerGoToLineTest
```
| Test class | Cases |
|------------|-------|
| `YamlRouteNodeScannerTest` | Simple route+steps, inline from, multi-route, processor id scoping, route id reset, beans exclusion, structural key filtering |
| `GotoSourceNodePopupTest` | Esc close, enter selection, arrow nav, fuzzy filter, duplicate route id filter independence |
| `SourceViewerGoToLineTest` | View-mode and edit-mode cursor positioning |
**16 tests, all passing.**
---
## Commits
1. `fb63168` — Initial implementation (scanner, popup, SourceTab/SourceViewer wiring, tests)
2. `d5170133` — Review fixes (id scoping, routeFromLine grouping, endpoint type on uri lines, dirty guard, expanded tests)
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org