Skip to content

Enable load animations on reset-rows handler event - #278

Merged
Miexil merged 5 commits into
masterfrom
mb/animations-on-handler-methods
Sep 3, 2026
Merged

Enable load animations on reset-rows handler event#278
Miexil merged 5 commits into
masterfrom
mb/animations-on-handler-methods

Conversation

@Miexil

@Miexil Miexil commented Sep 1, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Enable load animations on reset-rows handler event

Adds a new replayOn parameter for the initialLoadAnimation table configuration, in which we can specify on which HandlerEvent we want animations to be triggered. Currently it only handles the reset-rows event, but the code has been written to easily accept other events in the future, if required.

Also adds an off method to the Handler so that we can properly unsubscribe listeners.

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 Sep 1, 2026
@Miexil
Miexil requested review from a team and phndiaye as code owners September 1, 2026 08:55
@Miexil
Miexil requested review from OwenCoogan and edouardmisset and removed request for a team September 1, 2026 08:55

@edouardmisset edouardmisset 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.

Left a question that needs some thoughts :)

Comment thread addon/core/handler.ts Outdated
Comment thread addon/core/handler.ts Outdated
Comment thread addon/core/handler.ts Outdated
* @returns {TableHandler}
*/
on(event: string, handler: (...args: any[]) => any): TableHandler {
on(event: HandlerEvent, handler: (...args: any[]) => any): TableHandler {

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.

warning: this a public interface change (same with off below).

  • It might cause compilation errors
  • Mistakes in the consuming packages

I would advice to release a new major version if you're confident and have tested/modified consuming packages

OR

Widen the type like LooseAutoComplete<HandlerEvent>

Food for thoughts.

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.

A little more context:

handler.ts:181: on() previously accepted any string event name, but now only accepts the closed HandlerEvent union. Meanwhile, triggerEvent() still accepts arbitrary strings at handler.ts:169, and the package emits the custom filterUpdateIntent event from numeric.ts:77. Existing TypeScript consumers subscribing to custom or currently omitted events will stop compiling even though runtime behavior is unchanged. Preserve the public string API for on() and off(), or add an explicitly supported extensibility overload while keeping the narrower type for replayOn.

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.

A quick github search showed me that the consumers used values from this array though but - am concerned by this too ! Kinda waiting on @phndiaye 's feedback on this :)

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.

Phil checked this one for me, it was causing issue, we went with the loose autocomplete route 🙏

Comment thread tests/integration/components/hyper-table-v2-test.ts

@edouardmisset edouardmisset 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.

Left a question that needs some thoughts :)

Comment thread addon/components/hyper-table-v2/index.ts Outdated
Comment thread addon/components/hyper-table-v2/index.ts
Comment thread addon/core/handler.ts Outdated
@Miexil
Miexil merged commit f605709 into master Sep 3, 2026
5 checks passed
@Miexil
Miexil deleted the mb/animations-on-handler-methods branch September 3, 2026 07:16
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