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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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 1m3s
Replaces the legacy pql-plan.json export hooks with the new
changelog-aware set: pre-commit now stages incremental changelog
deltas via 'pql plan export --stage'; post-merge replays new
changelog files into pql.db; post-checkout / post-rewrite rebuild
pql.db when branch state changes. Companion shims under .githooks/
keep core.hooksPath = .githooks the single activation point.
Hook bodies are de-baked — pql 1.4.26 ships them with absolute
paths to the local pql binary, which doesn't survive cross-machine
tracking. Restored 'pql' on PATH form so the tracked copy stays
portable. Filed back-channel for pql to keep portable form.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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>
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>
The "consider bumping" hint pointed to `coverage/floor.txt`, but
the floor moved to `pubspec.yaml`'s `coverage_floor:` key when
the gate was first folded together. Updates the message to match
the actual source.
Co-Authored-By: Claude <noreply@anthropic.com>
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>
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>
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>
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>
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>
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>
test / unit + widget + golden + a11y (push) Failing after 35s
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
Clears the 19 misc lint hits left after the test_app print sweep
+ libc.dart suppression. By rule:
- `withOpacity(α)` → `withValues(alpha: α)` (deprecated_member_use)
in `painter.dart:187` and `terminal_view.dart:318`.
- `Pointer.elementAt(n)` → `Pointer + n` (deprecated_member_use)
in `native_pty.dart:306` and `session.dart:187`.
- Brace single-statement for/if bodies in `native_pty.dart`
(×3) and `decisions_view.dart` (curly_braces_in_flow_control_
structures).
- `IsolateClient` and `InProcessClient` constructors switched to
`super.log` / `super.events` parameters (use_super_parameters);
associated unused imports of `kernel/src/log.dart` and
`kernel/src/events/bus.dart` removed in the same files.
- `InProcessClient._dispatcher` field + getter/setter pair folded
into a single mutable public `dispatcher` field
(unnecessary_getters_setters).
- `_buildDispatcher` local in `lib/main.dart` renamed to
`buildDispatcher` (no_leading_underscores_for_local_identifiers).
- `_onTapDown(_)` in `terminal_view.dart` typed as
`TapDownDetails _` (strict_top_level_inference).
- `operator []=(...)` in `circular_buffer.dart` given an explicit
`void` return type (strict_top_level_inference).
- `CustomKeyboardListener` and `TerminalGestureDetector` callsites
reordered so `child:` lands last (sort_child_properties_last).
- `CustomTextEdit` constructor declared `const`
(prefer_const_constructors_in_immutables).
- `LinkedHashMap<K, V>()` in `paragraph_cache.dart` collapsed to a
`<K, V>{}` literal (prefer_collection_literals); the now-unused
`dart:collection` import dropped.
Project analyze: 19 → 0 issues. `make test` stays green; coverage
unchanged at 52.72%.
Co-Authored-By: Claude <noreply@anthropic.com>
`lib/src/pty/ffi/libc.dart` carried 34 analyze infos:
- 26 × `non_constant_identifier_names` on struct field names
(`msg_name`, `iov_base`, `msg_controllen`, etc.) that map 1:1
to POSIX (`man 2 socketpair`, `recvmsg`, `iovec`, `msghdr`).
- 8 × `library_private_types_in_public_api` on the C / Dart
function-signature typedefs (`_SocketpairC`, `_SocketpairDart`,
etc.) consumed only by the `lookupFunction<...>()` calls in
this same file.
Renaming the field names to lowerCamelCase would diverge from the
spec the file documents itself against; promoting the typedefs to
public would just add noise to the import surface. This is the
textbook FFI-binding case where the lints work against the file's
purpose.
Adds a file-wide `// ignore_for_file:` directive — explicitly
approved per the no-lint-suppression rule, with the reason
written inline above the directive so a future reader can
re-evaluate it.
Project analyze drops 65 → 31 issues.
Co-Authored-By: Claude <noreply@anthropic.com>
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>
`lib/test_app.dart` printed [testmode] / [testmode:json] lines via
the bare `print` builtin, which tripped the `avoid_print` analyze
rule 38 times — by far the loudest source of analyze noise in the
tree.
Routes everything through a `Logger()` instance held on
`_ClideTestAppState`, with a small `_say(msg)` helper for
human-readable lines and a separate `'testmode:json'` source for
the structured summary the harness greps. The default Logger sink
is stderr; `make run-testmode` already pipes `2>&1`, so the
existing `grep -q '"failed":0'` check is unaffected.
Also drops the now-redundant kernel sub-imports (events/bus,
events/types, log, toolchain) — `kernel/kernel.dart` re-exports
them, and the analyzer flagged the doubles as unnecessary.
Project analyze: 107 → 65 issues. test_app.dart is now clean
(0 issues, was 42).
Co-Authored-By: Claude <noreply@anthropic.com>
The file's only purpose is to expose the default-keytab string
constant, but it carried a `void main()` at the end that parsed
that constant and printed the result. That entry point:
- doesn't belong in `lib/` (Dart entry points live in `bin/` or
`tool/`),
- pulls in `keytab_parse` and `keytab_token` imports that are
unused everywhere else in the file,
- emits one of the pre-existing `avoid_print` analyze infos,
- only ever ran when a contributor manually invoked
`dart lib/src/terminal/src/core/input/keytab/keytab_default.dart`,
which the build never does.
Removing it unblocks the file from the coverage report (no
executable lines remain, just the string constant), drops the
unused imports, and shaves an analyze info off the pre-existing
total. If the dump-to-stdout helper turns out to be useful again,
the right home is a `tool/dump_keytab.dart` outside the package's
runtime surface.
Co-Authored-By: Claude <noreply@anthropic.com>
Four `throw` sites in `core/input/keytab/` were unreachable through
the public API:
- `keytab_token.dart` `_parseKeyboardNameDefine` and `_parseKeyDefine`
each tested `reader.readString() == 'keyboard'` / `'key'` after
the caller in the same file (`tokenize`) had already gated entry
on `_isKeyboardNameDefine` / `_isKeyDefine`. Both checks
redundantly re-derived a fact already established a function
call earlier; the `else { throw }` was dead code.
- `keytab_parse.dart` `_parseName` and `_parseKeyDefine` checked
the first token's type, but `addTokens` only delegates to those
functions after `peek().type` matches the expected kind. Same
pattern: the throw protects an invariant the caller already
enforces.
Surfaced while bringing `core/input/` to ~100% coverage. Per the
"near-perfect discipline" / "no carve-outs" rules, dead defensive
code is cleaned, not skipped — the surrounding callers in the same
file are tight enough that introducing a real callsite gap would
be a localised and obvious bug, not a silent failure rescued by
these guards.
The two `else`-throw sites in keytab_token.dart fold into a single
unconditional `reader.readString()` (consume the leading word) +
`yield` of the matching token type. The two type-check throws in
keytab_parse.dart fold into an unconditional `reader.take()` to
skip the already-validated token.
All public-API ParseError paths exercised by `core/input/`'s
unit tests still throw correctly — they're guarded by the second
check in each function (the action-token type check after
modeStatus loops, and the input-token check in _parseName).
After cleanup:
- keytab_token.dart: 80 / 80
- keytab_parse.dart: 63 / 63
Co-Authored-By: Claude <noreply@anthropic.com>
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>
`_csiHandleSgr` carried a `// ignore: dead_code` directive with the
note "workaround for a bug in the analyzer". Re-running the
analyzer with the suppression removed produces no warning — Dart's
flow analysis has caught up since the comment was added.
Per the no-lint-suppression rule the suppression needed to be
either removed or given a more substantive justification; the
analyzer's silence makes the call easy.
Co-Authored-By: Claude <noreply@anthropic.com>
Coverage parsing, lcov triage, and quick log scans use awk one-liners
constantly. Adding `Bash(awk *)` to the project allowlist removes
the permission prompt without weakening the deny rules.
Co-Authored-By: Claude <noreply@anthropic.com>
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>
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>
`removeCells`, `insertCells`, and `dispose` each iterate over
`_anchors` while invoking `anchor.dispose()` on entries inside the
loop — but `dispose()` removes the anchor from the same list, which
shifts later indexes left and causes the for-loop to skip them.
Symptoms (no user-facing report yet, but real correctness bug):
- After `removeCells` with multiple anchors past the start, anchors
that should be repositioned were silently left at their old `x`.
- After `insertCells` with anchors getting pushed past `_length`,
ones meant to be disposed could survive.
- `BufferLine.dispose` would throw `ConcurrentModificationError` as
soon as more than one anchor was attached.
Fix: iterate `_anchors.toList()` (a snapshot) in all three sites.
Cheap, safe, and matches the expected anchor-management semantics.
Surfaced by the unit tests added under T-91; that commit covers the
fix with regression tests.
Co-Authored-By: Claude <noreply@anthropic.com>
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>
`ci/test.sh` now runs `flutter test --coverage`, so
`ci/test_coverage.sh` was just re-running the same tests plus an
optional `lcov --summary` that needs `lcov` installed (it wasn't,
on at least this machine). Removing it.
- ci/test_coverage.sh: deleted.
- Makefile: drop the `coverage` target (it only wrapped the dead
script). Fix a stale `coverage/floor.txt` reference in the
`coverage-gate` help text — the floor lives in pubspec.yaml now.
- .gitea/workflows/test.yml: replace the test_coverage.sh invocation
with ci/coverage_gate.sh, so CI enforces the same floor as the
pre-push hook (defense in depth).
Co-Authored-By: Claude <noreply@anthropic.com>
First child of T-89. Codifies "don't make coverage worse" as a
durable pre-push contract before any test-writing children land.
- pubspec.yaml: new `coverage_floor: 34` key. Single source of
truth for the floor; ratchets up only.
- ci/coverage_gate.sh: parses coverage/lcov.info (LH/LF), reads
the floor from pubspec.yaml, exits non-zero if integer-truncated
measured % drops below it. Self-contained awk parser — no `lcov`
CLI dependency.
- ci/test.sh: flutter test now runs with --coverage, so the gate
reads fresh data without an extra test invocation. Wall time
delta is small and stays inside the < 90 s pre-push budget
(D-29).
- Makefile: new `coverage-gate` target wires the script in;
`push-check` adds it as a dependency. The .githooks/pre-push
hook (already wired) picks this up automatically.
- .gitignore: ignore /coverage/ wholesale; the floor lives in
pubspec.yaml, nothing under coverage/ is committed.
Decision recorded as D-66 (decisions/testing.md). End target is
95%; reaching it is tracked as the rest of T-89's children.
Co-Authored-By: Claude <noreply@anthropic.com>
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>
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>
`mouse/button.dart` and `mouse/button_state.dart` were imported but
nothing in terminal_view referenced their symbols — analyzer
warnings, not infos. Removed.
Probable origin: a half-landed mouse-forwarding refactor (the actual
work is now scoped under T-74); the imports can come back when the
real wiring lands. Removing them in the meantime keeps the analyze
gate clean.
Co-Authored-By: Claude <noreply@anthropic.com>
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>
Memory-only "if you encounter a failure, fix it first" advice keeps
losing to the model's default scope-protection behaviour: when a
test is red or analyze warns on entry, the safer-feeling option is
to flag and continue rather than fix and continue. Promoting the
rule into the load-bearing guardrails list makes it sit in the same
register as "Flutter desktop is the host" — non-negotiable, not
advisory.
Pairs with the .githooks/pre-push gate landed alongside: that
prevents broken state from being pushed in the first place; this
prevents the next session from building on broken state if it slips
through.
Co-Authored-By: Claude <noreply@anthropic.com>
`make hooks` already sets `core.hooksPath=.githooks/`, and the
pre-push gate at `.githooks/pre-push` already runs `make push-check`
— but the pql-installed pre-commit and post-merge shims live at
`.git/hooks/`, which take precedence and silently disable .githooks/.
Add the missing pre-commit / post-merge shims under .githooks/ so
`make hooks` becomes a single-step install: pre-push enforcement,
pql planning-state auto-export on commit, and auto-import on pull
all fire from the canonical .githooks/ location.
Co-Authored-By: Claude <noreply@anthropic.com>
test / unit + widget + golden + a11y (push) Failing after 41s
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 1m22s
Wraps the `dart doc --validate-links` step so any warning fails the
job, not just hard errors. The previous step exited 0 even with
broken doc refs and dangling README links — exactly the
informational-mode drift that lets a clean board rot.
Updates the CHANGELOG entry to describe the gate accurately (the
earlier wording overstated `--validate-links`, which only prints).
Co-Authored-By: Claude <noreply@anthropic.com>
Eight unresolved doc references and broken README-rewritten links
that surfaced under `dart doc --validate-links`:
- Library-scope refs `[spawn]`, `[openProject]` qualified to
`[Backend.spawn]` / `[Backend.openProject]`; same treatment for
`[resolvePaths]` / `[applyResolved]` on Toolchain.
- `[D-41]` was a decision ID, not a Dart symbol — drop the brackets.
- `[from]` from I18n.interpolated qualified to `[I18nReplacer.from]`.
- `[DefaultSurfaceMap]` was a stale name (private `_defaultSurfaceMap`
in resolver.dart); switch to backticked path reference since
dartdoc can't link private members.
- `[icons/]` was a directory, not a symbol; backticked path.
- README links to `legacy/`, `docs/initial-plan.md`, `decisions/`,
`LICENSE` rewritten as absolute github.com/postmeridiem/clide URLs
so dartdoc stops re-rooting them into the doc tree.
Co-Authored-By: Claude <noreply@anthropic.com>
`dart doc` writes the rendered API site to `doc/api/`. The CI step
uploads it as an artefact; locally it's regenerated on every run and
should never land in the tree.
Co-Authored-By: Claude <noreply@anthropic.com>
Walks the pql initiative/epic tree, filters to unblocked tickets,
optionally refines context via parallel agents, and transitions a
confirmed batch to in_progress. Mirrors the existing pql skill's
place in the planning flow so /whats-next is the natural counterpart
to "what's the plan status".
Co-Authored-By: Claude <noreply@anthropic.com>
Adds a docs job to .gitea/workflows/test.yml that runs
`dart doc --validate-links` and uploads doc/api/ as an artefact.
Runs in parallel with unit; documents the public lib/ surface and
fails the build on broken references. Stays inert with the rest of
the workflow until Gitea Actions activates per D-32.
Co-Authored-By: Claude <noreply@anthropic.com>