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/07/24 17:33:05 UTC
[PR] CAMEL-24254: Add configurable TUI shell and AI prompt history [camel]
atiaomar1978-hub opened a new pull request, #25101:
URL: https://github.com/apache/camel/pull/25101
## Summary
- Adds `camel.tui.shell.history` and `camel.tui.ai.promptHistory` (default **100**, **0** disables recall and persistence).
- **Shell (F6)**: configures JLine command history with `~/.camel/tui-shell.history`.
- **AI prompt (F8)**: Up/Down recall for submitted prompts with `~/.camel/tui-ai-prompt.history`.
- Documents the settings in the camel-jbang TUI manual page.
Agreed defaults from [CAMEL-24254](https://issues.apache.org/jira/browse/CAMEL-24254) (properties-only; no Settings popup in this change).
_AI-generated on behalf of atiaomar1978-hub_
## Test plan
- [x] `./mvnw -pl dsl/camel-jbang/camel-jbang-plugin-tui test` (707 tests, all green)
- [x] New unit tests: `TuiHistoryLimitsTest`, `TuiPromptHistoryTest`, `TuiShellHistorySupportTest`, `AiPanelPromptHistoryTest`, updated `TuiSettingsTest`
Made with [Cursor](https://cursor.com)
--
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-24254: Add configurable TUI shell and AI prompt history [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #25101:
URL: https://github.com/apache/camel/pull/25101
--
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-24254: Add configurable TUI shell and AI prompt history [camel]
Posted by "atiaomar1978-hub (via GitHub)" <gi...@apache.org>.
atiaomar1978-hub commented on PR #25101:
URL: https://github.com/apache/camel/pull/25101#issuecomment-5077432036
## Local test run
Verified on branch `CAMEL-24254-camel-tui-history` (OpenJDK 21):
```bash
./mvnw -pl dsl/camel-jbang/camel-jbang-plugin-tui test
```
**Result:** 708 tests, 0 failures, 0 errors — BUILD SUCCESS.
Includes history-related coverage: `TuiSettingsTest`, `TuiPromptHistoryTest`, `TuiShellHistorySupportTest`, `TuiHistoryLimitsTest`, `AiPanelPromptHistoryTest`.
_AI-generated comment on behalf of [atiaomar1978-hub](https://github.com/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-24254: Add configurable TUI shell and AI prompt history [camel]
Posted by "atiaomar1978-hub (via GitHub)" <gi...@apache.org>.
atiaomar1978-hub commented on PR #25101:
URL: https://github.com/apache/camel/pull/25101#issuecomment-5077336494
@davsclaus Thanks — agreed that reverse/search over history would be a nice step beyond what this PR ships.
**This PR (CAMEL-24254)** intentionally scoped to configurable limits, persistence, and **↑/↓** recall for the AI prompt plus JLine-backed command history for **F6**. It does **not** include Ctrl+R (or other) interactive history search yet.
**Why Ctrl+R is non-trivial in the TUI today**
- **Global shortcut:** `CamelMonitor` handles **Ctrl+R** first for tape recording, so that chord never reaches the embedded JLine shell while the monitor is active.
- **AI prompt (F8):** input is custom (`AiPanel`), not JLine — only Up/Down navigation is wired so far.
- **Standalone JBang CLI:** outside the TUI, JLine’s usual bindings may already apply; this change set only wires history file/size for the **F6** shell path via `TuiShellHistorySupport`.
**Possible follow-up (happy to take as a separate ticket/PR if you want it on the roadmap)**
1. **AI prompt:** interactive search UI (e.g. popup or inline “reverse-i-search”) — could mirror **Ctrl+E** on the SQL tab, or another binding if we keep **Ctrl+R** for tape globally.
2. **F6 shell:** when the shell panel has focus, either forward **Ctrl+R** to JLine (and relocate tape toggle), or document/use JLine’s history-search binding explicitly on the virtual terminal path.
3. **Docs/UX:** agree on one consistent story for “search history” vs “tape record” so shortcuts don’t fight each other.
If you prefer **Ctrl+R** specifically for history search in shell + AI, we should decide what happens to tape recording (different chord vs only when shell/AI focused). I can open a follow-up JIRA with that breakdown unless you’d rather fold it into a later CAMEL-24254 extension.
_AI-generated comment on behalf of [atiaomar1978-hub](https://github.com/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-24254: Add configurable TUI shell and AI prompt history [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #25101:
URL: https://github.com/apache/camel/pull/25101#discussion_r3649613964
##########
dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/TuiSettingsTest.java:
##########
@@ -71,6 +73,8 @@ void roundTripPreservesAllFields(@TempDir Path tempDir) {
assertEquals("gemini", loaded.getAiProvider());
assertEquals("gemini-3.5-flash", loaded.getAiModel());
assertEquals("https://generativelanguage.googleapis.com", loaded.getAiUrl());
+ assertEquals("25", loaded.getShellHistory());
Review Comment:
The new assertions added here (lines 74–75) and in `missingFileYieldsNullFieldsWithoutThrowing` (lines 113–114) use JUnit assertions (`assertEquals`, `assertNull`). Per project conventions, when modifying existing test methods, touched assertions should migrate to AssertJ. Since the sibling test files in this PR (`TuiHistoryLimitsTest`, `TuiPromptHistoryTest`, `AiPanelPromptHistoryTest`) all use AssertJ, it would be more consistent to use AssertJ here too:
```suggestion
assertThat(loaded.getShellHistory()).isEqualTo("25");
assertThat(loaded.getAiPromptHistory()).isEqualTo("50");
```
Not blocking — just a style consistency note.
--
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-24254: Add configurable TUI shell and AI prompt history [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #25101:
URL: https://github.com/apache/camel/pull/25101#issuecomment-5077238675
: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-24254: Add configurable TUI shell and AI prompt history [camel]
Posted by "atiaomar1978-hub (via GitHub)" <gi...@apache.org>.
atiaomar1978-hub commented on PR #25101:
URL: https://github.com/apache/camel/pull/25101#issuecomment-5077319345
## Review follow-up
Addressed @davsclaus feedback on AssertJ usage in `TuiSettingsTest`:
- **`roundTripPreservesAllFields`**: migrated all assertions in this method (including `shellHistory` / `aiPromptHistory` round-trip checks) to AssertJ so the method stays single-style.
- **`missingFileYieldsNullFieldsWithoutThrowing`**: migrated null/default history-limit assertions to AssertJ.
**Tests:** `./mvnw -pl dsl/camel-jbang/camel-jbang-plugin-tui test` (OpenJDK 21) — pass.
Commit: `0ae7d635e11`
_AI-generated comment on behalf of [atiaomar1978-hub](https://github.com/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-24254: Add configurable TUI shell and AI prompt history [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #25101:
URL: https://github.com/apache/camel/pull/25101#issuecomment-5077247108
For AI prompt it would be nice to have some kind of history search with ctrl + r that works in general in CLI and also in the JLine F6 shell.
--
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-24254: Add configurable TUI shell and AI prompt history [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #25101:
URL: https://github.com/apache/camel/pull/25101#issuecomment-5077324918
<!-- ci-tested-modules -->
:test_tube: **CI tested the following changed modules:**
- `docs`
- `dsl/camel-jbang/camel-jbang-plugin-tui`
---
<details><summary>:microscope: Scalpel shadow comparison — Scalpel: 3 tested, 1 compile-only — current: 2 all tested</summary>
[Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected **4 affected modules** (current approach: 2).
<details><summary>:warning: Modules only in Scalpel (2)</summary>
- `camel-launcher`
- `docs`
</details>
**Skip-tests mode would test 3 modules** (2 direct + 1 downstream), **skip tests for 1** (generated code, meta-modules)
<details><summary>Modules Scalpel would test (3)</summary>
- `camel-jbang-plugin-tui`
- `camel-launcher-container`
- `docs`
</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 (4 modules)</summary>
- Camel :: Docs
- Camel :: JBang :: Plugin :: TUI
- Camel :: Launcher
- Camel :: Launcher :: Container
</details>
---
:gear: [View full build and test results](https://github.com/apache/camel/actions/runs/30114656230)
--
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-24254: Add configurable TUI shell and AI prompt history [camel]
Posted by "atiaomar1978-hub (via GitHub)" <gi...@apache.org>.
atiaomar1978-hub commented on code in PR #25101:
URL: https://github.com/apache/camel/pull/25101#discussion_r3649644811
##########
dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/TuiSettingsTest.java:
##########
@@ -71,6 +73,8 @@ void roundTripPreservesAllFields(@TempDir Path tempDir) {
assertEquals("gemini", loaded.getAiProvider());
assertEquals("gemini-3.5-flash", loaded.getAiModel());
assertEquals("https://generativelanguage.googleapis.com", loaded.getAiUrl());
+ assertEquals("25", loaded.getShellHistory());
Review Comment:
Done in `0ae7d635e11` — AssertJ migration applied in both methods.
--
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