Skip to content

refactor(ui): separate spinner primitives from loading layouts - #42473

Merged
lyzno1 merged 6 commits into
mainfrom
codex/refactor-loading-primitives
Sep 18, 2026
Merged

lyzno1 merged 6 commits into
mainfrom
codex/refactor-loading-primitives

Conversation

@lyzno1

@lyzno1 lyzno1 commented Sep 18, 2026

Copy link
Copy Markdown
Member

Summary

The legacy Loading component combines spinner artwork, container geometry, localization, and live-region behavior. Its type="app" only means full height, while sizing classes affect the wrapper rather than the fixed-size artwork. Agent Configure's top-aligned loading state exposed this ambiguity; the immediate page fix shipped separately in #42457.

This change establishes three owners and migrates every legacy Loading consumer in one PR:

  • Dify UI Spinner provides a named indeterminate Base UI Progress; SpinnerIcon provides decorative artwork. Preserve the four-square animation, default 16px blue glyph, and reduced-motion support with scoped component CSS.
  • Web LoadingPlaceholder owns shared centering and localized naming. Features retain their height, spacing, and flex/grid allocation, including the existing full-screen loading composite.
  • Feature-owned persistent status regions handle loading/result announcements in plugin lists and the member picker. Existing button, autocomplete, combobox, and status containers use decorative icons where appropriate.

Remove the old component and type API without compatibility aliases. Generated theme CSS and data-fetching behavior are unchanged.

Fixes SNP-815.

Validation

  • vp run -w check and commit-time staged checks passed.
  • Selected affected/neighbor unit tests passed across targeted reruns (4,022 cases); final owner-specific regression run passed 126 cases in 10 files.
  • Four Spinner Storybook tests passed, covering accessible names, indeterminate semantics, sizes, and decorative use.
  • Marketplace browser test passed for scroll-position preservation when the first search result appears.
  • Compared ten representative old/new layout cases in desktop/narrow viewports, light/dark themes, and reduced motion. Verified Agent Configure's centered spinner under delayed network and the settled page, plus real plugin-filter result status updates.

Visual verification is representative rather than an exhaustive manual audit of every business page. Screen-reader speech was not tested; the existing Storybook axe configuration excludes color contrast.

Checklist

  • Associated issue documents scope and acceptance criteria.
  • Added or updated behavior tests where meaningful regression risk justifies coverage.
  • Documented primitive and Web ownership contracts.
  • Frontend static and staged checks passed; backend checks are not applicable.

From Codex

@github-actions github-actions Bot added the web This relates to changes on the web. label Sep 18, 2026
@codecov

codecov Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.81319% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.47%. Comparing base (331e618) to head (db6b396).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/dify-ui/src/spinner/index.tsx 0.00% 6 Missing ⚠️
...p-access-control/add-member-or-group-pop/index.tsx 71.42% 2 Missing ⚠️
web/app/components/full-screen-loading.tsx 0.00% 1 Missing ⚠️
...g/model-provider-page/install-from-marketplace.tsx 50.00% 1 Missing ⚠️
...mponents/plugins/marketplace/list/list-wrapper.tsx 87.50% 1 Missing ⚠️
...t-detail/configure/components/composer-session.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #42473      +/-   ##
==========================================
+ Coverage   87.46%   87.47%   +0.01%     
==========================================
  Files        5466     5468       +2     
  Lines      317173   316807     -366     
  Branches    63611    63506     -105     
==========================================
- Hits       277407   277130     -277     
+ Misses      34383    34294      -89     
  Partials     5383     5383              
Flag Coverage Δ
dify-ui 93.14% <0.00%> (-0.60%) ⬇️
web 87.95% <92.94%> (+0.03%) ⬆️

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:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lyzno1
lyzno1 enabled auto-merge September 18, 2026 03:26
hyoban
hyoban previously approved these changes Sep 18, 2026
@lyzno1
lyzno1 added this pull request to the merge queue Sep 18, 2026
Merged via the queue into main with commit 48189fe Sep 18, 2026
50 of 51 checks passed
@lyzno1
lyzno1 deleted the codex/refactor-loading-primitives branch September 18, 2026 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants