fix(macOS): replace @State caches with NSCache and remove nested ScrollViews in StepDetailRow#24336
Merged
Merged
Conversation
…llViews in StepDetailRow The previous approach used @State properties to cache colored output and input-length flags, which could mutate SwiftUI state during the render cycle. Replace with a static NSCache keyed by content hash so caching lives outside SwiftUI's observation graph entirely. Remove per-block nested ScrollViews for long tool output — the outer transcript already scrolls, and nested scroll views cause hit-testing and responder churn. Use fixedSize(horizontal: false, vertical: true) so text self-sizes correctly. Unify input rendering through the existing outputBlock helper.
devin-ai-integration Bot
added a commit
that referenced
this pull request
Apr 8, 2026
…ache Builds on the NSCache architecture from #24336 to bound worst-case coloredOutput() cost. For results exceeding 500 lines, only the first 500 are processed into AttributedString segments — the rest are counted but skipped. A truncation footer tells the user the full output is available via the copy button. Key changes: - coloredOutput() now accepts a lineLimit parameter and uses String.Index iteration instead of components(separatedBy:) to avoid N substring allocs - StepDetailAttributedStringCacheEntry stores totalLines alongside the attributed value so truncation state is cached with the output - outputBlock() accepts an optional truncationFooter parameter - cachedColoredEntry computed property returns the full cache entry so both the attributed string and truncation info are available Co-Authored-By: tkheyfets <timur@vellum.ai>
4 tasks
Contributor
Author
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b8ab3a428e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
noanflaherty
pushed a commit
that referenced
this pull request
Apr 8, 2026
…llViews in StepDetailRow (#24336) The previous approach used @State properties to cache colored output and input-length flags, which could mutate SwiftUI state during the render cycle. Replace with a static NSCache keyed by content hash so caching lives outside SwiftUI's observation graph entirely. Remove per-block nested ScrollViews for long tool output — the outer transcript already scrolls, and nested scroll views cause hit-testing and responder churn. Use fixedSize(horizontal: false, vertical: true) so text self-sizes correctly. Unify input rendering through the existing outputBlock helper.
2 tasks
devin-ai-integration Bot
added a commit
that referenced
this pull request
Apr 9, 2026
…ache Builds on the NSCache architecture from #24336 to bound worst-case coloredOutput() cost. For results exceeding 500 lines, only the first 500 are processed into AttributedString segments — the rest are counted but skipped. A truncation footer tells the user the full output is available via the copy button. Key changes: - coloredOutput() now accepts a lineLimit parameter and uses String.Index iteration instead of components(separatedBy:) to avoid N substring allocs - StepDetailAttributedStringCacheEntry stores totalLines alongside the attributed value so truncation state is cached with the output - outputBlock() accepts an optional truncationFooter parameter - cachedColoredEntry computed property returns the full cache entry so both the attributed string and truncation info are available Co-Authored-By: tkheyfets <timur@vellum.ai>
Contributor
Author
|
Addressed in #25048 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@Statecached properties with a shared staticNSCache<NSString, StepDetailAttributedStringCacheEntry>(128-entry limit) so colored-output memoization lives outside SwiftUI's observation graph — eliminates state mutations during render cyclesScrollViewwrappers for long tool output/input; the outer transcript handles scrolling, avoiding hit-testing and responder churnoutputBlockhelper, removing duplicated long/short branching logic