Skip to content

Commit da4b56c

Browse files
authored
Feat/hide initial toolbar sooner (#1694)
* [feat] Make short toolbar message show after initial prompt * Updated changelog
1 parent 0148744 commit da4b56c

3 files changed

Lines changed: 31 additions & 1 deletion

File tree

changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
Upcoming (TBD)
2+
==============
3+
4+
Features
5+
---------
6+
* Makes short toolbar message show after initial prompt
7+
8+
19
1.62.0 (2026/03/07)
210
==============
311

mycli/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ def get_continuation(width: int, _two: int, _three: int) -> AnyFormattedText:
10051005
return [("class:continuation", continuation)]
10061006

10071007
def show_initial_toolbar_help() -> bool:
1008-
return iterations < 2
1008+
return iterations == 0
10091009

10101010
# Keep track of whether or not the query is mutating. In case
10111011
# of a multi-statement query, the overall query is considered

test/test_clitoolbar.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from prompt_toolkit.shortcuts import PromptSession
2+
3+
from mycli.clitoolbar import create_toolbar_tokens_func
4+
from mycli.main import MyCli
5+
6+
7+
def test_create_toolbar_tokens_func_initial():
8+
m = MyCli()
9+
m.prompt_app = PromptSession()
10+
iteration = 0
11+
f = create_toolbar_tokens_func(m, lambda: iteration == 0, m.toolbar_format)
12+
result = f()
13+
assert any("right-arrow accepts full-line suggestion" in token for token in result)
14+
15+
16+
def test_create_toolbar_tokens_func_short():
17+
m = MyCli()
18+
m.prompt_app = PromptSession()
19+
iteration = 1
20+
f = create_toolbar_tokens_func(m, lambda: iteration == 0, m.toolbar_format)
21+
result = f()
22+
assert not any("right-arrow accepts full-line suggestion" in token for token in result)

0 commit comments

Comments
 (0)