Skip to content

feat: BROS-73: [FE] Create empty states for panels: info, regions, relations, history #7694

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

ricardoantoniocm
Copy link
Contributor

@ricardoantoniocm ricardoantoniocm commented Jun 4, 2025

Reason for change

The existing empty states in the Info, Regions, Relations, and History panels of the outliner are not sufficiently informative or user-friendly. This PR introduces new, improved empty states to provide a better user experience when these panels have no content to display.

The implemented solution follows a consistent design pattern across all affected panels: an icon, a concise title, and a descriptive message.

Key improvements include:

  • New EmptyState Component: A reusable React component (EmptyState.tsx) has been created to display an icon, header, description, and an optional "Learn more" link. This component is designed to hide the "Learn more" link in white-label environments.
  • Updated Panel Content:
    • Info Panel: Displays "Info" as the title and "Select a region to view its details."
    • Regions Panel (Outliner): Utilizes the new EmptyState component when no regions are present, with a relevant icon and "Learn more" link (hidden in white-label mode).
    • Relations Panel: Uses the new relations icon and displays "Create a relation" with the description "Created relations will be listed here."
    • History Panel: Displays "Draft creation, annotation submission, and annotation reviews will be listed here."
  • Dynamic Documentation Links: A new utility (utils/docs.ts) generates documentation URLs dynamically based on the deployment (Open Source vs. Enterprise) and ensures links are hidden for white-labeled environments.
  • Visibility: The new empty states will appear in quick view, label stream, review stream, and label config preview.
  • Code Quality: Various React functional components have been refactored for improved TypeScript typing, consistent named function expressions for observers, and cleaned-up callbacks (e.g., for region sorting, grouping, filtering).
  • Icon alignment: Two icons used to represent region types were reduced from 32x32 to 24x24 to ensure they are properly display and do not cause alignment issues.
  • Updated failing outliner and regions panel tests.

Other minor improvements:

  • Fixed size of polygon and rectangle tool icons to prevent alignment issues on Regions and Info panels.

Screenshots

Before:
image
image
image

After:
image
image
image

Testing

  • Unit Tests:
    • Added EmptyState.test.tsx with unit tests for the new EmptyState component, verifying:
      • Correct rendering of icon, header, and description props.
      • Behavior of the "Learn more" link, including its absence in white-label mode.
  • Manual Verification:
    • Confirmed that the new empty states display correctly in the Info, Regions, Relations, and History panels.
    • Verified visibility and correct content in:
      • Quick view
      • Label stream
      • Review stream
      • Label config preview
    • Ensured "Learn more" links are appropriately hidden in white-labeled environments.
    • Confirmed new icons (IconHistoryRewind, IconLsLabeling, new relations icon) and text content match the specifications.

Reviewer notes

  • Please verify the correct display and behavior of the "Learn more" links, especially in the context of white-labeled environments. The utility utils/docs.ts handles the dynamic URL generation.
  • Note the refactoring in DetailsPanel.tsx and OutlinerPanel.tsx for improved typing and maintainability.

General notes

This PR focuses on improving the user experience by providing clear and helpful empty states in key areas of the outliner. The introduction of the reusable EmptyState component promotes consistency and maintainability. Additionally, the changes include general code quality improvements such as enhanced TypeScript typings and refactoring of component logic.

…tates for Info, Regions, Relations, and History panel in outliner
…to get the Community or Enterprise variant of a docs page. Improves history-rewind icon visual weight.
@ricardoantoniocm ricardoantoniocm self-assigned this Jun 4, 2025
Copy link

netlify bot commented Jun 4, 2025

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

Name Link
🔨 Latest commit ee93399
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-docs-new-theme/deploys/684ddac0369f100008c00709

Copy link

netlify bot commented Jun 4, 2025

Deploy Preview for label-studio-playground ready!

Name Link
🔨 Latest commit ee93399
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-playground/deploys/684ddac084c17d00089a3cca
😎 Deploy Preview https://deploy-preview-7694--label-studio-playground.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added the feat label Jun 4, 2025
Copy link

netlify bot commented Jun 4, 2025

Deploy Preview for label-studio-storybook ready!

Name Link
🔨 Latest commit ee93399
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-storybook/deploys/684ddac0c9c81d00090c89ed
😎 Deploy Preview https://deploy-preview-7694--label-studio-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

netlify bot commented Jun 4, 2025

Deploy Preview for heartex-docs canceled.

Name Link
🔨 Latest commit ee93399
🔍 Latest deploy log https://app.netlify.com/projects/heartex-docs/deploys/684ddac066d8c3000816702e

@ricardoantoniocm ricardoantoniocm marked this pull request as ready for review June 5, 2025 14:52
@ricardoantoniocm ricardoantoniocm requested a review from makseq June 5, 2025 14:53
@ricardoantoniocm ricardoantoniocm requested a review from a team as a code owner June 5, 2025 15:17
@ricardoantoniocm ricardoantoniocm requested a review from Copilot June 5, 2025 15:59
Copilot

This comment was marked as outdated.

ricardoantoniocm and others added 2 commits June 5, 2025 12:04
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ricardoantoniocm ricardoantoniocm requested a review from Copilot June 5, 2025 16:56
Copilot

This comment was marked as outdated.

ricardoantoniocm and others added 4 commits June 5, 2025 12:58
….tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ty-states-info-regions-relations-history-panel-outliner' of https://github.com/heartexlabs/label-studio into fb-bros-73/fe-create-more-informative-user-friendly-empty-states-info-regions-relations-history-panel-outliner
@ricardoantoniocm
Copy link
Contributor Author

ricardoantoniocm commented Jun 12, 2025

/fm sync

Workflow run

ricardoantoniocm and others added 4 commits June 12, 2025 23:02
…ty-states-info-regions-relations-history-panel-outliner' of https://github.com/heartexlabs/label-studio into fb-bros-73/fe-create-more-informative-user-friendly-empty-states-info-regions-relations-history-panel-outliner
@ricardoantoniocm
Copy link
Contributor Author

ricardoantoniocm commented Jun 13, 2025

/fm sync

Workflow run

@ricardoantoniocm
Copy link
Contributor Author

ricardoantoniocm commented Jun 13, 2025

/fm sync

Workflow run

@yyassi-heartex
Copy link
Contributor

yyassi-heartex commented Jun 13, 2025

/git merge

Workflow run
Successfully merged: 2 files changed, 85 insertions(+), 15 deletions(-)

@ricardoantoniocm ricardoantoniocm merged commit bd69adb into develop Jun 16, 2025
44 checks passed
@robot-ci-heartex robot-ci-heartex deleted the fb-bros-73/fe-create-more-informative-user-friendly-empty-states-info-regions-relations-history-panel-outliner branch June 16, 2025 12:53
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