diff --git a/.docs/flutter-3-50-upgrade/changelog.md b/.docs/flutter-3-50-upgrade/changelog.md index 2b6e331d..d1c97733 100644 --- a/.docs/flutter-3-50-upgrade/changelog.md +++ b/.docs/flutter-3-50-upgrade/changelog.md @@ -19,3 +19,4 @@ - The two Xcode `swiftpm/Package.resolved` files the build creates stay untracked, as in the main checkout. - **Analyzer.** 0 issues on 3.47.1 → 214 infos on 3.50.0, all `deprecated_member_use` for `package:flutter/material.dart`. The material_ui migration is a separate task. - **Docs.** CLAUDE.md gained a Toolchain section (the pin and the "bump Android with Flutter" rule). CHANGELOG `[Unreleased]` says "Built with Flutter 3.50". +- 2026-11-12: PR #120 green (incl. new android job; only notice: third-party plugins still apply KGP); merged into develop. diff --git a/.docs/ui-redesign/brief.md b/.docs/ui-redesign/brief.md new file mode 100644 index 00000000..0f96e4b4 --- /dev/null +++ b/.docs/ui-redesign/brief.md @@ -0,0 +1,9 @@ +# UI redesign with forui — brief + +**What:** Redesign every YourSSH screen on the forui design system, "Amber Brand" direction (B): dark stone neutrals, amber accent, bundled Inter font, Lucide icons. Same look on macOS, Windows, Linux, Android and iOS. + +**Why:** The owner finds every screen unattractive and inconsistent across platforms. + +**Docs:** +- Spec: `docs/superpowers/specs/2026-11-12-yourssh-ui-redesign-design.md` +- Mockups: `docs/superpowers/specs/assets/ui-redesign/` diff --git a/.docs/ui-redesign/changelog.md b/.docs/ui-redesign/changelog.md new file mode 100644 index 00000000..8e3c58c9 --- /dev/null +++ b/.docs/ui-redesign/changelog.md @@ -0,0 +1,10 @@ +# Changelog + +- 2026-11-12: Built the spike: 3 directions, 18 screenshots. The owner chose B. +- 2026-11-12: Spec written. A builder check raised 6 questions, all settled as defaults (see "Decided here"). +- 2026-11-12: Phase 0–1 plan written. +- 2026-11-12: Phase 0 done (PR #118, awaiting owner OK). Phase 1 tasks 7-9 done on feature/ui-shell. Phases 2-6 plan written (17 tasks). +- 2026-11-12: Phase 1 (shell) done on feature/ui-shell. +- 2026-11-12: Phases 2-6 plan written and executed (phases 2-5 desktop, phase 6 mobile); Task 17 token sweep, lint gate and docs done. +- 2026-11-13: Final review fix round (P30): host editor remounts per edit target (data-loss fix), mail catcher skips the ESMTP options preamble, confirms for dashboard host Delete and Known Hosts Remove, terminal header and status bar follow host edits, proxy port range check, discovery and monitor sheets plus inline rename and fallback editor on forui, lint gate extended, `yourssh_web_tools` in the plugin CI matrix, watch banner cue restored, docs completed. +- 2026-11-13: Docs user-journey harness (app/integration_test/docs/) drove the final app against demo containers and captured 208 screenshots (untracked, screenshots/docs/). Its findings plus a controller review of every shot gave 22 fixes in 4 parallel worktrees (P31), incl. a pre-existing snippets data-loss bug from the half-migrated bundled JS Snippets plugin (P32). Journey re-run clean; README screenshots refreshed from it. diff --git a/.docs/ui-redesign/context.md b/.docs/ui-redesign/context.md new file mode 100644 index 00000000..153c8144 --- /dev/null +++ b/.docs/ui-redesign/context.md @@ -0,0 +1,20 @@ +# Context + +**Spike.** forui 0.27.7 needs Flutter >=3.47 and Dart >=3.13. The app now builds on Flutter 3.50.0 (CI pins it). The throwaway spike lives in the session scratchpad. + +**Current UI.** +- Palette: `AppColors` with a green accent, plus a separate mobile palette `MobileColors`/`MobileTokens`. +- Theme: Material `buildAppTheme()`; mobile uses `google_fonts`, which fetches fonts at runtime. +- `AppColors.accent`: 193 uses in 46 files. Some mean "success", others mean "primary". +- Material widgets: 117 of 261 files import Material. + +**Shell.** The shell is inside `app/lib/screens/main_screen.dart`: `_Sidebar` and `_TopTabBar` (1842 lines). Session tab: `app/lib/widgets/session_tab.dart`. + +**Terminal theme.** "YourSSH Dark" already exists in the catalog. The new default is therefore named "YourSSH Amber" and applies to new installs only. + +**State after phases 2-6.** +- The whole app (desktop and mobile) and the Snippets, DevOps and Web Tools plugins are on forui and the `yourssh_ui` components (`YsTab`, `YsFileTable`, `YsHostCard`, `YsStatusBar`, `YsPluginHost`, dialogs, toasts). +- `AppColors` and `MobileColors` stay as `@Deprecated` aliases of `YsColors`. +- `tool/check_ui_lint.sh` blocks Material `IconButton(`, `AlertDialog(`, `SnackBar(`, `Icons.`, `ScaffoldMessenger`, `showDialog(`, `showModalBottomSheet` and `TextField(`; the allowlist is empty. +- The host editor (`HostDetailPanel`) reads `existing` only in `initState`, so the shell mounts it with `hostEditorKey(editing, serial)`. +- Terminal header chips and the status bar read the host through `selectLiveHost` (fresh `HostProvider` lookup, snapshot fallback). diff --git a/.docs/ui-redesign/plan.md b/.docs/ui-redesign/plan.md new file mode 100644 index 00000000..8d368f5e --- /dev/null +++ b/.docs/ui-redesign/plan.md @@ -0,0 +1,7 @@ +# Plan + +- Phases 0-1 plan: `docs/superpowers/plans/2026-11-12-yourssh-ui-redesign-phase0-1.md` (done: foundation + shell). +- Phases 2-6 plan: `docs/superpowers/plans/2026-11-12-yourssh-ui-redesign-phase2-6.md` (done: dialogs and settings, hosts/dashboard/editor, terminal workspace, SFTP and tools, web tools, mobile). +- Task 17: token sweep, `AppColors`/`MobileColors` deprecated aliases, UI lint gate (`tool/check_ui_lint.sh`), CLAUDE.md and CHANGELOG. +- Final whole-branch review fix round (ruling P30): host editor reset, mail parser, delete/host-key confirms, live host in header and status bar, proxy port range, remaining Material sheets and fields, lint extension, CI for `yourssh_web_tools`, docs. +- Decision ledger and rulings P1-P30: `.superpowers/sdd/2026-11-12-yourssh-ui-redesign-phase2-6/progress.md`. diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index db9eac86..4ae237a9 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -64,6 +64,63 @@ jobs: working-directory: app run: flutter test + # forui-based UI kit: pure Dart widgets, no native bridge, so a small job. + ui: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + + - uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2 + with: + channel: stable + flutter-version: ${{ env.FLUTTER_VERSION }} + + # Pure shell, no Flutter needed: fails on new Material IconButton / + # AlertDialog / SnackBar / Icons. / ScaffoldMessenger outside yourssh_ui. + - name: UI lint gate + run: | + bash tool/check_ui_lint_selftest.sh + bash tool/check_ui_lint.sh + + - name: Install dependencies + working-directory: packages/yourssh_ui + run: flutter pub get + + - name: Analyze (yourssh_ui) + working-directory: packages/yourssh_ui + run: flutter analyze --no-fatal-infos + + - name: Test (yourssh_ui) + working-directory: packages/yourssh_ui + run: flutter test + + # Plugin packages built on yourssh_ui; pure Dart/Flutter, no native bridge. + plugins: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + package: [yourssh_snippets, yourssh_devops, yourssh_web_tools] + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + + - uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2 + with: + channel: stable + flutter-version: ${{ env.FLUTTER_VERSION }} + + - name: Install dependencies + working-directory: packages/${{ matrix.package }} + run: flutter pub get + + - name: Analyze (${{ matrix.package }}) + working-directory: packages/${{ matrix.package }} + run: flutter analyze --no-fatal-infos + + - name: Test (${{ matrix.package }}) + working-directory: packages/${{ matrix.package }} + run: flutter test + # One job per Rust crate. The cargo tests, build.sh and the Dart bridge tests # stay together on purpose: both cargo invocations use --release, so the # library build reuses the test build's compilation. Splitting them across jobs @@ -196,14 +253,15 @@ jobs: # forever instead of failing. test: name: test - needs: [app, bridge, android, cli, windows-cli] + needs: [app, ui, bridge, android, cli, windows-cli] if: always() runs-on: ubuntu-latest steps: - name: Check job results run: | - echo "app=${{ needs.app.result }} bridge=${{ needs.bridge.result }} android=${{ needs.android.result }} cli=${{ needs.cli.result }} windows-cli=${{ needs.windows-cli.result }}" + echo "app=${{ needs.app.result }} ui=${{ needs.ui.result }} bridge=${{ needs.bridge.result }} android=${{ needs.android.result }} cli=${{ needs.cli.result }} windows-cli=${{ needs.windows-cli.result }}" [ "${{ needs.app.result }}" = "success" ] || exit 1 + [ "${{ needs.ui.result }}" = "success" ] || exit 1 [ "${{ needs.bridge.result }}" = "success" ] || exit 1 [ "${{ needs.android.result }}" = "success" ] || exit 1 [ "${{ needs.cli.result }}" = "success" ] || exit 1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cd2a529..a9ed3f86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,8 +12,42 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **`yourssh://connect/` links** — open a saved host from a browser or script; saved hosts only, repeats of the same link within 2 s are ignored, and a refused link (unknown host, unsupported form) is listed in the notification bell. The scheme is registered by the macOS app, the Windows installer (current user) and the Linux .deb; the portable zip and tarball do not register it. - **Audit source for CLI and URL connects** — SSH connect rows carry `meta.source` = `cli` / `url`; RDP and VNC rows keep `source: rdp|vnc` and carry `via` = `cli` / `url`. +### Fixed +- **Snippets no longer disappear after allowing the bundled "Snippets" plugin.** Earlier builds shipped a half-migrated script copy of Snippets that moved your snippets out of the built-in plugin's storage on first load and then failed, so the next launch showed only the defaults. The script copy is no longer installed, a leftover copy in `~/.yourssh/plugins/snippets` is ignored (script plugins can't reuse a built-in plugin's id), and the moved snippets are restored once at startup (merged, no duplicates). +- Bulk "Run command" no longer reports `exit -1` for fast commands: the SSH layer kept an exit status that arrived before the session was ready. The footer counts non-zero exits separately (`N ok · M non-zero exit · K failed`) and an unknown exit status is shown as such. +- A host whose name doesn't resolve no longer sits on "Connecting…" forever: the TCP dial times out after 15 s and the connecting screen shows the last error with the retry attempt. +- Entering RDP/VNC fullscreen no longer raises a framework error; the first RDP connect shows a neutral "verifying certificate" state behind the trust dialog instead of an error with Retry; Retry buttons have a normal width. +- Shell-integration gutter markers follow their prompt line and disappear on `clear` instead of floating on empty rows. +- Field errors in the host editor and port-forward editor clear as soon as the value is fixed, and the port error fits on one line. +- The hosts toolbar fits the 900×600 minimum window (lower-priority controls collapse into a menu); the Mail Catcher and AI chat titles no longer truncate with room to spare; multi-line Web Tools editors start at the top; the mobile Generate/Import key sheets have an opaque surface; Esc closes the LAN-sync QR dialog. +- SFTP shows readable errors (e.g. '"releases" already exists') instead of raw `SftpStatusError` codes when creating or renaming. +- An empty split pane explains how to fill it; remaining all-caps buttons and titles (Keychain, Port forwarding, Audit log, bulk dialogs) use sentence case. +- **The host editor no longer leaks one host's form into another.** Opening "Edit" on a second host (or "New host" / "Duplicate") while the editor was open kept the first host's fields, and Save wrote them (including the password) into the second host. +- The terminal header and status bar follow edits to the host (label, user, tags, jump chain) instead of showing the values from when the tab was opened. +- Mail catcher: messages whose log starts with ESMTP options (`mail options: ['BODY=8BITMIME']`) are no longer dropped; the body is parsed separately from the headers, *Clear all* persists, and the log is written unbuffered in append mode. +- Port validation ("Invalid (1–65535)") in both host editors (SSH/RDP/VNC port and proxy port), port forwarding and the Cloudflare tunnel panel; an empty port keeps its default. +- Deleting a host also removes its stored proxy password. +- The mobile sync code and anonymous key are hidden behind a reveal toggle. +- The status bar also shows in RDP and VNC sessions. +- Terminal search and input bars keep or return focus correctly (Esc, Enter, clicking away). +- The read-only "Watching" banner has its own informational colour again. +- Session and DevOps result tabs can be selected and closed from the keyboard (Tab to a tab, Enter/Space to select, Tab again to its close button). +- List items in bottom sheets on mobile are at least 44 px tall. +- The Cloudflare tunnel panel shows "Required" / "Invalid (1–65535)" for a missing label or a bad port instead of silently adding nothing or falling back to 3000 (an empty port still means 3000). + ### Changed +- **New confirmations:** deleting a host from the dashboard card menu, removing a Known Hosts entry (its pinned key), Sync *Disconnect*, Docker Compose *Down* and opening an executable file externally now ask first; the safe choice has default focus. +- **SFTP click model:** on both panels a single click selects, and double-click or Enter opens. +- **Host editor:** a *Delete* button was added to the footer and the *CONNECT* button was removed. +- **AI chat:** Enter sends, Shift+Enter inserts a new line. +- **New look:** the app moves to the Amber Brand palette (warm dark surfaces, amber accent), the Inter font and a forui-based UI foundation on desktop and mobile. +- **New "YourSSH Amber" terminal theme**, the default for new installs. Existing installs keep their current terminal theme. - Built with Flutter 3.50. +- **New sidebar** with grouped sections and an amber selected item. +- **New tab bar** for sessions, with the active tab marked in amber. +- **New toasts** for notifications, shown bottom-right on desktop. +- **UI clean-up:** a lint gate (`tool/check_ui_lint.sh`, run in PR CI) keeps Material `IconButton`/`AlertDialog`/`SnackBar`/`Icons`/`ScaffoldMessenger` out of the app and the plugin packages, remaining colour literals moved to tokens, the discovery and server-monitor sheets and the inline tab rename / fallback code editor fields moved to forui, the gate also rejecting `showDialog(`, `showModalBottomSheet` and `TextField(`, and `AppColors`/`MobileColors` are now `@Deprecated` aliases of the new tokens (kept rather than deleted, to avoid churn across ~460 call sites). +- **New dialogs** across the app; security prompts (host key, RDP certificate) now focus the safe choice by default. --- diff --git a/CLAUDE.md b/CLAUDE.md index fa0aeff5..24ddb41f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -82,9 +82,9 @@ The active codebase is `app/` — a Flutter app targeting macOS, Windows, and Li **Monorepo layout:** - `app/` — the Flutter app - `packages/yourssh_rdp` — **Rust RDP client** (IronRDP 0.15, flutter_rust_bridge v2); exposes `RdpClient` + `RdpConfig`, a `StreamSink` event bus, and `rdp_lib_version()`; `RdpClient.ensureInitialized()` lazily loads the native library + inits the FRB runtime on first RDP connect (no init in main.dart); `RdpConfig.expectedFingerprint` carries the pinned cert fingerprint — the Rust engine verifies it post-TLS / **pre-CredSSP** and aborts with `RdpEvent.certMismatch` before any credentials are sent (TLS itself uses no cert verification — the pin is the only server check); an unpinned host is connected with the sentinel `kRdpUnpinnedProbe` (`app/lib/models/rdp_session.dart`) so the first connect also stops pre-CredSSP, `RdpSession.isFirstUseProbe` routes the reported fingerprint to the first-use trust dialog (`rdpCertVerifier`), and only after the user pins it does `SessionProvider` reconnect with the real pin — credentials never reach an unaccepted cert; `RdpEvent.connected` carries the **server-negotiated** desktop size (may differ from the request); dirty rects are inclusive-rectangle corrected (+1) and clamped before extraction; the run loop peeks every X224 frame for an MCS Disconnect Provider Ultimatum (server-side session end: remote sign-out / session takeover / admin disconnect) and turns it into a graceful `RdpEvent.disconnected` — ironrdp-session 0.9's x224 processor would otherwise surface it as a raw decode error; build scripts produce `libyourssh_rdp.dylib` / `.so` / `.dll` which the Dart `NativeLoader` resolves at runtime from the app bundle (release) or `assets/native/` (dev); the built libraries are **not tracked in git** (`assets/native/` is gitignored — run `build.sh`/`build.ps1` once after clone; CI builds them fresh) -- `packages/dartssh2` — **local fork** of dartssh2; overrides the pub.dev version via `dependency_overrides` in `app/pubspec.yaml`; adds `signAsync()` for agent-backed auth and SSH agent forwarding (sends `auth-agent-req@openssh.com` on shell channels only — never exec; accepts server-opened `auth-agent@openssh.com` channels via `SSHClient.agentHandler` **only after the server accepted an `auth-agent-req` from this client** (otherwise administratively-prohibited); agent frames are capped at 256 KiB and a peer overrunning the local window loses the channel; any packet-parse failure closes the transport with `SSHPacketError` (no hung `authenticated`); DH group exchange rejects primes outside 1024–8192 bits and out-of-range g / f; a refused request is non-fatal and surfaces as `SSHSession.agentForwardingRefused`); implements strict KEX (`kex-strict-c/s-v00@openssh.com`, CVE-2023-48795 "Terrapin" mitigation: sequence numbers reset after every NEWKEYS, non-KEX messages during the initial key exchange terminate the connection, KEXINIT must be the first packet); adds `OpenSSHEd25519KeyPair.generate()` and a passphrase-encrypting `toPem({passphrase})` (bcrypt-pbkdf + aes256-ctr; null passphrase output unchanged, interop-verified against real `ssh-keygen -y`) +- `packages/dartssh2` — **local fork** of dartssh2; overrides the pub.dev version via `dependency_overrides` in `app/pubspec.yaml`; adds `signAsync()` for agent-backed auth and SSH agent forwarding (sends `auth-agent-req@openssh.com` on shell channels only — never exec; accepts server-opened `auth-agent@openssh.com` channels via `SSHClient.agentHandler` **only after the server accepted an `auth-agent-req` from this client** (otherwise administratively-prohibited); agent frames are capped at 256 KiB and a peer overrunning the local window loses the channel; any packet-parse failure closes the transport with `SSHPacketError` (no hung `authenticated`); DH group exchange rejects primes outside 1024–8192 bits and out-of-range g / f; a refused request is non-fatal and surfaces as `SSHSession.agentForwardingRefused`); implements strict KEX (`kex-strict-c/s-v00@openssh.com`, CVE-2023-48795 "Terrapin" mitigation: sequence numbers reset after every NEWKEYS, non-KEX messages during the initial key exchange terminate the connection, KEXINIT must be the first packet); adds `OpenSSHEd25519KeyPair.generate()` and a passphrase-encrypting `toPem({passphrase})` (bcrypt-pbkdf + aes256-ctr; null passphrase output unchanged, interop-verified against real `ssh-keygen -y`; reply-less channel requests (`exit-status`, `exit-signal`) that arrive before a session installs its request handler are buffered (max 16) and replayed by `setRequestHandler` — a fast exec could otherwise lose its exit status, which surfaced as `exit -1` in bulk runs) - `packages/flutter_pty` — **local fork** of flutter_pty 0.4.2 (also via `dependency_overrides`); patches `src/flutter_pty_win.c` so the Windows command line doesn't duplicate `argv[0]` (upstream issue #19 — broke keyboard input in the local PowerShell terminal) -- `packages/xterm` — **local fork** of xterm 4.0.0 (also via `dependency_overrides`); patches: (1) `lib/src/ui/custom_text_edit.dart` passes `viewId: View.maybeOf(context)?.viewId` to `TextInputConfiguration` (upstream issue #207 — newer Flutter engines on Windows reject a text-input client without a viewId, so printable keys never reached any `TerminalView` while Enter/Tab/paste still worked); (2) copy/paste reachability (issue #43) — `shortcut/shortcuts.dart` adds Ctrl+C → `TerminalCopyAndClearIntent` and Ctrl+Shift+V paste alias on Windows/Linux, `shortcut/actions.dart` adds `_CopySelectionAndClearAction` (enabled only with an active selection; copies then clears it so the next Ctrl+C reaches the shell as SIGINT — without a selection `ShortcutManager` ignores the key and it falls through as ^C), `ui/gesture/gesture_handler.dart` un-aliases tertiary taps from the secondary-tap callbacks (middle clicks also reported to mouse-mode apps as `TerminalMouseButton.middle`, not right), and `terminal_view.dart` pastes the clipboard on middle-click unless `readOnly`; (3) scrollback-trim scroll compensation — `IndexAwareCircularBuffer` exposes a monotonic `droppedLines` counter (bumped on overflow push/insert and `trimStart`) and `RenderTerminal._compensateScrollbackTrim()` shifts the scroll offset up by the trimmed amount each layout, so once the buffer hits `maxLines` the content a scrolled-up user is reading stays put instead of streaming past (offset clamped at 0, skipped while overscrolled above the top; re-baselined on main↔alt buffer switches, never corrected across them); (4) per-line picture render cache — `BufferLine.version` (monotonic, bumped by every mutator) keys `TerminalPainter.getLinePicture()`, an LRU (`_linePictureCacheLimit` 1024, disposed on eviction) of per-line recorded `Picture`s replayed by `RenderTerminal._paint`, so scrolling/steady frames replay O(visible lines) pictures instead of issuing O(visible cells) `drawParagraph` calls (~7× less per-frame paint work); keyword highlights are baked into the cached picture (regex runs on line change, not per frame) — `RenderTerminal.keywordRules` forwards to `painter.keywordRules` on structural change, and the cache invalidates on textStyle/textScaler/theme/font-change/keyword-rule/device-pixel-ratio updates and glyph-atlas admissions (patch 11) (pixel-equivalence + invalidation covered by `app/test/widgets/xterm_line_picture_cache_test.dart`, scroll behavior by `app/test/widgets/terminal_scroll_probe_test.dart`); (5) scrollback keyboard paging — Shift+PageUp/PageDown in `TerminalViewState._handleKeyEvent` page the viewport locally (main buffer only; in the alt buffer the keys still reach the application); (6) `Terminal.recoverFromStuckState()` — local `reset`-equivalent for a full-screen app that died uncleanly and left the terminal trapped in the alt screen with mouse reporting on (the cause of "wheel scrolling completely dead at a prompt"): returns to the main buffer, disables mouse mode/report mode, re-shows the cursor, resets main-buffer margins; wired to the right-click "Reset Terminal" item in `app/lib/widgets/terminal_context_menu.dart`; (7) mouse-report encoding fixes — wheel buttons reported as 64-67 (flag 64 + low two bits of X11 buttons 4-7; upstream sent 68-71, which no application recognizes, so wheel scrolling was dead inside every mouse-aware TUI: claude CLI, htop, vim `mouse=a`, tmux with mouse on), and normal/UTF report mode no longer adds an extra +1 to the row byte (every event was reported one row below the pointer); covered by `app/test/widgets/xterm_mouse_report_test.dart`; (8) combining-mark composition — `Buffer.writeChar` merges a zero-width combining mark into the preceding cell when a precomposed NFC form exists (`unorm_dart`; preserves the base cell's style via `setCodePoint`, skips wide-char continuation cells), so decomposed Vietnamese (macOS `ls` filenames, NFD output from many tools) renders correctly instead of one displaced cell per diacritic; marks with no precomposed form keep the legacy own-cell behavior (single-codepoint cell model); covered by `app/test/widgets/xterm_combining_chars_test.dart`; (9) DoS limits on remote output — `CSI 8;r;c t` window resize is ignored, REP (`CSI n b`) is clamped to the screen size, a pending OSC over 64 KiB or CSI over 4096 chars is dropped and parsing resumes, CSI params are clamped to 65535 (covered by `app/test/widgets/xterm_dos_limits_test.dart`); (10) output throughput (≈10× in AOT) — `EscapeParser` decodes each chunk once into a reusable `Uint32List` and scans it by index (switch dispatch, allocation-free CSI params; an incomplete trailing sequence is still re-scanned from its ESC on the next write, and the rest of a chunk whose handler threw is processed by the next write, as before); `Terminal` implements `EscapeTextSink`, so runs of text go to `Buffer.writeChars` (one cursor-line lookup per line, printable ASCII copied straight into the line's `Uint32List` by `BufferLine.writeAsciiRun`, exact `writeChar` semantics for everything else); NFC composition of a (base, mark) pair is memoized; a line feed with full scrollback reuses the line it trims (`BufferLine.tryRecycle` — skipped for lines carrying anchors or a different capacity, `version` bumped so the picture cache never matches stale content); `Terminal.writeBytes(Uint8List)` decodes UTF-8 straight into the parser, identical to one chunked `Utf8Decoder(allowMalformed: true)` + `write` (malformed bytes → U+FFFD as that decoder reports them, stream-start BOM dropped); behavior pinned by `app/test/widgets/xterm_write_snapshot_test.dart` (state digests recorded on the pre-optimization code: corpora, fuzz incl. malformed input and exceptions, generic handler path), `xterm_line_recycling_test.dart` and `xterm_write_bytes_test.dart`; AOT benchmark `packages/xterm/benchmark/write_benchmark.dart` (compile with `--packages=../../app/.dart_tool/package_config.json`); (11) glyph-atlas text path — `TerminalPainter.getLinePicture(line, deviceOffset:)` records lines through `GlyphAtlas` (`lib/src/ui/glyph_atlas.dart`): each (code point, bold/italic/faint, ARGB color, horizontal subpixel phase 0–3, device y fraction) is rendered once with the exact paragraph `paintCellForeground` draws, read back after the frame (`toImage` + `toByteData`, batches ≤ 256) for its ink bounds, and packed into one page image (`toImageSync` of old page + new tiles; 2048 px wide, ≤ 2048 tall; full → reset, full again within 10 s → admission frozen 10 s); a line then draws merged background runs with `drawRect` and its glyphs with one `drawRawAtlas` per segment instead of `drawRect` + `drawParagraph` per cell (121x40 flood frame: ~6 → ~1 ms build, ~3.6 → ~1 ms raster), and `TerminalWriteQueue.floodInterval` is 16 ms (60 fps, was 33). Exactness (pixel tests in `xterm_line_picture_cache_test.dart`, tolerance 1/255 = premultiplied 8-bit tile rounding; `app/integration_test/terminal_atlas_pixel_test.dart` repeats them on the real macOS backend): tiles are per color (tinting one white mask is off by up to 65 levels — Skia picks the text gamma by color luminance); sprites land on exact device pixels (`RenderTerminal` passes the dpr from `MediaQuery` and each line's device-space origin from `getTransformTo(null)`; a non-translation transform → paragraphs); glyph x snaps like Skia (`floor(x + 1/8)`, phase `floor(frac * 4)`; a column within 1e-3 px of a phase boundary falls back); a background is never queued under a queued glyph's measured ink (the segment is flushed first); runs merge only when their anti-aliased top/bottom rows are whole device pixels (`paintLine`'s overlapping per-cell rects blend those rows twice). Drawn by the old paragraph code, in paint order: underlined cells (decorations sit at the exact fractional x), code points outside the allowlist (combining marks, format characters, U+2600–27BF, above U+FFFF, double-width outside CJK/Hangul/fullwidth), tiles whose ink reaches the slot border or is not the paint color (emoji), glyphs not admitted yet, and keyword foregrounds (a second glyph over the cell's own would round twice; their paragraphs are cached per (char, color)). Line pictures also key on atlas generation (admission drops them and `onGlyphAtlasChanged` repaints) and device fraction; the atlas resets on textStyle/textScaler/dpr/system-font changes and survives theme changes (tiles are keyed by final color) +- `packages/xterm` — **local fork** of xterm 4.0.0 (also via `dependency_overrides`); patches: (1) `lib/src/ui/custom_text_edit.dart` passes `viewId: View.maybeOf(context)?.viewId` to `TextInputConfiguration` (upstream issue #207 — newer Flutter engines on Windows reject a text-input client without a viewId, so printable keys never reached any `TerminalView` while Enter/Tab/paste still worked); (2) copy/paste reachability (issue #43) — `shortcut/shortcuts.dart` adds Ctrl+C → `TerminalCopyAndClearIntent` and Ctrl+Shift+V paste alias on Windows/Linux, `shortcut/actions.dart` adds `_CopySelectionAndClearAction` (enabled only with an active selection; copies then clears it so the next Ctrl+C reaches the shell as SIGINT — without a selection `ShortcutManager` ignores the key and it falls through as ^C), `ui/gesture/gesture_handler.dart` un-aliases tertiary taps from the secondary-tap callbacks (middle clicks also reported to mouse-mode apps as `TerminalMouseButton.middle`, not right), and `terminal_view.dart` pastes the clipboard on middle-click unless `readOnly`; (3) scrollback-trim scroll compensation — `IndexAwareCircularBuffer` exposes a monotonic `droppedLines` counter (bumped on overflow push/insert and `trimStart`) and `RenderTerminal._compensateScrollbackTrim()` shifts the scroll offset up by the trimmed amount each layout, so once the buffer hits `maxLines` the content a scrolled-up user is reading stays put instead of streaming past (offset clamped at 0, skipped while overscrolled above the top; re-baselined on main↔alt buffer switches, never corrected across them); (4) per-line picture render cache — `BufferLine.version` (monotonic, bumped by every mutator) keys `TerminalPainter.getLinePicture()`, an LRU (`_linePictureCacheLimit` 1024, disposed on eviction) of per-line recorded `Picture`s replayed by `RenderTerminal._paint`, so scrolling/steady frames replay O(visible lines) pictures instead of issuing O(visible cells) `drawParagraph` calls (~7× less per-frame paint work); keyword highlights are baked into the cached picture (regex runs on line change, not per frame) — `RenderTerminal.keywordRules` forwards to `painter.keywordRules` on structural change, and the cache invalidates on textStyle/textScaler/theme/font-change/keyword-rule/device-pixel-ratio updates and glyph-atlas admissions (patch 11) (pixel-equivalence + invalidation covered by `app/test/widgets/xterm_line_picture_cache_test.dart`, scroll behavior by `app/test/widgets/terminal_scroll_probe_test.dart`); (5) scrollback keyboard paging — Shift+PageUp/PageDown in `TerminalViewState._handleKeyEvent` page the viewport locally (main buffer only; in the alt buffer the keys still reach the application); (6) `Terminal.recoverFromStuckState()` — local `reset`-equivalent for a full-screen app that died uncleanly and left the terminal trapped in the alt screen with mouse reporting on (the cause of "wheel scrolling completely dead at a prompt"): returns to the main buffer, disables mouse mode/report mode, re-shows the cursor, resets main-buffer margins; wired to the right-click "Reset Terminal" item in `app/lib/widgets/terminal_context_menu.dart`; (7) mouse-report encoding fixes — wheel buttons reported as 64-67 (flag 64 + low two bits of X11 buttons 4-7; upstream sent 68-71, which no application recognizes, so wheel scrolling was dead inside every mouse-aware TUI: claude CLI, htop, vim `mouse=a`, tmux with mouse on), and normal/UTF report mode no longer adds an extra +1 to the row byte (every event was reported one row below the pointer); covered by `app/test/widgets/xterm_mouse_report_test.dart`; (8) combining-mark composition — `Buffer.writeChar` merges a zero-width combining mark into the preceding cell when a precomposed NFC form exists (`unorm_dart`; preserves the base cell's style via `setCodePoint`, skips wide-char continuation cells), so decomposed Vietnamese (macOS `ls` filenames, NFD output from many tools) renders correctly instead of one displaced cell per diacritic; marks with no precomposed form keep the legacy own-cell behavior (single-codepoint cell model); covered by `app/test/widgets/xterm_combining_chars_test.dart`; (9) DoS limits on remote output — `CSI 8;r;c t` window resize is ignored, REP (`CSI n b`) is clamped to the screen size, a pending OSC over 64 KiB or CSI over 4096 chars is dropped and parsing resumes, CSI params are clamped to 65535 (covered by `app/test/widgets/xterm_dos_limits_test.dart`); (10) output throughput (≈10× in AOT) — `EscapeParser` decodes each chunk once into a reusable `Uint32List` and scans it by index (switch dispatch, allocation-free CSI params; an incomplete trailing sequence is still re-scanned from its ESC on the next write, and the rest of a chunk whose handler threw is processed by the next write, as before); `Terminal` implements `EscapeTextSink`, so runs of text go to `Buffer.writeChars` (one cursor-line lookup per line, printable ASCII copied straight into the line's `Uint32List` by `BufferLine.writeAsciiRun`, exact `writeChar` semantics for everything else); NFC composition of a (base, mark) pair is memoized; a line feed with full scrollback reuses the line it trims (`BufferLine.tryRecycle` — skipped for lines carrying anchors or a different capacity, `version` bumped so the picture cache never matches stale content); `Terminal.writeBytes(Uint8List)` decodes UTF-8 straight into the parser, identical to one chunked `Utf8Decoder(allowMalformed: true)` + `write` (malformed bytes → U+FFFD as that decoder reports them, stream-start BOM dropped); behavior pinned by `app/test/widgets/xterm_write_snapshot_test.dart` (state digests recorded on the pre-optimization code: corpora, fuzz incl. malformed input and exceptions, generic handler path), `xterm_line_recycling_test.dart` and `xterm_write_bytes_test.dart`; AOT benchmark `packages/xterm/benchmark/write_benchmark.dart` (compile with `--packages=../../app/.dart_tool/package_config.json`); (11) glyph-atlas text path — `TerminalPainter.getLinePicture(line, deviceOffset:)` records lines through `GlyphAtlas` (`lib/src/ui/glyph_atlas.dart`): each (code point, bold/italic/faint, ARGB color, horizontal subpixel phase 0–3, device y fraction) is rendered once with the exact paragraph `paintCellForeground` draws, read back after the frame (`toImage` + `toByteData`, batches ≤ 256) for its ink bounds, and packed into one page image (`toImageSync` of old page + new tiles; 2048 px wide, ≤ 2048 tall; full → reset, full again within 10 s → admission frozen 10 s); a line then draws merged background runs with `drawRect` and its glyphs with one `drawRawAtlas` per segment instead of `drawRect` + `drawParagraph` per cell (121x40 flood frame: ~6 → ~1 ms build, ~3.6 → ~1 ms raster), and `TerminalWriteQueue.floodInterval` is 16 ms (60 fps, was 33). Exactness (pixel tests in `xterm_line_picture_cache_test.dart`, tolerance 1/255 = premultiplied 8-bit tile rounding; `app/integration_test/terminal_atlas_pixel_test.dart` repeats them on the real macOS backend): tiles are per color (tinting one white mask is off by up to 65 levels — Skia picks the text gamma by color luminance); sprites land on exact device pixels (`RenderTerminal` passes the dpr from `MediaQuery` and each line's device-space origin from `getTransformTo(null)`; a non-translation transform → paragraphs); glyph x snaps like Skia (`floor(x + 1/8)`, phase `floor(frac * 4)`; a column within 1e-3 px of a phase boundary falls back); a background is never queued under a queued glyph's measured ink (the segment is flushed first); runs merge only when their anti-aliased top/bottom rows are whole device pixels (`paintLine`'s overlapping per-cell rects blend those rows twice). Drawn by the old paragraph code, in paint order: underlined cells (decorations sit at the exact fractional x), code points outside the allowlist (combining marks, format characters, U+2600–27BF, above U+FFFF, double-width outside CJK/Hangul/fullwidth), tiles whose ink reaches the slot border or is not the paint color (emoji), glyphs not admitted yet, and keyword foregrounds (a second glyph over the cell's own would round twice; their paragraphs are cached per (char, color)). Line pictures also key on atlas generation (admission drops them and `onGlyphAtlasChanged` repaints) and device fraction; the atlas resets on textStyle/textScaler/dpr/system-font changes and survives theme changes (tiles are keyed by final color); (12) ED 2/3 (and the other erase-display variants) dispose the `CellAnchor`s on the lines they erase, so the shell-integration gutter markers (`ShellCommand.anchor`, created with `buffer.createAnchorFromCursor` at OSC 133;A) follow their prompt line through scroll/trim and disappear on `clear` instead of floating on stale rows - `packages/yourssh_cli` — pure-Dart `yourssh` command-line client (no Flutter dependency): protocol, endpoint resolution, transport, app launcher, output formatting; the app imports it for the shared protocol/endpoint types. See **CLI** below - `packages/yourssh_plugin_api` — abstract plugin interface (`YourSSHPlugin`, `YourSSHPluginContext`) - `packages/yourssh_devops` — DevOps plugin (containers (Docker/K8s), network tools, Cloudflare tunnel, mail catcher, MCP server, S3 browser) @@ -113,7 +113,7 @@ Flutter UI (widgets/screens) - `SyncProvider` — holds Supabase sync config (URL/key, optional passphrase, status); `enabled` is derived from `isSupabaseConfigured` — no separate stored flag; passphrase stored in secure storage via `StorageService` - `KnownHostsProvider` — persists known host fingerprints (one entry per host:port:keyType); exposes `pendingChallenge` for TOFU dialog; an unknown endpoint is accepted on first use, but a key of a **new type** for an endpoint already pinned under another type raises a blocking `HostKeyChallenge` (`oldKeyType` set, dialog says "Host key type changed") — a MITM offering a different host-key algorithm can't slip past the pin - `SettingsProvider` — app-wide prefs (auto-reconnect, tmux, hotkeys, feature flags for DevOps/WebTools/Snippets) -- `TerminalLayoutProvider` — split layout (none/horizontal/vertical), input bar visibility, and the right-side workspace panel via the `SidePanel` enum (`none`/`snippets`/`terminalConfig`; `toggleSidePanel()` opens one panel at a time — opening one closes the other; `toggleSnippetsPanel()` kept as alias). The snippets panel and the terminal-appearance config panel (`TerminalConfigPanel`, toggled by the tune icon; hosts `TerminalAppearanceControls`, the theme/font-size/font controls shared with Settings → Terminal) both render inside the shared `WorkspaceSidePanel` frame (340px, header + close) +- `TerminalLayoutProvider` — split layout (none/horizontal/vertical), input bar visibility, and the right-side workspace panel via the `SidePanel` enum (`none`/`snippets`/`terminalConfig`; `toggleSidePanel()` opens one panel at a time — opening one closes the other; `toggleSnippetsPanel()` kept as alias). The snippets panel and the terminal-appearance config panel (`TerminalConfigPanel`, toggled by the tune icon; hosts `TerminalAppearanceControls`, the theme/font-size/font controls shared with Settings → Appearance) both render inside the shared `WorkspaceSidePanel` frame (340px, header + close) - `LocalFilePanelProvider` — local filesystem state for the dual-panel SFTP view - `SftpPanelProvider` — remote SFTP panel state (current path, directory listing) - `SftpTransferProvider` — in-progress upload/download transfer queue and status @@ -155,7 +155,7 @@ Flutter UI (widgets/screens) - `agent_probe.dart` — pure pre-connect probe (`probeAgentStatus`) behind the host panel's `AgentStatusLine` — reports system-agent identity count, Keychain-fallback key count, or nothing-to-serve; never throws (every failure maps to a displayable result) - `KeyGenService` — SSH key generation: Ed25519 pure-Dart (the fork's `OpenSSHEd25519KeyPair.generate()` + `toPem(passphrase:)`), RSA-4096/ECDSA-P256 via `ssh-keygen` (`probeSshKeygen` gates the panel options when the binary is missing); `buildDeployCommand` (ssh-copy-id-style, `grep -qxF` idempotent, `EXISTS`/`ADDED` marker) used by `DeployKeyDialog` over `SshService.exec`; generated keys land in `Documents/YourSSH/keys` with mode 600 and the passphrase saved as `pp_` via `KeyProvider.savePassphrase` (callback wired to `StorageService` in main.dart — `addKeyFromFile` returns the created entry) - `RecordingService` — writes asciicast v2 (`.cast`) files; tracks active recordings keyed by `sessionId`; passive intercept pattern — `SshService` always calls `writeOutput()` / `onShellClosed()`, which no-op when not recording; when `redact:` is on (effective = `SettingsProvider.recordingRedactionEnabled` AND `Host.recordingRedaction`, both default true; sampled once at start via `RecordingProvider.redactionPolicy` wired in main.dart with a fresh `HostProvider` lookup — the session's Host snapshot goes stale after a panel edit), output is line-buffered (split at the last newline, start-once `flushDelay` timer, default 500 ms, stop flushes the tail) and passed through `AuditRedactor.redact()` before writing — coalesces events per line, which also strips keystroke timing; ANSI escapes inside a secret and a secret straddling a flushDelay boundary defeat the regexes (defense-in-depth, not a guarantee) -- `ShellIntegrationService` — pure (no Flutter/IO): `parseOsc(code, args)` maps xterm `onPrivateOSC` to a typed `ShellOscEvent` (OSC 7 cwd, OSC 133 A/D; C ignored); `buildInjectionScript()` is the guarded one-line bash/zsh prompt-hook installer (auto-on, opt-out via `Host.shellIntegration` + `SettingsProvider.shellIntegrationEnabled`), delivered **invisibly** via a two-phase handshake: `buildBootstrapLine()` (short line that disables tty echo and blocks in `read -rs`, printing `__YS_RDY__`/`__YS_DONE__` sentinels) + `buildPayloadLine({includeInstaller, workingDir, envVars})` (the installer plus the per-host session-template setup — `cd -- ''` + `export K='v'`, single-quote-escaped via `shQuote`, keys checked by `isValidEnvKey`; a failing cd prints a warning placed *after* the DONE sentinel so it survives the gate discard; consumed by `read` so never echoed). `SshService.openShell` wires `terminal.onPrivateOSC` and injects only when `injection_gate.dart`'s `InjectionReadiness` confirms the line editor is reading (bracketed-paste `ESC[?2004h` toggle + settle, bare-`\n` probe fallback for bash ≤ 5.0; skipped on alt-screen/user typing/never-confirmed) while `InjectionGate` withholds and discards the bootstrap echo; `path_completion.dart` (pure) plans cwd-aware path completion for the input bar over `SshService.listDirectory`. Design: `docs/superpowers/specs/2026-06-03-invisible-shell-integration-design.md` +- `ShellIntegrationService` — pure (no Flutter/IO): `parseOsc(code, args)` maps xterm `onPrivateOSC` to a typed `ShellOscEvent` (OSC 7 cwd, OSC 133 A/D; C ignored); `buildInjectionScript()` is the guarded one-line bash/zsh prompt-hook installer (auto-on, opt-out via `Host.shellIntegration` + `SettingsProvider.shellIntegrationEnabled`), delivered **invisibly** via a two-phase handshake: `buildBootstrapLine()` (short line that disables tty echo and blocks in `read -rs`, printing `__YS_RDY__`/`__YS_DONE__` sentinels) + `buildPayloadLine({includeInstaller, workingDir, envVars})` (the installer plus the per-host session-template setup — `cd -- ''` + `export K='v'`, single-quote-escaped via `shQuote`, keys checked by `isValidEnvKey`; a failing cd prints a warning placed *after* the DONE sentinel so it survives the gate discard; consumed by `read` so never echoed). `SshService.openShell` wires `terminal.onPrivateOSC` and injects only when `injection_gate.dart`'s `InjectionReadiness` confirms the line editor is reading (bracketed-paste `ESC[?2004h` toggle + settle, bare-`\n` probe fallback for bash ≤ 5.0; skipped on alt-screen/user typing/never-confirmed) while `InjectionGate` withholds and discards the bootstrap echo and, on a clean DONE, clears the line still holding the prompt painted before the bootstrap (`kClearPromptLine`) and drops the sentinel's line break, so a new session shows one prompt, not an empty one above it; `path_completion.dart` (pure) plans cwd-aware path completion for the input bar over `SshService.listDirectory`. Design: `docs/superpowers/specs/2026-06-03-invisible-shell-integration-design.md` - `AuditService` / `AuditRedactor` — local SQLite audit trail (`sqlite3` + `sqlite3_flutter_libs`, WAL, `/audit.db`): `connect`/`disconnect`/`exec`/`input` events with denormalized host fields; commands pass `AuditRedactor` (pure regex masking: `key=value` secrets incl. prefixed `PGPASSWORD=`, Bearer tokens, `sshpass -p`, mysql/mariadb attached `-p`, URL userinfo — psql `-p` is the port, deliberately excluded) **before** insert; every write fail-soft (never breaks SSH ops); `SshService.exec` takes `auditSource` (`'app'` default; `'bulk'`/`'devops'`/`'plugin:'`/`'plugin:js'` threaded by callers; `null` = skip — used by the network-stats poll so it can't flood the log); connect failures logged only when no retry is scheduled; retention pruned at startup (`auditRetentionDays`, default 90, 0 = forever); CSV/JSON export of the filtered view - `SandboxMigrationService` — **macOS is not sandboxed** (`app/macos/Runner/*.entitlements` deliberately omit `com.apple.security.app-sandbox`): the sandbox rewrote `HOME` to `~/Library/Containers/com.thangnm.yourssh/Data`, where `~/Downloads`, `~/Desktop` and `~/.ssh` are only symlinks that raise `EPERM` — unusable for an SSH/SFTP client, and Apple ships no entitlement that covers Desktop/Documents (the exception entitlements that would, `keychain-access-groups` and `temporary-exception.*`, are restricted: an ad-hoc-signed build claiming one is SIGKILLed at launch, and this app ships unsigned via DMG/zip, not the Mac App Store). Folder access is now governed by macOS privacy (TCC) prompts, explained by the `NS*FolderUsageDescription` strings in `Info.plist`. This service is the one-time carry-over run from `main()` before any provider reads prefs: `parseXmlPlist` (pure) reads the container's prefs domain via `plutil -convert xml1`, `planPrefsMigration` (pure) drops keys the new domain already has, and the audit database + `~/.yourssh/plugins` are copied file-by-file, never overwriting. Keys and recordings are deliberately *not* copied — prefs hold their absolute container paths and an unsandboxed app can still read the container, so copying would only duplicate private key material. Every step is fail-soft and the `macos_sandbox_migration_done` marker is written either way - `UpdateService` — in-app update glue: `fetchLatestRelease()` (GitHub `releases/latest`, stable-only), pure `isNewerVersion` (semver, fail-closed on blank) and `assetForPlatform` (OS/arch → release asset; macOS ships a universal DMG — Intel only matches it, falling back to the browser on pre-universal releases), `downloadAsset` (streamed to Downloads with progress, cleans up partial file), `launchInstaller` (macOS: `verifyMacInstallerSignature` requires a Developer ID signature by `releaseTeamId` 84T567KMYD via `codesign -R` before `open` — our own downloads carry no quarantine xattr, so Gatekeeper never checks them; an unsigned/foreign DMG throws and the user is sent to the release page; Windows: run installer `.exe`; Linux: `xdg-open`); throws typed `UpdateException`; takes an injectable `http.Client` for testing @@ -167,7 +167,7 @@ Flutter UI (widgets/screens) - `file_mode.dart` — POSIX mode helpers: `modeToOctal` / `parseOctal` (3–4 octal digits only — shorter is a partially-typed mode and never parses), the 9 `kMode*` permission-bit constants used by `PermissionsDialog`'s rwx grid, and `chmodLocal` (system `chmod`, macOS/Linux; callers hide the menu item on Windows) - `app_launcher.dart` — `launchFileDefault` (OS default app via url_launcher), `launchFileWithApp` (macOS `open -a` / Windows `Process.run` without a shell / Linux direct exec; `buildAppLaunch` is the pure plan), `isExecutableExtension(name, platform)` — "open externally" refuses server-supplied executables (`.bat/.exe/.lnk/.command/.desktop/…`) and points the user to Download instead, `pickApplication` (file_selector) — shared by `ExternalEditService` and the local file panel - `fs_error.dart` — `describeFileSystemError` maps a `dart:io` failure to a sentence the UI can show: EPERM/EACCES (macOS privacy denial, POSIX mode) becomes a "grant access in System Settings → Privacy & Security" hint, ENOENT becomes "no longer exists", anything else keeps its own message; used by the local file panel's list/create/rename/delete/chmod paths instead of a raw `PathAccessException` dump -- `terminal_appearance.dart` — `resolveTerminalAppearance` merges per-host theme/font/size overrides with the global Settings → Terminal values (unknown theme name → global, not catalog[0]); consumed by `terminal_view.dart` with a fresh-host lookup (HostProvider absent in tests → session snapshot) +- `terminal_appearance.dart` — `resolveTerminalAppearance` merges per-host theme/font/size overrides with the global Settings → Appearance / Terminal values (unknown theme name → global, not catalog[0]); consumed by `terminal_view.dart` with a fresh-host lookup (HostProvider absent in tests → session snapshot) **Key models** (`app/lib/models/`): - `AppSession` — abstract base interface for all session types; provides `id`, `tabLabel`, `customLabel`, `colorTag`, `isPinned`; implemented by `TerminalSession` (SSH + local shells) and `RdpSession` @@ -182,11 +182,13 @@ Flutter UI (widgets/screens) - `RecordingEntry` — immutable metadata for one `.cast` file; `hostTitle` and `recordedAt` parsed from path (`{basePath}/{user}@{host}/session_YYYY-MM-DD_HH-mm-ss.cast`) - `AuditEvent` — one immutable audit row (`AuditEventType`: connect/disconnect/exec/input; denormalized host fields, redacted command, exit code, JSON `meta` with `source`/`error`) -**UI entry point:** `app/lib/main.dart` — instantiates services and long-lived providers, wires callbacks between them (key lookup, host-key verifier, sync-on-mutation), then mounts `MainScreen` under `MultiProvider`. The app is dark-only (`ThemeMode.dark`); theme constants live in `app/lib/theme/app_theme.dart` (`AppColors`). +**UI entry point:** `app/lib/main.dart` — instantiates services and long-lived providers, wires callbacks between them (key lookup, host-key verifier, sync-on-mutation), then mounts `MainScreen` under `MultiProvider`. The app is dark-only (`ThemeMode.dark`); the palette comes from the `yourssh_ui` design system (see **Design system** below), surfaced to app code through `AppColors` in `app/lib/theme/app_theme.dart` (and `MobileColors` in `app/lib/mobile/theme/mobile_theme.dart`), which are `@Deprecated` aliases of the `YsColors` tokens (kept, not deleted: ~460 call sites would churn for no visual change; new code uses `YsColors` directly). -**Navigation:** `MainScreen` (`app/lib/screens/main_screen.dart`) renders a top tab bar (pinned Home/SFTP + scrollable SSH session tabs) and a left sidebar. The session tab itself is `SessionTab` (`app/lib/widgets/session_tab.dart`, extracted for testability): health dot, distro/OS glyph (fresh `detectedOs` looked up from `HostProvider` — the session's `Host` snapshot goes stale after `copyWith`), recording/color dots, rename, context menu, middle-click close (pinned tabs protected). `NavSection` enum: `hosts`, `keychain`, `portForwarding`, `sftp`, `knownHosts`, `recordings`, `audit`, `settings`, `plugins`. Each maps to a top-level screen widget under `app/lib/widgets/`. Both SFTP panels share `EntryContextMenu` (`app/lib/widgets/entry_context_menu.dart`) — Open / Open with / View / Edit / Copy to target (with up-front disabled reasons from `_copyBlockReason`, incl. the same-folder block) / Refresh / New folder / Permissions (`PermissionsDialog`) / Rename / Delete. The host panel's CONNECTION CHAIN section is `HostChainEditor` (`app/lib/widgets/host_chain_editor.dart`) — pure-presentational Termius-style **multi-hop** chain (hop cards → arrows → destination card, persistent Add-a-Host picker that excludes hosts already in the chain, per-hop remove ×, key icon on the last hop when agent forwarding is on, Clear resets to direct); writes the full ordered id list back via `onChanged` to the panel's `_jumpHostIds`. `HostDetailPanel` is the **single host editor** (the old `AddHostDialog`/`HostListPanel` were dead code and removed): an SSH/RDP `SegmentedButton` at the top switches protocol (port auto-flips between `HostProtocol.defaultPort`s only when still on the other default); RDP mode shows domain / RDP-security / single-hop SSH-tunnel dropdown (stale tunnel ids render as "Direct connection", never a dropdown assert) and hides all SSH-only sections; `_save` preserves `protocol`/`domain`/`rdpSecurity`/`createdAt`. The shared `RdpBadge` widget (`app/lib/widgets/rdp_badge.dart`) marks RDP hosts on dashboard cards, list rows, and the panel header. `RdpWorkspace` supports **fullscreen** (`isFullscreen` + `onFullscreenChanged(bool)` — the widget reports intent, `MainScreen._setRdpFullscreen` owns `windowManager.setFullScreen` and collapses the app chrome to just the workspace): toolbar button enters (enabled only while connected), an auto-hiding hover pill at the top screen edge (mstsc-style; flashes 2.5 s on entry) exits, and the workspace auto-requests windowed mode when the session leaves `connected`; `MainScreen.build` also force-exits if the active tab stops being the RDP session (tab switch/close via hotkey), so the user can never be trapped chrome-less. Dashboard host actions are protocol-aware: SFTP/Test hidden for RDP, bulk Run/Push filter to SSH hosts (with a skipped-count snack), CONNECT ALL counts live RDP tabs, Duplicate keeps the RDP fields, Copy URL uses `rdp://` for RDP hosts. +**Design system** (spec `docs/superpowers/specs/2026-11-12-yourssh-ui-redesign-design.md`, plan `docs/superpowers/plans/2026-11-12-yourssh-ui-redesign-phase0-1.md`): `packages/yourssh_ui` wraps forui ("Amber Brand", dark only) and re-exports `package:forui/forui.dart`, so app code imports `package:yourssh_ui/yourssh_ui.dart` and gets forui (`F*` widgets, `FLucideIcons`) plus the `Ys*` tokens. Tokens: `YsColors` (`background` 0D0C0A, `card`, `secondary`/`muted`, `foreground`, `mutedForeground`, `border` = #FFEBD2 at 12%, `primary` amber F3A231, `primaryForeground`, `accentText`, `chrome`, `sidebar`, `terminalSurface`, status `ok`/`warn`/`off`/`error`), `YsSpace` (`s1`..`s6` = 4/8/12/16/24/32), `YsRadius` (`control` 6, `card` 10, `mobileCard` 14), `kYsFontFamily` (`'Inter'`). Themes (built once and cached, so `MaterialApp` rebuilds do not recreate them): `ysThemeData()` (desktop sizing), `ysThemeDataTouch()` (touch sizing, mobile), and `ysMaterialTheme()` (Material fallback theme built from the same tokens, for widgets not yet ported). The app root is wrapped in `FTheme` + `FToaster` by `ysRootBuilder` (desktop) or `ysRootBuilderTouch` (mobile), both in `app/lib/theme/app_theme.dart`, passed as `MaterialApp.builder` so dialogs, routes and toasts inherit them. Widget tests use `ysTestApp(child, {touch})` from `app/test/helpers/ys_test_app.dart` (MaterialApp with `ysMaterialTheme` + the matching root builder). Inter is bundled under `app/assets/fonts/inter/`; UI text never uses `google_fonts` (the dependency was removed; terminal fonts are the bundled Nerd/Powerline/Meslo files). New icons use Lucide (`FLucideIcons`). **Components:** `YsFileTable` (file listings), `YsHostCard` (dashboard host card), `YsStatusBar` (+ `YsStatusItem`, the session status line) and `YsPluginHost` (the themed frame a plugin renders in) sit in `yourssh_ui` beside `YsTab` (browser-style tab chrome: active = card background + 2 px amber bottom indicator; presentational chrome, callers own state, but focusable: Tab reaches it, Enter/Space selects; the close button shows on hover, focus or when active and stays reachable by Tab while hidden, inert to pointer and semantics). `showYsToast(context, message, {kind, actionLabel, onAction, duration})` shows a forui toast; `YsToastKind` is `info` / `success` / `error` (info/success auto-dismiss after 3 s, error after 5 s and uses the destructive variant), placed bottom-right on desktop and bottom-centre on Android/iOS (`ysRootBuilderTouch` lifts the toaster by the mobile tab-bar height so toasts never cover `MobileTabBar`); `ScaffoldMessenger` and `scaffoldMessengerKey` are gone. `showYsDialog` (forui dialog route on the root navigator with a tint-only barrier, no backdrop blur, so a streaming terminal is not re-blurred every frame; the barrier and Escape close it only while `barrierDismissible`; a barrier tap uses `Navigator.pop`, so a `PopScope` inside is bypassed, while Escape calls `maybePop` and honours it — a dialog guarding against dismissal must still pass `barrierDismissible: false`), `YsDialog` (title or `titleWidget`, optional body, `actions` laid out in an `OverflowBar`: right-aligned, stacked when they do not fit), `showYsConfirm` (returns bool; when `destructive`, Cancel holds default focus and confirm is destructive) and `YsDialogFrame` (card shell for dialogs that lay out their own content, replaces `Dialog(backgroundColor: ...)`). Give the safe choice `autofocus: true`. The TOFU prompts (`TofuDialog`, `HostKeyDialog`, `RdpCertDialog`, `FpRow`) are public in `app/lib/widgets/tofu_dialogs.dart`; they focus the safe choice by default and an accept that changes a pinned key/certificate is styled destructive. `SettingsScreen` (`app/lib/widgets/settings/`, one file per section — Connection, Appearance, Terminal, Keyword highlighting, Recording, Monitoring, Audit, Security, Sync, AI providers, Keyboard (opens `HotkeySettingsScreen`), Updates — with shared tiles in `settings_tiles.dart`, which re-exports `app/lib/widgets/ys_form_controls.dart` — the form controls also used outside Settings: `settingsTileGroup`, `SettingsSelect`, `SettingsIconButton`, `SettingsCaption`, `settingsButtonText`; `widgets/settings_screen.dart` is an export shim) is built on `FTileGroup`/`FSwitch`/`FSelect`/`FTextField`: one column at the window minimum, two columns (each its own focus traversal group) from 1040 px of content; only `ysThemeDataTouch()` lifts forui's touch `FItem` content padding so items measure >= 44 px (the desktop theme does not); both themes turn `slideableTiles`/`slideableItems` off for every tile and item group app-wide (ruling P16): the `FTappableGroup` a slideable group adds swallowed taps on buttons inside a text field's suffix (the password reveal toggle, an `FButton` suffix); `settingsTileGroup` is now a plain alias. Switch rows (`settingsSwitchTile`, the host editor's option tiles) toggle on a press anywhere on the row via the tile's `onPress`. `AppSnack` (`app_theme.dart`) delegates to `showYsToast`; use `AppSnack` or `showYsToast` for toasts and `showYsDialog`/`showYsConfirm` for dialogs rather than `showDialog`/`SnackBar`. **Rule:** new or rebuilt UI is built from forui widgets or `Ys*` components, not hand-styled Material. **Lint gate:** `tool/check_ui_lint.sh` (run by the `ui` job in `pr-test.yml`, with `tool/check_ui_lint_selftest.sh`) fails on `IconButton(`, `AlertDialog(`, `SnackBar(`, `Icons.`, `ScaffoldMessenger`, `showDialog(`, `showModalBottomSheet` and `TextField(` (word-boundary matched, so `FTextField(` and `showYsDialog(` pass) in `app/lib` and the snippets/devops/web_tools plugin packages (not `yourssh_ui`); justified exceptions go in `tool/ui_lint_allowlist.txt` as `path:pattern # reason` (empty today). Direct `Color(0x…)` literals are not allowed in widgets: use tokens (exempt: the terminal theme catalog, the `hostColors`/`tabColors` user palettes, keyword-highlight palette, OS glyph colours, the `AppColors.accentDim`/`textTertiary`/`orange`/`blue`/`purple` and `MobileColors.blue`/`tabInactive`/`borderSoft`/`accentSoft`/`textFaint` aliases, the web_tools `http_client/models.dart` HTTP-method palette and `history_panel.dart`). `AppColors` aliases: `bg`/`sidebar`/`card`/`cardHover`/`border`/`accent`(amber)/`textPrimary`/`textSecondary`/`red` map to `YsColors`, plus `success`/`warning`/`offline` (from `ok`/`warn`/`off`) — use `success` for status (connected/healthy) and `accent` (amber) for primary/active/selected state, never green for "active". `app` and `yourssh_ui` import `package:flutter/material.dart` (not `material_ui`): `material_ui`'s `ThemeData` is a different type from `MaterialApp`'s, so moving to `material_ui` is a separate later migration (ruling P6). Terminal themes live in `app/lib/theme/terminal_themes.dart`; `kDefaultTerminalTheme` is `'YourSSH Amber'`, applied to new installs only — `SettingsProvider.load` runs once when no `terminalTheme` pref is stored and pins existing installs (those with `yourssh.hosts`) to `'Dracula'`. -**Bulk actions:** the hosts dashboard's SELECT mode drives `app/lib/widgets/bulk/` — `BulkActionBar` (SELECT ALL / CLEAR / CONNECT ALL / RUN COMMAND / PUSH FILES / DONE; action cluster right-anchored, scrolls when narrow), `BulkRunDialog` + `BulkRunController` (parallel exec with bounded concurrency, 30 s per-host timeout, per-host failure isolation), `BulkDiffView` (groups identical outputs against a promotable baseline, side-by-side compare), `BulkPushDialog` (multi-host upload via `SftpTransferService.uploadDirectory(overwrite: true)`), `BulkHostStatusList` (shared per-host status rows). Closing a dialog mid-run confirms, cancels queued hosts, and lets in-flight operations finish. +**Navigation:** `MainScreen` (`app/lib/screens/main_screen.dart`) renders a top tab bar and a left sidebar, both in `app/lib/screens/shell/`. The sidebar is `AppSidebar` (`app_sidebar.dart`, also home of the `NavSection` enum), built on `FSidebar`; its amber selected style is defined once in `ys_theme.dart`. The tab bar is `SessionTabBar` (`session_tab_bar.dart`: pinned Home/SFTP + drag-reorderable scrollable SSH session tabs, "+" menu, notification bell). The session tab itself is `SessionTab` (`app/lib/widgets/session_tab.dart`, extracted for testability), rendered through `YsTab` from `yourssh_ui`: health dot, distro/OS glyph (fresh `detectedOs` looked up from `HostProvider` — the session's `Host` snapshot goes stale after `copyWith`), recording/color dots, rename, context menu, middle-click close (pinned tabs protected). `NavSection` enum: `hosts`, `keychain`, `portForwarding`, `sftp`, `knownHosts`, `recordings`, `audit`, `settings`, `plugins`. Each maps to a top-level screen widget under `app/lib/widgets/`. Both SFTP panels share `EntryContextMenu` (`app/lib/widgets/entry_context_menu.dart`) — Open / Open with / View / Edit / Copy to target (with up-front disabled reasons from `_copyBlockReason`, incl. the same-folder block) / Refresh / New folder / Permissions (`PermissionsDialog`) / Rename / Delete. The host panel's CONNECTION CHAIN section is `HostChainEditor` (`app/lib/widgets/host_chain_editor.dart`) — pure-presentational Termius-style **multi-hop** chain (hop cards → arrows → destination card, persistent Add-a-Host picker that excludes hosts already in the chain, per-hop remove ×, key icon on the last hop when agent forwarding is on, Clear resets to direct); writes the full ordered id list back via `onChanged` to the panel's `_jumpHostIds`. `HostDetailPanel` (`app/lib/widgets/host_detail_panel/`, one part file per section; the old path is an export shim) is the **single host editor** (the old `AddHostDialog`/`HostListPanel` were dead code and removed), built on forui: an SSH/RDP/VNC `FTabs` switch at the top switches protocol (port auto-flips between `HostProtocol.defaultPort`s only when still on the other default); GENERAL is the label, then hostname and port side by side, so Tab runs label → hostname → port → username, and Enter in any single-line field saves (same validation as Save); dropdowns are `FSelect`s over indexed options, so a `null` option ("follow global", "Direct connection") and a stale value (shown as the hint) never assert; RDP mode shows domain / RDP-security / single-hop SSH-tunnel select (stale tunnel ids render as "Direct connection") and hides all SSH-only sections; the per-host options are `FSwitch`es in an `FTileGroup`; the pinned footer holds Delete (existing hosts only; `showYsConfirm`, then `HostProvider.deleteHost`), Test (SSH only) and Save; `_save` preserves `protocol`/`domain`/`rdpSecurity`/`createdAt`. The shared `ProtocolBadge` widget (`app/lib/widgets/protocol_badge.dart`, a `YsStatusBadge`) marks RDP/VNC hosts on dashboard cards, list rows, and the panel header. `RdpWorkspace` supports **fullscreen** (`isFullscreen` + `onFullscreenChanged(bool)` — the widget reports intent, `MainScreen._setRdpFullscreen` owns `windowManager.setFullScreen` and collapses the app chrome to just the workspace): toolbar button enters (enabled only while connected), an auto-hiding hover pill at the top screen edge (mstsc-style; flashes 2.5 s on entry) exits, and the workspace auto-requests windowed mode when the session leaves `connected`; `MainScreen.build` also force-exits if the active tab stops being the RDP session (tab switch/close via hotkey), so the user can never be trapped chrome-less. Dashboard host actions are protocol-aware: SFTP/Test hidden for RDP, bulk Run/Push filter to SSH hosts (with a skipped-count snack), CONNECT ALL counts live RDP tabs, Duplicate keeps the RDP fields, Copy URL uses `rdp://` for RDP hosts. + +**Bulk actions:** the hosts dashboard's SELECT mode drives `app/lib/widgets/bulk/` — `BulkActionBar` (Select all / Clear / Connect all / Run command / Push files / Done, forui buttons; action cluster right-anchored, scrolls when narrow), `BulkRunDialog` + `BulkRunController` (parallel exec with bounded concurrency, 30 s per-host timeout, per-host failure isolation), `BulkDiffView` (groups identical outputs against a promotable baseline, side-by-side compare), `BulkPushDialog` (multi-host upload via `SftpTransferService.uploadDirectory(overwrite: true)`), `BulkHostStatusList` (shared per-host status rows), `bulk_dialog_chrome.dart` (shared header/footer and window-fitting body of the two dialogs). Closing a dialog mid-run confirms, cancels queued hosts, and lets in-flight operations finish. **Code editor:** `CodeEditorScreen` renders a Monaco editor via `webview_flutter` using the bundled `assets/monaco_editor.html`. @@ -201,7 +203,7 @@ Compiled into the app. Registered in `app/lib/plugins/plugin_registry.dart` (`kR 2. Import and instantiate in `plugin_registry.dart` Each implements `YourSSHPlugin` (from `yourssh_plugin_api`): -- `buildUI(context, pluginContext)` — plugin's widget +- `buildUI(context, pluginContext)` — plugin's widget; wrap it in `YsPluginHost` (from `yourssh_ui`) so it keeps the Ys forui theme even when mounted without the app's root builder (as Snippets, DevOps and Web Tools do) - `onActivate(ctx)` / `onDeactivate()` — lifecycle hooks - `minApiVersion` — checked at runtime against `kApiVersion` @@ -216,11 +218,11 @@ Loaded at runtime from a plugins directory via `packages/yourssh_script_engine`. - `QuickJsRuntime` — Dart FFI bindings for the QuickJS C engine; evaluates JS, calls hooks, returns structured results - `JsRuntimeRegistrar` — registers all Dart → JS bridge APIs into a `QuickJsRuntime` - `HookBus` — typed event bus; supports `transform` (modify data), `intercept` (block), and `observe` (side-effect) hooks; wired into `SshService` for `terminal.output`, `terminal.input`, and session lifecycle events -- `PluginLoader` — scans a directory for `plugin.json` manifests, loads plugins, watches the filesystem for changes and hot-reloads modified plugins +- `PluginLoader` — scans a directory for `plugin.json` manifests, loads plugins, watches the filesystem for changes and hot-reloads modified plugins; `reservedIds` (the built-in Dart plugin ids from `kRegisteredPlugins`, passed in `main.dart`) are never loaded or prompted for — a stale `~/.yourssh/plugins/snippets` copy of the old bundled JS Snippets (`dev.yourssh.snippets`, no longer shipped) is skipped with a console line. That copy used to move the native `yourssh.snippets` prefs into `plugin::dev.yourssh.snippets::storage::snippets` and delete them; `recoverJsSnippets` (`packages/yourssh_snippets`, run once from `SnippetProvider._load`, marker `yourssh.snippets.js_recovered`) restores or merges them back - `PermissionGuard` — enforces manifest-declared permissions before dispatching bridge calls - `PluginErrorTracker` — circuit breaker wired into hook/panel dispatch: errors count 1, timeouts 5, success resets; at 10 the plugin's hooks are skipped and it is unloaded - **Execution limits** (`native/bridge/qjs_bridge.c`): interrupt-handler deadline per call (250 ms hooks/panel messages, 5 s load) → `QuickJsTimeoutException`, 64 MiB memory cap, 512 KiB stack; host-callback results use the bridge's own `qjs_alloc` (freed in C). Only the macOS `assets/native/macos/libqjsbridge.dylib` (arm64) is prebuilt — rebuild with `native/build_macos.sh` after changing the C bridge -- **Consent** is bound to a SHA-256 of every file in the plugin dir (any change re-prompts) and stored grants are intersected with the manifest's current permissions; pending consents queue FIFO; `resolvePluginFile` keeps `manifest.entry` / panel `webviewEntry` inside the plugin dir (rejects `../`, absolute paths, escaping symlinks); `terminal.read` observes output only (its return value is ignored — rewriting needs `terminal.transform`); `MigrationBridge` is registered only for `dev.yourssh.snippets` +- **Consent** is bound to a SHA-256 of every file in the plugin dir (any change re-prompts) and stored grants are intersected with the manifest's current permissions; pending consents queue FIFO; `resolvePluginFile` keeps `manifest.entry` / panel `webviewEntry` inside the plugin dir (rejects `../`, absolute paths, escaping symlinks); `terminal.read` observes output only (its return value is ignored — rewriting needs `terminal.transform`) - `PluginUiRegistry` — plugins can register Flutter widgets by calling the `ui.register(id, widgetSpec)` JS API; the app renders these in the plugin manager **Bridges (Dart APIs exposed to JS):** diff --git a/app/assets/bundled_plugins/snippets/index.js b/app/assets/bundled_plugins/snippets/index.js deleted file mode 100644 index 5d9fdfbb..00000000 --- a/app/assets/bundled_plugins/snippets/index.js +++ /dev/null @@ -1,110 +0,0 @@ -'use strict'; - -var DEFAULTS = [ - { id: 'd1', label: 'Disk usage', command: 'df -h', description: 'Show disk usage per filesystem', tag: 'system' }, - { id: 'd2', label: 'Memory', command: 'free -h', description: 'Show memory and swap usage', tag: 'system' }, - { id: 'd3', label: 'Top processes', command: 'ps aux --sort=-%cpu | head -20', description: 'CPU-sorted process list', tag: 'system' }, - { id: 'd4', label: 'Syslog tail', command: 'tail -f /var/log/syslog', description: 'Follow system log', tag: 'logs' }, - { id: 'd5', label: 'Network interfaces', command: 'ip addr show', description: 'List network interfaces', tag: 'network' }, - { id: 'd6', label: 'Open ports', command: 'ss -tlnp', description: 'Show listening TCP ports', tag: 'network' } -]; - -var _activeSessionId = null; - -function getSnippets() { - var raw = _storage.get(JSON.stringify({ key: 'snippets' })); - if (raw === null || raw === 'null') return DEFAULTS.slice(); - try { - var parsed = JSON.parse(raw); - if (parsed === null) return DEFAULTS.slice(); - return JSON.parse(parsed.value || '[]'); - } catch (e) { - return DEFAULTS.slice(); - } -} - -function saveSnippets(list) { - _storage.set(JSON.stringify({ key: 'snippets', value: JSON.stringify(list) })); -} - -function migrateIfNeeded() { - try { - var migrated = _storage.get(JSON.stringify({ key: 'migrated' })); - if (migrated !== null && migrated !== 'null') return; - - var oldRaw = _migration.readOldSnippets(JSON.stringify({})); - if (oldRaw !== null && oldRaw !== 'null') { - try { - var oldData = JSON.parse(oldRaw); - if (Array.isArray(oldData) && oldData.length > 0) { - saveSnippets(oldData); - _migration.clearOldSnippets(JSON.stringify({})); - console.log('[snippets] Migrated ' + oldData.length + ' snippets from old storage'); - } - } catch (e) { - console.error('[snippets] Failed to parse old snippets: ' + e); - } - } - _storage.set(JSON.stringify({ key: 'migrated', value: '1' })); - } catch (e) { - console.error('[snippets] Migration error: ' + e); - } -} - -plugin.on('session.connect', function(ctx) { - _activeSessionId = ctx.sessionId; -}); - -plugin.on('session.disconnect', function(ctx) { - if (_activeSessionId === ctx.sessionId) { - _activeSessionId = null; - } -}); - -migrateIfNeeded(); - -function _handlePanelMessage(msg) { - try { - if (msg.type === 'get-snippets') { - return { type: 'snippets', data: getSnippets() }; - } - if (msg.type === 'add-snippet') { - var list = getSnippets(); - var snippet = msg.snippet; - snippet.id = 's' + String(new Date().getTime()) + Math.random().toString(36).slice(2, 6); - list.push(snippet); - saveSnippets(list); - return { type: 'ok' }; - } - if (msg.type === 'delete-snippet') { - var filtered = getSnippets().filter(function(s) { return s.id !== msg.id; }); - saveSnippets(filtered); - return { type: 'ok' }; - } - if (msg.type === 'run-snippet') { - if (!_activeSessionId) { - return { type: 'error', message: 'No active SSH session. Connect to a host first.' }; - } - _ssh.inject(JSON.stringify({ sessionId: _activeSessionId, text: msg.command + '\n' })); - return { type: 'ok' }; - } - if (msg.type === 'copy-snippet') { - _ui.copyToClipboard(JSON.stringify({ text: msg.command })); - _ui.notify(JSON.stringify({ message: 'Copied to clipboard', type: 'info' })); - return { type: 'ok' }; - } - return { type: 'error', message: 'Unknown message type: ' + msg.type }; - } catch (e) { - console.error('[snippets] onMessage error: ' + e); - return { type: 'error', message: String(e) }; - } -} - -plugin._setPanelMessage(_handlePanelMessage); - -ui.panel.register({ - title: 'Snippets', - icon: 'code', - webviewEntry: 'panel/index.html', - onMessage: _handlePanelMessage -}); diff --git a/app/assets/bundled_plugins/snippets/panel/index.html b/app/assets/bundled_plugins/snippets/panel/index.html deleted file mode 100644 index 4c9d3664..00000000 --- a/app/assets/bundled_plugins/snippets/panel/index.html +++ /dev/null @@ -1,303 +0,0 @@ - - - - - -Snippets - - - - -
- - -
- -
- - - -
- - - - diff --git a/app/assets/bundled_plugins/snippets/plugin.json b/app/assets/bundled_plugins/snippets/plugin.json deleted file mode 100644 index 49feb016..00000000 --- a/app/assets/bundled_plugins/snippets/plugin.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "id": "dev.yourssh.snippets", - "name": "Snippets", - "version": "2.0.0", - "entry": "index.js", - "minAppVersion": "1.0.0", - "permissions": [ - "session.observe", - "terminal.inject", - "ui.clipboard", - "ui.notify", - "ui.panel" - ] -} diff --git a/app/assets/fonts/inter/Inter-Bold.ttf b/app/assets/fonts/inter/Inter-Bold.ttf new file mode 100644 index 00000000..9fb9b751 Binary files /dev/null and b/app/assets/fonts/inter/Inter-Bold.ttf differ diff --git a/app/assets/fonts/inter/Inter-Medium.ttf b/app/assets/fonts/inter/Inter-Medium.ttf new file mode 100644 index 00000000..458cd060 Binary files /dev/null and b/app/assets/fonts/inter/Inter-Medium.ttf differ diff --git a/app/assets/fonts/inter/Inter-Regular.ttf b/app/assets/fonts/inter/Inter-Regular.ttf new file mode 100644 index 00000000..b7aaca8d Binary files /dev/null and b/app/assets/fonts/inter/Inter-Regular.ttf differ diff --git a/app/assets/fonts/inter/Inter-SemiBold.ttf b/app/assets/fonts/inter/Inter-SemiBold.ttf new file mode 100644 index 00000000..47f8ab1d Binary files /dev/null and b/app/assets/fonts/inter/Inter-SemiBold.ttf differ diff --git a/app/assets/fonts/inter/OFL.txt b/app/assets/fonts/inter/OFL.txt new file mode 100644 index 00000000..9b2ca37b --- /dev/null +++ b/app/assets/fonts/inter/OFL.txt @@ -0,0 +1,92 @@ +Copyright (c) 2016 The Inter Project Authors (https://github.com/rsms/inter) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION AND CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/app/assets/monaco_editor.html b/app/assets/monaco_editor.html index 39b2eaf6..775cee43 100644 --- a/app/assets/monaco_editor.html +++ b/app/assets/monaco_editor.html @@ -5,13 +5,13 @@ @@ -26,12 +26,31 @@