feat: replace framed input with horizontal rules in CLI
- Updated the input area layout by replacing the styled border frame with horizontal rules above and below the input, enhancing visual clarity. - Adjusted the layout to ensure the input area grows dynamically with content while maintaining a consistent appearance with inline completions. - Modified style definitions to reflect the new horizontal rule design, improving the overall aesthetics of the CLI.
This commit is contained in:
parent
5c545e67f3
commit
0e8ee051c6
1 changed files with 17 additions and 8 deletions
25
cli.py
25
cli.py
|
|
@ -35,7 +35,7 @@ from prompt_toolkit.application import Application
|
|||
from prompt_toolkit.layout import Layout, HSplit, Window, FormattedTextControl
|
||||
from prompt_toolkit.layout.dimension import Dimension
|
||||
from prompt_toolkit.layout.menus import CompletionsMenu
|
||||
from prompt_toolkit.widgets import TextArea, Frame
|
||||
from prompt_toolkit.widgets import TextArea
|
||||
from prompt_toolkit.key_binding import KeyBindings
|
||||
from prompt_toolkit.completion import Completer, Completion
|
||||
from prompt_toolkit.keys import Keys
|
||||
|
|
@ -1704,10 +1704,18 @@ class HermesCLI:
|
|||
height=get_hint_height,
|
||||
)
|
||||
|
||||
# Wrap the input in a styled border frame that grows with content
|
||||
framed_input = Frame(input_area, style='class:input-frame')
|
||||
# Horizontal rules above and below the input (bronze, 1 line each).
|
||||
# The bottom rule moves down as the TextArea grows with newlines.
|
||||
input_rule_top = Window(
|
||||
content=FormattedTextControl([('class:input-rule', '─' * 200)]),
|
||||
height=1,
|
||||
)
|
||||
input_rule_bot = Window(
|
||||
content=FormattedTextControl([('class:input-rule', '─' * 200)]),
|
||||
height=1,
|
||||
)
|
||||
|
||||
# Layout: spacer + framed input at bottom, completions below.
|
||||
# Layout: spacer + ruled input at bottom, completions below.
|
||||
# Using inline CompletionsMenu (not a Float) so it reliably appears even
|
||||
# after agent output has filled the terminal via patch_stdout. Float-based
|
||||
# menus lose their rendering space in non-full-screen mode once scrollback
|
||||
|
|
@ -1716,7 +1724,9 @@ class HermesCLI:
|
|||
HSplit([
|
||||
Window(height=0),
|
||||
spacer,
|
||||
framed_input,
|
||||
input_rule_top,
|
||||
input_area,
|
||||
input_rule_bot,
|
||||
CompletionsMenu(max_height=12, scroll_offset=1),
|
||||
])
|
||||
)
|
||||
|
|
@ -1727,9 +1737,8 @@ class HermesCLI:
|
|||
'prompt': '#FFF8DC',
|
||||
'prompt-working': '#888888 italic',
|
||||
'hint': '#555555 italic',
|
||||
# Bronze frame around the input area
|
||||
'input-frame': '#CD7F32',
|
||||
'input-frame.border': '#CD7F32',
|
||||
# Bronze horizontal rules around the input area
|
||||
'input-rule': '#CD7F32',
|
||||
'completion-menu': 'bg:#1a1a2e #FFF8DC',
|
||||
'completion-menu.completion': 'bg:#1a1a2e #FFF8DC',
|
||||
'completion-menu.completion.current': 'bg:#333355 #FFD700',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue