Skip to content

Fix cross-repo script dot tint and reduce sidebar animation CPU#265

Merged
sbertix merged 2 commits intomainfrom
sbertix/fix-script-dot-color
Apr 21, 2026
Merged

Fix cross-repo script dot tint and reduce sidebar animation CPU#265
sbertix merged 2 commits intomainfrom
sbertix/fix-script-dot-color

Conversation

@sbertix
Copy link
Copy Markdown
Collaborator

@sbertix sbertix commented Apr 21, 2026

Summary

  • Carry the tint color with each running-script record ([Worktree.ID: [UUID: TerminalTabTintColor]]) so worktree rows in repositories other than the selected one no longer fall back to green. Drops the view-side scriptsByID lookup that only covered the selected repo's scripts.
  • Migrate .repeatForever animations to phaseAnimator in PingDot / CyclingDot, ShimmerModifier, and GhosttySurfaceProgressBar so SwiftUI can pause them when occluded. PingRing now takes a concrete Color instead of AnyShapeStyle, removing the per-frame rebuild that made the sidebar ping a ~23% main-thread hotspot (Supacode gets sluggish after long multiple sessions #256).
  • Also drops the redundant .mask(solid black) from the shimmer's inactive branch.

Test plan

  • Run two repos with a long-running script in each; select a worktree in repo A and confirm the dot in repo B's sidebar row is the correct tint (previously green).
  • Run multiple scripts with distinct tints in the same worktree and confirm the cycling dot honors every color.
  • Confirm reduceMotion still renders the static dot.
  • Confirm shimmer + terminal progress bar still animate as before.
  • xcodebuild test once CI resolves DependenciesTestSupport locally (pre-existing tuist wiring issue reproduces on main).

sbertix added 2 commits April 21, 2026 15:55
… selected repository render the correct dot color instead of falling back to green.

`scriptsByID` only covered the selected repo's scripts, so sidebar rows for worktrees in other repos couldn't resolve their running-script tint. Shift `runningScriptsByWorktreeID` from `[Worktree.ID: Set<UUID>]` to `[Worktree.ID: [UUID: TerminalTabTintColor]]` and drop the view-side lookup.
PingDot was a measured CPU hotspot (~23% of main thread) because the always-on .repeatForever driver combined with a non-Equatable AnyShapeStyle rebuilt on every parent body evaluation. Swap to phaseAnimator so SwiftUI can pause when occluded, and pass a concrete Color through PingDot/PingRing instead of AnyShapeStyle.

Same treatment for the Shimmer sweep and the GhosttySurfaceProgressBar indeterminate sweep. Also drop the redundant .mask(solid black) from the inactive shimmer branch.
@sbertix sbertix enabled auto-merge (squash) April 21, 2026 13:58
@tuist
Copy link
Copy Markdown

tuist Bot commented Apr 21, 2026

🛠️ Tuist Run Report 🛠️

Builds 🔨

Scheme Status Duration Commit
supacode 1m 56s 8eae7d43b

@sbertix sbertix merged commit 57e620a into main Apr 21, 2026
2 checks passed
@sbertix sbertix deleted the sbertix/fix-script-dot-color branch April 21, 2026 14:06
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