Refactored button event handling code in TaskListCell to mirror Sidebar's implementation