Skip to content

Fix Progress component#145

Open
clarasb wants to merge 12 commits into
mainfrom
clarasb/xxx-fix_progress_spinner
Open

Fix Progress component#145
clarasb wants to merge 12 commits into
mainfrom
clarasb/xxx-fix_progress_spinner

Conversation

@clarasb

@clarasb clarasb commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR fixes the behaviour of progress components by adding hidden support for the components and connecting it to callback execution state.

Progress components can now be hidden with hidden=True and shown via callback outputs such as:

Output("progress", "hidden")

When a server-side callback declares a progress component’s hidden property as an output, chartlets now shows that progress indicator immediately while the callback request is pending. Once the callback completes, the normal callback output is applied, typically hiding the progress component again.

Changes

  • Added visible to the shared component state model.
  • Added pending-callback progress handling in invokeCallbacks().
  • Added a DEV_NOTES.md to explain the Progress logic.
  • Added another demo panel, demonstrating the progress component.
  • Other changes:
    • Fixed vega_test.py.

Demo Panel

image

xcube-viewer panels demo
grafik

@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.59155% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 93.57%. Comparing base (f8cf975) to head (f7f5ac9).

Files with missing lines Patch % Lines
...ackages/lib/src/actions/helpers/pendingProgress.ts 98.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #145      +/-   ##
==========================================
+ Coverage   92.53%   93.57%   +1.03%     
==========================================
  Files          90       91       +1     
  Lines        1594     1665      +71     
  Branches      243      262      +19     
==========================================
+ Hits         1475     1558      +83     
+ Misses         99       91       -8     
+ Partials       20       16       -4     
Flag Coverage Δ
backend 100.00% <100.00%> (ø)
frontend 87.70% <98.55%> (+2.55%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@clarasb clarasb self-assigned this Jun 26, 2026
@clarasb clarasb marked this pull request as ready for review June 26, 2026 09:51
@clarasb clarasb requested review from b-yogesh and forman July 2, 2026 08:30

@forman forman left a comment

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 implementation, especially the tests look overly complicated to me for what we want to achieve (display a progress indicator). But that may be due to my limited time.
I was not able to grasp what is done in pendingProgress.ts and what is actually tested in invokeCallbacks.test.ts.
And is the user supposed to set the visible flag? Why?

With that extra amount of code to be maintained it makes a lot sense to clearly document what has been developed here.

  • Add a developer note (.md) about the current progress implementation
  • Add docstrings to explain purpose and logic
  • Comment tests

And

  • Change name and meaning of property visible into hidden.

size,
value,
variant,
visible = true,

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.

visible is actually not a good choice as a component property. Many boolean component properties are optional and their default is therefore "falsy" (e.g. disabled). Hence this property should be called hidden, not visible.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done.

Comment thread chartlets.js/packages/lib/src/plugins/mui/LinearProgress.test.tsx Outdated
Comment thread chartlets.js/packages/lib/src/types/state/component.ts Outdated
Comment thread chartlets.js/CHANGES.md Outdated
Comment thread chartlets.py/chartlets/component.py Outdated
Comment thread chartlets.py/CHANGES.md Outdated
@clarasb clarasb requested a review from forman July 8, 2026 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants