software-factory
MAmattpocock/skills336k4,217 new stars in the last 7 days
Use this skill when reviewing or changing Con UI performance, especially when a view feels janky, expensive, or unexpectedly re-renders during unrelated updates.
Keep Con visually rich without paying repeated GPUI layout/render cost for work that could be cached or isolated.
Cache at the cheapest correct layer first.
Order of preference:
AnyView::cached(...) only when the subtree has a stable size contract.Do not jump straight to view caching.
For any slow UI path, inspect these in order:
SharedString, Vec<TextRun>, highlighted runs, or table cell text on every render?Preferred fix:
div() children for content that could be one StyledText?Preferred fix:
Entity<V> with a narrower invalidation surface?Preferred fix:
notify()Use AnyView::cached(...) only if all of these are true:
Good fits:
Bad fits:
If a cached view causes overlap, clipping, or stale layout, the cache boundary is wrong.
Entity
and reuse that entity across parent renders. Keep per-block UI state such as
table scroll handles on that entity, not inside parsed markdown data that is
produced off the UI thread.cursor_pointer() over repainting terminal text. Keep the overlay
state bounded to the hovered link/range.Do not return a child's layout ID from a presentation wrapper and then call
prepaint_as_root on that same child. The node is still parented in Taffy;
GPUI's absolute-origin lookup can count the parent offset again. Give the
wrapper its own layout node and lay out the child as an independent root.
Test hitbox positions against visible geometry, not merely whether a click
at the hitbox's reported (possibly wrong) position invokes its callback.
Caption .occlude() targets can block an ancestor's wheel listener. Forward
wheel events from the real occluded target to its shared scroll handle, and
include occlusion in the interaction test fixture. A plain layout fixture can
pass while the native caption cannot scroll.
Component popover triggers need mouse-down to reach their wrapper. Apply native-caption occlusion outside the whole popover, not to its inner button; retain mouse-down consumption on ordinary caption buttons.
When observing scroll endpoints after layout, request a follow-up frame only
when visibility changes. An unconditional on_next_frame from prepaint creates
idle frame demand even when no animation is running.
Recheck the pinned view-cache key before animating an ancestor's opacity. The current key includes bounds, content mask and text style, but not inherited opacity. Keep such a subtree uncached while its opacity changes, and restore caching at the fully opaque endpoint. A changing clip can invalidate the cache, but rounded pixel bounds are not a reliable opacity invalidation mechanism.
Native-surface overlays cannot rely on an opaque GPUI fill hiding a drop shadow's interior. If elevation is needed, paint only exterior content-mask strips, never a shadow-only full-surface div over terminal glass. The pinned Metal shadow vertex stage uses clip distances for these masks. Verify both the content's unchanged appearance and the masked geometry; do not infer a frame-rate improvement from a smaller painted region alone.
A pane's undecorated/single-pane path must still run native clip prepaint. A native scroll host also needs its own backing layer before a layer mask can work; a Metal-backed descendant does not imply parent backing. Reusing its terminal after closing a sibling can otherwise retain a split mask even though its view frame has expanded. Test the real rendering path, not just the native mask setter in isolation.
.hover(|style| ...) is a style hook on Div; .on_hover(...) is an
enter/exit listener and requires a Stateful<Div>.
If a view needs .on_hover(...), call .id(stable_id) first. Use a stable id
such as the pane's FocusHandle, not a changing row/index.
For platform-selected files (ghostty_view.rs, windows_view.rs,
linux_view.rs), a macOS cargo check -p con only checks the macOS path.
Validate the touched platform path on its target or wait for portable CI
before treating the fix as closed.
After a cache-related change:
cargo check -p conThe final fix should preserve UX quality first, then reduce repeated work structurally.
If the only way a change feels fast is by degrading rendering fidelity, treat that as an incomplete fix and keep going.
MAmattpocock/skills336k4,217 new stars in the last 7 days
MAmattpocock/skills336k4,217 new stars in the last 7 days
AFaffaan-m/ECC314k3,503 new stars in the last 7 days
AFaffaan-m/ECC314k3,503 new stars in the last 7 days
AFaffaan-m/ECC314k3,503 new stars in the last 7 days
DIDietrichGebert/ponytail202k4,226 new stars in the last 7 days