|
| 1 | +# Context Size Donut and Popup |
| 2 | + |
| 3 | +## Overview |
| 4 | +Tests the context size donut chart widget and its hover popup in the GitHub Copilot |
| 5 | +for Eclipse chat view. A `ContextSizeDonut` widget is rendered in the chat view's |
| 6 | +`ActionBar` control bar. It displays a ring that fills proportionally based on the |
| 7 | +token utilization percentage received via the LSP `ContextSizeInfo` payload. At |
| 8 | +≥90 % utilization the ring switches to a warning color. Hovering over the donut |
| 9 | +opens a `ContextWindowPopup` that shows a breakdown of token usage by category. |
| 10 | + |
| 11 | +Entry points: |
| 12 | +- **Copilot Chat view** → bottom control bar (the donut appears after the first |
| 13 | + response is received that includes `ContextSizeInfo`). |
| 14 | +- Hover the donut to open the **Context Window** popup. |
| 15 | + |
| 16 | +--- |
| 17 | + |
| 18 | +## Prerequisites |
| 19 | + |
| 20 | +- Eclipse IDE with the GitHub Copilot for Eclipse plugin installed and activated. |
| 21 | +- A valid GitHub Copilot subscription is active (authentication completed). |
| 22 | +- The Copilot Chat view is open and visible in the workbench. |
| 23 | + |
| 24 | +--- |
| 25 | + |
| 26 | +## 1. Donut Widget Visibility |
| 27 | + |
| 28 | +### TC-001: Donut appears after first response |
| 29 | + |
| 30 | +**Type:** `Happy Path` |
| 31 | +**Priority:** `P1` |
| 32 | + |
| 33 | +#### Preconditions |
| 34 | +- The Copilot Chat view is open. |
| 35 | +- No previous conversation is loaded (fresh session or new conversation). |
| 36 | + |
| 37 | +#### Steps |
| 38 | +1. Open the Copilot Chat view. |
| 39 | +2. Confirm the donut widget is **not** visible in the bottom control bar (no |
| 40 | + `ContextSizeInfo` has been received yet). |
| 41 | +3. Send a short chat message (e.g. "Hello") and wait for a response. |
| 42 | +4. Inspect the bottom control bar of the chat view. |
| 43 | + |
| 44 | +#### Expected Result |
| 45 | +- Before the first response the donut is not visible (or shows an empty/zero state). |
| 46 | +- After the first response arrives the donut widget appears in the control bar. |
| 47 | +- No error dialog or exception is logged. |
| 48 | + |
| 49 | +#### 📸 Key Screenshots |
| 50 | +- [ ] **Before response** — chat view control bar with no donut. |
| 51 | +- [ ] **After response** — chat view control bar showing the donut widget. |
| 52 | + |
| 53 | +--- |
| 54 | + |
| 55 | +## 2. Context Window Popup |
| 56 | + |
| 57 | +### TC-002: Hovering the donut opens the Context Window popup |
| 58 | + |
| 59 | +**Type:** `Happy Path` |
| 60 | +**Priority:** `P1` |
| 61 | + |
| 62 | +#### Preconditions |
| 63 | +- The donut widget is visible (at least one response received). |
| 64 | + |
| 65 | +#### Steps |
| 66 | +1. Hover the mouse cursor over the donut widget in the control bar. |
| 67 | +2. Wait for the popup to appear. |
| 68 | +3. Inspect the popup header. |
| 69 | +4. Inspect the popup body for: total token count, utilization percentage, progress |
| 70 | + bar, and per-category rows. |
| 71 | +5. Move the mouse away from the donut. |
| 72 | + |
| 73 | +#### Expected Result |
| 74 | +- The popup opens with the header **"Context Window"**. |
| 75 | +- Total usage is displayed in the format `X / Y tokens`. |
| 76 | +- A utilization percentage is shown. |
| 77 | +- A progress bar reflects the utilization level. |
| 78 | +- Per-category rows are shown: **System Instructions**, **Tool Definitions**, |
| 79 | + **Messages**, **Attached Files**, **Tool Results**. |
| 80 | +- Moving the mouse away closes the popup. |
| 81 | + |
| 82 | +#### 📸 Key Screenshots |
| 83 | +- [ ] **Popup open** — the Context Window popup showing all fields. |
| 84 | + |
| 85 | +--- |
| 86 | + |
| 87 | +## 3. Edge Cases |
| 88 | + |
| 89 | +### TC-003: Donut resets when a new conversation is started |
| 90 | + |
| 91 | +**Type:** `Edge Case` |
| 92 | +**Priority:** `P2` |
| 93 | + |
| 94 | +#### Steps |
| 95 | +1. Start a conversation and let the donut show some utilization. |
| 96 | +2. Start a new conversation (clear or new session). |
| 97 | +3. Observe the donut state before any new response. |
| 98 | + |
| 99 | +#### Expected Result |
| 100 | +- The donut resets (hidden or zero state) for the new conversation until a |
| 101 | + response with `ContextSizeInfo` is received. |
0 commit comments