Nathan Sobo
90a292cac6
Optimize terminal rendering when clipped by parent containers
...
This brings the terminal element's viewport culling in line with the editor
optimization in PR #44995 and the fix in PR #45077 .
## Problem
When a terminal is inside a scrollable container (e.g., the Agent Panel
thread view), it would render ALL cells during prepaint, even when the
terminal was entirely outside the viewport. This caused unnecessary CPU
usage when multiple terminal tool outputs existed in the Agent Panel.
## Solution
Calculate the intersection of the terminal's bounds with the current
content_mask (the visible viewport after all parent clipping). If the
intersection has zero area, skip all cell processing entirely.
### Important distinction between content modes:
- **ContentMode::Scrollable**: Cells use the terminal's internal coordinate
system with negative line numbers for scrollback history. We cannot filter
cells by screen-space row numbers, so we render all cells when visible.
The early-exit for zero intersection handles the offscreen case.
- **ContentMode::Inline**: Cells use 0-based line numbers (no scrollback).
We can filter cells to only those in the visible row range, using the
same logic that existed before but now extracted into a helper function
with proper bounds clamping to prevent the hang bug from PR #45077 .
## Testing
Added comprehensive unit tests for:
- compute_visible_row_range edge cases
- Cell filtering logic for Inline mode
- Line/i32 comparison behavior
Manually verified:
- Terminal fully visible (no clipping)
- Terminal clipped from top/bottom
- Terminal completely outside viewport (renders nothing)
- Scrollable terminals with scrollback history work correctly
Release Notes:
- Improved Agent Panel performance when terminals are scrolled offscreen.
2025-12-23 09:51:56 -07:00
..
2025-12-22 14:06:54 -03:00
2025-12-15 13:30:13 +00:00
2025-12-19 18:55:17 -05:00
2025-11-24 13:34:04 +01:00
2025-12-22 14:06:54 -03:00
2025-12-22 14:06:54 -03:00
2025-12-16 16:22:30 -03:00
2025-12-23 13:22:42 -03:00
2025-12-18 17:49:17 -03:00
2025-12-18 17:05:04 -05:00
2025-12-16 14:32:41 -05:00
2025-11-28 08:18:19 +01:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-12-15 08:24:57 +01:00
2025-12-15 04:07:44 +00:00
2025-11-07 22:27:14 +00:00
2025-11-27 14:08:43 +00:00
2025-11-11 12:55:19 +00:00
2025-11-27 13:46:43 +00:00
2025-10-17 18:58:14 +00:00
2025-12-17 12:54:57 +01:00
2025-11-20 12:18:50 +01:00
2025-12-22 20:40:02 +00:00
2025-12-16 05:10:33 +00:00
2025-11-24 13:34:04 +01:00
2025-12-16 01:22:41 +00:00
2025-12-15 20:53:50 -07:00
2025-11-06 09:16:45 +00:00
2025-11-10 23:00:55 -07:00
2025-10-17 18:58:14 +00:00
2025-12-13 00:56:06 +00:00
2025-12-17 21:43:42 +01:00
2025-12-21 23:50:02 +00:00
2025-12-17 16:51:16 +00:00
2025-10-17 18:58:14 +00:00
2025-12-17 16:51:16 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-12-20 00:34:14 +00:00
2025-12-16 21:44:39 +00:00
2025-12-17 21:43:42 +01:00
2025-12-02 16:15:18 -05:00
2025-10-17 18:58:14 +00:00
2025-11-19 12:34:41 +01:00
2025-12-08 19:57:02 +01:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-12-04 03:55:04 +05:30
2025-12-23 13:28:04 +01:00
2025-12-18 12:47:34 +00:00
2025-10-17 18:58:14 +00:00
2025-12-17 16:51:16 +00:00
2025-12-18 21:59:05 -05:00
2025-12-22 20:40:02 +00:00
2025-12-22 20:40:02 +00:00
2025-12-10 17:36:51 -08:00
2025-12-17 21:43:42 +01:00
2025-12-22 20:40:02 +00:00
2025-12-23 12:09:46 -03:00
2025-12-17 16:53:42 +00:00
2025-12-18 17:26:20 +01:00
2025-10-17 18:58:14 +00:00
2025-12-18 17:05:04 -05:00
2025-12-17 16:25:07 -08:00
2025-12-08 21:49:26 +01:00
2025-12-18 17:05:04 -05:00
2025-12-08 13:16:19 +00:00
2025-12-15 10:14:15 +00:00
2025-10-17 18:58:14 +00:00
2025-12-21 23:50:02 +00:00
2025-10-17 18:58:14 +00:00
2025-12-22 20:40:02 +00:00
2025-10-20 10:30:06 +00:00
2025-11-20 22:17:50 -07:00
2025-12-08 19:50:20 +01:00
2025-12-17 17:31:12 -05:00
2025-12-08 13:32:14 -05:00
2025-12-22 21:32:55 -05:00
2025-12-17 16:51:16 +00:00
2025-12-17 20:12:40 -06:00
2025-12-21 22:07:30 +00:00
2025-12-17 16:51:16 +00:00
2025-12-15 16:09:10 +01:00
2025-10-17 18:58:14 +00:00
2025-12-09 09:29:40 -08:00
2025-10-17 18:58:14 +00:00
2025-12-15 13:02:01 -03:00
2025-12-19 18:55:17 -05:00
2025-12-16 20:34:00 +02:00
2025-10-17 18:58:14 +00:00
2025-11-19 22:00:58 +00:00
2025-12-21 10:29:38 -05:00
2025-12-17 16:51:16 +00:00
2025-12-22 20:40:02 +00:00
2025-12-09 13:22:57 +01:00
2025-12-19 15:04:41 -05:00
2025-12-19 17:04:43 -05:00
2025-10-17 18:58:14 +00:00
2025-10-22 19:52:38 +00:00
2025-12-18 21:59:21 +00:00
2025-12-23 08:07:48 +00:00
2025-10-22 19:52:38 +00:00
2025-10-17 18:58:14 +00:00
2025-12-15 14:58:38 +01:00
2025-10-17 18:58:14 +00:00
2025-12-18 21:59:21 +00:00
2025-12-23 12:09:10 -03:00
2025-12-17 16:51:16 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-12-16 07:51:28 -03:00
2025-11-26 18:03:42 +01:00
2025-12-18 09:49:32 +00:00
2025-12-19 18:55:17 -05:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-12-17 16:53:42 +00:00
2025-12-15 12:06:17 +00:00
2025-11-11 16:10:47 +01:00
2025-12-17 16:51:16 +00:00
2025-12-11 15:49:10 -05:00
2025-11-24 13:24:26 -05:00
2025-12-17 16:51:16 +00:00
2025-12-18 11:45:26 -05:00
2025-10-17 18:58:14 +00:00
2025-12-10 12:10:43 -08:00
2025-12-17 16:51:16 +00:00
2025-12-12 11:16:17 +00:00
2025-12-22 20:40:02 +00:00
2025-12-17 16:53:42 +00:00
2025-12-19 10:12:01 +00:00
2025-12-03 21:56:39 +00:00
2025-12-19 14:59:01 -05:00
2025-12-19 18:55:17 -05:00
2025-12-17 16:51:16 +00:00
2025-12-15 13:30:13 +00:00
2025-11-27 13:46:43 +00:00
2025-12-19 17:06:16 +01:00
2025-12-17 16:53:42 +00:00
2025-12-12 06:32:30 -08:00
2025-12-09 09:29:40 -08:00
2025-11-03 19:25:15 +00:00
2025-12-15 08:25:50 +01:00
2025-12-04 14:42:26 +00:00
2025-12-18 17:21:41 +01:00
2025-10-17 18:58:14 +00:00
2025-12-16 10:48:14 -05:00
2025-12-19 13:31:27 -03:00
2025-12-01 09:12:31 +01:00
2025-12-22 20:40:02 +00:00
2025-10-27 10:13:26 -04:00
2025-11-21 08:28:17 -07:00
2025-11-07 22:27:14 +00:00
2025-12-19 16:48:53 -05:00
2025-10-17 18:58:14 +00:00
2025-12-08 21:38:24 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-11-20 01:52:13 -03:00
2025-11-03 19:25:15 +00:00
2025-12-15 08:25:50 +01:00
2025-12-17 21:43:42 +01:00
2025-10-17 18:58:14 +00:00
2025-11-20 12:18:50 +01:00
2025-11-24 13:34:04 +01:00
2025-12-16 08:26:29 +00:00
2025-12-04 15:37:32 -05:00
2025-12-09 09:08:59 +01:00
2025-11-07 11:36:05 +00:00
2025-11-24 13:34:04 +01:00
2025-12-17 15:53:22 -05:00
2025-12-23 09:51:56 -07:00
2025-12-12 14:28:25 +01:00
2025-12-04 03:55:04 +05:30
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-12-01 20:52:57 -07:00
2025-10-17 18:58:14 +00:00
2025-12-19 13:01:48 -03:00
2025-12-19 14:06:15 +01:00
2025-12-19 13:14:31 -03:00
2025-12-20 11:15:46 -03:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-12-22 09:28:11 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-12-21 23:50:02 +00:00
2025-11-07 22:27:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-10-17 18:58:14 +00:00
2025-12-17 11:53:48 -07:00
2025-12-22 00:50:54 +01:00
2025-12-19 18:55:17 -05:00
2025-12-19 11:18:36 +01:00
2025-12-08 16:38:34 +01:00
2025-12-21 23:50:02 +00:00
2025-12-18 16:38:47 +01:00
2025-12-13 11:06:30 -05:00
2025-12-10 17:36:51 -08:00
2025-12-06 17:56:49 +00:00
2025-11-07 22:27:14 +00:00
2025-12-17 16:14:57 +00:00
2025-12-05 17:23:06 +00:00