Tests the context size donut chart widget and its hover popup in the GitHub Copilot
for Eclipse chat view. A ContextSizeDonut widget is rendered in the chat view's
ActionBar control bar. It displays a ring that fills proportionally based on the
token utilization percentage received via the LSP ContextSizeInfo payload. At
≥90 % utilization the ring switches to a warning color. Hovering over the donut
opens a ContextWindowPopup that shows a breakdown of token usage by category.
Entry points:
- Copilot Chat view → bottom control bar (the donut appears after the first
response is received that includes
ContextSizeInfo). - Hover the donut to open the Context Window popup.
- Eclipse IDE with the GitHub Copilot for Eclipse plugin installed and activated.
- A valid GitHub Copilot subscription is active (authentication completed).
- The Copilot Chat view is open and visible in the workbench.
Type: Happy Path
Priority: P1
- The Copilot Chat view is open.
- No previous conversation is loaded (fresh session or new conversation).
- Open the Copilot Chat view.
- Confirm the donut widget is not visible in the bottom control bar (no
ContextSizeInfohas been received yet). - Send a short chat message (e.g. "Hello") and wait for a response.
- Inspect the bottom control bar of the chat view.
- Before the first response the donut is not visible (or shows an empty/zero state).
- After the first response arrives the donut widget appears in the control bar.
- No error dialog or exception is logged.
- Before response — chat view control bar with no donut.
- After response — chat view control bar showing the donut widget.
Type: Happy Path
Priority: P1
- A conversation exists with at least one response (donut is visible).
- Send a short message; note the approximate fill level of the donut ring.
- Send a message that attaches a large file or pastes a long code block to increase context size; wait for the response.
- Compare the donut fill level after the larger-context response.
- The donut ring fill increases visibly when more tokens are consumed.
- The fill level is proportional to the reported utilization percentage (0–100 %).
- Low utilization — donut with small fill.
- Higher utilization — donut with larger fill.
Type: Happy Path
Priority: P1
- The donut widget is visible (at least one response received).
- Hover the mouse cursor over the donut widget in the control bar.
- Wait for the popup to appear.
- Inspect the popup header.
- Inspect the popup body for: total token count, utilization percentage, progress bar, and per-category rows.
- Move the mouse away from the donut.
- The popup opens with the header "Context Window".
- Total usage is displayed in the format
X / Y tokens. - A utilization percentage is shown.
- A progress bar reflects the utilization level.
- Per-category rows are shown: System Instructions, Tool Definitions, Messages, Attached Files, Tool Results.
- Moving the mouse away closes the popup.
- Popup open — the Context Window popup showing all fields.
Type: Happy Path
Priority: P2
- The chat view is open.
- Send a message with at least one file attached as context.
- Wait for the response.
- Hover over the donut to open the popup.
- Locate the Attached Files row.
- The Attached Files row displays a non-zero token count.
Type: Happy Path
Priority: P2
- Agent mode is enabled in the chat view.
- Send a message that triggers at least one tool call in agent mode.
- Wait for the response.
- Hover over the donut to open the popup.
- Locate the Tool Definitions and Tool Results rows.
- Tool Definitions shows a non-zero token count.
- Tool Results shows a non-zero token count.
Type: Happy Path
Priority: P1
- A way to produce or simulate ≥90 % token utilization (e.g. very large context,
or by injecting a mock
ContextSizeInfovalue via a debug breakpoint).
- Bring the token utilization to ≥90 % (send large context or inject mock data).
- Observe the donut ring color.
- Below 90 % the ring is rendered in the normal (non-warning) color.
- At or above 90 % the ring switches to a warning/red color.
- Warning state — donut showing warning color at high utilization.
Type: Edge Case
Priority: P2
- Start a conversation and let the donut show some utilization.
- Start a new conversation (clear or new session).
- Observe the donut state before any new response.
- The donut resets (hidden or zero state) for the new conversation until a
response with
ContextSizeInfois received.
Type: Edge Case
Priority: P2
- Make the chat view narrow by dragging its edge.
- Send a message and wait for the donut to appear.
- Hover over the donut to open the popup.
- The donut and control bar do not overflow or clip incorrectly.
- The popup appears positioned near the donut without being cut off.
Type: Edge Case
Priority: P2
- Send several messages in quick succession.
- After all responses arrive, hover over the donut.
- The donut and popup reflect the most recent
ContextSizeInfowithout stale data, race conditions, or visual glitches.