Add live timer to activities in the Azure Activity Log
Issue
When performing long-running operations like deleting a resource group or a function app, the Azure Activity Log did not show a live timer indicating how long the operation has been running.
Changes Made
This PR adds a live timer to activities displayed in the Azure Activity Log:
- Modified
ActivityItem.tsto add a timer display for running activities - Added code to calculate and display the elapsed time since the activity started
- Implemented an automatic refresh mechanism that updates the timer every second
- Added proper cleanup when activities complete or error out
Before
Previously, running operations would only show the operation name without any timing information until the operation completed.
After
Now, running operations show the elapsed time since they started, updating in real-time (e.g., "Deleting resource group 'example' (1m 5s)").
Implementation Details
- Used the existing
dateTimeUtils.getFormattedDurationInMinutesAndSeconds()function fromvscode-azext-utils - Added a timer that refreshes the activity display every second
- Added proper cleanup to ensure timers are disposed when no longer needed
Fixes #1144.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.