Commit Graph
65 Commits
Author SHA1 Message Date
jpmschweitzerandClaude Opus 4.7 7c8114ecbe test sweep: cover src/git/client.dart (T-91)
test / unit + widget + golden + a11y (push) Failing after 29s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m0s
23 integration tests in test/git/client_test.dart driving a real git
binary against per-test sandbox repos. Covers every GitClient public
method that wasn't already exercised through the daemon command
suite:

- Queries: status (clean + with upstream tracking ahead/behind),
  diff with explicit paths, log, currentBranch, branches (with the
  current-marker check), repoRoot (in-repo + non-repo paths).
- Mutations: unstage with paths, commit-returns-hash, discard,
  discard with empty list, stash + stashPop with includeUntracked,
  checkout, stageHunk + unstageHunk via _applyPatch.
- Error surface: mutations throw GitException on non-zero exit,
  _applyPatch surfaces stderr from a bad patch, bad git binary path
  → ProcessException → GitException, queries return empty fallbacks
  on a non-git workDir.
- parseLog standalone parser: empty input, short-record skip, full
  record with body, 5-field record without body.

Coverage: src/git/client.dart 76/141 -> 124/141 (88%). The remaining
17 lines are the pull / push paths (would need a real remote with
matching credentials — out of scope) and the status GitException
catch branches that require an in-flight git process failure mid-call.

Total coverage 75.42% -> 76.04%; floor bumped to 76.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 06:46:13 +02:00
jpmschweitzerandClaude Opus 4.7 3175b7a633 test sweep: cover kernel/src/syntax (T-91)
test / unit + widget + golden + a11y (push) Failing after 31s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m2s
Two test files covering the pure-Dart and fallback paths of the
tree-sitter integration. The native-FFI parsing depth stays
untested — DynamicLibrary.open('libtree-sitter.so') doesn't resolve
under the flutter test runner because the bundled lib sits at
native/linux-x64/ rather than on the linker search path. Real
parsing coverage would need an integration-test harness that copies
or symlinks the lib into the runner's working directory.

- test/kernel/src/syntax/language_map_test.dart (6 tests): every
  branch of grammarForPath — common extensions, case-insensitive
  matching, special filenames (Makefile / Dockerfile / .gitignore /
  justfile), no-dot/no-special-match fallthrough, unknown extension.
- test/kernel/src/syntax/tree_sitter_service_test.dart (9 tests):
  graceful-fallback paths of TreeSitterService when the library
  can't load — hasGrammar / languageFor / highlight all short-
  circuit cleanly, plus SyntaxResult.empty and SyntaxSpan field
  storage.

Coverage: language_map.dart 0/7 -> 7/7; tree_sitter_service.dart
1/131 -> 22/131 (the rest is deep FFI work); tree_sitter_ffi.dart
0/15 -> 1/15 (init entry only).

Total coverage 75.11% -> 75.42%.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 06:41:14 +02:00
jpmschweitzerandClaude Opus 4.7 331201e287 test sweep: cover src/editor/ tail paths (T-91)
test / unit + widget + golden + a11y (push) Failing after 33s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m2s
Adds 6 tests in test/editor/registry_test.dart closing out the
EditorRegistry methods the existing suite didn't reach:

- activate(id): unknown id is a no-op (no event emitted); known id
  flips the active buffer and emits editor.active-changed.
- setContent(id, content, selection?): explicit selection clamped to
  new content length, missing selection falls back to clamping the
  existing one, missing id is a silent no-op. Each emits the
  editor.edited replace event.
- contentFromArgs(args): the content_b64 fallback when text is
  absent, plus the empty-args default.
- Selection.hashCode + .toString.

Coverage: src/editor/buffer.dart 20/24 -> 24/24; src/editor/registry
.dart 87/105 -> 105/105. Both at 100%.

Total coverage 74.79% -> 75.11%; floor bumped to 75.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 06:37:14 +02:00
jpmschweitzerandClaude Opus 4.7 7ad427bd88 test sweep: cover I18n locale getters (T-91)
Adds one test covering the currentLocale / defaultLocale /
availableLocales getters on the I18n class. Existing suite exercised
the lookup behaviour but never read back the three locale fields,
leaving them as the last reachable gaps in lib/kernel/src/i18n/.

Coverage: kernel/src/i18n/i18n.dart 54/58 -> 57/58. The 1 remaining
line is the I18nReplacer const-constructor body (lcov phantom).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 11:21:24 +02:00
jpmschweitzerandClaude Opus 4.7 eeb2ee4b82 test sweep: mop up kernel/src/theme residuals (T-91)
test / unit + widget + golden + a11y (push) Failing after 30s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m2s
10 small tests in test/kernel/src/theme/mop_up_test.dart covering the
scattered last-mile gaps across the theme subsystem:

- ClideTheme.of and ClideTheme.controllerOf inherited-widget lookups
  (both happy path + the FlutterError-throw branch when no ancestor).
- contrast._composite alpha-mix branch via a partially-transparent
  foreground in contrastRatio.
- ContrastFailure.toString format with embedded pair name / ratio /
  minimum.
- ThemeLoader.fromYamlString FormatException on a non-map root.
- ThemeLoader.fromFile happy path with a tempdir YAML.
- Palette.names and SemanticRoles.roles iterables.

Coverage: theme/controller.dart 37/42 -> 42/42; theme/contrast.dart
54/64 -> 62/64 (remaining 2 lines are the failingPairs add-to-list
path, needs a constructed-broken SurfaceTokens to fire);
theme/loader.dart 48/54 -> 53/54 (1 const-ctor phantom);
theme/palette.dart 9/10 -> 10/10; theme/semantic.dart 2/3 -> 3/3.

Total coverage 74.55% -> 74.79%.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 09:13:43 +02:00
jpmschweitzerandClaude Opus 4.7 c3033fe304 test sweep: cover i18n catalog loaders + theme_picker _pick (T-91)
test / unit + widget + golden + a11y (push) Failing after 32s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m1s
Two test files / batches:

- test/kernel/src/i18n/catalog_loader_test.dart (11 tests): all three
  CatalogLoader implementations end-to-end. AssetCatalogLoader against
  an in-memory AssetBundle covers happy path, FlutterError catch
  (missing asset), FormatException catch (malformed JSON), blank
  asset, non-object JSON. FileCatalogLoader against a tempdir covers
  happy path, missing file, malformed, blank. InMemoryCatalogLoader
  covers lookup + namespace-miss.

- Extends test/builtin/theme_picker/widget_test.dart with two tests
  for the _pick command callback: defensive not-activated branch
  (drive the contribution's run() before activate runs, _ctx is still
  null) and the dialog-resolution happy path (register + activate,
  invoke theme.pick, manually drive dialog.dismiss('forest'), assert
  IpcResponse data['selected']).

Coverage: kernel/src/i18n/catalog_loader.dart 14/26 -> 26/26;
builtin/theme_picker/src/extension.dart 9/18 -> 15/18 (remaining 3
lines are the dialog builder body — needs a DialogHost in the test
harness, out of scope).

Total coverage 74.08% -> 74.55%; floor bumped to 74.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 09:03:29 +02:00
jpmschweitzerandClaude Opus 4.7 5dcd76a9a9 test sweep: cover builtin/ipc_status (T-91)
test / unit + widget + golden + a11y (push) Failing after 29s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m2s
Four new widget tests in test/builtin/ipc_status/widget_test.dart
covering the toolchain-state branches of ToolStatusItem and the
StatusItemContribution build callback:

- unresolved toolchain → SizedBox.shrink (no chip text rendered)
- all tools resolved → single "application ok" chip
- some tools missing → one warning chip per missing tool
- StatusItemContribution.build returns a ToolStatusItem widget

Coverage: builtin/ipc_status/src/status_item.dart 9/22 -> 22/22;
builtin/ipc_status/src/extension.dart 6/7 -> 7/7. Both at 100%.
Total 73.88% -> 73.99%.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 22:23:17 +02:00
jpmschweitzerandClaude Opus 4.7 8d98efc900 test sweep: cover src/pql/client.dart (T-91)
test / unit + widget + golden + a11y (push) Failing after 31s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m2s
18 integration tests in test/pql/client_test.dart driving the real
pql 1.4.30 binary against the clide vault. Covers the methods the
existing test/daemon/pql_commands_test suite didn't reach: backlinks,
tags, query, search, decisionValidate, decisionRead, decisionList
with filters, decisionShow with --with-refs / --with-tickets,
ticketList with status / team / assigned / decision filters,
ticketShow with --with-context / --with-blockers, ticketBoard with
--team. Plus PqlException.toString and the two error paths in _run
(ProcessException from a bad binary path, non-zero exit code from
the validator).

Coverage: src/pql/client.dart 43/92 -> 89/92 (97%). The 3 remaining
lines are an unreachable null-coalesce branch in _runList and
PqlException's field initialisers (lcov phantom).

Total coverage 73.34% -> 73.88%.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 19:11:52 +02:00
jpmschweitzerandClaude Opus 4.7 889058db1b test sweep: cover kernel/src/{events,ipc} (T-91)
test / unit + widget + golden + a11y (push) Failing after 28s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m2s
Three new test files + a small DaemonClient dispose-safety fix:

- test/kernel/src/events/types_test.dart (7 tests): every ClideEvent
  subclass's subsystem / kind / payload contract + the
  ClideEventEnvelope v1 JSON shape.
- test/kernel/src/events/message_bus_test.dart (6 tests): Message
  shape, MessageBus publish/subscribe/dispose, filter-by-publisher,
  filter-by-channel, intersection.
- test/kernel/src/ipc/client_test.dart (9 tests): real Unix-socket
  roundtrip via a _TestDaemon helper — connect + correlate request/
  response, event forwarding to the DaemonBus, malformed-line skip,
  daemon-disconnect failing pending requests, stop cleanup, dispose,
  connect-failure-then-reconnect, daemon-sent-Request warn-and-skip,
  DaemonConnectionChanged emission.

Fix in lib/kernel/src/ipc/client.dart: _setConnected now skips
notifyListeners / event emit when _disposed. The socket stream's
onDone can fire after dispose runs, which previously hit
ChangeNotifier's "used after disposed" assertion. State flip stays
unconditional so stop()'s explicit transition still works.

Coverage: ipc/client.dart 14% -> 92% (79/86; remaining 7 lines are
the socket onError callback + 1 const ctor phantom); events/types
.dart 95% (37/39 — 2 const-ctor phantoms); events/message_bus.dart
100%; events/bus.dart stays 100%.

Total coverage 71.93% -> 73.34%; floor bumped to 73.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 19:06:17 +02:00
jpmschweitzerandClaude Opus 4.7 94ff623708 remove dead Scrollable-era widgets + simulateScroll param
Three widgets under lib/src/terminal/src/ui/ and one TerminalView
parameter were leftovers from the era when TerminalView wrapped its
viewport in a real Scrollable. The Scrollable path was replaced with
PointerScrollEvent → PgUp/PgDown translation (alive, well-tested in
terminal_view_test.dart); these helpers stayed behind with tests but
zero production callers.

Drops:
- TerminalScrollGestureHandler (scroll_handler.dart, 100 LOC)
- InfiniteScrollView (infinite_scroll_view.dart, 117 LOC)
- KeyboardVisibilty (keyboard_visibility.dart, 59 LOC) — last
  production caller was removed in 048e835
- TerminalView.simulateScroll parameter — declared, never read
- The matching test groups + imports in ui_widget_test.dart
- The KeyboardVisibilty export from the terminal barrel

Net: -585 lines from lib/ + test/, no behavior change, and
infinite_scroll_view.dart stops being the 90%-coverage outlier we
were apologising for in the previous test sweep.

Same shape as T-93 (dead onTapUp wiring), T-95 (dead tertiary tap),
and 048e835 (dead scrollController plumbing). Public-or-tested
surface that no caller exercised.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 18:20:50 +02:00
jpmschweitzerandClaude Opus 4.7 387a336520 test sweep: cover escape parser + render _onScroll listener (T-91)
test / unit + widget + golden + a11y (push) Failing after 29s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m0s
Six tests for the last reachable coverage gaps in the terminal tree:

- EscapeParser CSI handlers that read params[0] and normalise 0 → 1:
  CUF (ESC [ Ps C), CUB (ESC [ Ps D), CPL (ESC [ Ps F).
- insertLines with an explicit param (ESC [ Ps L).
- DEC private mode 1001 (HighlightMouseTracking) toggles MouseMode
  .upDownScroll on, none off.
- RenderTerminal._onScroll driven via a test ViewportOffset that
  exposes notifyListeners — verifies the listener body runs without
  throwing when an offset is swapped in via the setter.

Coverage: escape/parser.dart 503/513 -> 510/513 (the 3 remaining
lines are _CSI.toString — only reachable from a debug log call that
no production path makes); render.dart 245/249 -> 249/249.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 18:12:31 +02:00
jpmschweitzerandClaude Opus 4.7 048e835b31 remove dead Scrollable plumbing from TerminalView
TerminalView's build tree doesn't wrap content in a Scrollable —
scroll is handled by translating PointerScrollEvent into PgUp/PgDown
keyInput. The ScrollController parameter, _scrollableKey, internal
_scrollController, _scrollToBottom helper, and its five call sites
were all dead: _scrollableKey.currentState was always null because no
Scrollable in the tree carried the key, so _scrollToBottom's jumpTo
never fired.

Drops:
- public scrollController parameter on TerminalView
- _scrollableKey + _scrollController fields
- the didUpdateWidget swap block and dispose call
- _scrollToBottom + the five call sites
- KeyboardVisibilty wrapper (its only callback was _scrollToBottom,
  now a no-op; the widget remains a reusable primitive under ui/ for
  future use)
- the matching tests in terminal_view_test.dart

Same shape as T-93 (dead onTapUp wiring) and T-95 (dead tertiary tap
surface) — public API that no caller used + internal state that no
path executed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 18:12:23 +02:00
jpmschweitzerandClaude Opus 4.7 f46ab50ff9 test sweep: cover terminal_view IME / focus tail paths (T-91)
test / unit + widget + golden + a11y (push) Failing after 30s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m1s
Three tests for the lines the existing TerminalView suite didn't quite
touch: the deleteDetection backspace flow (CustomTextEdit.onDelete
→ scrollToBottom + Terminal.keyInput), the hardwareKeyboardOnly tap
that requests focus directly (_onTapUp's else-branch when there's no
CustomTextEdit), and the single-char IME insert path where the
character maps to a TerminalKey (_onInsert's key != null branch).

Coverage: terminal_view.dart 180/188 -> 187/188 (99.5%). The 1
remaining line is _scrollToBottom's jumpTo call — unreachable in
current wiring since the tree has no Scrollable; _scrollableKey
.currentState is always null and the guard short-circuits.

Note: infinite_scroll_view.dart stays at 90% — the 4 uncovered lines
are the position-setter's value-changed branch, only reachable when
the inner Scrollable swaps its ViewportOffset. The widget doesn't
expose ScrollController or physics, so there's no public surface to
drive that path from a test.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 18:04:48 +02:00
jpmschweitzerandClaude Opus 4.7 0a43a1f7d2 remove dead tertiary-tap surface (T-95)
test / unit + widget + golden + a11y (push) Failing after 30s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m1s
The middle-click ("tertiary tap") path in TerminalGestureHandler was
wired wrong: build() bound onTertiaryTapDown to the secondary state
method, so a middle-click fired as if it were a right-click. The
state's onTertiaryTapDown/Up methods were unreachable, and the
onTertiaryTapUp body had a copy-paste bug (button=right instead of
middle). No production caller passed onTertiaryTapDown / onTertiaryTapUp
through, and TerminalView didn't expose them either, so the public
parameters were dead too.

Drops both layers of dead surface — option B of T-95. Same shape as
T-93's resolution (delete unused, restore later when a real consumer
needs it). Also collapses the unreachable onDragStart selectWord
branch (PanGestureRecognizer is mouse-only, so the touch path can't
fire) into a single selectCharacters call with a comment.

Companion: refines the reflow-padding test in coverage_trivials_test
to use narrow→wide reflow setup (more honest about intent, also
actually exercises the padding branch — Buffer.resize now 100%) and
clears two unnecessary_import warnings surfaced by the deletion.

Coverage: gesture_handler 55/59 -> 59/59; gesture_detector 50/50;
buffer/buffer 260/261 -> 261/261.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 17:56:24 +02:00
jpmschweitzerandClaude Opus 4.7 155af91e66 test sweep: close small terminal coverage gaps (T-91)
test / unit + widget + golden + a11y (push) Failing after 36s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m1s
Four targeted tests covering the last single-line/short-tail gaps
in the terminal tree: the PointerInputs.none / .all const
constructors, the abstract TerminalMouseHandler const constructor
(reached via a private subclass), the reflow-output-padding branch
in Buffer.resize (line < newHeight), and the wide-char skip in
TerminalPainter.paintLine.

Coverage: pointer_input 1/3 -> 3/3; mouse/handler 33/34 -> 34/34;
buffer/buffer 260/261 -> 261/261; painter 120/121 -> 121/121.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 17:03:47 +02:00
jpmschweitzerandClaude Opus 4.7 eb32422e05 drop dead pql.decisions.coverage IPC command
The 'pql decisions coverage' subcommand was removed in pql 1.4.x — the
replacement is the 'coverage_gaps' field on 'pql plan status'. No
production callers used this IPC surface; only the unit test referenced
it.

Removes the IPC registration, the PqlClient helper, and the matching
test case. Net negative LOC.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 17:03:40 +02:00
jpmschweitzerandClaude Opus 4.7 d2e65d8821 test sweep: cover ui/render.dart (T-91)
test / unit + widget + golden + a11y (push) Failing after 34s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m2s
10 widget tests driving RenderTerminal through a hosted TerminalView:
the reactive setters via updateRenderObject (theme, textStyle,
textScaler, padding, autoResize, cursorType, alwaysShowCursor) and
direct setter calls on the render box (padding, onEditableRect,
composingText) to cover the value-changed branches; getOffset for
non-origin cells; systemFontsDidChange; the terminal listener via
write(); the viewport-offset listener via scrollback overflow; and
the paint paths for composingText and controller-driven highlights.

Coverage: render.dart 179/249 -> 245/249 (98%). The 4 still-uncovered
lines are the _onScroll body — reachable only when the inner
ViewportOffset notifies, which doesn't happen with the current
ViewportOffset.zero() wiring (scroll lives in PointerScrollEvent →
PgUp/PgDown). Total 71.23% -> 72.02%; floor bumped to 72.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 09:15:29 +02:00
jpmschweitzerandClaude Opus 4.7 1bb5d8d534 test sweep: cover base/disposable.dart (T-91)
test / unit + widget + golden + a11y (push) Failing after 31s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m4s
Three pure-Dart tests covering the Disposable mixin: the disposed
getter flipping after dispose(), onDisposed firing once, and
register propagating dispose to child disposables.

Coverage: disposable.dart 12/17 -> 17/17. Total 71.20% -> 71.23%.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 20:23:00 +02:00
jpmschweitzerandClaude Opus 4.7 8ae5e7a9e8 test sweep: cover ui/custom_text_edit.dart (T-91)
test / unit + widget + golden + a11y (push) Failing after 32s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m2s
Adds 17 widget tests covering CustomTextEdit's focus / input-connection
lifecycle (autofocus, focus loss, readOnly toggling both directions,
focusNode swap), the keyboard helpers (requestKeyboard / closeKeyboard
both with and without an active connection, setEditingState,
setEditableRect early-return + active path), and the TextInputClient
surface (updateEditingValue insert / delete / composing branches,
performAction, plus the no-op stubs — updateFloatingCursor,
showAutocorrectionPromptRect, connectionClosed, performPrivateCommand,
insertTextPlaceholder, removeTextPlaceholder, showToolbar — and the
two getters).

Coverage: custom_text_edit.dart 66/96 -> 96/96. Total 70.86% -> 71.20%;
floor bumped to 71.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 17:29:13 +02:00
jpmschweitzerandClaude Opus 4.7 ca46bf4518 test sweep: cover ui/painter.dart (T-91)
test / unit + widget + golden + a11y (push) Failing after 31s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m2s
Adds 22 unit tests in test/terminal/painter_test.dart covering the
constructor, the three reactive setters (textStyle, textScaler,
theme — both same-value early-return and different-value paths),
clearFontCache, paintCursor for all three cursor types plus the
no-focus stroked-rect branch, paintHighlight, paintLine end-to-end,
paintCellForeground (codepoint-0 short-circuit, faint, inverse,
underline-on-space, bold+italic, cache hit), paintCellBackground
(normal early-return, inverse, named/palette, double-width), and
the foreground / background colour resolvers across normal / named /
palette / rgb colour types.

Coverage: painter.dart 72/120 -> 120/121. Total 70.30% -> 70.86%.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 09:08:57 +02:00
jpmschweitzerandClaude Opus 4.7 3ea49421bb test sweep: cover shortcut/ + base/event.dart (T-91)
test / unit + widget + golden + a11y (push) Failing after 30s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m0s
Adds 9 tests in test/terminal/shortcut_event_test.dart covering
Event / EventEmitter / EventSubscription, the platform branch in
defaultTerminalShortcuts, and the three TerminalActions intent
handlers (copy / paste / select-all, plus the empty-selection
no-op path).

Coverage: base/event.dart 2/13 -> 13/13; shortcut/actions.dart
8/24 -> 24/24; shortcut/shortcuts.dart 8/18 -> 18/18. Total
69.87% -> 70.30%; floor bumped to 70.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 01:40:07 +02:00
jpmschweitzerandClaude Opus 4.7 2216092ef4 test sweep: cover gesture_handler / gesture_detector selection paths (T-91)
test / unit + widget + golden + a11y (push) Failing after 34s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m2s
Adds three widget tests under TerminalView — selection gestures:
double-tap selects a word; long-press (touch) selects a word and
keeps the selection across move-update; mouse drag selects characters
across drag-start and drag-update. Each verifies the side-effect on
the externally-supplied TerminalController.

Coverage: gesture_detector.dart 42/50 -> 50/50; gesture_handler.dart
39/59 -> 55/59. The 4 remaining uncovered lines (147, 148, 151, 152)
are the dead tertiary-tap state methods filed as T-95 — same shape
as T-93 but on middle-click. Floor stays at 69 (69.79% measured;
integer threshold unchanged).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 18:16:07 +02:00
jpmschweitzerandClaude e966836886 test sweep: cover ui/ widget-level helpers (T-91)
Adds test/terminal/ui/ui_widget_test.dart — 14 widget tests
covering the lib/src/terminal/src/ui/ helpers that need a Flutter
widget tree (CustomKeyboardListener, KeyboardVisibilty,
InfiniteScrollView, TerminalScrollGestureHandler).

Files reaching ~100% (the 4 missing lines in infinite_scroll_view
sit in the render-object's `position` setter, only triggered when
Scrollable feeds a different ViewportOffset between rebuilds —
not reachable through normal widget plumbing without internal
access):

- scroll_handler.dart: 0 / unmeasured → 39/39 (100%) — main-buffer
  passthrough vs. alt-buffer interception, mouse-mode forwarding
  vs. simulateScroll fallback, simulateScroll=false drop, alt-flip
  + didUpdateWidget rebinding, onPointerDown tracking the cursor
  for the next scroll event.
- infinite_scroll_view.dart: 0 / unmeasured → 36/40 (90%) — onScroll
  fires on viewport position change, callback identity update via
  updateRenderObject.
- keyboard_listener.dart: 7/12 → 12/12 (100%) — character-key
  fallthrough into onInsert when onKeyEvent returns ignored,
  short-circuit to onKeyEvent's "handled" return, no-op on a key
  with no character.
- keyboard_visibility.dart: 18/19 → 19/19 (100%) — show + hide
  callbacks paired against view-insets transitions; no fire on
  same-inset metrics events.

Coverage delta:
- Total project: 68.80% → 69.12%; coverage_floor bumped 68 → 69.

Tests use a `_host()` helper that wraps the widget under test in
Directionality + MediaQuery + Center + a sized SizedBox. The
TerminalScrollGestureHandler tests use ColoredBox as the child
because Listener.onPointerSignal needs a hit-testable render
object below it, and SizedBox.expand alone doesn't paint anything.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-08 12:40:03 +02:00
jpmschweitzerandClaude ecf8ee56af test sweep: cover ui/ pure-Dart files (T-91)
test / unit + widget + golden + a11y (push) Failing after 48s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m0s
Adds test/terminal/ui/ui_pure_test.dart — 39 unit tests covering
the lib/src/terminal/src/ui/ files that don't need a Flutter widget
harness.

Files at 100%:
- palette_builder.dart: 0/52 → 52/52 (named-colour mapping for
  indices 0..15, RGB cube walk for 16..231 with the 95-then-+40
  step pattern, grayscale ramp 232..255, out-of-range clamp).
- paragraph_cache.dart: 2/22 → 22/22 (LRU promotion on read,
  eviction at maxSize, miss returns null, clear empties).
- terminal_text_style.dart: 7/19 → 19/19 (default ctor,
  fromTextStyle fontFamily fallback chain + size/height pass-
  through, toTextStyle attribute threading, copyWith with override
  + no-args clone).
- input_map.dart: 8/20 → 20/20 (keyToTerminalKey hits + null on
  unmapped LogicalKeyboardKey id, charToTerminalKey case-fold +
  multi-char/unknown null).
- terminal_size.dart: 4/8 → 8/8 (operator==/hashCode/toString,
  identity + type-mismatch branches).
- pointer_input.dart: 1/3 → 3/3 (default ctor, .none(), .all()).
- terminal_theme.dart: 1/1 unchanged.
- char_metrics.dart: 0/10 → 10/10 (positive width/height, monotonic
  text-scaler scaling).
- ui/controller.dart: 18/52 → 52/52 (TerminalController default
  state, setSelection + mode override, attached/detached anchor
  selection-getter behaviour, prior-anchor disposal on second
  setSelection, setSelectionMode no-op short-circuit, clearSelection,
  setPointerInputs / setSuspendPointerInput gating,
  highlight register/dispose lifecycle, TerminalHighlight.range
  null on detached anchors).

Enums (selection_mode, cursor_type) and themes constants are
covered transitively — they have no executable lines that lcov
instruments.

Coverage delta:
- Total project: 67.06% → 68.80%; coverage_floor bumped 66 → 68.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-08 11:28:17 +02:00
Jeroen SchweitzerandClaude Opus 4.6 a6eca2561b remove dissolved daemon, retire ptyc, fix golden cross-platform
Complete three overdue cleanups discovered during macOS health check:

D-56 daemon dissolution: delete bin/clide.dart, DaemonServer,
and orphaned tests (test/cli/, subprocess_test, in_process_test).
Update stale "clide --daemon" references in i18n catalogs, error
messages, editor_commands, CI scripts, and decision records.

ptyc retirement: delete ptyc/ source tree, PtySession, scm_rights.
Remove from Toolchain resolution, ToolCheck gate, backend
serialization, testmode harness, Makefile, CI, and sandbox
entitlements. PTY spawning uses NativePty (Dart FFI forkpty) since
the terminal was absorbed in-tree. D-5 amended.

Golden tests: wire the existing but never-applied clideGoldenConfig
via flutter_test_config.dart. Disable CI goldens (Skia anti-aliasing
differs between macOS/Linux even with Ahem). Keep platform-keyed
goldens only — goldens/linux/ and goldens/macos/ each run on their
own OS.

Test suite: 826 pass, 0 fail on macOS (was 829 pass, 11 fail).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-07 18:40:01 +02:00
jpmschweitzerandClaude 6b7290dc42 fix dead-wired TerminalView.onTapUp callback (T-93)
test / unit + widget + golden + a11y (push) Failing after 28s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 59s
`TerminalView.onTapUp` was documented as "Callback for when the
user taps on the terminal" but was wired to a code path nothing
ever invoked:

- `TerminalView.build` passed it via `onTapUp:` to
  `TerminalGestureHandler`,
- which forwarded via `onTapUp:` to `TerminalGestureDetector`,
- whose `onTapUp` field was declared and accepted but never called
  by `_handleTapUp` (which only fires `onSingleTapUp`).

Net: every caller that registered an `onTapUp` callback on
`TerminalView` got silent failure. zero in-tree callers depended
on it (clide_pty_view.dart is the only TerminalView callsite and
doesn't pass any tap callback), but the public API said one thing
and did another.

Fix: wire `_onTapUp` (the cell-resolving state-method) through the
detector's working `onSingleTapUp` slot. The user-facing semantics
("fires on confirmed single tap with the resolved cell offset")
match the only sane interpretation of the docstring, and don't
overlap with the existing `onSecondaryTap*` (which were already
correctly wired through TapGestureRecognizer's secondary callbacks).

Also drops the dead surface that surfaced the bug:
- `TerminalGestureHandler.onTapUp` parameter + field — no caller
  passes it after the fix; was only used to forward into the dead
  detector field.
- `TerminalGestureDetector.onTapUp` parameter + field — never
  invoked by `_handleTapUp`. Pure dead code.

Tests: extends `terminal_view_test.dart` with a primary-tap
regression case + paired tests for selection-clearing and
secondary-tap callback routing. The double-tap recognizer's
300 ms timer is flushed via `pump(const Duration(seconds: 1))`
(pumpAndSettle waits for animations, not arbitrary timers).

Coverage delta:
- terminal_view.dart: 151/188 → 180/188 (95.7%; remaining gaps
  are IME `_onComposing`/`_onEditableRect`/`_onKeyboardShow`
  body branches that need deeper IME mocking).
- gesture_handler.dart: 18/60 → 39/59.
- gesture_detector.dart: 30/50 → 42/50.
- Total project: 65.76% → 66.97%; coverage_floor 65 → 66.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-07 08:49:09 +02:00
jpmschweitzerandClaude fb85dfa6f9 test sweep: cover TerminalView widget (T-91)
Adds test/terminal/terminal_view_test.dart — 14 widget tests
covering the StatefulWidget that wires gesture / keyboard / scroll
plumbing around a `Terminal`:

- Construction smoke tests (default, externally-supplied
  controller / focusNode / scrollController, hardwareKeyboardOnly,
  readOnly + hardwareKeyboardOnly).
- Pointer-signal handling: PointerScrollEvent → PgUp/PgDown
  keyInput; non-scroll PointerSignalEvent ignored.
- didUpdateWidget swap of focusNode / controller / scrollController
  (auto-created previous instance gets disposed cleanly).
- Hardware key event flowing through to Terminal.keyInput.
- cursorRect / globalCursorRect after layout.
- requestKeyboard / closeKeyboard as no-ops when no edit state is
  mounted; hasInputConnection false when no input connection is
  open.
- Selection survival when the widget unmounts but an
  externally-owned controller stays alive.

Coverage delta:
- terminal_view.dart: 0/188 → 151/188 (80.3%).
- Total project: 59.82% → 65.76%; coverage_floor bumped 59 → 65.

The remaining ~20% in terminal_view.dart sits in
gesture / IME / keyboard-event plumbing (`_onTapUp`, `_onTapDown`,
secondary-tap callbacks, `_onInsert`, `_onComposing`,
`_handleKeyEvent` shortcut path, `_onKeyboardShow`,
`_onEditableRect`, `_scrollToBottom`). These are reachable only
through full pointer / IME simulation that's better suited to
`integration_test/` than widget tests — leaving them for a
later integration-test pass rather than papering over with
brittle gesture mocking.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-07 08:25:44 +02:00
jpmschweitzerandClaude 4642a2f25b test sweep: cover Terminal orchestrator (T-91)
Adds test/terminal/terminal_test.dart — 54 unit tests covering the
`Terminal` class as a pure-Dart orchestrator: construction +
TerminalState defaults, the Observable mixin, write/writeChar,
keyInput / charInput / textInput / paste (with bracketed-paste +
ctrl/alt encodings, including macOS reservation), mouseInput
gating, resize (clamping + onResize callback + alt-buffer
scrollback clear), buffer switching (use{Alt,Main}Buffer +
clearAltBuffer), every SBC handler (bell / backspace / lineFeed /
CR / SO / SI / unknown), tab-stop manipulation (tab jump +
saturation, clearTabStopUnderCursor, clearAllTabStops, setTapStop),
every ANSI escape handler (save/restore cursor, index, nextLine,
reverseIndex, designateCharset), CSI cursor + erase + line/char
insert/delete + scroll + repeatPreviousCharacter (incl. no-op when
no preceding char), device-attribute and status reports, every
mode setter mirroring into its getter, every SGR set/unset attr +
colour setter, OSC handlers (setTitle / setIconName / unknownOSC),
and all the documented no-op fallbacks (unknownSBC, unkownEscape,
unknownCSI, setUnknownMode, setUnknownDecMode, setColumnMode,
unsupportedStyle).

Also fixes a real production bug surfaced while writing tests:
`BufferLine.eraseRange(0, 0, ...)` panicked with a `RangeError`
because the right-side wide-char guard read `_data[-1]` via
`getWidth(end - 1)` when `end == 0`. The left guard already had a
`start > 0` check; the right guard was missing the symmetric
`end > 0`. Real trigger path: `Terminal.eraseDisplayAbove`
(`ESC[1J`) with the cursor at column 0 — common after `ESC[H\x1b[1J`
home-then-erase-above sequences that many TUIs emit on redraw.
Regression test added in line_test.dart.

Coverage delta:
- terminal.dart: 0/283 → 291/291 (file grew by 8 LF for the
  fix's comment lines).
- base/observable.dart: 0/7 → 7/7 (covered transitively via
  Terminal's listener tests).
- Total project: 56.40% → 59.82%; coverage_floor bumped 56 → 59.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-07 08:21:18 +02:00
jpmschweitzerandClaude 6008b4914c test sweep: cover utils/ + core/mouse/ (T-91)
Adds two test files closing the last two pure-Dart sub-areas in
`lib/src/terminal/src/`:

`test/terminal/utils/utils_test.dart` — 51 tests covering:
- Ascii.isNonPrintable (control chars + DEL).
- hashValues (every optional arg slot, 2..20 inclusive) +
  hashList (including the documented zero-on-empty short-circuit).
- ByteConsumer (single-block + cross-block consume, peek's
  consume-rollback path, rollback within block + across consumed
  blocks, rollbackTo, unrefConsumedBlocks, reset).
- IndexAwareCircularBuffer (push/trim, pushAll, pop, [] / []=,
  clear, forEach, remove with count clamp / no-op, insert in the
  middle / at end / at full ring, insertAll, trimStart, replaceWith
  with truncate-from-head, swap, maxLength setter incl. error +
  no-op cases, debugDump, IndexedItem mixin attach/detach/index).
- UnicodeV11.wcwidth (control chars, printable ASCII, DEL+C1,
  combining marks BMP+high-plane, wide chars BMP+high-plane,
  unmapped high-plane default, version field).
- The push wrap branch where _startIndex resets to 0 after a full
  revolution (last circular_buffer line).

`test/terminal/mouse/mouse_test.dart` — 21 tests covering:
- TerminalMouseButton ids + isWheel for the 7 enum values.
- MouseReporter for all four MouseReportMode shapes (normal with
  >223 null-byte clamp, utf with the 2015-limit clamp, sgr's M/m
  pair, urxvt's button+32 / 3-on-up encoding).
- TerminalMouseEvent constructor.
- CascadeMouseHandler first-non-null semantics.
- ClickMouseHandler — only fires on clickOnly + down + button id
  < 3; null otherwise. UpDownMouseHandler — fires on every
  upDownScroll* mode; drops wheel-up; passes wheel-down. Default
  defaultMouseHandler routes through both.

Coverage delta:
- utils/ascii.dart: 0/2 → 2/2.
- utils/byte_consumer.dart: 28/42 → 42/42.
- utils/circular_buffer.dart: 71/130 → 130/130.
- utils/hash_values.dart: 16/36 → 36/36.
- utils/unicode_v11.dart: 16/27 → 27/27.
- core/mouse/handler.dart: 3/34 → 34/34.
- core/mouse/reporter.dart: 0/17 → 17/17.
- (utils/char_code.dart, utils/lookup_table.dart already at 100%
  from earlier reflow + parser work; mouse/button.dart,
  mouse/button_state.dart, mouse/mode.dart are pure enums with no
  executable lines.)
- Total project: 54.62% → 56.40%; coverage_floor bumped 54 → 56.

Two pre-existing `// ignore_for_file: constant_identifier_names`
suppressions that lacked documented reasons get inline
justifications:
- `lib/src/terminal/src/utils/ascii.dart` — RFC 20 / ISO 646
  control-character names; lowerCamelCase would diverge from every
  spec/man-page reference.
- `lib/src/terminal/src/utils/unicode_v11.dart` — Unicode 11
  wcwidth tables vendored as-is; future re-vendoring stays a
  verbatim paste.

Both fall under the same "FFI / spec-shaped names" pattern as the
libc.dart suppression (D-66 era).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-07 08:13:07 +02:00
jpmschweitzerandClaude 6caa82597e fix dangling tail anchors in reflow on partially-filled lines (T-92)
test / unit + widget + golden + a11y (push) Failing after 29s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 1m0s
`_LineReflow._addPart`'s post-loop block reparents anchors past the
source line's trimmed content onto whatever `_builder._result` was
active at that moment. When no further content lands in the builder
(non-wrapped lines, or the last logical line of a wrapped run),
`finish()` was emitting only when `_builder.isNotEmpty` — leaving
the empty result line with the reparented anchor unappended. The
anchor then pointed to a `BufferLine` that the reflow output never
included, `lines.replaceWith(reflowResult)` discarded it, and
`CellAnchor.attached` returned false. The selection controller's
`extent.attached` null-check then dropped the selection silently
on resize.

The fix adds a `_LineBuilder.hasAnchors` getter and uses it in
`finish()` so the builder line is also emitted when it's carrying
an anchor — even when otherwise empty. Trade-off: an extra trailing
line in the reflow output when (and only when) a tail anchor would
have dangled. `Buffer.resize` already pads the result to `newHeight`
afterward, so for the common case (resize fits inside view height)
the total ring length is unchanged; only when the result already
meets / exceeds `newHeight` does the buffer grow by one. Acceptable
in exchange for selections surviving a width change.

User-visible trigger paths:
- `SelectAllTextIntent` (Ctrl+A) creates an end anchor at
  `x = viewWidth` on the last buffer line — exactly the past-
  trimmed-length position. Resizing narrower while the selection
  was active dropped it.
- Mouse drag selections past the end of a partially-filled line
  hit the same shape.

Tests:
- The pre-existing `reflow anchors on the source line tail (past
  trimmedLength) get reparented` test was originally written to
  document the buggy behaviour ("anchor moves off the source onto
  a dangling builder line"). Updated to assert the post-fix
  contract: `out.contains(tail.line)` is true.
- New `SelectAllTextIntent-shaped end anchor survives shrink`
  regression test that mirrors the actual production trigger
  (anchor at `x = viewWidth` on a partially-filled line, narrower
  reflow).

reflow.dart 71/71 → 72/72 (the new getter is a one-liner). Project
coverage 54.62% unchanged within rounding.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-07 07:58:44 +02:00
jpmschweitzerandClaude 3196c4957f test sweep: cover core/(root) — cell, cursor, charset, tabs, reflow (T-91)
Adds test/terminal/core/core_test.dart — 36 unit tests across the
small standalone files that sit directly under
`lib/src/terminal/src/core/*.dart`:

- CellData (constructor + empty + getHash + toString),
- CursorStyle (default ctor, every set/unset attr getter pair, all
  three colour-mode setters per channel, reset, the .empty
  singleton) + CursorPosition,
- Charset (translate, designate/use, save/restore, asciiTranslator,
  decSpecGraphicsTranslator with in-table, out-of-table, and high-
  codepoint paths),
- TabStops (default 8-column grid, find with empty-range / out-of-
  bounds / no-stop-in-range cases, setAt/clearAt/clearAll/reset),
- reflow (empty input, single-line passthrough, grow, shrink-with-
  split, wrapped-run continuation, wide-char boundary on the new
  width, inner wide-char clamp during _addPart, anchor reparent on
  the main path, anchor reparent past trimmedLength).

Two source-side cleanups folded in:
- `CursorStyle.isItalis` was a defined-but-never-called getter
  with a typo. No external callers reference it; renamed to
  `isItalic` in the same change as the test that exercises it.
- `_LineBuilder.isEmpty` in reflow.dart was dead — the only callers
  use `isNotEmpty` or check `_lines.isNotEmpty` separately.
  Removed.

Coverage delta:
- cell.dart: 3/7 → 7/7.
- charset.dart: 12/25 → 25/25.
- cursor.dart: 2/62 → 62/62.
- tabs.dart: 0/23 → 23/23.
- reflow.dart: 24/72 → 71/71 (file shrank by one line after the
  isEmpty getter removal).
- Total project: 52.72% → 54.62%; coverage_floor bumped 52 → 54.

Note for follow-up (not blocking): the post-loop "anchor.x >= to"
branch in reflow's `_addPart` reparents anchors past trimmedLength
onto whatever builder line is active at that moment. If no
subsequent content is added (no wrapped continuations after the
last shrink iteration), that builder line is never emitted by
`finish()` and the anchor lands on a dangling reference. The path
is exercised by the new test, but the contract it implements is
arguably broken — anchors that should follow the source content
end up off the visible buffer. Worth a separate ticket if real
terminals trip it.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-07 00:03:19 +02:00
jpmschweitzerandClaude 26cc1b3154 drop redundant single-symbol imports across the tree
12 imports flagged by `unnecessary_import` because the symbols
they bring in are also re-exported by the umbrella import already
present in the same file:

- bin/clide.dart: src/git/client.dart, src/pql/client.dart
  (covered by package:clide/clide.dart).
- lib/builtin/decisions/, lib/builtin/tickets/ (4 files):
  kernel/src/events/message_bus.dart (covered by kernel.dart).
- lib/kernel/src/ipc/in_process.dart: src/daemon/dispatcher.dart
  (covered by clide.dart).
- lib/main.dart: kernel/src/toolchain.dart (covered by kernel.dart).
- test/builtin/ipc_status/widget_test.dart:
  builtin/ipc_status/src/status_item.dart (covered by
  ipc_status.dart).
- test/daemon/{git,pql}_commands_test.dart: src/git/client.dart and
  src/pql/client.dart (covered by clide.dart).
- test/widgets/multitab_pane_test.dart: widgets/src/icons/x.dart
  (covered by widgets.dart).

Mechanical change — every removed line was already a no-op for
symbol resolution; the umbrella imports define the public surface
each file is actually using.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-06 23:46:24 +02:00
jpmschweitzerandClaude f3e164b834 test sweep: cover core/input/ keytab + handlers (T-91)
Adds test/terminal/input/input_test.dart — 58 unit tests covering
the keytab tokenizer, parser, unescape helper, KeytabRecord
toString shapes, Keytab.find modifier-matching rules, and the four
TerminalInputHandler implementations (CascadeInputHandler,
KeytabInputHandler, CtrlInputHandler, AltInputHandler).

Highlights:

- keytabUnescape: every documented backslash escape + \xHH hex.
- LineReader: peek/take/done, whitespace skip, readString
  (alphanumeric/underscore), readUntil (both exclusive and
  inclusive variants).
- tokenize: keyboard-name and key-define lines, comment + blank
  stripping, shortcut vs string actions, error paths on malformed
  input.
- KeytabParser: full mode-flag matrix, error paths on every
  defensive throw reachable through the public addTokens API
  (stray non-keyboard token, missing colon, modeStatus value other
  than '+'/'-', non-mode token after modeStatus, action token of
  wrong type, second token of wrong kind for both _parseName and
  _parseKeyDefine).
- KeytabRecord.toString covers every supported flag (Alt, Control,
  Shift, AnyMod, Ansi, AppScreen, KeyPad, AppCuKeys, AppKeyPad,
  NewLine, Mac).
- Keytab.find: -Shift / +AnyMod / -AnyMod gating, mode-flag
  filters (newLine, appKeyPad, appScreen, macos, appCursorKeys,
  keyPad), -Ansi (VT52) skip, fallthrough to fallback record,
  null when no key matches.
- KeytabInputHandler: every modifier combination's `*` placeholder
  expansion (1..8 inclusive), default-keytab fallback, no-match
  null, no-* passthrough.
- CtrlInputHandler: A..Z → 0x01..0x1A; null without ctrl, with
  shift / alt, or on non-letter keys.
- AltInputHandler: A..Z → ESC + uppercase; null without alt, with
  shift / ctrl, on macOS, or on non-letter keys.
- defaultInputHandler integration: keytab routing, fallthrough to
  CtrlInputHandler.

Coverage delta:
- core/input/handler.dart: 4/54 → 54/54.
- keytab.dart: 0/29 → 29/29.
- keytab_record.dart: 0/44 → 44/44.
- keytab_token.dart: 0/82 → 80/82 (the two remaining lines are
  defensive throws inside `_parseKeyboardNameDefine` /
  `_parseKeyDefine` that are unreachable from tokenize() — the
  callers only enter those functions after the `_isKeyboardNameDefine`
  / `_isKeyDefine` guards in the same file, so the inner readString
  always matches).
- keytab_parse.dart: 0/65 → 63/65 (the two remaining lines mirror
  the same shape — _parseName and _parseKeyDefine both check the
  first token's type, but addTokens only delegates to them after
  matching that type, so the throws are dead defensive code).
- keytab_default.dart: 0/4 unchanged — that's the file's own
  `void main()` debug entrypoint that prints the parsed default
  keytab; not part of the runtime contract.
- keytab_escape.dart: 0/14 → 14/14.
- Total project: 49.31% → 52.53%; coverage_floor bumped 49 → 52.

The 4 dead defensive throws are flagged but not removed in this
commit — they're a code-style call (defensive paranoia vs. dead-
code cleanup) that belongs in a separate review, not folded into a
test sweep.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-06 23:33:57 +02:00
jpmschweitzerandClaude 9331055b44 test sweep: cover EscapeParser + EscapeEmitter (T-91)
Adds test/terminal/escape/parser_test.dart — 70 unit tests covering
the parser's dispatch surface end-to-end:

- single-byte controls (BEL, BS, HT, LF/VT/FF, CR, SO, SI),
- ESC sequences (D, E, H, M, =, >, 7, 8, ( name, ) name, unknown),
- CSI cursor moves (A/B/C/D/E/F/G/H/d/f) with default + 0-as-1
  fallback semantics,
- erase / scroll / line-insert/delete / chars (J, K, L, M, P, S, T,
  X, @, b, g, r),
- device attributes (c / >c / =c) and DSR (5, 6),
- window manipulation (CSI 8 t resize, CSI 18 t sendSize, ignored
  no-op codes, malformed CSI 8 t),
- mode set/reset (h/l, ? prefix for DEC modes — covering ?1, ?3,
  ?5, ?6, ?7, ?9, ?12, ?25, ?47, ?66, ?1000, ?1002, ?1003, ?1004,
  ?1005, ?1006, ?1007, ?1015, ?1047, ?1048, ?1049, ?2004, +
  unknown fallback),
- SGR styling (resets, set/unset for every attr, 16-colour
  foreground + background, 256-colour, 24-bit RGB, 39 / 49
  resets, unknown → unsupportedStyle),
- OSC 0/1/2 (BEL- and ST-terminated), unknown OSC, incomplete
  sequence held back across writes,
- unknown CSI final byte → unknownCSI,
- token bookkeeping (tokenBegin / tokenEnd advance with consumed
  bytes).

Plus EscapeEmitter — every reply string format (primary /
secondary / tertiary device attributes, operating status, cursor
position, bracketed paste, size).

Coverage delta:
- parser.dart: 0 / 462 → 504 / 514 (98.1%; the remaining 10 lines
  sit inside the `// ignore: dead_code` SGR loop, which I'm
  surfacing for separate review rather than extending tests
  around).
- emitter.dart: 1 / 11 → 11 / 11.
- Total project: 43.20% → 49.38%; coverage_floor bumped 43 → 49.

Two real source-code issues found while writing tests, fixed in
the same commit:

1. Swapped docstrings on `_escHandleSetAppKeypadMode` /
   `_escHandleResetAppKeypadMode`. The function names + dispatch
   table + bodies all match the VT spec correctly (ESC = enables,
   ESC > disables); only the doc-comments were swapped. Now read
   the right way around.
2. `case 10061000:` in `_setDecMode` was unreachable (no DEC mode
   has that value). Almost certainly a typo where `case 1006:`
   meant to glue onto `case 1000:` but a newline went missing.
   Mode 1006 is already handled separately at its own clause as
   `MouseReportMode.sgr`. Removed.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-06 23:24:12 +02:00
jpmschweitzerandClaude c233b7607d test sweep: cover Buffer (T-91)
Adds test/terminal/buffer/buffer_test.dart — 67 unit tests against
the Buffer orchestrator on top of BufferLine. Drives a fake
TerminalState through writes, cursor moves, scroll regions,
erase commands, line insert/delete, resize (with and without
reflow), word-boundary lookup, getText, and the toString debug
dump.

Coverage delta:
- buffer.dart: 0 / 260 → 260 / 261 (one while-loop-body line
  Dart coverage doesn't instrument distinctly; the loop's effect
  is exercised end-to-end by the reflow-pad test).
- Total project: 39.12% → 43.20%.
- pubspec.yaml `coverage_floor:` bumped 39 → 43.

Notes:
- The fake TerminalState (`_State`) is a per-file impl rather than
  a shared fixture; it stays close to the test that exercises it
  and avoids forcing other terminal tests to depend on a one-shape-
  fits-all stub.
- Tests that walk through `lineFeed` use `lineFeedMode: true` so
  the column resets between newlines — otherwise the saturated
  cursor X from a previous full-width write spills the next write
  onto an extra line via `writeChar`'s autoWrap branch.

This closes the `core/buffer/` sub-area for T-91 — every leaf file
in `lib/src/terminal/src/core/buffer/` is now at >= 96% line
coverage; the only outliers are Dart-coverage-instrumentation
quirks, not real gaps.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-06 23:13:42 +02:00
jpmschweitzerandClaude c744c8ce4b test sweep: cover BufferLine + CellAnchor (T-91)
Adds test/terminal/buffer/line_test.dart — 51 unit tests covering
BufferLine and CellAnchor, hitting every reachable line in
lib/src/terminal/src/core/buffer/line.dart (192 / 192).

Coverage delta:
- line.dart: 0 / 194 → 192 / 192 (file shrank by two lines after
  the prior commit's iteration fix folded two for-loop heads into
  for-each-toList).
- Total project: 36.39% → 39.12%.
- pubspec.yaml `coverage_floor:` bumped 36 → 39 in lockstep.

Highlights:
- All packed-cell encodings (foreground/background/attrs/content
  channels, codepoint+width packing, CellData round-trips).
- `eraseRange` wide-char neighbor extension on both ends.
- `removeCells` / `insertCells` shift logic, anchor reposition, and
  the wide-tail-erase branch (insertCells case where the post-shift
  last cell carries a wide marker).
- `resize` exercising the [64, 256) capacity-doubling branch and
  the >=256 +32 branch separately.
- `getTrimmedLength` cols-clamp behaviour for null/over-capacity.
- `getText` skip-trailing-wide-char branch.
- `CellAnchor` lifecycle: detached construction, `reposition`,
  `reparent` (both detached→attached and between owners), `dispose`,
  attached y/offset via a real IndexAwareCircularBuffer.

Also cleans up five `unrelated_type_equality_checks` analyze infos
in test/terminal/buffer/range_test.dart by typing the RHS as Object
when intentionally probing the type-mismatch branch of operator==.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-06 23:03:21 +02:00
jpmschweitzerandClaude eb32396bd4 test sweep: cover BufferRange family (T-91)
Adds test/terminal/buffer/range_test.dart — 38 unit tests covering
the small pure-Dart files in lib/src/terminal/src/core/buffer/:

- cell_offset.dart       23 / 23  (was 0 / 23)
- range.dart             13 / 13  (was 0 / 13)
- segment.dart           13 / 13  (was 0 / 13)
- range_line.dart        30 / 30  (was 0 / 30)
- range_block.dart       48 / 48  (was 0 / 48)

Total project line coverage 34.90% → 36.39%; coverage_floor in
pubspec.yaml bumped 34 → 36 in lockstep.

Tests exercise the abstract BufferRange operator==/hashCode/toString
via a local _StubRange (BufferRangeLine and BufferRangeBlock both
override those, so the base versions are otherwise unreachable —
worth a stub rather than carving the lines out of coverage). The
denormalized-input branches in Block contain/toSegments/extend get
explicit cases too.

Pure Dart, no Flutter dependency — uses package:test/test.dart and
runs in <100ms.

First batch under T-91; line.dart and buffer.dart land in subsequent
commits with their own floor bumps.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-06 22:55:15 +02:00
jpmschweitzerandClaude a67a768592 restore semantic bold rendering in terminal panes (T-73)
Bold attributes from terminal escapes now render in a real bold
weight instead of being silently flattened.

- pubspec.yaml: register JetBrainsMono Bold + BoldItalic at
  weight 700 under family JetBrainsMono. Files already shipped on
  disk; only the registration was missing.
- assets/licenses.yaml: bump JetBrainsMono weights_bundled to
  [Regular, Italic, Bold, BoldItalic] per D-42 (the entry must
  match what is actually wired into the family).
- lib/src/terminal/src/ui/painter.dart: revert the `bold: false`
  override and drop the workaround comment. Bold now flows from
  CellFlags.bold to TextStyle.fontWeight.
- test/terminal/painter_bold_metrics_test.dart: load Regular and
  Bold via FontLoader and assert paragraph maxIntrinsicWidth is
  identical (cell-grid drift = 0). JetBrainsMono Bold's monospace
  by spec; this test is the canary for the day someone swaps the
  font.
- test/goldens/goldens/{ci,linux}/clide_button.png: regenerate.
  ClideButton's label renders slightly heavier on the bold variant
  (expected — 0.28% pixel diff before regen).

Earlier perception of over-bolding in the Claude pane was
synthetic-bold smearing (Flutter overpaints when no Bold.ttf is
registered for the family), not legitimate bold rendering. Visual
A/B confirms a real Bold face renders crisp emphasis without the
smear, so no per-pane renderer config is needed.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-06 22:29:23 +02:00
jpmschweitzerandClaude 699bd40423 fix Overlay sizing in widget_harness for Flutter 3.27+
Flutter 3.27 changed Overlay layout: an Overlay given infinite
height constraints now requires at least one OverlayEntry with
`canSizeOverlay: true` to delegate sizing, otherwise the entire
golden suite throws "Overlay was given infinite constraints" before
any test can render.

Marking the harness's only entry as size-determining is the minimal
fix — keeps the existing MediaQuery-driven layout shape intact and
unblocks every widget/golden test that uses `harness()`.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-06 22:29:05 +02:00
jpmschweitzerandClaude f0bb2ffcce format the tree to current dart format spec
Mechanical `dart format` sweep across files that drifted from the
formatter's output (mostly trailing-comma and line-wrap differences
from a Dart SDK / formatter version bump). No semantic changes.

Caught because the pre-push gate now actually fires.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-06 22:28:51 +02:00
jpmschweitzerandClaude 6601056972 finish T-87: cold-start reap, kill-all-sessions, helper tests
Three remaining acceptance criteria for T-87:

1. Cold-start reap. The Claude extension's activate() now kills
   every leftover secondary tmux session for the current repo
   before any new spawn. activate runs before any UI mounts, so
   _nextSecondary's starting value of 1 is correct even when a
   previous run died abruptly (kill -9, OOM, force-quit). The
   deactivate() hook also calls reapSecondaries as a courtesy on
   explicit extension teardown — but Flutter's deactivate doesn't
   fire on app quit, so activate is the load-bearing path.

2. claude.kill-all-sessions actually kills server-side. The
   command previously called pane.close on every claude pane,
   which only kills the tmux client. It now also calls
   tmux.killAllForRepo to kill the sessions on the clide socket.

3. Tests. test/builtin/claude/tmux_session_test.dart covers
   killSession, listClideSessions, reapSecondaries, and
   killAllForRepo via the TmuxRunner override — no real shell-out
   in tests.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-06 16:48:06 +02:00
jpmschweitzerandClaude e329f1cc6f codify UI spacing constants (T-86)
Adds lib/widgets/src/spacing.dart with three categories of named
constants — insets (clideInsetHairline / Tight / Icon / Standard /
Text), gaps (clideGapTight / Standard / Section / SectionLarge /
Major / Column), and sizes (clideIconMicro / Caption / Standard /
HitTarget / Emphatic, clideControlHeight).

Migrates MultitabPane to consume the constants and updates the
ui-design geometry reference to point at them. Inline pixel
literals in widget code were drifting (12 here, 6 there, 28
elsewhere) — pulling them through named symbols makes the
"uniform inner spacing" rule enforceable instead of eyeballed.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-06 15:45:07 +02:00
jpmschweitzerandClaude 96c6cfc6c5 MultitabPane: keepAlive mode and tab strip polish
Adds keepAlive: when true, all entry bodies stay mounted via
IndexedStack so switching tabs doesn't tear down their state.
Hosts that own PTY-backed sessions or any long-lived widget
state opt in; callers that want fresh state on each switch use
the default single-body mode.

Polishes the tab strip itself for production use:
- bottom divider so the strip visually anchors to the body below
- Column.crossAxisAlignment.stretch so the strip fills the pane
  width instead of sizing to its content
- close button: replace the text × glyph with the CloseIcon
  painter (clean cross strokes, font-independent)
- two-column tab layout — Expanded title on the left, fixed
  16x16 close button on the right; uniform 12px left padding,
  6px right padding to match the 6px top/bottom breathing room
  around the close button

Two new widget tests cover keepAlive (state preserved across
switches) and default mode (inactive bodies disposed).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-06 15:20:57 +02:00
jpmschweitzerandClaude aa742eed79 MultitabPane: drag-to-reorder gesture wiring (T-84)
Each tab is wrapped in a Draggable (when allowReorder is true and the
entry itself is reorderable) and a DragTarget (always — the controller's
barrier logic decides whether the move actually happens). Drops insert
the dragged entry at the target tab's index. A 2px leading insertion
indicator highlights the active drop target.

The widget harness now wraps children in an Overlay so Draggable's
feedback can mount without each test re-wrapping. Sized by the test
view's bounds to avoid disturbing existing tests that query
find.byType(SizedBox).first.

Four widget tests cover the gesture path: drop reorders, pinned
barrier blocks, pinned tabs aren't draggable, and allowReorder=false
disables drag entirely.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-06 14:17:16 +02:00
jpmschweitzerandClaude 1caaf5f4dd implement MultitabPane widget + controller (T-83)
MultitabController<T> is a Flutter-free ChangeNotifier owning the
tab list, active selection, and reorder/close invariants:
- pinned (non-reorderable) entries form barriers that other tabs
  cannot cross
- non-closeable entries silently no-op on remove() so hosts don't
  need to gate the call site
- closing the active tab falls right, then left, then to null
- duplicate ids are rejected

MultitabPane<T> is the widget shell: a horizontal tab strip
followed by the active entry's body. Active tab gets the
panelHeader background and a panelActiveBorder top accent;
inactive tabs blend into the tab bar. Close × is hidden until
hover. Add button only renders when onAddRequested is wired.

Hosts route the user's add/close intent through callbacks so the
widget stays domain-free — for the Claude pane, add will spawn a
new tmux session and close will kill one. Drag-to-reorder is
controller-side only for now (the gesture wiring lands with T-24).

19 controller tests + 9 widget tests.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-06 12:12:42 +02:00
jpmschweitzerandClaude 5f162a6668 rename tagline to "IDE for Claude Code CLI"
clide is an IDE for the Claude Code CLI. The previous tagline
"Flutter desktop IDE for Claude Code" overemphasized the host
toolkit (Flutter is implementation detail, immediately obvious to
contributors) and was ambiguous about whether the integration
target is the CLI specifically.

Updates the welcome subtitle (i18n catalog + widget test + view),
the project description in pubspec.yaml, README and CLAUDE.md, the
CLI banner, and the web manifest/index.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-06 11:06:41 +02:00
jpmschweitzerandClaude 5fb3df84ed map POSIX errno to actionable IPC error kinds (T-79)
pane.spawn (via PtyException.errno) and editor.open (via
FileSystemException.osError.errorCode) now route ENOENT to
not_found, EACCES/EPERM to user_error with a permissions hint,
EISDIR/ENOTDIR/EEXIST to distinct user-error/conflict, and
EMFILE/ENFILE to tool_error with a "fd limit hit" hint. The
mapping lives in lib/src/ipc/errno_mapping.dart so other handlers
can adopt the same surface as they pick up errno-bearing failures.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-06 09:56:04 +02:00
jpmschweitzerandClaude 816e60d028 reject path traversal in files.read and files.ls (T-78)
Both handlers concatenated the request path onto the workspace root
without validating containment, letting `path: "../../../etc/passwd"`
escape the workspace. resolveUnderRoot normalizes the path and
checks containment under root.absolute.path before any filesystem
access.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-05 15:02:30 +02:00
jpmschweitzerandClaude a5221792ba fix sidebar order and ptyc status bar warning
test / unit + widget + golden + a11y (push) Failing after 29s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
Revert priority sort in tabsFor() — registration order in
main.dart is the intended sidebar order, not priority. The
priority fields on extensions were dead code.

Remove ptyc from toolchain missing list since NativePty
replaced it.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 22:22:23 +02:00
jpmschweitzerandClaude b45699ccd1 fix test suite — green on make test
tabsFor() sorts by contribution priority when no user order is
set. Test expectations updated for sidebar defaultSize 400 and
decision ID D-1 (no zero-padding). PTY tests tagged forkpty and
run via dart test (forkpty output unreliable inside flutter test
runner). CI script adds --no-fatal-infos and --exclude-tags.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-03 21:52:39 +02:00