Skip to content

Conversation

@ricardoantoniocm
Copy link
Contributor

@ricardoantoniocm ricardoantoniocm commented Nov 13, 2025

This pull request refactors and improves the BottomBar component in the editor UI, focusing on layout, style consistency, and user interaction. It moves the CurrentTask component to the Bottom Bar, enhances button usability and accessibility, and standardizes spacing and visual separation between controls. The changes also update styles to use theme variables and improve feature flag handling for conditional UI elements.

Recordings

Before (LSO)

https://www.loom.com/share/3a6f0e71075143568147b8b1fb55ef92

After (LSO)

https://www.loom.com/share/9626f00290bc4ce58da6dcbdbddbf272

Component and Layout Refactoring:

  • Introduced the new CurrentTask component to the BottomBar, which displays the current task ID, history controls, and task counter, with improved feature flag support and conditional rendering. [1] [2] [3] [4]
  • Refactored the Actions component to use semantic div containers instead of Space, grouping action buttons and model actions with clearer separation and updated markup. [1] [2] [3]

UI and Style Improvements:

  • Updated styles for BottomBar and its children to use theme spacing variables, improved padding, and added visual separators between sections and actions. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

Button and Interaction Enhancements:

  • Standardized button sizes, icon usage, and aspect ratios for all action and history buttons; replaced deprecated icons and added tooltips and accessibility labels for improved usability. [1] [2] [3] [4] [5]
  • Improved feature flag handling and conditional logic for enabling/disabling buttons and actions, including postponing tasks based on comments and session state.

Utility and Import Updates:

  • Updated imports to expose additional BEM utility (BemWithSpecificContext) for more flexible class name generation.

Icon and Color Consistency:

  • Updated icon color variables to use theme-based values for consistency across normal, disabled, and negative states. [1] [2] [3] [4]

@github-actions github-actions bot added the feat label Nov 13, 2025
@ricardoantoniocm ricardoantoniocm self-assigned this Nov 13, 2025
@netlify
Copy link

netlify bot commented Nov 13, 2025

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

Name Link
🔨 Latest commit 05577e0
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-docs-new-theme/deploys/69179ae2ba1a58000835fc07

@netlify
Copy link

netlify bot commented Nov 13, 2025

Deploy Preview for heartex-docs canceled.

Name Link
🔨 Latest commit 05577e0
🔍 Latest deploy log https://app.netlify.com/projects/heartex-docs/deploys/69179ae279ebc800088afdac

@netlify
Copy link

netlify bot commented Nov 13, 2025

Deploy Preview for label-studio-storybook ready!

Name Link
🔨 Latest commit 05577e0
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-storybook/deploys/69179ae21f644a000858fccc
😎 Deploy Preview https://deploy-preview-8822--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 13, 2025

Deploy Preview for label-studio-playground ready!

Name Link
🔨 Latest commit 05577e0
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-playground/deploys/69179ae20866a500089ad222
😎 Deploy Preview https://deploy-preview-8822--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 13, 2025

Codecov Report

❌ Patch coverage is 85.29412% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.04%. Comparing base (1ef1969) to head (05577e0).

Files with missing lines Patch % Lines
...bs/editor/src/components/BottomBar/CurrentTask.jsx 88.46% 3 Missing ⚠️
...b/libs/editor/src/components/BottomBar/Actions.jsx 60.00% 2 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (1ef1969) and HEAD (05577e0). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (1ef1969) HEAD (05577e0)
pytests 1 0
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8822      +/-   ##
===========================================
- Coverage    65.77%   58.04%   -7.74%     
===========================================
  Files          811      552     -259     
  Lines        63432    40017   -23415     
  Branches     10690    10675      -15     
===========================================
- Hits         41723    23228   -18495     
+ Misses       21706    16786    -4920     
  Partials         3        3              
Flag Coverage Δ
lsf-e2e 51.86% <52.94%> (+1.72%) ⬆️
lsf-integration 49.31% <52.94%> (+<0.01%) ⬆️
lsf-unit 8.04% <71.87%> (-0.06%) ⬇️
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.

@ricardoantoniocm ricardoantoniocm marked this pull request as ready for review November 13, 2025 20:46
@ricardoantoniocm ricardoantoniocm requested review from a team and yyassi-heartex November 13, 2025 20:46
@ricardoantoniocm
Copy link
Contributor Author

ricardoantoniocm commented Nov 13, 2025

/git merge

Workflow run
Successfully merged: create mode 100644 docs/themes/v2/source/images/admin/command-palette2.png

@bmartel
Copy link
Contributor

bmartel commented Nov 13, 2025

This looks fantastic 🔥 @ricardoantoniocm. One question, with the changes here, what happens with the annotation tabs? Do they remain the same as before but take up the whole row of spacing now?

@ricardoantoniocm
Copy link
Contributor Author

Thanks @bmartel ! The annotation tabs take up the whole row of spacing now on Quick View and the Review Stream. Minus the View All / Add Annotation buttons.


{!isViewAll && (
<div className={cn("bottombar").elem("section").toClassName()}>
<div className={cn("model-actions").toClassName()}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this classname going to fail on testing selectors?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's probable. But I think the best approach would be to add data-testids to the buttons. I'll add those.

look="string"
disabled={!historyEnabled || !store.canGoPrevTask}
onClick={store.prevTask}
style={{ background: !isFF(FF_DEV_3873) && "none", backgroundColor: isFF(FF_DEV_3873) && "none" }}
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this FF_DEV_3873 gating, also why the inline style?

<div
className={cn("current-task")
.elem("history-controls")
.mod({ newui: isFF(FF_DEV_3873) })
Copy link
Contributor

Choose a reason for hiding this comment

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

@yyassi-heartex Do you recall what this FF_DEV_3873 is for? I feel there are a lot of changes in this PR that are hinging on its lingering existence, which makes it hard to understand what is necessary.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@bmartel we are basically on UI v3 right now. We had v1 which was finally removed some time ago (FF_1170). And we still have v2 hidden behind feature flag. It's enabled for everyone and is ready to be removed, but it's everywhere, including some tests, so we have to fix them first. One day, one day...

Comment on lines +17 to +39
const [initialCommentLength, setInitialCommentLength] = useState(0);
const [visibleComments, setVisibleComments] = useState(0);

useEffect(() => {
store.commentStore.setAddedCommentThisSession(false);

const reactionDisposer = reaction(
() => store.commentStore.comments.map((item) => item.isDeleted),
(result) => {
setVisibleComments(result.filter((item) => !item).length);
},
);

return () => {
reactionDisposer?.();
};
}, []);

useEffect(() => {
if (store.commentStore.addedCommentThisSession) {
setInitialCommentLength(visibleComments);
}
}, [store.commentStore.addedCommentThisSession]);
Copy link
Contributor

Choose a reason for hiding this comment

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

What does this do?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Basically that's just a TopBar/CurrentTask.jsx moved to BottomBar. This file was not used at all, so it can be fully rewritten with no doubts. And apparently these files overlapped enough to have this specific diffs instead of full rewrite.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This part of the code serves two purposes:

  1. Tracks visible (non-deleted) comments: The first useEffect sets up a MobX reaction that monitors the comment store. Whenever a comment's isDeleted status changes, it recalculates how many comments are still visible and updates the visibleComments state.
  2. Captures baseline comment count: The second useEffect watches for when a user adds their first comment in the current session (addedCommentThisSession flag). When this happens, it saves the current visible comment count as the initialCommentLength. This baseline is likely used to determine how many new comments were added during this session (by comparing current count to initial count).

This component needs to distinguish between comments that existed when the task was opened versus comments added during the current annotation session. This is used to help determine whether a task can be postponed. See lines 52-54.

When FF_DEV_4174 is enabled, the postpone functionality requires at least one "visible" comment.

Comment on lines +52 to +54
if (store.hasInterface("annotations:comments") && isFF(FF_DEV_4174)) {
canPostpone = canPostpone && store.commentStore.addedCommentThisSession && visibleComments >= initialCommentLength;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not 100% sure of this change, or why its necessary to move the topbar CurrentTask down to the bottombar.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

But we changed the logic of canPostpone here. Maybe I am not seeing the ask in the messages.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, just about the moving the CurrentTask to the bottom. The canPostpone shouldn't have changed. I'll check that out.

Copy link
Collaborator

Choose a reason for hiding this comment

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

same here — it's just how it was in original TopBar file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

<div className={cn("current-task").elem("task-id").toClassName()}>
<div
className={cn("current-task").elem("task-id").toClassName()}
style={{ fontSize: isFF(FF_DEV_3873) ? 12 : 14 }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar question here about the need for a FF based inline style

@ricardoantoniocm
Copy link
Contributor Author

ricardoantoniocm commented Nov 14, 2025

/git merge

Workflow run
Successfully merged: create mode 100644 web/libs/datamanager/src/components/Filters/types/TaskStateFilter.jsx

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.

4 participants