Commit Graph

32 Commits

Author SHA1 Message Date
alan 0c4f008045 Merge branch 'worktree-agent-ad4dacaa0da379451'
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 02:44:31 +00:00
alan c5af000453 Terminal: text input for IMEs, Capture browser keys, touch key row
- Desktop and web terminals use the text-input path too, so IMEs, dead
  keys, the emoji picker and dictation work; the key handler still
  encodes special keys and chords first (handled keys are never typed
  again), composing text is drawn at the cursor and sent on commit, the
  platform editable sits at the cursor, and a closed input reopens on
  the next key. The editable terminal is a semantics text field so web
  typing also works with semantics on.
- Web: "Capture browser keys" (terminal menu and right-click menu) goes
  full screen and calls navigator.keyboard.lock(); hold Esc to leave.
  No-op where unsupported; cheatsheet and menu note give alternatives.
- Touch: scrollable key row with sticky Ctrl/Alt (tap once, double-tap
  lock), Esc, Tab, arrows, Home/End, PgUp/PgDn and symbols through the
  hardware encoder; soft keyboard types per key (delete detection,
  Return as Enter); the line field moves behind the row's Line button.
- Capture kit: compose=, --semantics false, --user-agent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 02:43:57 +00:00
alan 9c6fdc9043 Terminal tabs: a short title keeps a select target wider than its close button
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 02:27:40 +00:00
alan b59ab5fad7 Terminal round 3: readable palettes, panel and card sizing, rail, tabs
- Colours: terminal background is the theme's lowest surface; the 16 ANSI
  colours come from a chosen palette (Theme colours, Classic, Calm, Vivid;
  Settings > Terminal > Colours, saved as `palette`) adjusted in lightness
  to the background: colours 4.5:1, bright ones lighter than normal,
  white light and black dark in both themes so white-on-red/blue/magenta
  and black-on-green/yellow/cyan (ls setuid, setgid, sticky) keep 3:1.
  Selection, find matches and the current match keep text at 4.5:1.
- Bottom panel opens at 40% of the window, at least 16 rows, until
  dragged; the dragged height is remembered (old saved 300 px default
  reads as never resized).
- Navigation rail scrolls its tabs (and below 240 px Settings too), so
  items never overlap under a tall panel.
- Chat command cards: Expand / Collapse grows a live terminal to 60% of
  the window (finished output only to its rows); collapsed stays 12 rows.
- Terminal tabs: ellipsised titles (220 px) with the whole title in the
  tooltip, selected tab filled, outlined and bold, close buttons are
  IconButtons (48 px touch, 40 px desktop).
- Capture fixture: ?terminalColors=1 and ?terminalPalette=.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 02:25:16 +00:00
alan eaed2583a7 Merge branch 'worktree-agent-a2220433c67c864f1' 2026-11-26 00:57:20 +00:00
alan e13cb99ade Terminals: keep screen state on the server; snapshot on reload and gaps
A headless xterm-compatible emulator (internal/termstate) follows each
machine terminal's PTY output under the same lock as the 1 MiB tail. A
terminal_output from before the retained tail (new page, reload, gap)
now gets output_snapshot: an escape stream that resets the client and
restores scrollback (1000 lines), main screen, the alternate screen when
in use (via ?1049h so the program's exit brings the shell back), saved
cursors, tabs, scroll region, cursor incl. pending wrap, modes (mouse
tracking/encoding, bracketed paste, DECCKM, keypad, autowrap, origin,
focus, ...), charsets, pen and title, as of output_end; frames continue
there. Reads inside the tail stay raw.

No Go library was adequate: charmbracelet/x/vt and vito/midterm scroll at
0.2-4 MB/s and hide modes/pen/region; vt10x is unmaintained. termstate
runs at 160-200 MB/s.

The app treats a snapshot reply as a replay without the dropped-output
line, and every replay now starts with RIS so stale modes end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 00:56:49 +00:00
alan e65354496a Terminal round 2: tests for every feature; split find host and tab events
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 00:48:11 +00:00
alan 6832ec789e Terminal: find, zoom, scrollback, scroll keys, context menu, bell, link hover, OSC 52/7, cursor blink, stale selection
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 00:33:53 +00:00
alan aaed57e105 Merge main into the terminal flow-control branch
Conflicts resolved keeping both sides: main's active-client rules, input
lane, reply marking and key input, and this branch's flow control,
acknowledgements, subscriptions and sliced emulator feed. terminal_ack
joins the terminal lane; the feed marks each live slice it writes as
drawing, so the emulator's answers still go to onReply.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 00:03:20 +00:00
alan 0963a071d0 Terminals: flow-controlled output, immediate echo, sliced emulator writes
Machine terminals no longer skip output for live viewers. Each connection's
subscription is a cursor into the 1 MiB retained tail, drained by the
connection's writer as soon as the PTY reader writes (no 50 ms tick; a
streaming frame gathers for at most 2 ms). A subscription opened with
flow: true gets window (256 KiB) in its reply and acknowledges drawn output
with terminal_ack; while one is full the reader stops reading the PTY, so
the program waits. A subscription full for 3 s without acking stops holding
the terminal and later sees a gap; a gone connection drops its
subscriptions. Clients that never ask for flow keep the old pacing (newest
64 KiB per 50 ms). terminal_open/terminal_output replies precede the frames
that follow them, which start exactly at the reply's output_end.

Chat shell runs share the buffer code: output is pushed as it arrives,
oldest first, while the chat's watchers keep short queues; 256 KiB unpushed
stops the reader, and watchers behind for 3 s get the old pacing.

The app asks for flow, takes offsets from the server (frame end, reply
output_end) instead of re-encoded text length, acks per quarter window, and
writes replays and bursts into the emulator in slices that yield to the
event loop (ChatShellTerminalFeed, shared with chat shells).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 23:57:18 +00:00
alan fafaa46afb Merge branch 'worktree-agent-ab9de97501bc94a9c'
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 23:38:04 +00:00
alan c3458d8a7f Terminals: one active client per terminal; keystrokes skip the request queue
Several clients drawing one terminal (machine terminal or chat terminal
command) no longer interfere. The server tracks, per terminal, the
connections drawing it, most recently active first: the active client
(the opener, then whoever last typed or focused it) owns the PTY size and
is the only one whose emulator's automatic query answers reach the
process; other clients' answers are acknowledged and dropped, and their
sizes recorded but not applied. When the active connection closes the next
most recent client's size is applied.

Protocol (backwards compatible; all new fields optional):
- terminal_input / chat_shell_input: reply (emulator answer), cols/rows
  (the typist's size, applied before the input).
- terminal_resize / chat_shell_resize: activate (the client focused it).

Latency: PipelinesClient sends terminal_input, terminal_resize,
chat_shell_input and chat_shell_resize at once rather than behind the
previous request's reply. The server reads those onto a per-connection
terminal lane handled in order beside the ordinary request loop, and
terminal_open (up to 5 s waiting for su) now runs off the read loop.

Client: ChatShellTerminalSession routes what the emulator emits while
drawing output to onReply and reports focus through activate();
ChatShellInputPipe keeps answers and typing in separate requests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 23:37:16 +00:00
alan 7d1ffe8ad3 Terminal: xterm key encoding, no live reflow on resize, Alt+T/Ctrl+T reach the shell
- Live terminals no longer reflow (xterm.dart 4.0.0 left the cursor on the
  wrong row); narrowing cuts and erases cells past the width, rows scroll
  into scrollback keeping the cursor row; finished output still reflows.
- App-side key encoding before xterm.dart's defaults: Alt as Meta (ESC +
  the typed character), Ctrl symbol table, xterm modifier parameter for
  arrows/Home/End/PgUp/PgDn/Ins/Del/F-keys, DECCKM and DECKPAM, Alt+BS.
- Settings > Appearance > Terminal: Use Option as Meta key (Macs, on).
- Inside a focused terminal only Cmd+T and Ctrl+` toggle it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 23:32:29 +00:00
alan 40623991e8 Merge commit '6aeabfe5916b3eb345e922c86a60e04580156c01' into pipelines/run-20261112-0138-mobile-chat-terminal-buttons-26ca 2026-11-12 02:54:31 +00:00
alan a233733966 Match chat terminal buttons to responsive UI
Remove the duplicate terminal action from narrow shell bars and expose the terminal in open chat bars only where appropriate. Use the shared plain bar-button styling and add focused light/dark responsive widget coverage.
2026-11-12 02:16:23 +00:00
alan e4f3ebdcab Make floating-window close buttons minimise
Remove the separate minimise control and make the title-bar X hide windows while preserving their state and reachability. Update window behavior documentation and focused tests for chat, terminal, and window layering.
2026-11-12 01:45:42 +00:00
alan 9551eceaed Complete Material-only APIs and fixtures
Remove obsolete control-family flags and icon metadata across all callers, dead alternate themes and host helpers, obsolete test setup, and the unused icon-font dependency. Preserve native Material Back transitions. Make navigation fixtures independent of update plugins and answer auxiliary shell snapshots so the complete application suite can run deterministically.
2026-11-11 21:55:39 +00:00
alan 214bbbc54f Remove Cupertino branches from terminal chat shell
Keep the existing Material terminal and chat-shell behavior while removing live Cupertino widgets, icon metadata, and alternate-host branches. Retain only the documented optional compatibility parameters until remaining callers migrate.
2026-11-11 20:05:55 +00:00
alan 3be07064f9 Remove Cupertino terminal branches
Keep the Material-only terminal implementation while preserving public Cupertino parameters for callers. This removes unreachable Cupertino widgets and imports without changing the Material path.
2026-11-11 03:58:24 +00:00
alan 2628f6c425 Copy a terminal selection with Ctrl+C outside Apple platforms
A browser keeps Ctrl+Shift+C for its developer tools, so on Linux and
Windows web nothing copied. With text selected Ctrl+C now copies it (and
clears the selection) instead of interrupting the process; Ctrl+Insert
copies too, and a finished run's read-only output answers the copy keys.
The terminal's options menu names the key.
2026-11-11 00:05:16 +00:00
alan 75a61dbd8c Make the terminal's floating mode a window of the window system
Phase 3 of docs/plans/floating-windows.md. The terminal window kind reuses
TerminalHub; TerminalWindows keeps the window in step with TerminalLayout
(show opens or shows it, hide minimises it, Minimise and Close hide the
terminal). The bottom panel stays a shell panel. The first window takes the
frame and maximised state pipelines.terminal-layout.v1 saved.

The terminal's own float chrome and FloatingLayer are deleted.
2026-11-10 22:19:30 +00:00
alan fdc730422d Host floating chats on the shell window system
Phase 2.3 and 2.4 of docs/plans/floating-windows.md. A floating chat is a
window of the chat kind over the app's WindowManager, built from the
app-lifetime ChatRuntime, so it shows over every destination and at start
without the Chat destination being built. Float and Dock move the same
keyed view between the tiling and the window host. The pipelines app keeps
one runtime and one ChatWindows; saved chatFloat records (v1 and v2) are
brought over once.

ChatFloatHost, ChatFloatWindow, the float frames and binding, the
controller's float list and FloatingFocusRoot are gone; the workspace only
asks whether a chat is out in a window. Every MenuAnchor targets the root
overlay (guarded by a test), and menus and tooltips name the Alt chords.
2026-11-10 21:17:40 +00:00
alan a99f7014f5 Add the shell window host with layering acceptance tests
Phase 1.3 and 1.4 of docs/plans/floating-windows.md. Windows are plain
children of the terminal stage's stack in the shell page, outside every
destination, so popups opened from one are above all of them. Each window
has its own page navigator: pushed pages open inside the window, and popup
routes go to the root navigator. One WindowFrame chrome (move, resize,
minimise, maximise, close), a focus scope per window, a ScaffoldMessenger
per window.

No feature uses it yet. The capture fixture opens probe windows with
?windows=N, and window_layering_test.dart covers every popup type from a
window over Chat and over another destination.
2026-11-10 20:48:31 +00:00
alan bb669aface Float one chat pane over the app and toggle it with Ctrl+Y / Cmd+Y 2026-11-10 12:56:39 +00:00
alan 87519985bf Always show the terminal shortcut on the phone Chat page
The shortcut no longer waits for a running shell: on the Chat page it opens
the terminal, starting one at its login prompt when none is open, and shows
a count when more than one shell runs.
2026-11-10 02:25:36 +00:00
alan d52eb4ba82 Show the phone terminal shortcut on the Chat tab only 2026-11-10 02:20:54 +00:00
alan a792b30513 Open one login terminal on first show; toggling only hides it
The first show of an app run starts one terminal (the machine's login
prompt) unless one is running; later toggles never open another. Drop
the tmux field and restart note, and update the Settings copy and the
terminal notes.
2026-11-10 00:42:59 +00:00
alan 070f9e205e Show a terminal shortcut below the top bar on phones
While shells are running and the full-screen terminal is closed, a small
floating button under the right end of the top bar reopens it, with a count
when more than one shell runs. The surface's stack is always present so the
app never remounts when the shortcut comes or goes.
2026-11-10 00:23:53 +00:00
alan 9e74810957 Swallow held toggle chords, film key presses in the capture kit, and record terminal shortcut verification 2026-11-09 23:56:55 +00:00
alan 30934aa71c Toggle the terminal with Alt/Ctrl/Cmd+T, animate it, focus it, and cycle its tabs with Ctrl+Tab
Alt+T, Ctrl+T and Cmd+T join Ctrl+` as early focus-manager key handlers, so
they toggle the panel, window or narrow page from anywhere without reaching
the shell or a text field. Opening with no terminal starts one. The shown
terminal takes the keyboard (also on reload and tab changes) and hiding gives
it back. The panel slides from the bottom edge as the app shrinks, the window
scales and fades, both on Motion.standard and off under reduced motion.
While shown, Ctrl+Tab/Ctrl+Shift+Tab move between terminal tabs instead of
chat panes. The tooltip and menu list the shortcuts the platform delivers.
2026-11-09 23:43:56 +00:00
alan e79a120ac7 Terminal surface: lazy activation, settings mode choice, open in terminal, tests 2026-11-09 21:55:38 +00:00
alan acd160b49e Add the app's terminal surface: bottom panel, floating window and full-screen page 2026-11-09 21:42:52 +00:00