Skip to content

Conversation

ricardoantoniocm
Copy link
Contributor

@ricardoantoniocm ricardoantoniocm commented Aug 13, 2025

This PR was automatically generated via Follow Merge. Workflow Run
Please ensure that all linked upstream Pull Requests are merged before proceeding with this one.

Reason for change

This PR addresses the user experience of the data manager's empty state. The previous "blank" state was unhelpful and didn't provide users with clear guidance on how to get started. This change introduces a new, comprehensive empty state component that is more informative.

The new component provides different messaging and actions based on the context:

  • Empty Projects: Guides Administrators and Managers to import their initial data (via Connecting Cloud Storage or from their computer using the Import modal) and, guides Reviewers and Annotators on what they can do given their role (when applicable).
  • A link to documentation is added that works dynamically depending on whether it's presented on LSO or LSE. It is excluded from whitelabeled environments.
  • Empty Filter Results: Informs users when their current filters return no results and provides an easy way to clear the filters.

This improvement enhances the user experience by providing a clear path forward, reducing friction for new users, and improving usability for existing users.

The Connect Storage button pushes the user to the Cloud Storages page and automatically opens the Add Source Storage modal, streamlining the process. It also leverages the Import modal for processing any uploaded files.

This PR also introduces improvements to the destructive confirmation dialogs used in the Data Manager, fixing the variants of the buttons as well as implementing more meaningful copy on the title, body text and buttons.

Screenshots

Before

Empty State
image

No results from filters
image

Destructive DM Actions
image

After

Empty State
image

No results from filters
image

Destructive DM Actions
image

Rollout strategy

  • The new EmptyState component will be deployed as part of the normal release cycle.
  • No feature flag is necessary as this change is a direct improvement to the existing UI.
  • The change is fully backward compatible, as it only affects the presentation layer when a dataset is empty.

Testing

I've conducted the following testing to ensure the new component works as expected:

  • Unit Tests: Added comprehensive unit tests for the EmptyState component, covering all display modes and props.
  • Integration Tests:
    • Verified that the correct empty state is displayed for a brand new project with no data.
    • Confirmed that the "Empty Filter Results" state appears when applying a filter that yields no results.
    • Tested the functionality of the "Import" and "Clear Filters" buttons.
    • Ensured the component integrates correctly with the main DataManager and Table components.
    • Verified the component works as expected on different screen sizes to confirm responsiveness.

Reviewer notes

  • Please pay close attention to the visual implementation of the new empty states.
  • Verify that the conditional rendering logic correctly differentiates between truly empty projects and empty filtered results.
  • Some files may have some automatic linting changes applied, unrelated to the work itself. Those changes should be safe to keep though.

Copy link

netlify bot commented Aug 13, 2025

Deploy Preview for label-studio-docs-new-theme canceled.

Name Link
🔨 Latest commit 49f5dc2
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-docs-new-theme/deploys/68a8ee55ec849a0008a801c0

@ricardoantoniocm ricardoantoniocm self-assigned this Aug 13, 2025
Copy link

netlify bot commented Aug 13, 2025

Deploy Preview for label-studio-playground canceled.

Name Link
🔨 Latest commit 49f5dc2
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-playground/deploys/68a8ee55cb6b1100085059ae

Copy link

netlify bot commented Aug 13, 2025

Deploy Preview for heartex-docs canceled.

Name Link
🔨 Latest commit 49f5dc2
🔍 Latest deploy log https://app.netlify.com/projects/heartex-docs/deploys/68a8ee55a5e1380008cf733f

Copy link

netlify bot commented Aug 13, 2025

Deploy Preview for label-studio-storybook canceled.

Name Link
🔨 Latest commit 49f5dc2
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-storybook/deploys/68a8ee556fd83f0008756c12

Copy link

codecov bot commented Aug 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.26%. Comparing base (def47a2) to head (3e841ce).
✅ All tests successful. No failed tests found.

❗ There is a different number of reports uploaded between BASE (def47a2) and HEAD (3e841ce). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (def47a2) HEAD (3e841ce)
lsf-e2e 1 0
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8149      +/-   ##
===========================================
- Coverage    70.58%   64.26%   -6.33%     
===========================================
  Files          725      725              
  Lines        52670    52670              
  Branches      9015     9015              
===========================================
- Hits         37179    33846    -3333     
- Misses       15488    18821    +3333     
  Partials         3        3              
Flag Coverage Δ
lsf-e2e ?
lsf-integration 56.32% <ø> (+<0.01%) ⬆️
lsf-unit 9.40% <ø> (ø)
pytests 78.38% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Improves empty state functionality for Data Manager by implementing role-based empty states and enhanced import functionality. This provides better guidance to users based on their permissions and project state.

  • Unified empty state component that handles different user roles (REVIEWER, ANNOTATOR) and project states
  • Enhanced drag-and-drop functionality with improved UI feedback and file import capabilities
  • Updated modal dialogs with improved destructive action patterns and better button styling

Reviewed Changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
web/libs/ui/src/assets/icons/index.ts Exports new IconInbox icon for empty states
web/libs/datamanager/src/sdk/dm-sdk.js Adds role property to DataManager configuration
web/libs/datamanager/src/components/MainView/DataView/tests/EmptyState.test.tsx Test coverage for EmptyState component accessibility features
web/libs/datamanager/src/components/MainView/DataView/Table.scss Adds dropzone styling with drag-and-drop visual feedback
web/libs/datamanager/src/components/MainView/DataView/Table.jsx Integrates unified EmptyState component with role-based functionality
web/libs/datamanager/src/components/MainView/DataView/EmptyState.jsx New unified empty state component with role-based UI and import functionality
web/libs/datamanager/src/components/DataManager/Toolbar/ActionsButton.jsx Updates action dialogs with improved destructive action patterns
web/libs/datamanager/src/components/Common/Modal/Modal.scss Increases modal width for better content display
web/libs/datamanager/src/components/Common/Modal/Modal.jsx Updates modal buttons to use new variant system
web/libs/datamanager/src/components/Common/Menu/MenuItem.jsx Adds variant prop while maintaining backward compatibility
web/apps/labelstudio/src/pages/Settings/StorageSettings/StorageSettings.jsx Adds auto-open functionality for source storage modal
web/apps/labelstudio/src/pages/Settings/StorageSettings/StorageSet.jsx Implements ref forwarding for programmatic modal opening
web/apps/labelstudio/src/pages/DataManager/DataManager.jsx Adds event handlers for storage modal and file import functionality
web/apps/labelstudio/src/pages/CreateProject/Import/Import.jsx Handles auto-start import when files are provided via event
Comments suppressed due to low confidence (1)

web/libs/datamanager/src/components/MainView/DataView/EmptyState.jsx:294

  • Direct access to global window.APP_SETTINGS creates tight coupling and makes testing difficult. Consider passing this as a prop or using a context/configuration provider.
          )}

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

The EmptyState component was updated to use 'userRole' instead of 'role'
to avoid ARIA role conflicts, but Table.jsx was still passing 'role'.
This caused the Reviewer role to show the default empty state instead
of the role-specific content.
- Annotators with auto-distribution now see role-specific empty state
  even when filters are applied, instead of generic filter message
- Filter empty state now only applies to Owners/Admins/Managers
- Fixed logic order: role-specific checks first, then filter checks
- Updated both EmptyState.tsx files to maintain consistency
- Cleared caches to ensure fresh component loading
This will help identify why hasFilters is incorrectly true when no filters are applied.
Check console for 'DEBUG hasFilters' messages to see the filtersApplied value.
@ricardoantoniocm ricardoantoniocm marked this pull request as ready for review August 13, 2025 17:30
@ricardoantoniocm ricardoantoniocm requested a review from a team as a code owner August 13, 2025 17:30
@ricardoantoniocm
Copy link
Contributor Author

ricardoantoniocm commented Aug 15, 2025

/git merge

Workflow run
Successfully merged: create mode 100644 web/libs/editor/tests/integration/e2e/control_tags/text-with-dual-taxonomy.cy.ts

@ricardoantoniocm
Copy link
Contributor Author

ricardoantoniocm commented Aug 18, 2025

/git merge

Workflow run
Successfully merged: create mode 100644 web/libs/ui/src/shad/components/ui/accordion.tsx

Copy link
Contributor

@nass600 nass600 left a comment

Choose a reason for hiding this comment

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

@ricardoantoniocm Looks good. I believe this EmptyState could be promoted to the Design System as we have it spread all over the app

@ricardoantoniocm
Copy link
Contributor Author

ricardoantoniocm commented Aug 20, 2025

/git merge

Workflow run
Successfully merged: 47 files changed, 1763 insertions(+), 97 deletions(-)

@ricardoantoniocm
Copy link
Contributor Author

ricardoantoniocm commented Aug 22, 2025

/git merge

Workflow run
Successfully merged: 67 files changed, 3812 insertions(+), 1028 deletions(-)

@ricardoantoniocm
Copy link
Contributor Author

ricardoantoniocm commented Aug 22, 2025

/fm sync

Workflow run

@robot-ci-heartex robot-ci-heartex merged commit 7d639a7 into develop Aug 22, 2025
@robot-ci-heartex robot-ci-heartex deleted the fb-fit-450/improve-empty-state-data-manager branch August 22, 2025 22:25
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.

3 participants