Fixed-frame TUI and inline menu chrome - #7
Conversation
Introduce a fixed header + bottom input frame for the terminal UI and add an InlineMenuChrome to render inline selection menus inside that frame. Key changes: - Add InlineMenuChrome dataclass and propagate a menu_chrome parameter through onboarding interactive prompts to allow custom menu framing and styling. - Enhance menu application to support optional framing, cursor positioning, and merging of prompt styles when a chrome is provided. - Rework TerminalFractalApp to use a fixed-frame prompt session: add a fixed header, transcript window, rounded input frame, and logic to lift completion floats out of the fixed input. - Implement live-mode helpers to pin/reset the terminal scroll region, render a static running frame, and capture command output into the fixed transcript area. - Replace the old footer/prompt behavior with a more compact prompt icon (with optional nerd-font), context level bar, and improved slash-command completion reservation. - Update onboarding flows to accept and forward menu_chrome so configuration/setup menus render inside the fixed frame. - Update and expand tests to cover prompt icon behavior, fixed-frame layout, transcript retention, pinned running frame behavior, and various prompt/menu interactions. These changes improve UX in terminal environments by keeping the prompt and header stable, allowing inline configuration menus, and preserving command output in a transcript area.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
This PR refactors Fractal’s terminal UI to use a fixed top header and a fixed bottom input frame, and introduces “inline menu chrome” so interactive selection menus (onboarding/config/session selection) can render inside that fixed frame without disrupting the layout.
Changes:
- Added a fixed-frame
PromptSessionlayout (header + transcript window + rounded input frame) and logic to lift completion menu floats out of the fixed input area. - Added
InlineMenuChromeand threaded amenu_chromeparameter through interactive onboarding/setup prompts, including style merging and optional full-screen framing. - Expanded TUI tests to cover prompt icon behavior, transcript retention, fixed-frame layout expectations, and inline session selection for
/sessionsand/resume.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/fractal/tui/app.py |
Implements fixed-frame prompt layout, transcript capture, prompt icon/title rendering, and inline session selection/resume flows. |
src/fractal/onboarding.py |
Adds InlineMenuChrome and updates inline menu rendering to support framing, cursor positioning, and style merging. |
tests/test_tui.py |
Updates/adds tests for fixed-frame layout, prompt/user message rendering, transcript retention, and menu interactions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| async def handle_provider_command(self, rest: str) -> bool: | ||
| if rest.strip(): | ||
| self.console.print(Text("usage: /provider", style="yellow")) | ||
| self._print_command_output(Text("usage: /provider", style="yellow")) | ||
| return True |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
magix022
left a comment
There was a problem hiding this comment.
This PR is not close to being ready for merge, it breaks most of the text rendering in the TUI. Needs human review, an AI can't verify TUI rendering.
Introduce a fixed header + bottom input frame for the terminal UI and add an InlineMenuChrome to render inline selection menus inside that frame. Key changes:
These changes improve UX in terminal environments by keeping the prompt and header stable, allowing inline configuration menus, and preserving command output in a transcript area.