Skip to content

feat(dashboard): add per-row data cleanup in Team Dashboard#302

Open
Virginia-Hamra wants to merge 1 commit intorajbos:mainfrom
Virginia-Hamra:copilot/blob-cleanup-ui
Open

feat(dashboard): add per-row data cleanup in Team Dashboard#302
Virginia-Hamra wants to merge 1 commit intorajbos:mainfrom
Virginia-Hamra:copilot/blob-cleanup-ui

Conversation

@Virginia-Hamra
Copy link
Contributor

Summary

Adds a per-row delete action to the Team Dashboard leaderboard, allowing removal of all stored Azure Table aggregate data for a specific user + dataset combination — without deleting the entire container or other users' data.

What changed

UI (Webview)

  • Each leaderboard row now has a 🗑️ trash icon button in a new Action column
  • Clicking the button sends a deleteUserDataset message to the extension backend with the row's userId and datasetId
  • Minimal CSS additions (.action-header, .action-cell, .delete-row-btn) keep the styling consistent with the existing table design

Extension host

  • New handleDeleteUserDataset(userId, datasetId) method in CopilotTokenTracker:
    • Shows a VS Code modal confirmation dialog before any deletion
    • Posts a loading state to the webview while the operation runs
    • Displays success/warning notifications depending on outcome
    • Automatically refreshes the dashboard with fresh data after deletion

Backend

  • DataPlaneService.deleteEntitiesForUserDataset() — scans Azure Table entities in the date range, filters by ds:{datasetId} in PartitionKey and u:{userId} in RowKey, then deletes each matching entity with timeout protection
  • BackendFacade.deleteUserDataset() — orchestrates credentials, invokes the data plane method, and clears the query cache to prevent stale data
  • ConfirmationMessages.deleteUserDataset() — user-friendly confirmation message following the existing ConfirmationMessages pattern

Data flow

Webview (click 🗑️) → postMessage({ command: "deleteUserDataset", userId, datasetId })
  → extension.ts handleDeleteUserDataset()
    → VS Code confirmation dialog (modal)
    → BackendFacade.deleteUserDataset()
      → DataPlaneService.deleteEntitiesForUserDataset()
        → Azure Tables: list entities by timestamp + filter PK/RK → deleteEntity() per match
    → QueryService cache cleared
    → refreshDashboardPanel() → fresh getDashboardData() → webview re-renders

Safety constraints

  • Scoped deletion: Only deletes table entities matching the exact userId + datasetId — never touches other rows or the blob container
  • Confirmation required: Modal dialog with clear explanation before any destructive action
  • Partial failure handling: Errors on individual entity deletions are collected and reported without crashing the extension
  • No stale UI: Dashboard auto-refreshes after deletion; query cache is invalidated

Files changed

File Change
src/backend/services/dataPlaneService.ts Added deleteEntitiesForUserDataset()
src/backend/facade.ts Added deleteUserDataset(), imported MAX_LOOKBACK_DAYS
src/backend/ui/messages.ts Added ConfirmationMessages.deleteUserDataset()
src/extension.ts Added handleDeleteUserDataset(), wired deleteUserDataset message, imported ConfirmationMessages
src/webview/dashboard/main.ts Added 🗑️ button + action column to leaderboard rows
src/webview/dashboard/styles.css Added .action-header, .action-cell, .delete-row-btn styles

Testing

  • npm run compile passes cleanly (TypeScript + ESLint)
  • Manual testing: open Team Dashboard → verify trash icon on each row → click → confirm dialog → data deleted → dashboard refreshes

Copilot AI review requested due to automatic review settings February 25, 2026 11:17
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

Adds a per-row “delete user + dataset” cleanup action to the Team Dashboard leaderboard, wiring a new webview action through the extension to an Azure Tables deletion routine.

Changes:

  • Dashboard webview: add an Action column with a trash button that posts a deleteUserDataset message.
  • Extension + backend: add a confirmation flow and a backend facade/service path to delete matching Azure Table entities and refresh the dashboard.
  • UI messages/styles: add confirmation message helper and minimal CSS for the new column/button.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/webview/dashboard/main.ts Adds Action column + 🗑️ button and posts deleteUserDataset message.
src/webview/dashboard/styles.css Adds styles for action header/cell and delete button hover.
src/extension.ts Wires deleteUserDataset webview message and implements confirmation + refresh flow.
src/backend/facade.ts Adds deleteUserDataset() orchestration + cache clear.
src/backend/services/dataPlaneService.ts Adds deleteEntitiesForUserDataset() to scan and delete matching entities.
src/backend/ui/messages.ts Adds ConfirmationMessages.deleteUserDataset() helper.

rajbos
rajbos previously approved these changes Feb 25, 2026
@Virginia-Hamra
Copy link
Contributor Author

I see there were some recent changes around dataPlaneService.ts while this PR was open.
Before I proceed further, just confirming the per-row cleanup direction is still desired and hasn’t been superseded by another change.
I’ll address the CI type issue shortly.

@Virginia-Hamra Virginia-Hamra force-pushed the copilot/blob-cleanup-ui branch from afd5ff0 to 94e9614 Compare February 25, 2026 13:23
@rajbos
Copy link
Owner

rajbos commented Feb 25, 2026

Still desired! 😄

@Virginia-Hamra Virginia-Hamra force-pushed the copilot/blob-cleanup-ui branch from 94e9614 to 1ba3b7c Compare February 25, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants