Skip to content

Add sliding animation to workflow switch component#20831

Merged
daniellok-db merged 3 commits intomlflow:masterfrom
daniellok-db:workflow-animation
Feb 20, 2026
Merged

Add sliding animation to workflow switch component#20831
daniellok-db merged 3 commits intomlflow:masterfrom
daniellok-db:workflow-animation

Conversation

@daniellok-db
Copy link
Collaborator

@daniellok-db daniellok-db commented Feb 16, 2026

Related Issues/PRs

N/A

What changes are proposed in this pull request?

Add a smooth sliding animation to the sidebar workflow switch when toggling between GenAI and Model training modes. The thumb indicator now slides between positions with a 200ms ease-out CSS transition, providing better visual feedback during interaction.

How is this PR tested?

  • Existing unit/integration tests
  • New unit/integration tests
  • Manual tests
Screen.Recording.2026-02-16.at.2.03.24.PM.mov

Does this PR require documentation update?

  • No. You can skip the rest of this section.
  • Yes. I've updated:
    • Examples
    • API references
    • Instructions

Does this PR require updating the MLflow Skills repository?

  • No. You can skip the rest of this section.
  • Yes. Please link the corresponding PR or explain how you plan to update it.

Release Notes

Is this a user-facing change?

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release notes for MLflow users.

Add sliding animation to the workflow type switch in the sidebar for smoother visual feedback when toggling between GenAI and Model training modes.

What component(s), interfaces, languages, and integrations does this PR affect?

Components

  • area/tracking: Tracking Service, tracking client APIs, autologging
  • area/models: MLmodel format, model serialization/deserialization, flavors
  • area/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registry
  • area/scoring: MLflow Model server, model deployment tools, Spark UDFs
  • area/evaluation: MLflow model evaluation features, evaluation metrics, and evaluation workflows
  • area/gateway: MLflow AI Gateway client APIs, server, and third-party integrations
  • area/prompts: MLflow prompt engineering features, prompt templates, and prompt management
  • area/tracing: MLflow Tracing features, tracing APIs, and LLM tracing functionality
  • area/projects: MLproject format, project running backends
  • area/uiux: Front-end, user experience, plotting, JavaScript, JavaScript dev server
  • area/build: Build and test infrastructure for MLflow
  • area/docs: MLflow documentation pages

How should the PR be classified in the release notes? Choose one:

  • rn/none - No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" section
  • rn/breaking-change - The PR will be mentioned in the "Breaking Changes" section
  • rn/feature - A new user-facing feature worth mentioning in the release notes
  • rn/bug-fix - A user-facing bug fix worth mentioning in the release notes
  • rn/documentation - A user-facing documentation change worth mentioning in the release notes

Should this PR be included in the next patch release?

  • Yes (this PR will be cherry-picked and included in the next patch release)
  • No (this PR will be included in the next minor release)

Refactor MlflowSidebarWorkflowSwitch to use a sliding thumb indicator
with CSS transitions when switching between GenAI and Model training
workflow types. The animation provides smoother visual feedback.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Daniel Lok <daniel.lok@databricks.com>
Copilot AI review requested due to automatic review settings February 16, 2026 04:20
@github-actions
Copy link
Contributor

🛠 DevTools 🛠

Install mlflow from this PR

# mlflow
pip install git+https://github.com/mlflow/mlflow.git@refs/pull/20831/merge
# mlflow-skinny
pip install git+https://github.com/mlflow/mlflow.git@refs/pull/20831/merge#subdirectory=libs/skinny

For Databricks, use the following command:

%sh curl -LsSf https://raw.githubusercontent.com/mlflow/mlflow/HEAD/dev/install-skinny.sh | sh -s pull/20831/merge

@github-actions github-actions bot added area/uiux Front-end, user experience, plotting, JavaScript, JavaScript dev server rn/feature Mention under Features in Changelogs. labels Feb 16, 2026
Copy link
Contributor

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

This PR updates the sidebar workflow type switch UI to use a sliding “thumb” indicator animation when toggling between GenAI and Model training modes, improving visual feedback in the navigation sidebar.

Changes:

  • Replaced the previous per-option “pill” rendering with a single sliding thumb indicator.
  • Added CSS transitions for thumb movement/size/background to animate state changes.
  • Adjusted switch layout/styling (e.g., min-content width, z-index layering) to support the overlay thumb.

Comment on lines +46 to +51
width: `${isGenAi ? 39 : 67}%`,
background: borderColor,
borderRadius: theme.borders.borderRadiusFull,
padding: 1,
transition: 'transform 200ms ease-out, width 200ms ease-out, background 200ms ease-out',
transform: isGenAi ? 'translateX(0)' : `translateX(calc(51%))`,
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

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

The thumb sizing/positioning relies on magic percentages (width 39%/67% and translateX(51%)). Note that translateX(%) is relative to the thumb’s own width, so these values won’t reliably line up with the two option widths and can even push the thumb past the container edge. Consider making the two options deterministic widths (e.g., 2 equal grid columns) and animate the thumb using left (0/50%) or translateX(0/100%) with a fixed 50% width (or measure actual option widths) instead.

Suggested change
width: `${isGenAi ? 39 : 67}%`,
background: borderColor,
borderRadius: theme.borders.borderRadiusFull,
padding: 1,
transition: 'transform 200ms ease-out, width 200ms ease-out, background 200ms ease-out',
transform: isGenAi ? 'translateX(0)' : `translateX(calc(51%))`,
width: '50%',
background: borderColor,
borderRadius: theme.borders.borderRadiusFull,
padding: 1,
transition: 'transform 200ms ease-out, width 200ms ease-out, background 200ms ease-out',
transform: isGenAi ? 'translateX(0)' : 'translateX(100%)',

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

50% / 50% looks bad. it's true that it's hardcoded / magic number but this is not a component we expect to edit further

paddingLeft: theme.spacing.md,
whiteSpace: 'nowrap' as const,
}}
onClick={() => setWorkflowType(WorkflowType.GENAI)}
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

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

This option is a clickable <div> (with onClick) but it isn’t keyboard-focusable and has no semantic role/state for assistive tech. Please use a <button type="button"> (or add role, tabIndex, aria-* state, and Enter/Space key handling) so the workflow switch can be operated via keyboard.

Copilot uses AI. Check for mistakes.
paddingLeft: theme.spacing.sm,
whiteSpace: 'nowrap' as const,
}}
onClick={() => setWorkflowType(WorkflowType.MACHINE_LEARNING)}
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

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

This option is a clickable <div> (with onClick) but it isn’t keyboard-focusable and has no semantic role/state for assistive tech. Please use a <button type="button"> (or add role, tabIndex, aria-* state, and Enter/Space key handling) so the workflow switch can be operated via keyboard.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Contributor

github-actions bot commented Feb 16, 2026

Documentation preview for 80d1fd2 is available at:

More info
  • Ignore this comment if this PR does not change the documentation.
  • The preview is updated when a new commit is pushed to this PR.
  • This comment was created by this workflow run.
  • The documentation was built by this workflow run.

Signed-off-by: Daniel Lok <daniel.lok@databricks.com>
Copy link
Collaborator

@B-Step62 B-Step62 left a comment

Choose a reason for hiding this comment

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

The animation change looks good!

Do you think it makes sense to add transition animation for the background color too? It seems it's a bit tricky to do it between linear-gradient and static color, but claude suggested sth like this, which appear to work

--- a/mlflow/server/js/src/MlflowRouter.tsx
+++ b/mlflow/server/js/src/MlflowRouter.tsx
@@ -67,15 +67,25 @@ const MlflowRootLayout = ({
               display: 'flex',
               flexDirection: 'row',
               width: '100%',
-              background:
-                workflowType === WorkflowType.GENAI
-                  ? `linear-gradient(163deg, rgba(66, 153, 224, 0.06) 20%, rgba(202, 66, 224, 0.06) 35%, rgba(255, 95, 70, 0.06) 50%, transparent 80%), ${theme.colors.backgroundSecondary}`
-                  : theme.colors.backgroundSecondary,
+              position: 'relative',
+              background: theme.colors.backgroundSecondary,
             }}
           >
+            <div
+              css={{
+                position: 'absolute',
+                inset: 0,
+                background:
+                  'linear-gradient(163deg, rgba(66, 153, 224, 0.06) 20%, rgba(202, 66, 224, 0.06) 35%, rgba(255, 95, 70, 0.06) 50%, transparent 80%)',
+                opacity: workflowType === WorkflowType.GENAI ? 1 : 0,
+                transition: 'opacity 200ms ease-out',
+                pointerEvents: 'none',
+              }}
+            />
             <MlflowSidebar showSidebar={showSidebar} setShowSidebar={setShowSidebar} />

Copy link
Collaborator

@TomeHirata TomeHirata left a comment

Choose a reason for hiding this comment

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

Looks great!

paddingLeft: theme.spacing.md,
whiteSpace: 'nowrap' as const,
}}
role="button"
Copy link
Collaborator

Choose a reason for hiding this comment

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

q: is it difficult to use the Button component for this use case?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i think for things that require lots of custom styling it's easier to use custom div, for example the buttons come with some default styles for hover, etc which we might not want.

that being said i realize that using custom div means we have to track telemetry ourselves which i forgot to do. i will include it in this PR for convenience

Signed-off-by: Daniel Lok <daniel.lok@databricks.com>
@daniellok-db daniellok-db added this pull request to the merge queue Feb 20, 2026
Merged via the queue into mlflow:master with commit 810fd0e Feb 20, 2026
17 checks passed
@daniellok-db daniellok-db deleted the workflow-animation branch February 20, 2026 05:06
daniellok-db added a commit to daniellok-db/mlflow that referenced this pull request Feb 20, 2026
Signed-off-by: Daniel Lok <daniel.lok@databricks.com>
Co-authored-by: Claude <noreply@anthropic.com>
daniellok-db added a commit that referenced this pull request Feb 20, 2026
Signed-off-by: Daniel Lok <daniel.lok@databricks.com>
Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/uiux Front-end, user experience, plotting, JavaScript, JavaScript dev server rn/feature Mention under Features in Changelogs. size/M v3.10.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants