Skip to content

feat(terminal): full-screen mode, touch key toolbar, and copy/paste#487

Open
gvillenave wants to merge 2 commits into
cogwheel0:mainfrom
gvillenave:terminal-touch-improvements
Open

feat(terminal): full-screen mode, touch key toolbar, and copy/paste#487
gvillenave wants to merge 2 commits into
cogwheel0:mainfrom
gvillenave:terminal-touch-improvements

Conversation

@gvillenave

@gvillenave gvillenave commented May 29, 2026

Copy link
Copy Markdown

Summary

Makes the in-app terminal far more usable on touch devices. Adds a full-screen presentation, a touch-friendly accessory key toolbar (history, Tab, Ctrl-C), copy/paste support, a shared connection-status badge, and a collapsible "listening ports" section. Also extracts the console rendering into a reusable surface shared by the inline pane and the full-screen page, and fixes a Material assertion in the file/port list tiles.

Simulator.Screen.Recording.-.iPhone.17.-.2026-05-28.at.23.44.11.mov

Features

  • Full-screen terminal (terminal_fullscreen_page.dart) — opens via a full-screen dialog; the inline pane shows a tap-to-reopen placeholder so only one TerminalView is ever mounted against the shared session at a time.
  • Touch key toolbar (terminal_key_toolbar.dart) — full-width accessory row: Up · Down · Tab · Copy · Paste · Ctrl-C (icon). Buttons scale evenly; key actions are gated on the connection state, copy/paste remain available.
  • Copy / paste (terminal_clipboard_actions.dart) — copy the xterm selection to the system clipboard (UTF-16 sanitized) with a "nothing selected" affordance; bracketed-paste-aware paste with a "connect to paste" guard while disconnected.
  • Connection-status badge (terminal_connection_badge.dart) — shared pill badge (connected / connecting / error / disconnected) used by both the inline header and the full-screen page.
  • Shared console surface (terminal_console_surface.dart) — extracts the TerminalView + toolbar + overlay stack into one reusable widget; adds small interior padding so command text isn't flush against the edges.
  • Collapsible listening-ports section in terminal_tab.dart, collapsed by default to give the terminal more room.

Fixes

  • ListTile Material assertion — the file/port tiles rendered an AdaptiveListTile (Material ListTile) directly inside ConduitCard's colored DecoratedBox, tripping Flutter's "background/ink may be invisible" assertion on the Material platform. Each tile is now wrapped in a transparent Material so it has a proper Material ancestor (no visual change).

Tests

  • terminal_clipboard_actions_test.dart — copy with/without a selection, paste while connected/disconnected (mocks the Clipboard platform channel).
  • terminal_key_toolbar_test.dart — key taps route correct control codes (Tab to tab, Ctrl-C to ETX) when connected, are inert when disconnected, and copy stays interactive while disconnected.
  • Updated terminal_tab_test.dart for the now-collapsed ports section.

Localization

New app_en.arb keys: terminalExpandAction, terminalReopenFullscreen, terminalPortsToggle, terminalKeyTab/Up/Down/Escape/CtrlC, terminalCopyAction, terminalPasteAction, terminalNothingToCopy, terminalCopied, terminalPasteWhileDisconnected.

Test plan

  • flutter test test/features/terminal/ passes (21 tests green locally)
  • Inline terminal: open full-screen, confirm placeholder + reopen
  • Toolbar keys send correct sequences; Ctrl-C interrupts a running command
  • Copy a selection / paste into the shell; verify disconnected guards
  • Expand/collapse listening ports; tap a port to open in browser

🤖 Generated with Claude Code

Make the in-app terminal usable on touch devices:

- Full-screen terminal presentation via a full-screen dialog, with the
  inline pane showing a tap-to-reopen placeholder so only one TerminalView
  is mounted against the shared session at a time.
- Full-width touch key toolbar: Up, Down, Tab, Copy, Paste, and Ctrl-C
  (icon). Key actions are gated on the connection state.
- Copy/paste: copy the xterm selection to the clipboard (UTF-16 sanitized)
  and bracketed-paste-aware paste, with disconnected/empty-selection guards.
- Shared connection-status badge used by the inline header and full-screen
  page.
- Reusable console surface (TerminalView + toolbar + overlay) shared by the
  inline pane and full-screen page, with small interior text padding.
- Collapsible "listening ports" section, collapsed by default.

Fix: wrap the file/port AdaptiveListTile in a transparent Material so the
Material ListTile no longer trips Flutter's "background/ink may be invisible"
assertion under ConduitCard's colored DecoratedBox.

Tests: add coverage for clipboard actions (copy/paste, connected and
disconnected) and the key toolbar (control codes routed when connected,
inert when disconnected, copy stays interactive).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented May 29, 2026

Copy link
Copy Markdown

Reviews (1): Last reviewed commit: "feat(terminal): full-screen mode, touch ..." | Re-trigger Greptile

Comment thread lib/l10n/app_en.arb Outdated
The Escape key was removed from the terminal toolbar; drop its now-unused
localization entry.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@gvillenave

Copy link
Copy Markdown
Author

@cogwheel0 can you take a look? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant