You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[CLI] Rebuild the TUI suggestion editor with Hex1b widgets - #1522
↑ Debug solution build, Release Tui.Tests build and all 28 Tui.Tests pass (automator-driven, isolated temp history), including nine new anchor cases across sizes, panels, suggestion counts and input shapes. ↑ Real PTY at 60×18, 80×24 and 120×40 reproduced 1–4 blank rows below the input on the previous revision; at this revision input sits directly above the bottom separator with 0, few and many suggestions. ↑ Wrapped input stays flush with the separator while growing and shrinking; focus stays on input after the first submission replaces the welcome panel. ↓ Ctrl+Enter could not be injected via PTY, so multiline layout is verified only headlessly. ↓ Live Azure path completion and the full test suite were not run.
Related command
Azclips TUI command entry
Description
Builds on #1521 and includes its Hex1b 0.176.0 upgrade commit. This PR targets upstream Azure/azclips:main, not the dependency branch; the original branch remains unchanged.
Replace SuggestionRenderer.Render with Build, returning a VStack containing a native controlled List above a TextBox configured with Predict. Up/Down transfer focus and navigate suggestions; crossing the list boundary or pressing Escape returns focus to input. Right Arrow completes the selected or first available suggestion at the end of input, while retaining ordinary cursor movement elsewhere. Tab/Enter accept a selected suggestion; Enter otherwise submits the command. Typing while browsing resumes editing. History, wrapping and Ctrl+Enter multiline entry remain supported.
Clear stale suggestions/selection before asynchronous path lookup and discard results for changed input or mode. Remove the obsolete placement menu because suggestions now always appear above the input.
The input TextBox fills the row width, and the inline prediction is dropped for one frame after programmatic edits (submit, history recall, completion), because Hex1b 0.176.0 refreshes predictions only on typed input. Without that frame, stale ghost text would remain. Inline predictions are single-line only, so wrapped or multiline commands use list-based completion.
Keep the editor immediately above the bottom separator, with suggestions growing upward. Hex1b's content measurement reserves at least one row for an empty List and measures all items even when its arranged height is capped at eight. The enclosing stack now uses the displayed list rows plus actual wrapped/multiline input rows, and the input row uses its actual height, eliminating the unused space without padding or spacer widgets.
Add a dedicated tests/Tui.Tests project, which receives InternalsVisibleTo instead of Cli.Tests. The TUI tests move there and are rewritten to drive input with Hex1bTerminalAutomator through a TuiTestApp headless fixture. A single-widget SuggestionRenderer example is also added. HistoryService accepts an optional directory so tests never read or write the user's real history. A new tui-testing skill documents the approach.
Passed: dotnet test tests/Tui.Tests/Tui.Tests.csproj (28 tests).
Passed: dotnet build tests/Tui.Tests/Tui.Tests.csproj -c Release -v:q (0 errors; signed build used by CI).
Passed: real pseudo-terminal runs (pexpect + pyte) at 60×18, 80×24 and 120×40. The previous revision left 1 blank row below the input with no suggestions and 3–4 rows with many. At this revision, input sits directly above the bottom separator for empty, few, many and no-match suggestion states, after backspacing, and for wrapped input growing to 3 rows and shrinking back. Focus stays on input after the first submission swaps the welcome panel for history.
Headless only: multiline (Ctrl+Enter) layout and help-panel layout, covered by the new anchor theory; Ctrl+Enter could not be injected through the PTY.
Earlier pseudo-terminal runs verified inline prediction while typing; Up/Down list focus and selection; Esc focus return; Right Arrow completion and ordinary cursor movement; editing after completion; Enter submission matching the base branch; history recall without stale ghost text.
Not run: live Azure path completion; full test suite.
History Notes
[CLI] TUI: Navigate native suggestions above command input and accept completions with Right Arrow
The PR title starts with [Component Name] for customer-facing changes or {Component Name} for non-customer-facing changes, and does not end with trailing punctuation or spaces.
Customer-facing changes include a useful release note in the PR title or the History Notes section.
I added or updated tests for behavior changes.
I updated documentation when behavior, setup, support, or security guidance changed.
Migrate to the split WithHex1bApp(options, app => ...) overload; the
combined (app, options) callback was removed.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Azure Pipelines:
6 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Stale asynchronous path lookups can overwrite newer suggestions, and pressing Space after selecting a suggestion activates it instead of resuming editing.
Make the suggestion TextBox fill the row so completed text is not
horizontally scrolled, and drop the predictor for one frame after
programmatic edits so stale inline predictions are cleared.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Completion lookups can publish stale results after repeated input or working-directory changes, overwriting suggestions and selections, while mode switches can leave stale inline predictions visible.
Clear cached inline predictions when mode or suggestions change
TUI/Rendering/SuggestionRenderer.cs:56
Pressing F2 after typing an Azure command prefix can leave its inline prediction visible in Local mode even when the new suggestion list is empty, because TypedInputText still equals InputText. The PR's stated Hex1b 0.176.0 behavior is consistent with upstream default-branch reconciliation, which clears cached predictions only when the handler is removed. Track mode and suggestion revision alongside the input text, and clear the cached prediction when that context changes without a typed edit.
Size the editor stack from its displayed suggestion rows and wrapped input rows, avoiding List's uncapped content measurement and empty-list row reservation. Cover list growth and multiline input across terminal sizes and output panels.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Unresolved bugs can flatten multiline pastes, accept stale completions, block editing from the suggestion list, and let outdated suggestion requests disrupt focus.
Forward editing keys and paste from the suggestion list
TUI/Rendering/SuggestionRenderer.cs:37
After typing /p and pressing Down, Space accepts /pwd instead of resuming editing because the native List binds Space to activation (default-branch source, also confirmed in 0.176.0). Backspace, Delete, Left Arrow and paste also fail to reach the sibling TextBox. Override Space and forward editing keys with their modifiers and paste to the editor, restoring input focus and refreshing suggestions after edits.
Preserve line breaks when pasting into a single-line editor
TUI/Rendering/SuggestionRenderer.cs:52
An empty or short editor is single-line, so pasting echo one\necho two changes it to echo one echo two. Hex1b normalizes the newlines before OnTextChanged (confirmed in 0.176.0; default-branch implementation). Add an explicit paste handler that preserves line breaks and replaces the selection, and cover this case with a regression test.
Clear stale ghost text when suggestion context changes
TUI/Rendering/SuggestionRenderer.cs:58
Type g in Azure mode, wait for the group prediction, then press F2 with no matching local history: the suggestions clear but the ghost text remains. Right Arrow can then accept that stale completion because replacing a non-null predictor does not clear Hex1b's cache (confirmed in 0.176.0; default-branch source). Track mode and suggestion-context changes as well as text, and omit the predictor for a frame when that context changes.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
A superseded completion request can still overwrite newer suggestions and reset the active selection because matching text and mode does not uniquely identify the current request.
Moves TUI tests out of Cli.Tests into a dedicated project driven by
Hex1bTerminalAutomator, makes the HistoryService directory injectable so
tests use isolated history, and adds a tui-testing skill.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Completion requests lack generation-based invalidation, allowing stale callbacks to overwrite or clear current suggestions, while pending lookups can leave inline predictions blank.
Azure Pipelines:
Successfully started running 1 pipeline(s).
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
49ef80f40fb938b250f44da51ece24718248c433↑ Real PTY at 60×18, 80×24 and 120×40 reproduced 1–4 blank rows below the input on the previous revision; at this revision input sits directly above the bottom separator with 0, few and many suggestions.
↑ Wrapped input stays flush with the separator while growing and shrinking; focus stays on input after the first submission replaces the welcome panel.
↓ Ctrl+Enter could not be injected via PTY, so multiline layout is verified only headlessly.
↓ Live Azure path completion and the full test suite were not run.
Related command
Azclips TUI command entry
Description
Builds on #1521 and includes its Hex1b 0.176.0 upgrade commit. This PR targets upstream
Azure/azclips:main, not the dependency branch; the original branch remains unchanged.Replace
SuggestionRenderer.RenderwithBuild, returning a VStack containing a native controlled List above a TextBox configured withPredict. Up/Down transfer focus and navigate suggestions; crossing the list boundary or pressing Escape returns focus to input. Right Arrow completes the selected or first available suggestion at the end of input, while retaining ordinary cursor movement elsewhere. Tab/Enter accept a selected suggestion; Enter otherwise submits the command. Typing while browsing resumes editing. History, wrapping and Ctrl+Enter multiline entry remain supported.Clear stale suggestions/selection before asynchronous path lookup and discard results for changed input or mode. Remove the obsolete placement menu because suggestions now always appear above the input.
The input TextBox fills the row width, and the inline prediction is dropped for one frame after programmatic edits (submit, history recall, completion), because Hex1b 0.176.0 refreshes predictions only on typed input. Without that frame, stale ghost text would remain. Inline predictions are single-line only, so wrapped or multiline commands use list-based completion.
Keep the editor immediately above the bottom separator, with suggestions growing upward. Hex1b's content measurement reserves at least one row for an empty List and measures all items even when its arranged height is capped at eight. The enclosing stack now uses the displayed list rows plus actual wrapped/multiline input rows, and the input row uses its actual height, eliminating the unused space without padding or spacer widgets.
Add a dedicated
tests/Tui.Testsproject, which receivesInternalsVisibleToinstead of Cli.Tests. The TUI tests move there and are rewritten to drive input withHex1bTerminalAutomatorthrough aTuiTestAppheadless fixture. A single-widgetSuggestionRendererexample is also added.HistoryServiceaccepts an optional directory so tests never read or write the user's real history. A newtui-testingskill documents the approach.Testing Guide
dotnet build azclips.slnx -v:q(0 errors).dotnet test tests/Tui.Tests/Tui.Tests.csproj(28 tests).dotnet build tests/Tui.Tests/Tui.Tests.csproj -c Release -v:q(0 errors; signed build used by CI).History Notes
[CLI] TUI: Navigate native suggestions above command input and accept completions with Right Arrow
[Component Name]for customer-facing changes or{Component Name}for non-customer-facing changes, and does not end with trailing punctuation or spaces.