Skip to content

Introduce a customizable loading stagger animation on hypertableV2 - #275

Merged
Miexil merged 10 commits into
masterfrom
mb/DRA-5506
Aug 20, 2026
Merged

Introduce a customizable loading stagger animation on hypertableV2#275
Miexil merged 10 commits into
masterfrom
mb/DRA-5506

Conversation

@Miexil

@Miexil Miexil commented Aug 18, 2026

Copy link
Copy Markdown
Member

What does this PR do?

This PR adds an initial-load animation system to HyperTableV2:

  • Updates the existing OptionSet with a new initialRowsAnimation configuration object
  • rows now reveal with a staggered sequence
  • targeted columns can receive an additional visual effect class, and that extra effect can be delayed independently.
  • It also introduces finer control for selection checkboxes by making the extra effect on the selection column configurable (default remains off)

Documentation has been updated, you can check there to have more details of how it's used.

Good PR checklist

  • Title makes sense
  • Is against the correct branch
  • Only addresses one issue
  • Properly assigned
  • Added/updated tests
  • Added/updated documentation
  • Migrated touched components to Glimmer Components
  • Properly labeled

@Miexil Miexil self-assigned this Aug 18, 2026
@Miexil
Miexil requested review from a team and phndiaye as code owners August 18, 2026 15:55
@Miexil
Miexil requested review from OwenCoogan and olxmpe and removed request for a team August 18, 2026 15:55
@linear-code

linear-code Bot commented Aug 18, 2026

Copy link
Copy Markdown

DRA-5506

background-color: white;
}

// Apply stacking fixes only on cells that actually get the custom effect class.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

left this here for context, it's in the dummy app so 🤷

Can also remove if needed 😇

Comment thread addon/components/hyper-table-v2/cell.hbs Outdated
Comment thread addon/components/hyper-table-v2/cell.ts Outdated
Comment thread addon/components/hyper-table-v2/cell.ts Outdated
Comment thread addon/components/hyper-table-v2/index.ts Outdated
Comment thread addon/components/hyper-table-v2/index.ts Outdated
Comment on lines +94 to +96
get disableInitialRowsAnimationExtraEffectOnSelectionCells(): boolean {
return !this.initialRowsAnimation?.includeSelectionColumnInExtraEffect;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the default seems to be false, so maybe this should be the contrary ? (make it special when it's enabled ?)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

can do 🫡

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

applied a change, maybe I went too far in the inversion of logic ^^ let me know :P

} as const satisfies Omit<InitialLoadAnimationConfig, 'extraColumnCellEffectClass' | 'columns'>;
} as const satisfies Omit<InitialLoadAnimationConfig, 'extraColumnEffect' | 'includeSelectionColumnInExtraEffect'> & {
extraColumnEffect: Pick<InitialLoadAnimationExtraColumnEffect, 'delayMs'>;
includeSelectionColumnInExtraEffect: boolean;

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.

nit: I would probably have picked (Pick<>) but no matter, this type is already getting out of control 😅


if (!option) return null;

const options: InitialLoadAnimationOption = option === true ? {} : option;

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.

question: The typing here threw me a little. Shouldn't it be Partial<InitialLoadAnimationConfig> like the option?

Also naming... option => options: I find it a little easy to confuse the two. Maybe a more evocative name, wdyt?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I have removed the typing here so that is is infered directly

...options,
extraColumnEffect: {
...DEFAULT_INITIAL_LOAD_ANIMATION_CONFIG.extraColumnEffect,
...options.extraColumnEffect

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.

issue: ...undefined is going to throw I think.

Suggested change
...options.extraColumnEffect
...(options?.extraColumnEffect ?? {})

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

undefined case is already handled & early returned on line 141

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  • ...undefined does work ;)

this.initialLoadAnimationActive = true;

const rowsAnimationWindowMs = Math.max(this.args.handler.rows.length - 1, 0) * this.initialLoadAnimation.staggerMs;
const activeDurationMs =

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.

AIssue: Keep the animation context active through a configured extra-effect delay.

activeDurationMs omits extraColumnEffect.delayMs, while each cell schedules that class after the row delay plus that extra delay. A valid configuration such as maxAnimationDurationMs: 100 with extraColumnEffect.delayMs: 500 disables the context after 100ms, cancels the cell timer in resetExtraEffectState(), and the requested class is never applied. Include the maximum extra-effect delay in the active duration, or explicitly validate/document that maxAnimationDurationMs must exceed it. Add an integration test that asserts a delayed extra class actually appears.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yup, that is wanted on my part.
maxAnimationDurationMs is an overall stop including the extraEffects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants