Scroll logs by a delta (positive = down, negative = up).
(&mut self, delta: isize)
| 1957 | |
| 1958 | /// Scroll logs by a delta (positive = down, negative = up). |
| 1959 | pub fn scroll_logs(&mut self, delta: isize) { |
| 1960 | let filtered_len = self.filtered_log_lines().len(); |
| 1961 | let max_scroll = self.log_autoscroll_offset(); |
| 1962 | if delta < 0 { |
| 1963 | self.sandbox_log_scroll = self.sandbox_log_scroll.saturating_sub(delta.unsigned_abs()); |
| 1964 | self.log_autoscroll = false; |
| 1965 | } else { |
| 1966 | self.sandbox_log_scroll = |
| 1967 | (self.sandbox_log_scroll + delta.cast_unsigned()).min(max_scroll); |
| 1968 | } |
| 1969 | let visible = filtered_len |
| 1970 | .saturating_sub(self.sandbox_log_scroll) |
| 1971 | .min(self.log_viewport_height); |
| 1972 | if visible > 0 { |
| 1973 | self.log_cursor = self.log_cursor.min(visible - 1); |
| 1974 | } else { |
| 1975 | self.log_cursor = 0; |
| 1976 | } |
| 1977 | } |
| 1978 | |
| 1979 | // ------------------------------------------------------------------ |
| 1980 | // Create sandbox modal (simplified — pick existing providers by name) |
no test coverage detected