Skip to content

refactor(labextension): replace Kale toolbar polling with reactive state handling#681

Open
Sayan4496 wants to merge 8 commits intokubeflow:mainfrom
Sayan4496:refactor/kale-reactive-toolbar-state
Open

refactor(labextension): replace Kale toolbar polling with reactive state handling#681
Sayan4496 wants to merge 8 commits intokubeflow:mainfrom
Sayan4496:refactor/kale-reactive-toolbar-state

Conversation

@Sayan4496
Copy link
Copy Markdown
Contributor

Summary

This PR replaces the polling mechanism previously used to detect the Kale enable state in the JupyterLab toolbar.

Previously the toolbar relied on a setInterval loop to repeatedly check whether Kale was enabled. This approach introduced unnecessary polling in a React-based UI.

This change introduces a reactive callback mechanism that notifies the toolbar whenever the Kale state changes.

Changes

  • Removed setInterval polling from kaleToolbar.ts
  • Introduced a reactive onKaleStateChange callback in KubeflowKaleLeftPanel
  • Toolbar buttons now update instantly when Kale is enabled or disabled
  • Simplified state synchronization between the Kale panel and the toolbar

Benefits

  • Removes unnecessary polling
  • Improves frontend architecture
  • Aligns with React’s event-driven state updates
  • Makes future UI refactors easier

Testing

  • Verified that Compile and Run toolbar buttons update immediately when Kale is enabled/disabled
  • Confirmed existing functionality remains unchanged

Closes #649

…mands integrated with Kale deployment flow

Signed-off-by: Sayan Deyashi <deyashisayan2@gmail.com>
…eployType typing

Signed-off-by: Sayan Deyashi <deyashisayan2@gmail.com>
Signed-off-by: Sayan Deyashi <deyashisayan2@gmail.com>
Signed-off-by: Sayan Deyashi <deyashisayan2@gmail.com>
Signed-off-by: Sayan Deyashi <deyashisayan2@gmail.com>
Signed-off-by: Sayan Deyashi <deyashisayan2@gmail.com>
…ate handling

Signed-off-by: Sayan Deyashi <deyashisayan2@gmail.com>
@google-oss-prow
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign stefanofioravanzo for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow Bot added size/S and removed size/L labels Mar 11, 2026
@Sayan4496
Copy link
Copy Markdown
Contributor Author

Sayan4496 commented Mar 11, 2026

@ederign this PR implements the reactive state handling discussed in #649 by removing the polling mechanism from the toolbar. Please let me know if any improvements are needed.

@Sayan4496
Copy link
Copy Markdown
Contributor Author

Hi @jesuino,
Could you please review this PR when you get a chance?
It replaces polling with reactive state handling for the Kale toolbar.

Thanks!

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature] Refactor Kale toolbar state polling to reactive state handling

1 participant