Activity Feed widget displays a vertical timeline of activity items with status indicators. Each item can contain custom widget content and shows a visual status (completed, in progress, pending, or error). This widget is useful for showing task progress, workflow steps, or sequential operations in applications.
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Create activity items with custom content
Create individual activity items with different statuses and custom widget content:
Initialize ActivityFeed widget
Create app layout
Prepare a layout for app using Card widget with the content parameter and place widget that we've just created in the Container widget.
Create app using layout
Create an app object with layout parameter.
The activity feed will display a vertical timeline showing all activities with their current status indicators. Items with "completed" status show a checkmark, "in_progress" shows a spinner, "pending" shows an empty circle, and "failed" shows an error indicator.
# Update status by item number
feed.set_status(2, "completed")
# Get item status
status = feed.get_status(2)
print(f"Item 2 status: {status}")
# Remove an item
feed.remove_item(1)
# Clear all items
feed.clear()
# Set new items
new_items = [
ActivityFeed.Item(content=Text("Step 1"), status="completed"),
ActivityFeed.Item(content=Text("Step 2"), status="in_progress"),
]
feed.set_items(new_items)