Skip to content

Conversation

@yyassi-heartex
Copy link
Contributor

This pull request introduces a comprehensive state transition history feature for tasks and annotations, including backend API endpoints and frontend UI components for displaying state history in popovers. The changes enable users to view the complete FSM (finite state machine) state transition history for tasks and annotations, improving transparency and debugging capabilities.

Backend: State History API Endpoints

  • Added two new API endpoints in label_studio/tasks/api.py to retrieve the full state transition history for a specific task or annotation, including metadata such as who triggered the transition, timestamps, and reasons. These endpoints are registered in label_studio/tasks/urls.py. [1] [2]

Frontend: State History Popover Components and Hooks

  • Introduced a reusable StateHistoryPopover React component in web/apps/labelstudio/src/components/FSM/StateHistoryPopover.tsx that displays the state history in a popover with color-coded badges, timestamps, and user info.
  • Added a custom React hook useStateHistory for fetching state history from the new API endpoints, including caching and error handling.
  • Implemented formatting utilities for state names, timestamps, and user names in formatters.ts to ensure user-friendly display.
  • Exposed the new FSM components and types via the index.ts barrel file for easy import elsewhere.

Integration and UI Enhancements

  • Created a new StateChip component in web/libs/datamanager/src/components/CellViews/StateChip.tsx that displays the current state as a badge and, when interactive, opens the state history popover on click. This provides a consistent and interactive way to inspect state history from data tables or detail views.

Minor Cleanup

  • Removed an unnecessary console.log statement from the PeopleList component.

@yyassi-heartex yyassi-heartex requested a review from a team as a code owner November 12, 2025 22:25
@netlify
Copy link

netlify bot commented Nov 12, 2025

Deploy Preview for heartex-docs canceled.

Name Link
🔨 Latest commit 21be4e4
🔍 Latest deploy log https://app.netlify.com/projects/heartex-docs/deploys/691641d91d2d7a00081b5f7b

@netlify
Copy link

netlify bot commented Nov 12, 2025

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

Name Link
🔨 Latest commit 21be4e4
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-docs-new-theme/deploys/691641d9f0ffdc0008849d35

@netlify
Copy link

netlify bot commented Nov 12, 2025

Deploy Preview for label-studio-storybook ready!

Name Link
🔨 Latest commit 21be4e4
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-storybook/deploys/691641d9f9bc0f000877582f
😎 Deploy Preview https://deploy-preview-8809--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.

@netlify
Copy link

netlify bot commented Nov 12, 2025

Deploy Preview for label-studio-playground ready!

Name Link
🔨 Latest commit 21be4e4
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-playground/deploys/691641d977873900081a28b7
😎 Deploy Preview https://deploy-preview-8809--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.

@codecov
Copy link

codecov bot commented Nov 12, 2025

Codecov Report

❌ Patch coverage is 0% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.00%. Comparing base (0a7db05) to head (21be4e4).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
web/libs/ui/src/lib/state-chip/state-chip.tsx 0.00% 13 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (0a7db05) and HEAD (21be4e4). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (0a7db05) HEAD (21be4e4)
pytests 1 0
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8809      +/-   ##
===========================================
- Coverage    67.71%   60.00%   -7.71%     
===========================================
  Files          806      554     -252     
  Lines        62093    38999   -23094     
  Branches     10328    10333       +5     
===========================================
- Hits         42044    23400   -18644     
+ Misses       20046    15596    -4450     
  Partials         3        3              
Flag Coverage Δ
lsf-e2e 54.29% <0.00%> (-0.03%) ⬇️
lsf-integration 50.66% <0.00%> (-0.02%) ⬇️
lsf-unit 8.35% <ø> (ø)
pytests ?

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.

@yyassi-heartex yyassi-heartex changed the title Fb fit 983/state history popover feat: FIT-983: [FSM UI] StateChip popover with history Nov 12, 2025
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.

2 participants