Skip to content

Improves animated value - #315213

Merged
Henning Dieterichs (hediet) merged 2 commits into
mainfrom
hediet/b/frightened-squid
May 8, 2026
Merged

Henning Dieterichs (hediet) merged 2 commits into
mainfrom
hediet/b/frightened-squid

Conversation

@hediet

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings May 8, 2026 09:03
@hediet
Henning Dieterichs (hediet) enabled auto-merge (rebase) May 8, 2026 09:03
@lszomoru

Copy link
Copy Markdown
Member

Henning Dieterichs (@hediet), could we move this out of editor/contrib so that it can be used in other places as well? Thanks!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, updates AnimatedValue to accept nowMs for getValue/isFinished, and exports InterpolationFunction.
  • Adds LoopingAnimatedValue and extends ObservableAnimatedValue with an isFinished(reader) helper plus consistent “now” handling.
  • Updates FadeoutDecoration to call val.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.const declares a return type of ObservableAnimatedValue (which defaults to ObservableAnimatedValue<IAnimatedValue>), but the constructor call infers T as AnimatedValue. Because the class has a private member depending on T, these instantiations are not assignable and this is likely to cause a TypeScript type error. Consider either (1) making the return type ObservableAnimatedValue<AnimatedValue> or (2) explicitly constructing new ObservableAnimatedValue<IAnimatedValue>(...) (or dropping the generic if you intend it to always hold IAnimatedValue).
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

Comment thread src/vs/base/browser/animatedValue.ts
Comment thread src/vs/base/browser/animatedValue.ts
@hediet
Henning Dieterichs (hediet) enabled auto-merge (squash) May 8, 2026 09:29
@hediet
Henning Dieterichs (hediet) merged commit ab6beec into main May 8, 2026
26 checks passed
@hediet
Henning Dieterichs (hediet) deleted the hediet/b/frightened-squid branch May 8, 2026 09:46
@vs-code-engineering vs-code-engineering Bot added this to the 1.120.0 milestone May 8, 2026
Ladislau Szomoru (lszomoru) pushed a commit that referenced this pull request May 8, 2026
Refactors animated value
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Jun 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants