Skip to content

test: remove 245 low-value renderer cases - #37522

Merged
OrcaWin merged 1 commit into
mainfrom
codex/remove-low-value-tests-964-965
Nov 2, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
codex/remove-low-value-tests-964-965

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Removes 245 authored renderer test cases across 60 reviewed files, including ten entire suites. The removed cases mostly assert supplied value tables, mock forwarding, or narrow synthetic fixture behavior. Retains 224 cases for content restoration, keyed ownership, cancellation, bounded work and resource lifetime.

Updates seven reliability gates and removes ten obsolete timing entries. Lost alarms include scrollbar targeting, same-pane WebGL attach backoff, pre-dispatch context loss, fit overrides and Windows refresh predicates. Adjacent tests are not claimed as equivalent coverage; historical executed commands and results remain intact.

One retained wheel-sampling test now fakes only setTimeout, preserving its manual animation-frame queue after earlier tests are removed. Three fixture casts receive line-specific safety explanations. Runtime implementation is unchanged.

Validation: static parsing, external formatting, inert lint, exact source/owner and metadata checks; retained assertions are unchanged, with the timer setup correction above as the sole retained-callback exception. Full tests and typechecks run on the current commit in GitHub CI.

Risk: reduced future regression detection in the listed paths; revert this PR to restore the removed alarms. Visual proof and skill changes do not apply to this test-only cleanup. Requested directly by a maintainer; no linked issue. Authored and reviewed with Codex.

@OrcaWin
OrcaWin force-pushed the codex/remove-low-value-tests-964-965 branch from 011f5e4 to f1b4387 Compare November 2, 2026 18:00
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b037dc14-0881-4b32-8b4c-edc8851f45d4
Commits

Reviewing files that changed from the base of the PR and between f1b4387 and cd6d340.

Files selected for processing: 1
  • src/renderer/src/lib/pane-manager/terminal-scroll-intent.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

Walkthrough

This change removes or narrows tests across pane management, terminal rendering and input, and application libraries. It also updates reliability-gate descriptions, records coverage gaps, and revises CI shard timing entries. No runtime implementation changes are described.

Merge Risk: Low · up to cd6d3

This is a test-only change with bounded risk, but future Windows terminal or scrollbar regressions may no longer be detected by the retained suite.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: removing 245 low-value renderer test cases.
Description check Passed The description covers the change scope, rationale, retained coverage, reliability-gate updates, validation, risk, visual-proof status, AI disclosure, and rollback. It does not use the template headin…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description covers the change scope, rationale, retained coverage, reliability-gate updates, validation, risk, visual-proof status, AI disclosure, and rollback. It does not use the template headings, but the required information is mostly present. The missing linked issue is explained by the maintainer exception.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 15 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick comments: 1
src/renderer/src/lib/pane-manager/terminal-complex-script.test.ts: 1

4-4: Trivial · Functional Correctness · Quick win

Retain focused coverage for the two Windows refresh helpers.

The retained tests cannot detect regressions in the native-ConPTY, foreground, or in-place-rewrite gates, or in the Windows/recent-input and redraw-size gates. Keep one focused test per helper unless an end-to-end spec exercises the real caller paths. Record these uncovered gates in config/reliability-gates.jsonc if no equivalent coverage exists.


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 090d7bfd-df66-4e6c-b1a1-981455ce5283
Commits

Reviewing files that changed from the base of the PR and between 509461a and 011f5e4.

Files selected for processing: 48
  • config/reliability-gates.jsonc
  • config/scripts/ci-shard-timings.json
  • src/renderer/src/lib/pane-manager/pane-tree-equalization-parity.test.ts
  • src/renderer/src/lib/pane-manager/pane-tree-match-moves.test.ts
  • src/renderer/src/lib/pane-manager/pane-tree-ops.test.ts
  • src/renderer/src/lib/pane-manager/pane-tree-reparent-frame.test.ts
  • src/renderer/src/lib/pane-manager/pane-viewport-present-lifetime.test.ts
  • src/renderer/src/lib/pane-manager/pane-webgl-context-recovery.test.ts
  • src/renderer/src/lib/pane-manager/pane-webgl-refresh-lifecycle.test.ts
  • src/renderer/src/lib/pane-manager/pane-webgl-renderer.test.ts
  • src/renderer/src/lib/pane-manager/terminal-arabic-shaping-joiner.test.ts
  • src/renderer/src/lib/pane-manager/terminal-canvas-dpr-repair.test.ts
  • src/renderer/src/lib/pane-manager/terminal-complex-script.test.ts
  • src/renderer/src/lib/pane-manager/terminal-delivery-credit.test.ts
  • src/renderer/src/lib/pane-manager/terminal-dom-block-fill.test.ts
  • src/renderer/src/lib/pane-manager/terminal-foreground-repair-convergence.test.ts
  • src/renderer/src/lib/pane-manager/terminal-ime-anchor.test.ts
  • src/renderer/src/lib/pane-manager/terminal-ime-candidate-anchor.test.ts
  • src/renderer/src/lib/pane-manager/terminal-indic-cluster-ranges.test.ts
  • src/renderer/src/lib/pane-manager/terminal-keyboard-protocol.test.ts
  • src/renderer/src/lib/pane-manager/terminal-kitty-file-reader.test.ts
  • src/renderer/src/lib/pane-manager/terminal-ligatures-addon.test.ts
  • src/renderer/src/lib/pane-manager/terminal-link-provider-guard.test.ts
  • src/renderer/src/lib/pane-manager/terminal-linkifier-hover-reset-on-write.test.ts
  • src/renderer/src/lib/pane-manager/terminal-render-pause-release-parked-resize.test.ts
  • src/renderer/src/lib/pane-manager/terminal-render-pause-release.test.ts
  • src/renderer/src/lib/pane-manager/terminal-scroll-intent-input-resync.test.ts
  • src/renderer/src/lib/pane-manager/terminal-scroll-intent-key-retention.test.ts
  • src/renderer/src/lib/pane-manager/terminal-scroll-intent-structural-transitions.test.ts
  • src/renderer/src/lib/pane-manager/terminal-scroll-intent.test.ts
  • src/renderer/src/lib/pane-manager/terminal-structural-replay-presentation.test.ts
  • src/renderer/src/lib/pane-manager/terminal-webgl-auto-policy.test.ts
  • src/renderer/src/lib/pane-manager/terminal-webgl-hidden-retention.test.ts
  • src/renderer/src/lib/pane-manager/terminal-windows-ctrl-alt-chord-classification.test.ts
  • src/renderer/src/lib/pane-manager/terminal-write-pipeline-health.test.ts
  • src/renderer/src/lib/pane-manager/windows-pty-compatibility.test.ts
  • src/renderer/src/lib/pane-manager/xterm-user-scrolling-contract.test.ts
  • src/renderer/src/lib/pane-manager/xterm-write-callback-guard.test.ts
  • src/renderer/src/lib/pane-spawn-deferral-drain.test.ts
  • src/renderer/src/lib/parked-terminal-host-hydration.test.ts
  • src/renderer/src/lib/passive-macos-app-data-access.test.ts
  • src/renderer/src/lib/paste-payload-metadata.test.ts
  • src/renderer/src/lib/path-head-elision.test.ts
  • src/renderer/src/lib/path.test.ts
  • src/renderer/src/lib/pi-live-session-no-duplicate-tab.test.ts
  • src/renderer/src/lib/pi-session-resume-wake.test.ts
  • src/renderer/src/lib/plugin-command-keybindings.test.ts
  • src/renderer/src/lib/plugin-command-replacements.test.ts
Files with no reviewable changes: 32
  • src/renderer/src/lib/pane-manager/terminal-keyboard-protocol.test.ts
  • src/renderer/src/lib/pane-manager/terminal-scroll-intent-structural-transitions.test.ts
  • src/renderer/src/lib/pane-manager/pane-tree-equalization-parity.test.ts
  • src/renderer/src/lib/pane-manager/terminal-render-pause-release.test.ts
  • src/renderer/src/lib/pane-manager/terminal-render-pause-release-parked-resize.test.ts
  • src/renderer/src/lib/parked-terminal-host-hydration.test.ts
  • src/renderer/src/lib/pi-session-resume-wake.test.ts
  • src/renderer/src/lib/pane-manager/pane-viewport-present-lifetime.test.ts
  • src/renderer/src/lib/path.test.ts
  • src/renderer/src/lib/pane-spawn-deferral-drain.test.ts
  • src/renderer/src/lib/pane-manager/terminal-canvas-dpr-repair.test.ts
  • src/renderer/src/lib/pane-manager/terminal-dom-block-fill.test.ts
  • src/renderer/src/lib/pane-manager/terminal-delivery-credit.test.ts
  • src/renderer/src/lib/pane-manager/terminal-linkifier-hover-reset-on-write.test.ts
  • src/renderer/src/lib/pane-manager/terminal-foreground-repair-convergence.test.ts
  • src/renderer/src/lib/pane-manager/terminal-kitty-file-reader.test.ts
  • src/renderer/src/lib/pi-live-session-no-duplicate-tab.test.ts
  • src/renderer/src/lib/pane-manager/terminal-webgl-auto-policy.test.ts
  • src/renderer/src/lib/pane-manager/terminal-link-provider-guard.test.ts
  • src/renderer/src/lib/passive-macos-app-data-access.test.ts
  • src/renderer/src/lib/pane-manager/terminal-ime-anchor.test.ts
  • src/renderer/src/lib/pane-manager/terminal-ligatures-addon.test.ts
  • src/renderer/src/lib/path-head-elision.test.ts
  • src/renderer/src/lib/pane-manager/pane-tree-reparent-frame.test.ts
  • src/renderer/src/lib/plugin-command-replacements.test.ts
  • src/renderer/src/lib/pane-manager/xterm-write-callback-guard.test.ts
  • src/renderer/src/lib/pane-manager/terminal-ime-candidate-anchor.test.ts
  • src/renderer/src/lib/pane-manager/terminal-windows-ctrl-alt-chord-classification.test.ts
  • src/renderer/src/lib/pane-manager/terminal-write-pipeline-health.test.ts
  • src/renderer/src/lib/pane-manager/terminal-indic-cluster-ranges.test.ts
  • src/renderer/src/lib/pane-manager/terminal-arabic-shaping-joiner.test.ts
  • config/scripts/ci-shard-timings.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick comments: 4
src/renderer/src/lib/pane-manager/pane-webgl-context-recovery.test.ts: 2

12-25: Trivial · Stability & Availability · Quick win

Keep one regression test for same-pane WebGL attach backoff.

This change removes the loadAddon failure injection and the tests for two recovery guarantees. A second attachWebgl call must not allocate another addon while webglAttachFailedSinceRecovery is set. A rendering resume must clear that latch and permit one retry. The retained renderer tests cover addon disposal and cross-pane isolation, but not same-pane backoff or resume retry. The reliability gate also records that this behavior has no equivalent coverage. Keep one focused test, or move it to pane-webgl-renderer.test.ts. (raw.githubusercontent.com)


12-25: Trivial · Stability & Availability · Quick win

Retain the pre-dispatch context-loss test.

The removed test used a retained addon whose _gl.isContextLost() was already true before xterm fired _onContextLoss. This path is separate from fireContextLoss, which only exercises xterm’s loss callback. resumePaneRendering still checks isPaneWebglContextLost and disposes the dead addon before reattaching. Keep this lifecycle case in this suite or another WebGL recovery suite. (raw.githubusercontent.com)

src/renderer/src/lib/pane-manager/pane-tree-ops.test.ts: 1

380-380: Trivial · Functional Correctness · Quick win

Retain direct coverage for safeFit fit overrides.

The deleted cases were the only direct checks that safeFit resizes to the owner grid, skips fit() for an active override, and isolates overrides by PTY. The retained transport tests cover override state propagation, not this consumer behavior. Keep one focused case in pane-fit.test.ts for this branch.

src/renderer/src/lib/pane-manager/terminal-scroll-intent.test.ts: 1

54-54: Trivial · Maintainability & Code Quality · Quick win

Restore direct coverage for scrollbar pointer targeting.

The production path still depends on .xterm-scrollbar, .xterm-slider, and pointerScrollActive, but the PR removes the last tests that exercise those selectors and restore a dragged viewport. Add one focused test before the first retained test. Exercise descendants of both classes, dispatch pointerdown and scroll, then assert that enforceTerminalCurrentScrollIntent restores the dragged line. Restore the minimal TestElement class-name, closest, parent, and bubbling behavior needed by that test.

Suggested fix
-class TestElement extends EventTarget {}
+class TestElement extends EventTarget {
+  parentElement: TestElement | null = null
+
+  constructor(public className = '') {
+    super()
+  }
+
+  append(child: TestElement): void {
+    child.parentElement = this
+  }
+
+  closest(selector: string): TestElement | null {
+    for (const candidate of selector.split(',')) {
+      const className = candidate.trim().slice(1)
+      if (candidate.trim().startsWith('.') && this.className.split(/\s+/).includes(className)) {
+        return this
+      }
+    }
+    return this.parentElement?.closest(selector) ?? null
+  }
+
+  dispatchEvent(event: Event): boolean {
+    if (!event.target) {
+      Object.defineProperty(event, 'target', { configurable: true, value: this })
+    }
+    const result = super.dispatchEvent(event)
+    if (event.bubbles && this.parentElement) {
+      this.parentElement.dispatchEvent(event)
+    }
+    return result
+  }
+}
 
 describe('terminal scroll intent', () => {
@@
   afterEach(() => {
     vi.useRealTimers()
     vi.unstubAllGlobals()
   })
 
+  it.each(['xterm-scrollbar', 'xterm-slider'])(
+    'restores a viewport dragged from a %s descendant',
+    (className) => {
+      vi.stubGlobal('Element', TestElement)
+      const terminal = createTerminal({ viewportY: 0, baseY: 600 })
+      const hostElement = new TestElement()
+      const target = new TestElement(className)
+      const child = new TestElement(`${className}-child`)
+      hostElement.append(target)
+      target.append(child)
+      const disposable = attachTerminalScrollIntentTracking(
+        terminal,
+        hostElement as unknown as HTMLElement
+      )
+
+      terminal.buffer.active.viewportY = 572
+      child.dispatchEvent(new Event('pointerdown', { bubbles: true }))
+      child.dispatchEvent(new Event('scroll', { bubbles: true }))
+      terminal.buffer.active.viewportY = 0
+      enforceTerminalCurrentScrollIntent(terminal)
+
+      expect(terminal.scrollToLine).toHaveBeenLastCalledWith(572)
+      disposable.dispose()
+    }
+  )
+
   it('keeps sampling briefly after wheel so delayed xterm scroll updates win', async () => {

Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7f07236b-94e5-433f-b253-bbd08e9743e7
Commits

Reviewing files that changed from the base of the PR and between 011f5e4 and f1b4387.

Files selected for processing: 2
  • src/renderer/src/lib/pane-manager/pane-tree-ops.test.ts
  • src/renderer/src/lib/pane-manager/pane-webgl-context-recovery.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

@OrcaWin
OrcaWin force-pushed the codex/remove-low-value-tests-964-965 branch from f1b4387 to cd6d340 Compare November 2, 2026 18:16
@OrcaWin
OrcaWin merged commit 83a4024 into main Nov 2, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant