agentleFS
nowledge-conowledge-co/con-terminal/skills/native-surface-coverage/SKILL.md

native-surface-coverage

Skill651 starsChanged 7 days agoMITView on GitHub

Prevent and investigate backdrop leaks, seams, stale clipping and rounded-corner artifacts when changing con pane/sidebar geometry, animation, transparency or native terminal composition.

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 7 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the relevant sections, not every historical investigation:

    line 31
  2. Very specific:

    Write down each pixel's owner and when its geometry becomes final.

    line 41
  3. Distinctive:

    Keep these independent contracts intact:

    line 46
  4. Distinctive:

    Verify inactive tabs and stacked surfaces after restart, then activate them.

    line 70
  5. Distinctive:

    Verify a live PID/TTY, hidden stacked surfaces and active-surface order before and after a move.

    line 83
  6. Distinctive:

    Do not assume every defer callback runs after presentation in arbitrary callers.

    line 99
  7. Very specific:

    Do not replace the transaction boundary with on_next_frame, longer timers or extra redraws.

    line 104
  8. Distinctive:

    Keep configured alpha, blur, rounding and animation timing.

    line 112
  9. Very specific:

    Run affected linked macOS tests and Rust formatting with the pinned toolchain.

    line 132
  10. Distinctive:

    Use a bright contrasting backdrop when the report has one.

    line 139

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Native surface coverage

Preserve con's glass material while keeping each moving pixel covered by its correct owner. A darker result, passing layout test or clean log is insufficient.

Identify the failure before choosing a fix

Record direction and trigger, tab orientation, compact/pinned/hover state, pane/surface layout, input-bar visibility, theme, terminal/UI opacity, blur, macOS version, display scale and release versus preview binary.

ObservationInvestigate
Different backdrop colors visible through adjacent surfaces at restIntended transparency; compare the same position and backdrop
A stable hairline or jagged curvePhysical-pixel endpoints, shared corner coverage, overlapping alpha
A broad moving strip, especially one that also clips textNative frame/mask/GPUI presentation timing; measure successive video frames
Correct model bounds but wrong native output after reuseAttached masks, native backing-layer replacement and actual framebuffer dimensions

Remote desktop or OS differences are verification limits, not presumed causes. For a transient report, inspect a recording before treating a helper-level bug as the root cause. A strip advancing with per-frame travel is evidence of a presentation mismatch, not a reason to thicken its edge.

Trace the real rendering path

Read the relevant sections, not every historical investigation:

  • Workspace composition and frame geometry.
  • Pane ownership, native host and AppKit masks.
  • Native presentation contract.
  • For cache/opacity changes, GPUI cache guidance.

Write down each pixel's owner and when its geometry becomes final. Check actual callback order: CanvasSurround currently precedes terminal content. GPUI .occlude() controls hit testing, not visual coverage; .overflow_hidden() does not itself clip an AppKit terminal sibling.

Keep these independent contracts intact:

  • Shared canvas changes refresh registered native masks in the same frame, including already-prepainted or idle consumers. Local pane clips must not escape into siblings, shared underlays or GPUI itself.
  • Host reuse after split closure, zoom or tab/surface changes still executes native clip prepaint. A Metal-backed descendant does not imply parent backing; AppKit may replace a layer without changing model bounds.
  • Native and GPUI corner coverage share snapped physical endpoints and a raster. Omit individual zero-area corner tiles near animation endpoints; do not discard other visible corners or suppress real raster-budget errors.
  • A geometry-correct native mask and correctly sized IOSurface still need to present with the matching GPUI scene.

Restore hidden native conversations without exposing bootstrap geometry

Ordinary control initialization still requires authoritative canvas bounds. Native conversation resume has one narrow exception: an inactive restored surface can initialize from its previously confirmed physical viewport size so its shell and native agent can start without selecting the tab. Keep that host hidden, keep awaiting_first_layout_visibility set, and discard the bootstrap bounds as current layout. Before activation exposes the host, the real canvas must commit the current frame, mask and clipping through the ordinary frame transaction. Never generalize this exception to estimated split/zoom bounds. Verify inactive tabs and stacked surfaces after restart, then activate them; verify closing a split and switching tabs still use current geometry.

Move existing surfaces across windows without rebuilding them

Reparent the retained native host, preserving its Ghostty surface and PTY. Keep it hidden until the destination's real canvas commits frame, backing scale and clips. Replace the host's GPUI parent, transition-underlay ownership and native backing/occlusion observer together; an observer installed on the source NSWindow must not remain bound there. Terminal/editor event subscriptions also follow the new workspace. Old bootstrap callbacks must stop without mutating an entity they no longer own. See session drag transfers.

Verify a live PID/TTY, hidden stacked surfaces and active-surface order before and after a move. Close the source window, then exercise focus, output and native-session reports in the destination. A rendered screenshot alone cannot prove ownership or callback continuity.

Keep native edits and platform presentation in one transaction

The accepted Con boundary is NativeGeometryTransaction::hold_for_frame, opened by CanvasSurround before terminal children. It spans native frame/mask changes, synchronous Ghostty drawing and GPUI's platform presentation. A retained pending flag coalesces opens, and RAII closes the transaction through App deferred effects.

This relies on the resolved GPUI implementation: its frame callback runs window.draw(cx) and window.present() within one App update; deferred effects flush after that callback returns. Recheck that ordering on GPUI upgrades. Window::draw alone builds a scene; it is not proof of platform presentation. Do not assume every defer callback runs after presentation in arbitrary callers.

Preserve the existing frame-scoped presentation request as well. Repeating that request at paint does not reunite native transactions already committed during prepaint; this approach passed tests but failed maintainer visual acceptance. Do not replace the transaction boundary with on_next_frame, longer timers or extra redraws. Close within the current update, restore the caller's animation context, suppress a second native implicit animation, and keep ordinary output on the asynchronous renderer path. Do not modify pinned dependencies or registry sources to manufacture a passing preview.

Preserve material and ownership

Keep configured alpha, blur, rounding and animation timing. The opaque transition underlay is for opaque terminals only. Do not cover a translucent terminal with it, enlarge masks, add full-pane fills, overlap translucent strips or add borders and shadows to disguise the gap. Keep surround paint narrow; viewport-sized paths with holes still incur large Metal blits.

Verify the failing boundary and the moving result

Choose linked tests for the changed contract:

  • native_frame_transaction_stays_open_through_paint_and_closes_after_update: transaction lifetime and coalescing; no wait for another frame/user action.
  • native_geometry_transaction_does_not_inherit_or_escape_implicit_animation: inherited animation suppression and restoration of the caller's context.
  • late_canvas_prepaint_refreshes_registered_masks_in_the_same_frame: late canvas changes refresh actual attached paths; unrelated siblings stay free.
  • Corner/reuse tests in workspace/frame.rs, ghostty_view.rs and pane_tree.rs: mixed visible/empty corners, fractional radii, alpha/scale endpoints and the actual render path after topology changes.

Run affected linked macOS tests and Rust formatting with the pinned toolchain. Type checking cannot prove FFI linkage, attached-mask correctness or presentation. Match the reporter's binary/configuration/backdrop in an isolated home/session; near-opaque Flexoki with input visible does not validate translucent Kanagawa with input hidden. Exercise Cmd+B and Cmd+L themselves: compact↔pinned, hover pinning and tools are different paths. Include the affected opposite transition, rapid reversal, pane/surface variants and Reduce Motion as appropriate. Use a bright contrasting backdrop when the report has one. Never alter the user's live configuration/session or OS appearance for a fixture.

Confirm moving frames, not only endpoints. Green tests, correct texture sizes, empty coverage-error logs and sparse automatic screenshots are supporting evidence, not visual acceptance. If automation misses an intermittent defect, use the supplied recording and maintainer reproduction to close the loop. Record the exact accepted build/configuration and delivery state. Scope claims to actual OS/hardware: no inferred FPS, 1x, Intel, remote-desktop or Windows/Linux certification. Once the relevant checks and matched acceptance pass, stop testing unless new changes, failures or feedback justify another pass.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.