Repository navigation
Improves animated value - #315213
Merged
Merged
Improves animated value#315213
Conversation
Member
|
Henning Dieterichs (@hediet), could we move this out of editor/contrib so that it can be used in other places as well? Thanks! |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the inline completions animation helpers to compute animation state using a shared “now” timestamp, and updates the inline-completions fadeout decoration to query completion state via ObservableAnimatedValue rather than the raw AnimatedValue.
Changes:
- Introduces
IAnimatedValue, updatesAnimatedValueto acceptnowMsforgetValue/isFinished, and exportsInterpolationFunction. - Adds
LoopingAnimatedValueand extendsObservableAnimatedValuewith anisFinished(reader)helper plus consistent “now” handling. - Updates
FadeoutDecorationto callval.isFinished(reader).
Show a summary per file
| File | Description |
|---|---|
| src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.ts | Switches fadeout disposal check to use ObservableAnimatedValue.isFinished(reader). |
| src/vs/editor/contrib/inlineCompletions/browser/model/animation.ts | Refactors animation API to accept timestamps, adds looping animation support, and enhances ObservableAnimatedValue. |
Copilot's findings
Comments suppressed due to low confidence (1)
src/vs/editor/contrib/inlineCompletions/browser/model/animation.ts:88
ObservableAnimatedValue.constdeclares a return type ofObservableAnimatedValue(which defaults toObservableAnimatedValue<IAnimatedValue>), but the constructor call infersTasAnimatedValue. Because the class has a private member depending onT, these instantiations are not assignable and this is likely to cause a TypeScript type error. Consider either (1) making the return typeObservableAnimatedValue<AnimatedValue>or (2) explicitly constructingnew ObservableAnimatedValue<IAnimatedValue>(...)(or dropping the generic if you intend it to always holdIAnimatedValue).
export class ObservableAnimatedValue<T extends IAnimatedValue = IAnimatedValue> {
public static const(value: number): ObservableAnimatedValue {
return new ObservableAnimatedValue(AnimatedValue.const(value));
}
- Files reviewed: 2/2 changed files
- Comments generated: 2
Henning Dieterichs (hediet)
disabled auto-merge
May 8, 2026 09:17
Henning Dieterichs (hediet)
enabled auto-merge (squash)
May 8, 2026 09:29
Ladislau Szomoru (lszomoru)
approved these changes
May 8, 2026
Ladislau Szomoru (lszomoru)
pushed a commit
that referenced
this pull request
May 8, 2026
Refactors animated value
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
No description provided.