diff --git a/plugins/woocommerce-admin/packages/experimental/src/experimental-list/collapsible-list/style.scss b/plugins/woocommerce-admin/packages/experimental/src/experimental-list/collapsible-list/style.scss
index 7eb100b6cbe..3c84a28a643 100644
--- a/plugins/woocommerce-admin/packages/experimental/src/experimental-list/collapsible-list/style.scss
+++ b/plugins/woocommerce-admin/packages/experimental/src/experimental-list/collapsible-list/style.scss
@@ -37,3 +37,7 @@
transition: max-height 500ms;
}
}
+
+.woocommerce-experimental-list-wrapper {
+ border-top: 1px solid $gray-100;
+}
diff --git a/plugins/woocommerce-admin/packages/experimental/src/experimental-list/task-item.tsx b/plugins/woocommerce-admin/packages/experimental/src/experimental-list/task-item.tsx
index 6843c15651b..a84b151168a 100644
--- a/plugins/woocommerce-admin/packages/experimental/src/experimental-list/task-item.tsx
+++ b/plugins/woocommerce-admin/packages/experimental/src/experimental-list/task-item.tsx
@@ -1,7 +1,12 @@
/**
* External dependencies
*/
-import { createElement, Fragment } from '@wordpress/element';
+import {
+ createElement,
+ Fragment,
+ useEffect,
+ useState,
+} from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { Icon, check } from '@wordpress/icons';
import { Button, Tooltip } from '@wordpress/components';
@@ -35,8 +40,10 @@ type TaskItemProps = {
title: string;
completed: boolean;
onClick: () => void;
+ onCollapse?: () => void;
onDelete?: () => void;
onDismiss?: () => void;
+ onExpand?: () => void;
remindMeLater?: () => void;
additionalInfo?: string;
time?: string;
@@ -100,7 +107,9 @@ export const TaskItem: React.FC< TaskItemProps > = ( {
completed,
title,
onDelete,
+ onCollapse,
onDismiss,
+ onExpand,
remindMeLater,
onClick,
additionalInfo,
@@ -114,9 +123,14 @@ export const TaskItem: React.FC< TaskItemProps > = ( {
actionLabel,
...listItemProps
} ) => {
+ const [ isTaskExpanded, setTaskExpanded ] = useState( expanded );
+ useEffect( () => {
+ setTaskExpanded( expanded );
+ }, [ expanded ] );
+
const className = classnames( 'woocommerce-task-list__item', {
complete: completed,
- expanded,
+ expanded: isTaskExpanded,
'level-2': level === 2 && ! completed,
'level-1': level === 1 && ! completed,
} );
@@ -128,11 +142,25 @@ export const TaskItem: React.FC< TaskItemProps > = ( {
( ( onDismiss || remindMeLater ) && ! completed ) ||
( onDelete && completed );
+ const toggleActionVisibility = () => {
+ setTaskExpanded( ! isTaskExpanded );
+ if ( isTaskExpanded && onExpand ) {
+ onExpand();
+ }
+ if ( ! isTaskExpanded && onCollapse ) {
+ onCollapse();
+ }
+ };
+
return (
@@ -159,7 +187,7 @@ export const TaskItem: React.FC< TaskItemProps > = ( {
{ content }