[pycharm] PY-85545 Jump to top on "display background processes" setting toggle

Merge-request: IJ-MR-182100
Merged-by: David Lysenko <david.lysenko@jetbrains.com>

(cherry picked from commit c33ebd6341d6c5bf86df4fdb3aada2e0ec7625e2)

IJ-MR-182100

GitOrigin-RevId: 4a3d16de05c9cc719459488f53f6c0841cdfa822
This commit is contained in:
David Lysenko
2025-11-11 17:29:39 +00:00
committed by intellij-monorepo-bot
parent 3faa3dbd1d
commit 0507ca219f
@@ -12,6 +12,7 @@ import com.intellij.openapi.application.EDT
import com.intellij.openapi.components.Service
import com.intellij.openapi.components.service
import com.intellij.openapi.ide.CopyPasteManager
import com.intellij.openapi.progress.runBlockingCancellable
import com.intellij.openapi.project.Project
import com.intellij.openapi.wm.ToolWindowManager
import com.intellij.python.community.execService.impl.ExecLoggerService
@@ -38,6 +39,7 @@ import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.stateIn
import kotlinx.coroutines.launch
import kotlinx.coroutines.plus
import kotlinx.coroutines.runBlocking
import org.jetbrains.annotations.ApiStatus
import org.jetbrains.annotations.Nls
import org.jetbrains.jewel.foundation.lazy.SelectableLazyListState
@@ -214,10 +216,17 @@ class ProcessOutputControllerService(
processTreeFilters.toggle(filter)
when (filter) {
TreeFilter.ShowBackgroundProcesses ->
TreeFilter.ShowBackgroundProcesses -> {
ProcessOutputUsageCollector.treeFilterBackgroundProcessesToggled(
processTreeFilters.contains(TreeFilter.ShowBackgroundProcesses),
processTreeFilters.contains(
TreeFilter.ShowBackgroundProcesses,
),
)
coroutineScope.launch(Dispatchers.EDT) {
processTreeUiState.selectableLazyListState.lazyListState.scrollToItem(0)
}
}
TreeFilter.ShowTime ->
ProcessOutputUsageCollector.treeFilterTimeToggled(
processTreeFilters.contains(TreeFilter.ShowTime),