Commit 359f143
authored
feat(tui): pi-style dock, Shift-Tab effort cycle, MCP loading line, pi-tui v1.0.1 (#369)
## Requirement or Bug
Give the TUI pi's fixed-bottom dock, make Shift-Tab cycle thinking
effort, replace per-server MCP lines with one loading line, and sync
pi-tui to upstream v1.0.1.
## Bug Reproduction Steps
N/A (feature PR). The Shift-Tab part fixes a mismatch: the welcome tip
said "shift+tab cycles thinking effort", but Shift-Tab toggled plan
mode.
## Root Cause
N/A for the dock, effort cycle, and pi-tui sync. For the MCP line: each
server that connected printed its own permanent `MCP server "x"
connected · N tools` line. While fixing that, the startup status
snapshot could also overwrite newer live `mcp.status` events, which
could leave a stale "loading" state on screen. Live events now win over
the snapshot.
## Code Changes
Seven commits, each one slice:
1. **Fullscreen by default** (`tui/config.ts`, `tui-mode-selector.ts`):
`DEFAULT_TUI_CONFIG.tuiMode` is `fullscreen`, and the "(experimental)"
label is gone. On exit, fullscreen still replays the transcript to the
main screen.
2. **Shift-Tab cycles effort** (`editor-keyboard.ts`,
`pythinker-tui.ts`, `commands/config.ts`): Shift-Tab steps through the
model's effort segments (without `off`) and wraps. Boolean-thinking
models toggle on/off. It uses `performModelSwitch` with a new `quiet`
option, so a key press adds no transcript line. The pick lasts for this
session only (`/effort` still saves it). While a reply streams, the key
does nothing. When no prompt highlight is active, the prompt frame uses
the theme's `effort*` color; plan, bash, and slash highlights still take
precedence. The tip, help panel, and docs are updated.
3. **Plain rules** (`custom-editor.ts`): the prompt is drawn as two `─`
rules with no sides. When a `/btw` panel is attached above
(`connectedAbove`), the old box is kept, so the panel border still
closes.
4. **Spinner in the top rule** (`activity-pane.ts`,
`activity-spinner.ts`, `custom-editor.ts`): while the agent works, the
editor's top rule becomes `── ⠋ Working · tip ───`. The spinner keeps
its lifecycle; only where it draws changes, so the dock height does not
change.
5. **MCP loading line** (`session-event-handler.ts`, new
`mcp-loading-line.ts`): one `● Loading MCP: a, b` line with the shared
blinking `STATUS_BULLET`. It lists only the servers still pending and is
removed when none are left. Failed and needs-OAuth servers still print
their own line, which stays.
6. **pi-tui upstream v1.0.1** (`packages/pi-tui`): a three-way merge
from the old sync point `53816d7` (v0.85.1) to `a7229ddc`. Fork changes
are kept. Upstream's private `asciiVisibleWidth` is renamed
`asciiTabVisibleWidth`, because the fork already exports a function with
that name. Upstream's new files received only `!`/bracket fixes for our
stricter tsconfig. The darwin `.node` prebuilds were rebuilt from the
reviewed `darwin-platform.m`. Their exports and linked libraries match
upstream's v1.0.1 binaries. `UPSTREAM.md` records the new sync point. No
new dependencies.
7. Changesets.
## Behavior Changes and Affected Users
| Behavior | Before | After | Who relies on the old behavior | Escape
hatch |
|---|---|---|---|---|
| Default TUI mode | `regular` (native scrollback) | `fullscreen` (fixed
bottom dock, alt screen) | New installs and users with no `tui.toml`.
Existing `tui.toml` files already contain `tui_mode = "regular"` and are
not affected. | `tui_mode = "regular"`, `/settings` → TUI mode |
| Shift-Tab | toggles plan mode | cycles thinking effort | TUI users who
toggle plan mode with the key | `/plan` |
| Shift-Tab while streaming | toggled plan mode | does nothing | same as
above | `/plan` |
| Prompt frame color | plan/bash/slash highlight, otherwise neutral |
when not highlighted, the effort color | none | none (visual only) |
| Prompt editor frame | rounded box | two plain rules (box kept while
`/btw` is attached) | none | `tui_mode = "regular"` keeps the regular
layout, but the frame is plain in both modes |
| Working spinner | own row above the prompt | inside the prompt's top
rule | none | none |
| MCP startup output | one permanent line per connected server | one
temporary blinking line; failed and needs-auth lines are unchanged |
users who read tool counts from the chat | the welcome card still shows
`MCP N connected`; `/mcp` lists servers |
| Status snapshot vs live MCP events | snapshot could overwrite newer
events | live events win | none | none |
| pi-tui internals | v0.85.1 | v1.0.1 (WezTerm image scroll, Kitty
non-PNG convert, ANSI order fix) | none | none |
Affected modules: `apps/pythinker-code/src/tui/**`, `packages/pi-tui`,
docs (`configuration/config-files.md`, `guides/interaction.md`,
`reference/keyboard.md`). Print mode, web, desktop, ACP, and SDK are not
touched. Tests: TUI config tests (default and pinned `regular`), the
editor-keyboard Shift-Tab cycle, editor side-border and plain-rule
tests, activity-pane rule placement, MCP loading-line
appear/shrink/clear, and the pi-tui `node --test` suite (1101 pass).
Checked manually with tmux at 150x45 and 80x24, in fullscreen and
regular mode. Shift-Tab changed `max → low → high` on DeepSeek V4.1
Flash. A slow stdio MCP fixture showed the blinking line shrink and then
clear.
## Checklist
- [x] I have read the
[CONTRIBUTING](https://github.com/PyModel/pythinker-code/blob/main/CONTRIBUTING.md)
document.
- [ ] I have linked a related issue (external PRs: issue must have a
maintainer's `/approve`).
- [x] I have added tests that prove my feature works.
- [x] The behavior-change table above is complete, and every removed
behavior or flipped default is named in the changeset and either has an
escape hatch or was explicitly approved by a maintainer in this PR.
- [x] Ran `gen-changesets` skill, or this PR needs no changeset.
- [x] Ran `gen-docs` skill, or this PR needs no doc update.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* The TUI now defaults to fullscreen, with the prompt fixed at the
bottom and in-app scrolling. Choose Regular mode to keep chat in
terminal scrollback; saved mode settings are preserved.
* Shift-Tab cycles through the current model’s thinking efforts. Use
`/plan` to toggle Plan mode.
* Connecting MCP servers appear together in a temporary loading line;
failures and servers needing authentication remain individually visible.
* Added support for clipboard file paths, improved image display in
supported terminals, and more responsive wheel scrolling.
* **Improvements**
* Autocomplete better handles paths, punctuation, and CJK text. LaTeX
rendering supports more script and cases layouts.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 6305545 commit 359f143
76 files changed
Lines changed: 3380 additions & 758 deletions
File tree
- .changeset
- apps/pythinker-code
- src/tui
- commands
- components
- chrome
- dialogs
- editor
- messages
- panes
- constant
- controllers
- theme
- test/tui
- commands
- components
- dialogs
- editor
- panes
- controllers
- theme
- docs
- configuration
- customization
- guides
- reference
- packages/pi-tui
- native
- darwin
- prebuilds
- darwin-arm64
- darwin-x64
- src
- src
- components
- test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
404 | 423 | | |
405 | 424 | | |
406 | 425 | | |
407 | 426 | | |
408 | 427 | | |
| 428 | + | |
409 | 429 | | |
410 | 430 | | |
411 | 431 | | |
| |||
488 | 508 | | |
489 | 509 | | |
490 | 510 | | |
| 511 | + | |
491 | 512 | | |
492 | 513 | | |
493 | 514 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
102 | 106 | | |
103 | 107 | | |
104 | 108 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
5 | 10 | | |
6 | 11 | | |
7 | 12 | | |
8 | 13 | | |
9 | 14 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
Lines changed: 32 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
154 | 156 | | |
155 | 157 | | |
156 | 158 | | |
| 159 | + | |
| 160 | + | |
157 | 161 | | |
158 | 162 | | |
159 | 163 | | |
| |||
341 | 345 | | |
342 | 346 | | |
343 | 347 | | |
344 | | - | |
| 348 | + | |
345 | 349 | | |
346 | 350 | | |
| 351 | + | |
347 | 352 | | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
348 | 358 | | |
349 | 359 | | |
350 | 360 | | |
| |||
842 | 852 | | |
843 | 853 | | |
844 | 854 | | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
845 | 865 | | |
846 | 866 | | |
847 | 867 | | |
| |||
854 | 874 | | |
855 | 875 | | |
856 | 876 | | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
857 | 880 | | |
858 | 881 | | |
859 | 882 | | |
860 | 883 | | |
861 | 884 | | |
862 | 885 | | |
863 | 886 | | |
864 | | - | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
865 | 892 | | |
866 | 893 | | |
867 | 894 | | |
868 | 895 | | |
869 | 896 | | |
870 | 897 | | |
871 | | - | |
872 | | - | |
| 898 | + | |
| 899 | + | |
873 | 900 | | |
874 | 901 | | |
875 | 902 | | |
| |||
886 | 913 | | |
887 | 914 | | |
888 | 915 | | |
889 | | - | |
| 916 | + | |
890 | 917 | | |
891 | 918 | | |
892 | 919 | | |
| |||
0 commit comments